feat(dwm): screenshots

This commit is contained in:
Didier Slof 2023-02-20 14:10:35 +01:00
parent aee809669d
commit 4a2dc0c95b
Signed by: didier
GPG key ID: 01E71F18AA4398E5
3 changed files with 18 additions and 5 deletions

View file

@ -3,7 +3,7 @@
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>
/* appearance */ /* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */ 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 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 systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
@ -62,20 +62,29 @@ static const Layout layouts[] = {
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */ /* commands */
// dmenu
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
// terminal
static const char *termcmd[] = { "alacritty", NULL }; static const char *termcmd[] = { "alacritty", NULL };
static const char *locksaver[] = { "i3lock", "-c", "#000000", NULL };
// general & sys
static const char *locksaver[] = { "i3lock", "-c", "#000000", NULL };
static const char *vol_up[] = { "amixer", "set", "Master", "5%+", NULL }; static const char *vol_up[] = { "amixer", "set", "Master", "5%+", NULL };
static const char *vol_down[] = { "amixer", "set", "Master", "5%-", NULL }; static const char *vol_down[] = { "amixer", "set", "Master", "5%-", NULL };
static const char *vol_mute[] = { "amixer", "set", "Master", "toggle", NULL }; static const char *vol_mute[] = { "amixer", "set", "Master", "toggle", NULL };
static const char *light_up[] = {"light", "-A", "5", NULL}; static const char *light_up[] = {"light", "-A", "5", NULL};
static const char *light_down[] = {"light", "-U", "5", NULL}; static const char *light_down[] = {"light", "-U", "5", NULL};
// screenshots
static const char *screenshot[] = {"flameshot", "full", "-c", NULL};
static const char *screenshot_partial[] = {"flameshot", "gui", "-c", NULL};
// kill dwm
static const char *dwmdie[] = {"/bin/sh", "-c", "pkill dwm-start && pkill dwm", "null"}; static const char *dwmdie[] = {"/bin/sh", "-c", "pkill dwm-start && pkill dwm", "null"};
static Key keys[] = { static Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } },
@ -101,6 +110,8 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ 0, XK_Print, spawn, {.v = screenshot } },
{ Mod1Mask, XK_Print, spawn, {.v = screenshot_partial } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = vol_up } }, { 0, XF86XK_AudioRaiseVolume, spawn, {.v = vol_up } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = vol_down } }, { 0, XF86XK_AudioLowerVolume, spawn, {.v = vol_down } },
{ 0, XF86XK_AudioMute, spawn, {.v = vol_mute } }, { 0, XF86XK_AudioMute, spawn, {.v = vol_mute } },

View file

@ -26,6 +26,7 @@ done &
nm-applet & nm-applet &
mate-volume-control-status-icon & mate-volume-control-status-icon &
flameshot &
feh -z -Z --bg-scale /home/didier/Pictures/background.png feh -z -Z --bg-scale /home/didier/Pictures/background.png
exec dwm >/dev/null exec dwm >/dev/null

View file

@ -8,7 +8,8 @@ $SUDO $PM $PM_INSTALL $PM_NOCONFIRM \
network-manager-applet \ network-manager-applet \
alsa-utils \ alsa-utils \
dstat \ dstat \
curl curl \
flameshot
# clone # clone
[ -d /tmp/dotfiles-dwm ] || git clone https://git.suckless.org/dwm /tmp/dotfiles-dwm [ -d /tmp/dotfiles-dwm ] || git clone https://git.suckless.org/dwm /tmp/dotfiles-dwm
@ -31,4 +32,4 @@ chmod +x ./files/dwm/dwm-start.sh
$SUDO cp ./files/dwm/dwm-start.sh /usr/local/bin/dwm-start $SUDO cp ./files/dwm/dwm-start.sh /usr/local/bin/dwm-start
# DM entry # DM entry
$SUDO cp ./files/dwm/dwm.desktop /usr/share/xsessions/dwm.desktop $SUDO cp ./files/dwm/dwm.desktop /usr/share/xsessions/dwm.desktop