diff options
author | Azat Bahawi <azahi@teknik.io> | 2020-01-12 17:57:07 +0300 |
---|---|---|
committer | Azat Bahawi <azahi@teknik.io> | 2020-01-12 17:57:07 +0300 |
commit | fc3ece0b1a0ab6bca8d2e8ee44518981de2cfdd1 (patch) | |
tree | ce98e88cf767f0cc352ae07423aabfa47185e541 | |
parent | Happy New Year (diff) |
Minor fixes to keybinds and scripts
-rw-r--r-- | .gitignore | 6 | ||||
-rwxr-xr-x | scripts/mpc-play-pause.sh | 8 | ||||
-rwxr-xr-x | scripts/nsp-console.sh | 2 | ||||
-rwxr-xr-x | scripts/toggle-compton.sh | 4 | ||||
-rwxr-xr-x | scripts/toggle-redshift.sh | 4 | ||||
-rw-r--r-- | src/XMonad/Custom/Bindings.hs | 7 | ||||
-rwxr-xr-x | test/test-xephyr.sh | 5 |
7 files changed, 13 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore index 2df3963..3d10d27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,15 @@ *.hi *.o .cabal-sandbox/ -.ghc.* +.ghc.environment.* .hdevtools.* .stack-work/ -cabal.project.* +cabal.project.local +cabal.project.local~ cabal.sandbox.config dist-newstyle/ dist/ prompt-history +stack.yaml.lock xmonad-*-* xmonad.errors diff --git a/scripts/mpc-play-pause.sh b/scripts/mpc-play-pause.sh deleted file mode 100755 index 6c82377..0000000 --- a/scripts/mpc-play-pause.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if mpc | grep -q '\[playing\]' -then - mpc pause -else - mpc play -fi diff --git a/scripts/nsp-console.sh b/scripts/nsp-console.sh index b83d526..510ecdb 100755 --- a/scripts/nsp-console.sh +++ b/scripts/nsp-console.sh @@ -1,6 +1,6 @@ #!/bin/sh -if tmux list-sessions | grep -q "scratchpad" +if tmux list-sessions | grep "scratchpad" then tmux attach-session -t "scratchpad" else diff --git a/scripts/toggle-compton.sh b/scripts/toggle-compton.sh index 7c36b2f..e5a3aaa 100755 --- a/scripts/toggle-compton.sh +++ b/scripts/toggle-compton.sh @@ -1,8 +1,8 @@ #!/bin/sh -if ! pgrep compton +if ! pgrep compton > /dev/null 2>&1 then - compton -b --config "$XDG_CONFIG_HOME/compton.conf" + compton -b else pkill compton fi diff --git a/scripts/toggle-redshift.sh b/scripts/toggle-redshift.sh index bd70f60..2813aea 100755 --- a/scripts/toggle-redshift.sh +++ b/scripts/toggle-redshift.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -if ! pgrep redshift +if ! pgrep redshift > /dev/null 2>&1 then - redshift -c "$XDG_CONFIG_HOME/redshift.conf" & + redshift & disown redshift else pkill redshift diff --git a/src/XMonad/Custom/Bindings.hs b/src/XMonad/Custom/Bindings.hs index 92dd66c..b008b64 100644 --- a/src/XMonad/Custom/Bindings.hs +++ b/src/XMonad/Custom/Bindings.hs @@ -127,9 +127,6 @@ keysSystem _ = , ("<XF86ScreenSaver>" , spawn "~/.xmonad/scripts/screenlock.sh") , ("M-<Print>" , spawn "~/.xmonad/scripts/xshot-upload.sh") , ("M-S-<Print>" , spawn "~/.xmonad/scripts/xshot-select-upload.sh") - , ("M-<Insert>" , spawn "~/.xmonad/scripts/xcast.sh --webm") - , ("M-S-<Insert>" , spawn "~/.xmonad/scripts/xcast.sh --gif") - , ("M-C-<Insert>" , spawn "pkill ffmpeg") -- FIXME Possible undefined behaviour , ("M-C-c" , spawn "~/.xmonad/scripts/toggle-compton.sh") , ("M-C-r" , spawn "~/.xmonad/scripts/toggle-redshift.sh") , ("M-C-p" , spawn "~/.xmonad/scripts/toggle-touchpad.sh") @@ -138,11 +135,11 @@ keysSystem _ = keysMedia :: XConfig Layout -> [(String, X ())] -- TODO Make audio keys compatible with ALSA/PA at the same time keysMedia _ = - [ ("<XF86AudioMicMute>" , spawn "pactl set-source-mute 1 toggle") -- TODO Add indicator + [ ("<XF86AudioMicMute>" , spawn "pactl set-source-mute 1 toggle") , ("<XF86AudioMute>" , spawn "pactl set-sink-mute 0 toggle") , ("<XF86AudioLowerVolume>" , spawn "pactl set-sink-mute 0 false && pactl set-sink-volume 0 -10%") , ("<XF86AudioRaiseVolume>" , spawn "pactl set-sink-mute 0 false && pactl set-sink-volume 0 +10%") - , ("<XF86AudioPlay>" , spawn "~/.xmonad/scripts/mpc-play-pause.sh") + , ("<XF86AudioPlay>" , spawn "mpc toggle") , ("<XF86AudioStop>" , spawn "mpc stop") , ("<XF86AudioPrev>" , spawn "mpc prev") , ("<XF86AudioNext>" , spawn "mpc next") diff --git a/test/test-xephyr.sh b/test/test-xephyr.sh index e28928a..e6115bf 100755 --- a/test/test-xephyr.sh +++ b/test/test-xephyr.sh @@ -52,7 +52,7 @@ fi if [ -d .stack-work ] then - echo "test-xephyt.sh: Stack build detected" + echo "test-xephyr.sh: Stack build detected" BIN_PATH=$(stack path --dist-dir)/build/xmonad-ng elif [ -d dist ]; then echo "test-xephyr.sh: Cabal build detected" @@ -104,8 +104,7 @@ done export DISPLAY=":$DISPLAY_NUMBER" echo "test-xephyr.sh: Waiting for windwos to appear..." && sleep 3 - xterm -hold xrandr & - xterm & + xrdb "$HOME/.Xresources" && urxvt & $ARCH_BIN ) |