diff options
| author | stkhan <personal@slickd.xyz> | 2022-03-29 19:55:52 -0800 |
|---|---|---|
| committer | stkhan <personal@slickd.xyz> | 2022-03-29 19:55:52 -0800 |
| commit | 356b726ec5ac1d6796cfb5ca6171d20b4d0783a1 (patch) | |
| tree | 335d668f66ade4a59ffafc95e5befbdb2fd67679 | |
| parent | c9faadd2309e0d101d99754ecbe3a874f2e6c835 (diff) | |
Icons in dwmblocks, and cleaned up scripts
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 14 | ||||
| -rw-r--r-- | config.mk | 7 | ||||
| -rw-r--r-- | dwm-6.3/Makefile | 2 | ||||
| -rw-r--r-- | dwm-6.3/config.h | 176 | ||||
| -rw-r--r-- | dwm-6.3/drw.c | 12 | ||||
| -rwxr-xr-x | dwm-6.3/scripts/dwm-mute | 4 | ||||
| -rwxr-xr-x | dwm-6.3/scripts/dwm-vol_down | 3 | ||||
| -rwxr-xr-x | dwm-6.3/scripts/dwm-vol_up | 3 | ||||
| -rw-r--r-- | scripts/Makefile | 5 | ||||
| -rwxr-xr-x | scripts/brighter | 4 | ||||
| -rwxr-xr-x | scripts/darker | 7 | ||||
| -rwxr-xr-x | scripts/dmenumount | 7 | ||||
| -rwxr-xr-x | scripts/dmenuumount | 6 | ||||
| -rwxr-xr-x | scripts/mic_toggle | 3 | ||||
| -rwxr-xr-x | scripts/mpvopen | 4 | ||||
| -rwxr-xr-x | scripts/mute | 4 | ||||
| -rwxr-xr-x | scripts/rs | 4 | ||||
| -rwxr-xr-x | scripts/screenshot | 6 | ||||
| -rwxr-xr-x | scripts/set_theme.sh | 2 | ||||
| -rwxr-xr-x | scripts/vol_down | 4 | ||||
| -rwxr-xr-x | scripts/vol_up | 5 | ||||
| -rwxr-xr-x | scripts/xrandrdmenu | 4 |
23 files changed, 206 insertions, 81 deletions
@@ -27,4 +27,3 @@ *.swp *~ dwm-6.3.tar.gz -config.h @@ -1,20 +1,22 @@ +include config.mk all: sarc sarc: clean @./scripts/set_theme.sh - make -C dwm-6.3 - make -C st-0.8.4 - make -C dmenu-5.0 + make -C $(DWM) + make -C $(ST) + make -C $(DMENU) make -C farbfeld make -C sent make -C wmname rm colors.h +c: clean install: - make install -C dwm-6.3 - make install -C st-0.8.4 - make install -C dmenu-5.0 + make install -C $(DWM) + make install -C $(ST) + make install -C $(DMENU) make install -C scripts make install -C farbfeld make install -C sent @@ -1 +1,8 @@ PREFIX=/usr/local +MANPREFIX=$(PREFIX)/share/man +X11INC=/usr/X11R6/include +X11LIB=/usr/X11R6/lib + +DWM=dwm-6.3 +ST=st-0.8.4 +DMENU=dmenu-5.0 diff --git a/dwm-6.3/Makefile b/dwm-6.3/Makefile index 77bcbc0..5ac0a5e 100644 --- a/dwm-6.3/Makefile +++ b/dwm-6.3/Makefile @@ -43,7 +43,7 @@ install: all mkdir -p ${DESTDIR}${MANPREFIX}/man1 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - + cp scripts/* $(PREFIX)/bin uninstall: rm -f ${DESTDIR}${PREFIX}/bin/dwm\ ${DESTDIR}${MANPREFIX}/man1/dwm.1 diff --git a/dwm-6.3/config.h b/dwm-6.3/config.h new file mode 100644 index 0000000..ec0ebed --- /dev/null +++ b/dwm-6.3/config.h @@ -0,0 +1,176 @@ +#include "../colors.h" +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +static const unsigned int gappih = 10; +static const unsigned int gappiv = 10; +static const unsigned int gappoh = 10; +static const unsigned int gappov = 10; +static int smartgaps = 0; +static const char *fonts[] = { "Source Code Pro:size=9" , "Twitter Color Emoji:size=8"}; +static const char dmenufont[] = "Source Code Pro:size=9"; +static const unsigned int baralpha = 0xd0; +static const unsigned int borderalpha = OPAQUE; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +}; +static const unsigned int alphas[][3] = { + /* fg bg border */ + [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, + [SchemeSel] = { OPAQUE, baralpha, borderalpha }, +}; + +static const char *const autostart[] = { + "picom", NULL, + "fehbg", NULL, + "dwmblocks", NULL, + NULL /* terminate */ +}; + +/* 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 isterminal noswallow monitor */ + { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, + { "St", NULL, NULL, 0, 0, 1, 0, -1 }, + { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ +}; + +/* 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 */ + +#define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */ +#include "vanitygaps.c" + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "[M]", monocle }, + { "[@]", spiral }, + { "[\\]", dwindle }, + { "H[]", deck }, + { "TTT", bstack }, + { "===", bstackhoriz }, + { "HHH", grid }, + { "###", nrowgrid }, + { "---", horizgrid }, + { ":::", gaplessgrid }, + { "|M|", centeredmaster }, + { ">M>", centeredfloatingmaster }, + { "><>", NULL }, /* no layout function means floating behavior */ + { NULL, NULL }, +}; + +/* key definitions */ +#define MODKEY Mod1Mask +#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 } } + +#define STATUSBAR "dwmblocks" + +/* commands */ +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 *termcmd[] = { "st", NULL }; + +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_d, spawn, {.v = dmenucmd } }, + { MODKEY, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_u, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY|ShiftMask, XK_Return, zoom, {0} }, + { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_o, incrogaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_6, incrihgaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_7, incrivgaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_8, incrohgaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_9, incrovgaps, {.i = +1 } }, + { MODKEY|Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_0, togglegaps, {0} }, + { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY, XK_x, killclient, {0} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_space, setlayout, {0} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {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 } }, + { MODKEY|ShiftMask, XK_f, spawn, SHCMD("chromium-ungoogled") }, + { MODKEY, XK_r, spawn, SHCMD("get_weather") }, + { MODKEY, XK_F11, spawn, SHCMD("dwm-vol_up") }, + { MODKEY, XK_F10, spawn, SHCMD("dwm-vol_down") }, + { MODKEY, XK_F9, spawn, SHCMD("pamixer -t") }, + 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 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, Button1, sigstatusbar, {.i = 1} }, + { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} }, + { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} }, + { ClkStatusText, 0, Button4, sigstatusbar, {.i = 4} }, + { ClkStatusText, 0, Button5, sigstatusbar, {.i = 5} }, + { 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/dwm-6.3/drw.c b/dwm-6.3/drw.c index fe3aadd..45baf67 100644 --- a/dwm-6.3/drw.c +++ b/dwm-6.3/drw.c @@ -136,18 +136,6 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) die("no font specified."); } - /* Do not allow using color fonts. This is a workaround for a BadLength - * error from Xft with color glyphs. Modelled on the Xterm workaround. See - * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 - * https://lists.suckless.org/dev/1701/30932.html - * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 - * and lots more all over the internet. - */ - FcBool iscol; - if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { - XftFontClose(drw->dpy, xfont); - return NULL; - } font = ecalloc(1, sizeof(Fnt)); font->xfont = xfont; diff --git a/dwm-6.3/scripts/dwm-mute b/dwm-6.3/scripts/dwm-mute new file mode 100755 index 0000000..5a23e63 --- /dev/null +++ b/dwm-6.3/scripts/dwm-mute @@ -0,0 +1,4 @@ +#!/bin/sh + +pamixer -t +dunstify "Toggled mute" & diff --git a/dwm-6.3/scripts/dwm-vol_down b/dwm-6.3/scripts/dwm-vol_down new file mode 100755 index 0000000..8ecec15 --- /dev/null +++ b/dwm-6.3/scripts/dwm-vol_down @@ -0,0 +1,3 @@ +#!/bin/sh + +pamixer --allow-boost -d 5 diff --git a/dwm-6.3/scripts/dwm-vol_up b/dwm-6.3/scripts/dwm-vol_up new file mode 100755 index 0000000..4e11111 --- /dev/null +++ b/dwm-6.3/scripts/dwm-vol_up @@ -0,0 +1,3 @@ +#!/bin/sh + +pamixer --allow-boost -i 5 diff --git a/scripts/Makefile b/scripts/Makefile index f978670..1b32df7 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,6 +1,7 @@ include ../config.mk install: - cp brighter darker vol_down vol_up mpvopen get_weather mute mic_toggle $(PREFIX)/bin + gcc -o gip ip.c + cp get_weather fehbg gip $(PREFIX)/bin clean: - rm $(PREFIX)/bin/{brighter,darker,vol_down,vol_up,mute,mic_toggle} + rm $(PREFIX)/bin/{gip, , fehbg, get_weather} diff --git a/scripts/brighter b/scripts/brighter deleted file mode 100755 index b495a84..0000000 --- a/scripts/brighter +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - - -sudo light -A 6 diff --git a/scripts/darker b/scripts/darker deleted file mode 100755 index f7530e7..0000000 --- a/scripts/darker +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# -# A script that lowers and ups the brightness -# - -sudo light -U 6 diff --git a/scripts/dmenumount b/scripts/dmenumount deleted file mode 100755 index 9556063..0000000 --- a/scripts/dmenumount +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -DEVICE=$(lsblk -o NAME -n -r -p | dmenu) -ROOT="sudo" -MOUNTPOINT=$(echo -e "/mnt\n/mnt2" | dmenu) - -$ROOT mount $DEVICE $MOUNTPOINT diff --git a/scripts/dmenuumount b/scripts/dmenuumount deleted file mode 100755 index b921b04..0000000 --- a/scripts/dmenuumount +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -DEVICE=$(lsblk -o NAME -n -r -p | dmenu) -ROOT=$(sudo) - -$ROOT umount $DEVICE diff --git a/scripts/mic_toggle b/scripts/mic_toggle deleted file mode 100755 index 044b9d6..0000000 --- a/scripts/mic_toggle +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -amixer -D pulse sset Capture toggle -notify-send "Toggled mute" diff --git a/scripts/mpvopen b/scripts/mpvopen deleted file mode 100755 index f1a4846..0000000 --- a/scripts/mpvopen +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -notify-send "Opening $(xclip -o) in MPV" -mpv $(xclip -o) diff --git a/scripts/mute b/scripts/mute deleted file mode 100755 index 7941e5d..0000000 --- a/scripts/mute +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -pactl set-sink-mute @DEFAULT_SINK@ toggle & -dunstify "Toggled mute" & diff --git a/scripts/rs b/scripts/rs deleted file mode 100755 index f8f1468..0000000 --- a/scripts/rs +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# A script to start sarc -sx dwm -# That's it diff --git a/scripts/screenshot b/scripts/screenshot deleted file mode 100755 index 7154c73..0000000 --- a/scripts/screenshot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -pictureName=$(echo "Enter filename of screenshot" | dmenu) -sleep 1s -import $pictureName.png -mv $pictureName.png ~/Pictures/Screenshots diff --git a/scripts/set_theme.sh b/scripts/set_theme.sh index cd4eca8..b2517ae 100755 --- a/scripts/set_theme.sh +++ b/scripts/set_theme.sh @@ -3,7 +3,7 @@ echo "Choose a theme:" && ls ./theme/ read theme -cp ./theme/$theme/$theme.png $HOME/.config/sarc/wallpaper.png +cp ./theme/$theme/$theme.png $HOME/.config/wallpaper.png cp ./theme/$theme/colors.h ./ echo "Done" diff --git a/scripts/vol_down b/scripts/vol_down deleted file mode 100755 index 9a01c42..0000000 --- a/scripts/vol_down +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -pactl set-sink-volume @DEFAULT_SINK@ -5% & -dunstify "Turned the volume down 5%" diff --git a/scripts/vol_up b/scripts/vol_up deleted file mode 100755 index 5107cd5..0000000 --- a/scripts/vol_up +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pactl set-sink-volume @DEFAULT_SINK@ +5% & -dunstify "Turned the volume up +5" & - diff --git a/scripts/xrandrdmenu b/scripts/xrandrdmenu deleted file mode 100755 index f6a918e..0000000 --- a/scripts/xrandrdmenu +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -OUTPUT=$(xrandr | grep " connected " | awk '{ print$1 }' | dmenu) -CHOICE=$(echo "Change resolution\nCh |