aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Langer <nikitalanger@icloud.com>2026-04-10 18:09:12 +0200
committerNikita Langer <nikitalanger@icloud.com>2026-04-10 18:09:12 +0200
commit77db57e9b3fe17097ed10de2568e2bfc48f2f542 (patch)
tree8c6193de467edcfaa6f8a17baccd61402ccecc20
parent1ddfb5c720e0afaff0d214ac1966c504d37ecde2 (diff)
downloaddwm-77db57e9b3fe17097ed10de2568e2bfc48f2f542.tar.gz
dwm-77db57e9b3fe17097ed10de2568e2bfc48f2f542.tar.bz2
dwm-77db57e9b3fe17097ed10de2568e2bfc48f2f542.tar.xz
dwm-77db57e9b3fe17097ed10de2568e2bfc48f2f542.zip
Multimedia Keys
-rwxr-xr-xconfig.def.h14
-rwxr-xr-xconfig.h238
-rw-r--r--drw.obin0 -> 11720 bytes
-rwxr-xr-xdwmbin0 -> 83240 bytes
-rw-r--r--dwm.obin0 -> 77920 bytes
-rw-r--r--util.obin0 -> 2400 bytes
6 files changed, 250 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h
index 8b557f7..2ee8957 100755
--- a/config.def.h
+++ b/config.def.h
@@ -137,6 +137,11 @@ static const char *mutevol[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@",
static const char *lockcmd[] = { "bash", "-c", "slock -m \"$(cowsay \"$(fortune)\" | lolcat -ft)\"", NULL };
static const char *screensht[] = { "/usr/local/bin/dwm-scripts/screenshot.sh", NULL };
static const char *scripts[] = { "/usr/local/bin/dwm-scripts/scripts.sh", NULL };
+static const char *playpause[] = { "playerctl", "play-pause", NULL };
+static const char *nexttrack[] = { "playerctl", "next", NULL };
+static const char *prevtrack[] = { "playerctl", "previous", NULL };
+static const char *stoptrack[] = { "playerctl", "stop", NULL };
+static const char *mutemic[] = { "pactl", "set-source-mute", "@DEFAULT_SOURCE@", "toggle", NULL };
#include "movestack.c"
@@ -190,8 +195,13 @@ static const Key keys[] = {
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
- // { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightup} },
- // { 0, XF86XK_MonBrightnessDown, spawn, {.v = brightdown } },
+ { 0, XF86XK_AudioPlay, spawn, {.v = playpause } },
+ { 0, XF86XK_AudioNext, spawn, {.v = nexttrack } },
+ { 0, XF86XK_AudioPrev, spawn, {.v = prevtrack } },
+ { 0, XF86XK_AudioStop, spawn, {.v = stoptrack } },
+ { 0, XF86XK_AudioMicMute, spawn, {.v = mutemic } },
+ { 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
+ { 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
{ MODKEY, XK_F11, spawn, {.v = dimmer } },
{ MODKEY, XK_F12, spawn, {.v = brighter } },
// { 0, XF86XK_AudioForward },
diff --git a/config.h b/config.h
new file mode 100755
index 0000000..2ee8957
--- /dev/null
+++ b/config.h
@@ -0,0 +1,238 @@
+#ifdef _laptop
+#define laptop(...) __VA_ARGS__
+#define komputer(...)
+#endif
+
+#ifdef _komputer
+#define komputer(...) __VA_ARGS__
+#define laptop(...)
+#endif
+
+/* See LICENSE file for copyright and license details. */
+
+#include <X11/XF86keysym.h>
+#include <stdio.h>
+
+/* appearance */
+static const unsigned int borderpx = 2; /* border pixel of windows */
+static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
+static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
+static const unsigned int systrayspacing = 2; /* systray spacing */
+static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
+static const int showsystray = 1; /* 0 means no systray */
+static const unsigned int gappx = 6; /* gap pixel between windows */
+static const int showbar = 1; /* 0 means no bar */
+static const int topbar = 1; /* 0 means bottom bar */
+// static const char *fonts[] = { "SF Pro Text:size=10" };
+// static const char dmenufont[] = "Sf Pro Text:size=10";
+komputer(
+static const char *fonts[] = { "JetBrains Mono Nerd Font Propo:size=11" };
+static const char dmenufont[] = "JetBrains Mono Nerd Font Propo:size=11";
+)
+laptop(
+static const char *fonts[] = { "JetBrains Mono Nerd Font Propo:size=10" };
+static const char dmenufont[] = "JetBrains Mono Nerd Font Propo:size=10";
+)
+static const char col_gray1[] = "#222222";
+static const char col_gray2[] = "#444444";
+static const char col_gray3[] = "#bbbbbb";
+static const char col_gray4[] = "#eeeeee";
+static const char col_red[] = "#ff0000";
+static const char col_cyan[] = "#005577";
+// static const char *colors[][3] = {
+// /* fg bg border */
+// [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+// [SchemeSel] = { col_gray4, col_cyan, col_red },
+// };
+
+static char normbgcolor[] = "#222222";
+static char normbordercolor[] = "#444444";
+static char normfgcolor[] = "#bbbbbb";
+static char selfgcolor[] = "#eeeeee";
+static char selbordercolor[] = "#b20701";
+static char selbgcolor[] = "#005577";
+static char *colors[][3] = {
+ /* fg bg border */
+ laptop([SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },)
+ laptop([SchemeSel] = { selfgcolor, selbordercolor, selbordercolor },)
+ komputer([SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },)
+ komputer([SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },)
+ };
+
+/* tagging */
+static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+
+static const Rule rules[] = {
+ /* xprop(1):
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+ /* class instance title tags mask isfloating monitor */
+ // { "Gimp", NULL, NULL, 0, 1, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ { "steam", NULL, NULL, 1 << 6, 0, -1 },
+};
+
+/* layout(s) */
+static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+static const int nmaster = 1; /* number of clients in master area */
+static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
+laptop(
+static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */
+)
+komputer(
+static const int refreshrate = 300; /* refresh rate (per second) for client move/resize */
+)
+
+static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
+};
+
+/* key definitions */
+#define MODKEY Mod4Mask
+#define TAGKEYS(KEY,TAG) \
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+
+/* helper for spawning shell commands in the pre dwm-5.0 fashion */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+/* commands */
+static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+static const char *menualt[] = { "rofi", "-show", "drun", NULL };
+static const char *termcmd[] = { "st", NULL };
+static const char *tabbedterm[] = { "tabbed", "-r", "2", "st", "-w", "\'\'", NULL };
+laptop(
+static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", selbordercolor, "-sf", col_gray4, NULL };
+static const char *screencmd[] = { "xrandr", "--output", "eDP-1", "--mode", "1920x1080", NULL };
+static const char *browsercmd[] = { "firefox-bin", NULL };
+static const char *thunar[] = { "thunar", NULL };
+static const char *brighter[] = { "brightnessctl", "set", "5%+", NULL };
+static const char *dimmer[] = { "brightnessctl", "set", "5%-", NULL };
+)
+komputer(
+static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", selbgcolor, "-sf", col_gray4, NULL };
+static const char *screencmd[] = { "xrandr", "--output", "DisplayPort-0", "--mode", "2560x1440", "-r", "240", NULL };
+static const char *altscreen[] = { "xrandr", "--output", "DisplayPort-0", "--mode", "2560x1440", "-r", "260", NULL };
+static const char *dolphin[] = { "/usr/local/bin/dolphinfix.sh", NULL };
+static const char *filebrowser[]= { "dolphin" ,NULL };
+static const char *browsercmd[] = { "firefox", NULL };
+static const char *wallcmd[] = { "/bin/bash", "-c", "feh --bg-fill \"$(find /home/nikita/Walls/normal -type f ! -name \"$(basename \"$CURRENT_WALL\")\" | shuf -n 1)\"", NULL };
+static const char *brighter[] = { "/usr/local/bin/dwm-scripts/bright.sh", "5", NULL };
+static const char *dimmer[] = { "/usr/local/bin/dwm-scripts/bright.sh", "-5", NULL };
+)
+static const char *steam[] = { "steam" ,NULL };
+static const char *minecraft[] = { "prismlauncher", NULL };
+static const char *downvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
+static const char *upvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
+static const char *mutevol[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
+// static const char *lockcmd[] = { "slock", NULL };
+static const char *lockcmd[] = { "bash", "-c", "slock -m \"$(cowsay \"$(fortune)\" | lolcat -ft)\"", NULL };
+static const char *screensht[] = { "/usr/local/bin/dwm-scripts/screenshot.sh", NULL };
+static const char *scripts[] = { "/usr/local/bin/dwm-scripts/scripts.sh", NULL };
+static const char *playpause[] = { "playerctl", "play-pause", NULL };
+static const char *nexttrack[] = { "playerctl", "next", NULL };
+static const char *prevtrack[] = { "playerctl", "previous", NULL };
+static const char *stoptrack[] = { "playerctl", "stop", NULL };
+static const char *mutemic[] = { "pactl", "set-source-mute", "@DEFAULT_SOURCE@", "toggle", NULL };
+
+#include "movestack.c"
+
+static const Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_d, spawn, {.v = dmenucmd } },
+ { MODKEY|ShiftMask, XK_d, spawn, {.v = menualt } },
+ komputer (
+ { MODKEY, XK_w, spawn, {.v = wallcmd } },
+ { MODKEY, XK_e, spawn, {.v = filebrowser } },
+ { MODKEY|ShiftMask, XK_e, spawn, {.v = dolphin } },
+ { MODKEY|ShiftMask, XK_n, spawn, {.v = altscreen } },
+ ) laptop(
+ { MODKEY, XK_e, spawn, {.v = thunar } },
+ )
+ { MODKEY, XK_s, spawn, {.v = steam } },
+ { MODKEY, XK_x, movecenter, {0} },
+ { MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_p, spawn, {.v = minecraft } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = tabbedterm } },
+ { MODKEY, XK_F5, xrdb, {.v = NULL } },
+ { MODKEY, XK_f, spawn, {.v = browsercmd } },
+ { MODKEY|Mod1Mask, XK_l, spawn, {.v = lockcmd } },
+ { MODKEY|Mod1Mask, XK_s, spawn, {.v = screensht } },
+ { MODKEY|ShiftMask, XK_s, spawn, {.v = scripts } },
+ { MODKEY, XK_n, spawn, {.v = screencmd } },
+ { MODKEY, XK_b, togglebar, {0} },
+ { MODKEY, XK_j, focusstack, {.i = +1 } },
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+ { MODKEY, XK_o, incnmaster, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY|ShiftMask, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY, XK_q, killclient, {0} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_v, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
+ { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_comma, focusmon, {.i = -1 } },
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
+ { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
+ { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
+ { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
+ { 0, XF86XK_AudioPlay, spawn, {.v = playpause } },
+ { 0, XF86XK_AudioNext, spawn, {.v = nexttrack } },
+ { 0, XF86XK_AudioPrev, spawn, {.v = prevtrack } },
+ { 0, XF86XK_AudioStop, spawn, {.v = stoptrack } },
+ { 0, XF86XK_AudioMicMute, spawn, {.v = mutemic } },
+ { 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
+ { 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
+ { MODKEY, XK_F11, spawn, {.v = dimmer } },
+ { MODKEY, XK_F12, spawn, {.v = brighter } },
+ // { 0, XF86XK_AudioForward },
+ // { 0, XF86XK_AudioRewind },
+ // { 0, XF86XK_AudioPrev },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+ TAGKEYS( XK_4, 3)
+ TAGKEYS( XK_5, 4)
+ TAGKEYS( XK_6, 5)
+ TAGKEYS( XK_7, 6)
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
+};
+
+/* button definitions */
+/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
+static const Button buttons[] = {
+ /* click event mask button function argument */
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+};
+
diff --git a/drw.o b/drw.o
new file mode 100644
index 0000000..522c426
--- /dev/null
+++ b/drw.o
Binary files differ
diff --git a/dwm b/dwm
new file mode 100755
index 0000000..b035e20
--- /dev/null
+++ b/dwm
Binary files differ
diff --git a/dwm.o b/dwm.o
new file mode 100644
index 0000000..8114785
--- /dev/null
+++ b/dwm.o
Binary files differ
diff --git a/util.o b/util.o
new file mode 100644
index 0000000..34da63d
--- /dev/null
+++ b/util.o
Binary files differ