From 1aa9a3cd3b12b0f09d80a2d8f1f37c106e23753e Mon Sep 17 00:00:00 2001 From: rwxd Date: Sun, 2 Oct 2022 10:56:40 +0200 Subject: [PATCH] fix(i3): volume controls --- .../Linux/Window-Manager/i3/spotify.md | 9 +++++++++ Operating-Systems/Linux/Window-Manager/i3/volume.md | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Operating-Systems/Linux/Window-Manager/i3/spotify.md diff --git a/Operating-Systems/Linux/Window-Manager/i3/spotify.md b/Operating-Systems/Linux/Window-Manager/i3/spotify.md new file mode 100644 index 000000000..a1d3be415 --- /dev/null +++ b/Operating-Systems/Linux/Window-Manager/i3/spotify.md @@ -0,0 +1,9 @@ +# Control Spotify in i3 + +```bash +# spotify player controls +bindsym XF86AudioPlay exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" +bindsym XF86AudioStop exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" +bindsym XF86AudioPrev exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" +bindsym XF86AudioNext exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" +``` diff --git a/Operating-Systems/Linux/Window-Manager/i3/volume.md b/Operating-Systems/Linux/Window-Manager/i3/volume.md index 51ca6a8ed..c6b6bb6b0 100644 --- a/Operating-Systems/Linux/Window-Manager/i3/volume.md +++ b/Operating-Systems/Linux/Window-Manager/i3/volume.md @@ -1,3 +1,14 @@ # Volume Control in i3 -A graphical control for [PulseAudio](https://wiki.archlinux.org/title/PulseAudio) is `pavucontrol`. \ No newline at end of file +A graphical control for [PulseAudio](https://wiki.archlinux.org/title/PulseAudio) is `pavucontrol`. + +## Keys + +``` +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +```