aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-22 15:43:03 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-22 15:43:03 +0530
commitae9fd159b9c2f03dee0be7660bf8039cc57d346c (patch)
treebe6d5776a778b62b3cb86a655183c303cd25b783
parent7a78baba1bd4a952a3d46215f100dfc7cadd4483 (diff)
downloadshotkey-ae9fd159b9c2f03dee0be7660bf8039cc57d346c.tar.gz
shotkey-ae9fd159b9c2f03dee0be7660bf8039cc57d346c.zip
Improves example config
-rw-r--r--config.def.h24
-rw-r--r--config.h24
2 files changed, 28 insertions, 20 deletions
diff --git a/config.def.h b/config.def.h
index ebab43c..d93a341 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,3 +1,5 @@
+#include <X11/XF86keysym.h>
+
// Shell
char shell[] = "/bin/sh";
@@ -5,7 +7,7 @@ char shell[] = "/bin/sh";
enum {
Music,
- Bright,
+ Power,
// Declare modes above this
MODE_SIZE,
@@ -15,26 +17,28 @@ enum {
// NOTE: "10" here is the maximum number of key bindings for each mode
Key modes[MODE_SIZE][10] = {
[Music] = {
- { 0, XK_m, cmd("notify-send inside_music") },
+ { 0, XK_h, cmd("playerctl previous") },
+ { 0, XK_l, cmd("playerctl next") },
+ { 0, XK_space, cmd("playerctl play-pause") },
},
- [Bright] = {
- { 0, XK_m, cmd("notify-send inside_bright") },
- { 0, XK_n, cmd("notify-send inside_bright_1") },
+ [Power] = {
+ { 0, XK_s, cmd("notify-send shutting_down") },
+ { 0, XK_r, cmd("notify-send restarting") },
},
};
// Define normal mode key bindings here
Key keys[] = {
- { Super|ShiftMask, XK_y, cmd("notify-send hello") },
- { Super|ShiftMask, XK_z, mode(Music, False) },
- { Super|ShiftMask, XK_x, mode(Bright, True) },
+ { Mod1Mask, XK_y, cmd("notify-send hello") },
+ { Mod1Mask, XK_z, mode(Music, True) },
+ { Mod1Mask, XF86XK_PowerOff, mode(Power, False) },
};
ModeProperties mode_properties[MODE_SIZE] = {
[Music] = { "Music player" },
- [Bright] = { "Brightness" },
+ [Power] = { "Power menu" },
};
// Call this script on mode change
-char* on_mode_change = "notify-send \"kadj [$SHOTKEY_MODE_ID] $SHOTKEY_MODE_LABEL\"";
+char* on_mode_change = "echo \"kadj [$SHOTKEY_MODE_ID] $SHOTKEY_MODE_LABEL\"";
diff --git a/config.h b/config.h
index ebab43c..d93a341 100644
--- a/config.h
+++ b/config.h
@@ -1,3 +1,5 @@
+#include <X11/XF86keysym.h>
+
// Shell
char shell[] = "/bin/sh";
@@ -5,7 +7,7 @@ char shell[] = "/bin/sh";
enum {
Music,
- Bright,
+ Power,
// Declare modes above this
MODE_SIZE,
@@ -15,26 +17,28 @@ enum {
// NOTE: "10" here is the maximum number of key bindings for each mode
Key modes[MODE_SIZE][10] = {
[Music] = {
- { 0, XK_m, cmd("notify-send inside_music") },
+ { 0, XK_h, cmd("playerctl previous") },
+ { 0, XK_l, cmd("playerctl next") },
+ { 0, XK_space, cmd("playerctl play-pause") },
},
- [Bright] = {
- { 0, XK_m, cmd("notify-send inside_bright") },
- { 0, XK_n, cmd("notify-send inside_bright_1") },
+ [Power] = {
+ { 0, XK_s, cmd("notify-send shutting_down") },
+ { 0, XK_r, cmd("notify-send restarting") },
},
};
// Define normal mode key bindings here
Key keys[] = {
- { Super|ShiftMask, XK_y, cmd("notify-send hello") },
- { Super|ShiftMask, XK_z, mode(Music, False) },
- { Super|ShiftMask, XK_x, mode(Bright, True) },
+ { Mod1Mask, XK_y, cmd("notify-send hello") },
+ { Mod1Mask, XK_z, mode(Music, True) },
+ { Mod1Mask, XF86XK_PowerOff, mode(Power, False) },
};
ModeProperties mode_properties[MODE_SIZE] = {
[Music] = { "Music player" },
- [Bright] = { "Brightness" },
+ [Power] = { "Power menu" },
};
// Call this script on mode change
-char* on_mode_change = "notify-send \"kadj [$SHOTKEY_MODE_ID] $SHOTKEY_MODE_LABEL\"";
+char* on_mode_change = "echo \"kadj [$SHOTKEY_MODE_ID] $SHOTKEY_MODE_LABEL\"";