diff --git a/Makefile b/Makefile index c3c13ed..f0bf421 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,19 @@ include config.mk +ifdef LAPTOP + CFLAGS += -DLAPTOP +endif + +ifdef THINKPAD + CFLAGS += -DTHINKPAD +endif + SRC = drw.c dwm.c util.c OBJ = ${SRC:.c=.o} all: options dwm -laptop: LFLAG = -DLAPTOP -laptop: install - options: @echo dwm build options: @echo "CFLAGS = ${CFLAGS}" diff --git a/config.def.h b/config.def.h index a32d53d..c0739a8 100644 --- a/config.def.h +++ b/config.def.h @@ -65,7 +65,11 @@ const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL }; const char *spcmd2[] = {"st", "-n", "spranger", "-g", "144x41", "-e", "ranger", NULL }; //const char *spcmd2[] = {"st", "-n", "sppcmanfm", "-g", "144x41", "-e", "/home/slococo/launchPcmanfm", NULL }; //const char *spcmd2[] = {"pcmanfm", NULL }; +#ifdef THINKPAD +const char *spcmd3[] = {"bitwarden", NULL }; +#else const char *spcmd3[] = {"bitwarden-desktop", NULL }; +#endif static Sp scratchpads[] = { /* name cmd */ {"spterm", spcmd1}, @@ -233,23 +237,40 @@ static Key keys[] = { TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY, XK_q, spawn, SHCMD("kill -15 $(ps -u $USER -o pid,%mem,%cpu,command | sort -b -k2 -r | sed -n '1!p' | cut -b 1-75 | dmenu -l 15)") }, +#ifndef THINKPAD { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pulsemixer --change-volume -1; sigdwmblocks 2") }, { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1; sigdwmblocks 2") }, { 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute; sigdwmblocks 2") }, +#else + { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("$HOME/.local/bin/volume sink -0.1; sigdwmblocks 2") }, + { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("$HOME/.local/bin/volume sink +0.1; sigdwmblocks 2") }, + { 0, XF86XK_AudioMute, spawn, SHCMD("$HOME/.local/bin/volume sink mute; sigdwmblocks 2") }, + { 0, XF86XK_AudioMicMute, spawn, SHCMD("$HOME/.local/bin/volume source mute; sigdwmblocks 2") }, +#endif +#ifndef THINKPAD { 0, XF86XK_AudioPlay, spawn, SHCMD("$HOME/.local/bin/player play-pause") }, { 0, XF86XK_AudioNext, spawn, SHCMD("$HOME/.local/bin/player next") }, { 0, XF86XK_AudioPrev, spawn, SHCMD("$HOME/.local/bin/player previous") }, { 0, XF86XK_AudioStop, spawn, SHCMD("$HOME/.local/bin/player --all-players stop") }, +#endif + #ifdef LAPTOP +#ifndef THINKPAD { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 5") }, { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 5") }, { 0, XF86XK_KbdBrightnessDown, spawn, SHCMD("brightnessctl --device='smc::kbd_backlight' set 20%-") }, { 0, XF86XK_KbdBrightnessUp, spawn, SHCMD("brightnessctl --device='smc::kbd_backlight' set +20%") }, #else + { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 5%-") }, + { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 5%+") }, +#endif +#endif { 0, XF86XK_HomePage, spawn, SHCMD("pcmanfm") }, { 0, XF86XK_Tools, spawn, SHCMD("pkill imwheel && imwheel -b 45") }, { 0, XF86XK_AudioStop, spawn, SHCMD("dunstctl set-paused toggle; sigdwmblocks 6") }, { 0, XK_Print, spawn, SHCMD("$HOME/.local/bin/screenshot") }, +#ifdef THINKPAD + { 0, XF86XK_Messenger, spawn, SHCMD("slock") }, #endif { MODKEY|ShiftMask, XK_m, spawn, SHCMD("noisetorch; $TERMINAL -e \"alsamixer\"") }, { MODKEY, XK_v, spawn, SHCMD("clipmenu") },