From 1ed1e7896089bc3bc5aae19c245791fc2b9bd310 Mon Sep 17 00:00:00 2001 From: JopStro Date: Fri, 19 Jun 2020 10:06:46 +0100 Subject: Swap the main script and the alternative script --- README.md | 2 +- alternative/README.md | 2 +- alternative/bspswallow | 2 +- bspswallow | 2 +- examples/noswallow | 1 + examples/swallow | 2 -- 6 files changed, 5 insertions(+), 6 deletions(-) mode change 100644 => 100755 alternative/bspswallow create mode 100644 examples/noswallow delete mode 100644 examples/swallow diff --git a/README.md b/README.md index c629374..ba7d3ba 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Adds functionality provided by the dwm "swallow" patch to bspwm. # Instalation Add two files to ~/.config/bspwm -* swallow - list of classes of windows that you want to swallow the terminal +* noswallow - list of classes of windows that you dont't to swallow the terminal * terminals - list of classes of terminals that you want to be swallowed diff --git a/alternative/README.md b/alternative/README.md index 0794648..8e98ae0 100644 --- a/alternative/README.md +++ b/alternative/README.md @@ -1,3 +1,3 @@ # Alternative version -This is a version of the script in which you specify a list of classes of programs that you don't want to swallow the terminal in a file called "noswallow". +This is a version of the script in which you specify a list of classes of programs that you *do* want to swallow the terminal in a file called "swallow" and everything else isn't swallowed. diff --git a/alternative/bspswallow b/alternative/bspswallow old mode 100644 new mode 100755 index 8e787a3..1406fcf --- a/alternative/bspswallow +++ b/alternative/bspswallow @@ -13,7 +13,7 @@ get_class() { swallow() { swallowerid=$1 swallowingid=$(bspc query -n prev -N) - cat ~/.config/bspwm/noswallow ~/.config/bspwm/terminals | grep "^$(get_class $swallowerid)$" && return + grep "^$(get_class $swallowerid)$" ~/.config/bspwm/swallow || return grep "^$(get_class $swallowingid)$" ~/.config/bspwm/terminals || return echo $swallowerid $swallowingid >> /tmp/swallowids bspc node $swallowingid --flag hidden=on diff --git a/bspswallow b/bspswallow index 1406fcf..8e787a3 100755 --- a/bspswallow +++ b/bspswallow @@ -13,7 +13,7 @@ get_class() { swallow() { swallowerid=$1 swallowingid=$(bspc query -n prev -N) - grep "^$(get_class $swallowerid)$" ~/.config/bspwm/swallow || return + cat ~/.config/bspwm/noswallow ~/.config/bspwm/terminals | grep "^$(get_class $swallowerid)$" && return grep "^$(get_class $swallowingid)$" ~/.config/bspwm/terminals || return echo $swallowerid $swallowingid >> /tmp/swallowids bspc node $swallowingid --flag hidden=on diff --git a/examples/noswallow b/examples/noswallow new file mode 100644 index 0000000..9f23d84 --- /dev/null +++ b/examples/noswallow @@ -0,0 +1 @@ +xev diff --git a/examples/swallow b/examples/swallow deleted file mode 100644 index 47ed947..0000000 --- a/examples/swallow +++ /dev/null @@ -1,2 +0,0 @@ -mpv -Sxiv -- cgit v1.2.3