Media Control
- Bind media track keys to control playerctl for play/pause, next, prev - Update README with volume and media control
This commit is contained in:
@@ -63,3 +63,6 @@ and (re)compiling the source code.
|
||||
* Increase border to 2 pixels
|
||||
* Change tags to be [Font Awesome](https://fontawesome.com) icons
|
||||
* Run programs and processes on autostart
|
||||
* [Pulse Audio Volume Control](https://gist.github.com/palopezv/efd34059af6126ad970940bcc6a90f2e)
|
||||
* Media Play/Pause, Prev, and Next Keybindings via [Playerctl](https://github.com/altdesktop/playerctl)
|
||||
* Arch Community Repo: [playerctl](https://www.archlinux.org/packages/community/x86_64/playerctl/)
|
||||
|
24
config.h
24
config.h
@@ -66,15 +66,18 @@ static const char rootdir[] = "/home/sravan/.config"; /* Location of dwm source
|
||||
static const char deaddscriptpath[] = "/home/sravan/.config/deadd/open-notification-center.sh";
|
||||
|
||||
/* commands */
|
||||
static const char *rofiruncmd[] = { "rofi", "-show", "drun", NULL };
|
||||
static const char *roficlipcmd[] = { "rofi", "-show", "clipboard", NULL };
|
||||
static const char *deaddcmd[] = { "/bin/bash", deaddscriptpath, NULL };
|
||||
static const char *lockcmd[] = { "slock", NULL };
|
||||
static const char *sleepcmd[] = { "slock", "systemctl", "suspend", NULL };
|
||||
static const char *termcmd[] = { "alacritty", NULL };
|
||||
static const char *upvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%", NULL };
|
||||
static const char *downvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-1%", NULL };
|
||||
static const char *mutevolcmd[] = { "/usr/bin/pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
||||
static const char *rofiruncmd[] = { "rofi", "-show", "drun", NULL };
|
||||
static const char *roficlipcmd[] = { "rofi", "-show", "clipboard", NULL };
|
||||
static const char *deaddcmd[] = { "/bin/bash", deaddscriptpath, NULL };
|
||||
static const char *lockcmd[] = { "slock", NULL };
|
||||
static const char *sleepcmd[] = { "slock", "systemctl", "suspend", NULL };
|
||||
static const char *termcmd[] = { "alacritty", NULL };
|
||||
static const char *upvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%", NULL };
|
||||
static const char *downvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-1%", NULL };
|
||||
static const char *mutevolcmd[] = { "/usr/bin/pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
||||
static const char *playerplaypausecmd[] = { "playerctl", "--player=playerctld", "play-pause", NULL };
|
||||
static const char *playernextcmd[] = { "playerctl", "--player=playerctld", "next", NULL };
|
||||
static const char *playerprevcmd[] = { "playerctl", "--player=playerctld", "previous", NULL };
|
||||
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
@@ -110,6 +113,9 @@ static Key keys[] = {
|
||||
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvolcmd} },
|
||||
{ 0, XF86XK_AudioMute, spawn, {.v = mutevolcmd} },
|
||||
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvolcmd} },
|
||||
{ 0, XF86XK_AudioPlay, spawn, {.v = playerplaypausecmd} },
|
||||
{ 0, XF86XK_AudioNext, spawn, {.v = playernextcmd} },
|
||||
{ 0, XF86XK_AudioPrev, spawn, {.v = playerprevcmd} },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
|
Reference in New Issue
Block a user