aboutsummaryrefslogtreecommitdiff
path: root/Window_Manager/ratpoison
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-04-03 19:48:32 +0100
committerVasil Zlatanov <v@skozl.com>2019-04-03 19:48:32 +0100
commit5fed1e097d543abaf0b8726b21fc43e87e4526ad (patch)
treeaab3e7c6587619bb0015f9c07ab1edec1a83db05 /Window_Manager/ratpoison
parentf62fb0f2ab09407803680364849e22ffe2eb6342 (diff)
parent9e057a7cdeb3eddbe842bf3e5902753e7b556e7b (diff)
downloaddotfiles-5fed1e097d543abaf0b8726b21fc43e87e4526ad.tar.gz
dotfiles-5fed1e097d543abaf0b8726b21fc43e87e4526ad.tar.bz2
dotfiles-5fed1e097d543abaf0b8726b21fc43e87e4526ad.zip
Merge branch 'master' of ssh://skozl.com:/srv/git/dotfiles
Diffstat (limited to 'Window_Manager/ratpoison')
-rwxr-xr-xWindow_Manager/ratpoison/get_spotify_sink4
-rw-r--r--Window_Manager/ratpoison/ratpoisonrc.conf30
2 files changed, 21 insertions, 13 deletions
diff --git a/Window_Manager/ratpoison/get_spotify_sink b/Window_Manager/ratpoison/get_spotify_sink
new file mode 100755
index 0000000..58ba5e9
--- /dev/null
+++ b/Window_Manager/ratpoison/get_spotify_sink
@@ -0,0 +1,4 @@
+#!/bin/sh
+pacmd list-sink-inputs |
+tr '\n' '\r' |
+perl -ne 's/ *index: ([0-9]+).+?application\.name = "([^\r]+)"\r.+?(?=index:|$)/\2:\1\r/g; print $1 if $2=="Spotify"'
diff --git a/Window_Manager/ratpoison/ratpoisonrc.conf b/Window_Manager/ratpoison/ratpoisonrc.conf
index f9e4e9c..702ab68 100644
--- a/Window_Manager/ratpoison/ratpoisonrc.conf
+++ b/Window_Manager/ratpoison/ratpoisonrc.conf
@@ -2,6 +2,8 @@
# info: C=control, M=meta/alt, s=super, S=shift, H = Hyper
# xnest for testing
+set onlyborder 0
+
escape grave
definekey top s-grave meta
definekey top Arabic_dammatan meta
@@ -55,7 +57,7 @@ showpanel
alias showborder set border 2
alias hideborder set border 0
-bordscript
+#bordscript
######################################
# Panel
@@ -74,7 +76,7 @@ addhook switchwin barsend
#addhook deletewindow barsend
addhook switchframe barsend
addhook switchgroup barsend
-addhook switchgroup bordscript
+#addhook switchgroup bordscript
#addhook titlechanged barsend
#addhook key barsend
@@ -106,7 +108,7 @@ bind V hsplit 2/3
bind s vsplit
bind S vsplit 2/3
bind d remove
-bind space exec urxvt
+bind space exec alacritty
bind o only
bind semicolon colon
bind e exec
@@ -122,9 +124,6 @@ bind P exec ~/bin/safepaste
alias paneltoggle exec ~/.config/ratpoison/paneltoggle
-# autohide border when in fullscreen
-set onlyborder 0
-
definekey top s-b bordtoggle
definekey top s-p paneltoggle
@@ -172,19 +171,24 @@ definekey top KP_Enter exec ~/Dropbox/speech/run-duplex.sh
#-------------------------------------------------------------
# Volume Control
#-------------------------------------------------------------
-# Up
-#alias volup exec amixer -D sysdefault -q set Master 5+ && ratpoison -c "echo `$HOME/.config/ratpoison/volind`" & volume -f 'V%i' > /tmp/panel-fifo
-alias volup exec amixer -D sysdefault -q set Master 5+ && volume -f 'V%i' > /tmp/panel-fifo
+alias volup exec pactl set-sink-volume `pactl list sinks short | perl -ne '/^(\d*)/; $x=$1; END { print $x }'` +2% && volume -f 'V%i' > /tmp/panel-fifo
+alias voldown exec pactl set-sink-volume `pactl list sinks short | perl -ne '/^(\d*)/; $x=$1; END { print $x }'` -2% && volume -f 'V%i' > /tmp/panel-fifo
+
+alias spvolup exec pactl set-sink-input-volume `.config/ratpoison/get_spotify_sink` +2%
+alias spvoldown exec pactl set-sink-input-volume `.config/ratpoison/get_spotify_sink` -2%
+
-definekey top XF86AudioRaiseVolume volup
+definekey top M-XF86AudioRaiseVolume spvolup
definekey top s-Prior volup
definekey top s-q volup
-# Down
-#alias voldown exec amixer -D sysdefault -q set Master 5- && ratpoison -c "echo `$HOME/.config/ratpoison/volind`" & volume -f 'V%i' > /tmp/panel-fifo
-alias voldown exec amixer -D sysdefault -q set Master 5- && volume -f 'V%i' > /tmp/panel-fifo
+definekey top XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
+definekey top XF86AudioStop exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
+definekey top XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
+definekey top XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
definekey top XF86AudioLowerVolume voldown
+definekey top M-XF86AudioLowerVolume spvoldown
definekey top s-Next voldown
definekey top s-a voldown