diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 870c946..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -custom: ["https://suckless.org/donations/", "https://paypal.me/dwmflexipatch"] diff --git a/README.md b/README.md index f5b0607..ac9dc4a 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 ### Changelog: -2023-06-27 - Added the focusfollowmouse and unmanaged patches - -2023-06-25 - Added the toggletopbar patch - 2023-01-18 - Added the view history patch 2022-10-08 - Added the alt-tab patch @@ -435,10 +431,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 - allows focusing on clients based on direction (up, down, left, right) instead of client order - - [focusfollowmouse](https://github.com/bakkeby/patches/wiki/focusfollowmouse) - - the window under the mouse cursor will receive focus when changing tags, closing windows or - moving client out of view (as opposed to the most recently focused client) - - [focusmaster](https://dwm.suckless.org/patches/focusmaster/) - a simple patch that just puts focus back to the master client @@ -624,7 +616,7 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 - [rotatestack](https://dwm.suckless.org/patches/rotatestack/) - let's you rotate through the stack using keyboard shortcuts - - [roundedcorners](https://github.com/mitchweaver/suckless/blob/master/dwm/inactive/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch) + - [roundedcorners](https://github.com/mitchweaver/suckless/blob/master/dwm/patches/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch) - adds rounded corners to client windows - [savefloats](https://dwm.suckless.org/patches/save_floats/) @@ -780,18 +772,15 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 - [togglefullscreen](https://github.com/bakkeby/patches/wiki/togglefullscreen/) - allows you to toggle fullscreen on and off using a single shortcut key - - [togglelayout](https://github.com/bakkeby/patches/wiki/togglelayout) - - toggle layout using the same keyboard shortcuts to set the layout - - e.g. hitting `MOD+m` switches to monocle layout, hitting the same keybinding again brings - you back to the previous layout - - [toggletag](https://github.com/bakkeby/patches/wiki/toggletag) - toggle tags using the same keyboard shortcuts to view tags - e.g. hitting `MOD+4` lets you view tag 4 and hitting the keybinding a second time brings you back to where you were before - - [toggletopbar](https://dwm.suckless.org/patches/toggletopbar/) - - allows for the bar position (top or bottom) to be toggled during runtime + - [togglelayout](https://github.com/bakkeby/patches/wiki/togglelayout) + - toggle layout using the same keyboard shortcuts to set the layout + - e.g. hitting `MOD+m` switches to monocle layout, hitting the same keybinding again brings + you back to the previous layout - [transfer](https://dwm.suckless.org/patches/transfer/) - lets you transfer the currently focused client between the master and stack area while @@ -808,10 +797,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 - resets isfloating on any visible windows that have it set and optionally also applies a layout - - [unmanaged](https://github.com/bakkeby/patches/wiki/unmanaged) - - adds a client rule that allows for windows to not be managed by the window manager - - this can be useful for external bars, widgets, launchers, docks, desktop icons and more - - [~urgentborder~](https://dwm.suckless.org/patches/urgentborder/) - ~this patch makes "urgent" windows have different colors~ diff --git a/bar.sh b/bar.sh new file mode 100755 index 0000000..18b6501 --- /dev/null +++ b/bar.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# ^c$var^ = fg color +# ^b$var^ = bg color + +interval=0 + +# load colors +# . ~/.config/bar_themes/onedark + +# colors + +rosewater=#f4dbd6 +flamingo=#f0c6c6 +pink=#f5bde6 +mauve=#c6a0f6 +red=#ed8796 +maroon=#ee99a0 +peach=#f5a97f +yellow=#eed49f +green=#a6da95 +teal=#8bd5ca +sky=#91d7e3 +sapphire=#7dc4e4 +blue=#8aadf4 +lavender=#b7bdf8 +text=#cad3f5 +subtext1=#b8c0e0 +subtext0=#a5adcb +overlay2=#939ab7 +overlay1=#8087a2 +overlay0=#6e738d +surface2=#5b6078 +surface1=#494d64 +surface0=#363a4f +base=#24273a +mantle=#1e2030 +crust=#181926 + +pulse () { + VOL=$(pamixer --get-volume) + STATE=$(pamixer --get-mute) + + printf "%s" "$SEP1" + if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then + printf "AMUT%%" + elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then + printf "A%s%%" "$VOL" + elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then + printf "A%s%%" "$VOL" + else + printf "A%s%%" "$VOL" + fi + printf "%s\n" "$SEP2" +} + +cpu() { + cpu_val=$(grep -o "^[^ ]*" /proc/loadavg) + + printf "^c$crust^ ^b$yellow^ 󰇄 " + printf "^c$crust^ ^b$yellow^$cpu_val" +} + +battery() { + capacity_0="$(cat /sys/class/power_supply/BAT0/capacity)" + capacity_1="$(cat /sys/class/power_supply/BAT1/capacity)" + + capacity="$capacity_0+$capacity_1" + # capacity=$(((capacity_0 + capacity_1) / 2)) + + printf " B$capacity%% " +} + +brightness() { + value=$(cat /sys/class/backlight/*/brightness) + percentage=$(echo "scale=2; $value / 8.54" | bc) + printf "L%.0f%%" "$percentage" +} + +mem() { + printf "^c$crust^^b$green^  " + printf "^c$crust^^b$green^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)" +} + +wlan() { + case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in + up) printf "^c$crust^ ^b$blue^ 󰤨 ^c$crust^ ^b$blue^Connected" ;; + down) printf "^c$crust^ ^b$blue^ 󰤭 ^c$crust^ ^b$blue^Disconnected" ;; + esac +} + +clock() { + printf " $(date '+%I:%M %P') " +} + +today() { + printf " $(date '+%b %e') " +} + +net() { + if nc -zw1 google.com 443; then + printf "^c$crust^^b$green^ i " + else + printf "^c$crust^^b$red^ ! " + fi +} + +while true; do + + # [ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates) + # interval=$((interval + 1)) + + # sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" + # sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" + if hash dockd 2>/dev/null; then + sleep 1 && xsetroot -name "^c$text^^b$surface0^ $(brightness) ^b$base^ $(battery) $(net)^c$text^^b$base^ $(today) ^b$surface0^ $(clock) ^b$surface1^ $(pulse) " + else + sleep 1 && xsetroot -name "^c$text^$(net)^c$text^^b$base^ $(today) ^b$surface0^ $(clock) ^b$surface1^ $(pulse) " + fi + +done diff --git a/config.def.h b/config.def.h index af32234..761a3df 100644 --- a/config.def.h +++ b/config.def.h @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ +#include + /* appearance */ #if ROUNDED_CORNERS_PATCH static const unsigned int borderpx = 0; /* border pixel of windows */ @@ -7,13 +9,7 @@ static const int corner_radius = 10; #else static const unsigned int borderpx = 1; /* border pixel of windows */ #endif // ROUNDED_CORNERS_PATCH -#if BAR_BORDER_PATCH -/* This allows the bar border size to be explicitly set separately from borderpx. - * If left as 0 then it will default to the borderpx value of the monitor and will - * automatically update with setborderpx. */ -static const unsigned int barborderpx = 0; /* border pixel of bar */ -#endif // BAR_BORDER_PATCH -static const unsigned int snap = 32; /* snap pixel */ +static const unsigned int snap = 28; /* snap pixel */ #if SWALLOW_PATCH static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ #endif // SWALLOW_PATCH @@ -56,7 +52,7 @@ static const int showtab = showtab_auto; /* Default tab b static const int toptab = False; /* False means bottom tab bar */ #endif // TAB_PATCH #if BAR_HEIGHT_PATCH -static const int bar_height = 0; /* 0 means derive from font, >= 1 explicit height */ +static const int bar_height = 32; /* 0 means derive from font, >= 1 explicit height */ #endif // BAR_HEIGHT_PATCH #if BAR_PADDING_PATCH static const int vertpad = 10; /* vertical padding of bar */ @@ -94,7 +90,7 @@ static const int horizpadbar = 2; /* horizontal padding for status static const int vertpadbar = 0; /* vertical padding for statusbar */ #endif // BAR_STATUSPADDING_PATCH #if BAR_STATUSBUTTON_PATCH -static const char buttonbar[] = ""; +static const char buttonbar[] = ""; #endif // BAR_STATUSBUTTON_PATCH #if BAR_SYSTRAY_PATCH static const unsigned int systrayspacing = 2; /* systray spacing */ @@ -107,7 +103,7 @@ static const int lcaselbl = 0; /* 1 means make tag label lowerc #endif // BAR_TAGLABELS_PATCH #if BAR_UNDERLINETAGS_PATCH static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */ -static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinestroke = 4; /* thickness / height of the underline */ static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ #endif // BAR_UNDERLINETAGS_PATCH @@ -160,53 +156,67 @@ static void (*bartabmonfns[])(Monitor *) = { NULL /* , customlayoutfn */ }; #endif // MONOCLE_LAYOUT #endif // BAR_TABGROUPS_PATCH #if BAR_PANGO_PATCH -static const char font[] = "monospace 10"; +static const char font[] = "monospace 11"; #else -static const char *fonts[] = { "monospace:size=10" }; +static const char *fonts[] = { "Noto Nerd Font:size=11:antialias=true", "monospace:size=11:antialias=true" }; #endif // BAR_PANGO_PATCH -static const char dmenufont[] = "monospace:size=10"; +static const char dmenufont[] = "Noto Nerd Font:size=11:antialias=true"; static char c000000[] = "#000000"; // placeholder value -static char normfgcolor[] = "#bbbbbb"; -static char normbgcolor[] = "#222222"; -static char normbordercolor[] = "#444444"; -static char normfloatcolor[] = "#db8fd9"; +static char normfgcolor[] = "#cad3f5"; +static char normbgcolor[] = "#24273a"; +static char normbordercolor[] = "#494d64"; +static char normfloatcolor[] = "#5b6078"; -static char selfgcolor[] = "#eeeeee"; -static char selbgcolor[] = "#005577"; -static char selbordercolor[] = "#005577"; -static char selfloatcolor[] = "#005577"; +static char selfgcolor[] = "#181926"; +static char selbgcolor[] = "#ed8796"; +static char selbordercolor[] = "#ee99a0"; +static char selfloatcolor[] = "#ee99a0"; -static char titlenormfgcolor[] = "#bbbbbb"; -static char titlenormbgcolor[] = "#222222"; -static char titlenormbordercolor[] = "#444444"; -static char titlenormfloatcolor[] = "#db8fd9"; +static char titlenormfgcolor[] = "#cad3f5"; +static char titlenormbgcolor[] = "#24273a"; +static char titlenormbordercolor[] = "#363a4f"; +static char titlenormfloatcolor[] = "#c6a0f6"; -static char titleselfgcolor[] = "#eeeeee"; -static char titleselbgcolor[] = "#005577"; -static char titleselbordercolor[] = "#005577"; -static char titleselfloatcolor[] = "#005577"; +static char titleselfgcolor[] = "#a6da95"; +static char titleselbgcolor[] = "#363a4f"; +static char titleselbordercolor[] = "#5b6078"; +static char titleselfloatcolor[] = "#5b6078"; -static char tagsnormfgcolor[] = "#bbbbbb"; -static char tagsnormbgcolor[] = "#222222"; -static char tagsnormbordercolor[] = "#444444"; -static char tagsnormfloatcolor[] = "#db8fd9"; +static char tagsnormfgcolor[] = "#cad3f5"; +static char tagsnormbgcolor[] = "#24273a"; +static char tagsnormbordercolor[] = "#363a4f"; +static char tagsnormfloatcolor[] = "#363a4f"; -static char tagsselfgcolor[] = "#eeeeee"; -static char tagsselbgcolor[] = "#005577"; -static char tagsselbordercolor[] = "#005577"; -static char tagsselfloatcolor[] = "#005577"; +static char tagsselfgcolor[] = "#a6da95"; +static char tagsselbgcolor[] = "#181926"; +static char tagsselbordercolor[] = "#eed49f"; +static char tagsselfloatcolor[] = "#8bd5ca"; -static char hidnormfgcolor[] = "#005577"; -static char hidselfgcolor[] = "#227799"; -static char hidnormbgcolor[] = "#222222"; -static char hidselbgcolor[] = "#222222"; +static char hidnormfgcolor[] = "#5b6078"; +static char hidselfgcolor[] = "#5b6078"; +static char hidnormbgcolor[] = "#181926"; +static char hidselbgcolor[] = "#181926"; -static char urgfgcolor[] = "#bbbbbb"; -static char urgbgcolor[] = "#222222"; -static char urgbordercolor[] = "#ff0000"; -static char urgfloatcolor[] = "#db8fd9"; +static char urgfgcolor[] = "#181926"; +static char urgbgcolor[] = "#ed8796"; +static char urgbordercolor[] = "#ed8796"; +static char urgfloatcolor[] = "#ed8796"; + +static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL}; +static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-3%", NULL}; +static const char *upvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "+3%", NULL}; +static const char *mutemic[] = {"/usr/bin/pactl", "set-source-mute", "0", "toggle", NULL}; +static const char *downbrt[] = {"xbacklight", "-dec", "5", NULL}; +static const char *upbrt[] = {"xbacklight", "-inc", "5", NULL}; +static const char *displ[] = {"arandr", NULL}; +static const char *wlan[] = {"alacritty", "-e", "nmtui", NULL}; +static const char *tools[] = {"lxappearance"}; +static const char *search[] = {"rofi", "-show", "drun", NULL}; +// static const char *launcha[] = {alttabstart}; +static const char *explorer[] = {"nemo", NULL}; +static const char *locksession[] = {"loginctl", "lock-session", NULL}; #if RENAMED_SCRATCHPADS_PATCH static char scratchselfgcolor[] = "#FFF7D4"; @@ -409,7 +419,7 @@ static const char *const autostart[] = { #if RENAMED_SCRATCHPADS_PATCH static const char *scratchpadcmd[] = {"s", "st", "-n", "spterm", NULL}; #elif SCRATCHPADS_PATCH -const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL }; +const char *spcmd1[] = {"alacritty", "-t", "scratchpad", "--option", "window.dimensions.columns=120", "--option", "window.dimensions.lines=34", NULL }; static Sp scratchpads[] = { /* name cmd */ {"spterm", spcmd1}, @@ -769,31 +779,31 @@ static const char *xkb_layouts[] = { #endif // XKB_PATCH /* key definitions */ -#define MODKEY Mod1Mask +#define MODKEY Mod4Mask #if COMBO_PATCH && SWAPTAGS_PATCH && TAGOTHERMONITOR_PATCH #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, #elif COMBO_PATCH && SWAPTAGS_PATCH #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, #elif COMBO_PATCH && TAGOTHERMONITOR_PATCH #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, #elif COMBO_PATCH #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ @@ -806,24 +816,24 @@ static const char *xkb_layouts[] = { { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, #elif SWAPTAGS_PATCH #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} }, \ - { MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, #elif TAGOTHERMONITOR_PATCH #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} }, \ - { MODKEY|Mod4Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod4Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, + { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ + { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, #else #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ @@ -854,6 +864,7 @@ static const char *xkb_layouts[] = { #if !NODMENU_PATCH static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ #endif // NODMENU_PATCH +static const char *rofidruncmd[] = {"rofi", "-show", "drun", "-modi", "drun,run,window,calc", "-no-show-match", "-no-sort", "-automatic-save-to-history", NULL}; static const char *dmenucmd[] = { "dmenu_run", #if !NODMENU_PATCH @@ -869,7 +880,7 @@ static const char *dmenucmd[] = { #endif // BAR_DMENUMATCHTOP_PATCH NULL }; -static const char *termcmd[] = { "st", NULL }; +static const char *termcmd[] = { "alacritty", NULL }; #if BAR_STATUSCMD_PATCH #if BAR_DWMBLOCKS_PATCH @@ -897,6 +908,22 @@ static const Key on_empty_keys[] = { static const Key keys[] = { /* modifier key function argument */ + {0, XF86XK_AudioMute, spawn, {.v = mutevol}}, + {0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}}, + {0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}}, + {0, XF86XK_AudioMicMute, spawn, {.v = mutemic}}, + {0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}}, + {0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}}, + {0, XF86XK_Display, spawn, {.v = displ}}, + {0, XF86XK_WLAN, spawn, {.v = wlan}}, + {0, XF86XK_Tools, spawn, {.v = tools}}, + {0, XF86XK_Search, spawn, {.v = search}}, + {0, XF86XK_LaunchA, alttabstart, {0}}, + {0, XF86XK_Explorer, spawn, {.v = explorer}}, + { MODKEY|Mod1Mask, XK_F1, spawn, {.v = upvol}}, + { MODKEY|Mod1Mask, XK_F3, spawn, {.v = downvol}}, + { MODKEY, XK_n, spawn, {.v = explorer} }, + { MODKEY|ShiftMask, XK_l, spawn, {.v = locksession} }, #if KEYMODES_PATCH { MODKEY, XK_Escape, setkeymode, {.ui = COMMANDMODE} }, #endif // KEYMODES_PATCH @@ -908,9 +935,6 @@ static const Key keys[] = { { MODKEY, XK_s, rioresize, {0} }, #endif // RIODRAW_PATCH { MODKEY, XK_b, togglebar, {0} }, - #if TOGGLETOPBAR_PATCH - { MODKEY|ShiftMask, XK_b, toggletopbar, {0} }, - #endif // TOGGLETOPBAR_PATCH #if TAB_PATCH { MODKEY|ControlMask, XK_b, tabmode, {-1} }, #endif // TAB_PATCH @@ -937,14 +961,14 @@ static const Key keys[] = { { MODKEY, XK_v, switchcol, {0} }, #endif // SWITCHCOL_PATCH #if ROTATESTACK_PATCH - { MODKEY|Mod4Mask, XK_j, rotatestack, {.i = +1 } }, - { MODKEY|Mod4Mask, XK_k, rotatestack, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_j, rotatestack, {.i = +1 } }, + { MODKEY|Mod1Mask, XK_k, rotatestack, {.i = -1 } }, #endif // ROTATESTACK_PATCH #if INPLACEROTATE_PATCH - { MODKEY|Mod4Mask, XK_j, inplacerotate, {.i = +2 } }, // same as rotatestack - { MODKEY|Mod4Mask, XK_k, inplacerotate, {.i = -2 } }, // same as reotatestack - { MODKEY|Mod4Mask|ShiftMask, XK_j, inplacerotate, {.i = +1} }, - { MODKEY|Mod4Mask|ShiftMask, XK_k, inplacerotate, {.i = -1} }, + { MODKEY|Mod1Mask, XK_j, inplacerotate, {.i = +2 } }, // same as rotatestack + { MODKEY|Mod1Mask, XK_k, inplacerotate, {.i = -2 } }, // same as reotatestack + { MODKEY|Mod1Mask|ShiftMask, XK_j, inplacerotate, {.i = +1} }, + { MODKEY|Mod1Mask|ShiftMask, XK_k, inplacerotate, {.i = -1} }, #endif // INPLACEROTATE_PATCH #if PUSH_PATCH || PUSH_NO_MASTER_PATCH { MODKEY|ControlMask, XK_j, pushdown, {0} }, @@ -968,14 +992,14 @@ static const Key keys[] = { { MODKEY|ControlMask|ShiftMask, XK_r, aspectresize, {.i = -24} }, #endif // ASPECTRESIZE_PATCH #if MOVERESIZE_PATCH - { MODKEY|Mod4Mask, XK_Down, moveresize, {.v = "0x 25y 0w 0h" } }, - { MODKEY|Mod4Mask, XK_Up, moveresize, {.v = "0x -25y 0w 0h" } }, - { MODKEY|Mod4Mask, XK_Right, moveresize, {.v = "25x 0y 0w 0h" } }, - { MODKEY|Mod4Mask, XK_Left, moveresize, {.v = "-25x 0y 0w 0h" } }, - { MODKEY|Mod4Mask|ShiftMask, XK_Down, moveresize, {.v = "0x 0y 0w 25h" } }, - { MODKEY|Mod4Mask|ShiftMask, XK_Up, moveresize, {.v = "0x 0y 0w -25h" } }, - { MODKEY|Mod4Mask|ShiftMask, XK_Right, moveresize, {.v = "0x 0y 25w 0h" } }, - { MODKEY|Mod4Mask|ShiftMask, XK_Left, moveresize, {.v = "0x 0y -25w 0h" } }, + { MODKEY|Mod1Mask, XK_Down, moveresize, {.v = "0x 25y 0w 0h" } }, + { MODKEY|Mod1Mask, XK_Up, moveresize, {.v = "0x -25y 0w 0h" } }, + { MODKEY|Mod1Mask, XK_Right, moveresize, {.v = "25x 0y 0w 0h" } }, + { MODKEY|Mod1Mask, XK_Left, moveresize, {.v = "-25x 0y 0w 0h" } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Down, moveresize, {.v = "0x 0y 0w 25h" } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Up, moveresize, {.v = "0x 0y 0w -25h" } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Right, moveresize, {.v = "0x 0y 25w 0h" } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Left, moveresize, {.v = "0x 0y -25w 0h" } }, #endif // MOVERESIZE_PATCH #if MOVESTACK_PATCH { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, @@ -998,22 +1022,22 @@ static const Key keys[] = { #endif // INSETS_PATCH { MODKEY, XK_Return, zoom, {0} }, #if VANITYGAPS_PATCH - { 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|Mod1Mask, XK_u, incrgaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_i, incrigaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_o, incrogaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_6, incrihgaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_7, incrivgaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_8, incrohgaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_9, incrovgaps, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } }, + { MODKEY|Mod1Mask, XK_0, togglegaps, {0} }, + { MODKEY|Mod1Mask|ShiftMask, XK_0, defaultgaps, {0} }, #endif // VANITYGAPS_PATCH #if ALT_TAB_PATCH { Mod1Mask, XK_Tab, alttabstart, {0} }, @@ -1033,21 +1057,22 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_backslash, shiftview, { .i = +1 } }, #endif // SHIFTVIEW_PATCH #if SHIFTVIEW_CLIENTS_PATCH - { MODKEY|Mod4Mask, XK_Tab, shiftviewclients, { .i = -1 } }, - { MODKEY|Mod4Mask, XK_backslash, shiftviewclients, { .i = +1 } }, + { MODKEY|Mod1Mask, XK_Tab, shiftviewclients, { .i = -1 } }, + { MODKEY|Mod1Mask, XK_backslash, shiftviewclients, { .i = +1 } }, #endif // SHIFTVIEW_CLIENTS_PATCH #if SHIFTBOTH_PATCH { MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft { MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright #endif // SHIFTBOTH_PATCH #if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH - { MODKEY|Mod4Mask|ShiftMask, XK_Left, shiftswaptags, { .i = -1 } }, - { MODKEY|Mod4Mask|ShiftMask, XK_Right, shiftswaptags, { .i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Left, shiftswaptags, { .i = -1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_Right, shiftswaptags, { .i = +1 } }, #endif // SHIFTSWAPTAGS_PATCH #if BAR_WINTITLEACTIONS_PATCH { MODKEY|ControlMask, XK_z, showhideclient, {0} }, #endif // BAR_WINTITLEACTIONS_PATCH { MODKEY|ShiftMask, XK_c, killclient, {0} }, + { MODKEY, XK_q, killclient, {0} }, #if KILLUNSEL_PATCH { MODKEY|ShiftMask, XK_x, killunsel, {0} }, #endif // KILLUNSEL_PATCH @@ -1087,7 +1112,7 @@ static const Key keys[] = { { MODKEY|Mod5Mask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */ { MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */ #endif // FLEXTILE_DELUXE_LAYOUT - { MODKEY, XK_space, setlayout, {0} }, + { MODKEY, XK_space, spawn, {.v = rofidruncmd}}, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, #if MAXIMIZE_PATCH { MODKEY|ControlMask|ShiftMask, XK_h, togglehorizontalmax, {0} }, @@ -1109,7 +1134,7 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_grave, removescratch, {.ui = 0 } }, #endif // SCRATCHPADS_PATCH | RENAMED_SCRATCHPADS_PATCH #if UNFLOATVISIBLE_PATCH - { MODKEY|Mod4Mask, XK_space, unfloatvisible, {0} }, + { MODKEY|Mod1Mask, XK_space, unfloatvisible, {0} }, { MODKEY|ShiftMask, XK_t, unfloatvisible, {.v = &layouts[0]} }, #endif // UNFLOATVISIBLE_PATCH #if TOGGLEFULLSCREEN_PATCH @@ -1168,12 +1193,12 @@ static const Key keys[] = { { MODKEY|ControlMask, XK_F9, tagall, {.v = "9"} }, #endif // TAGALL_PATCH #if TAGALLMON_PATCH - { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, - { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, + { MODKEY|Mod1Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, #endif // TAGALLMON_PATCH #if TAGSWAPMON_PATCH - { MODKEY|Mod4Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } }, - { MODKEY|Mod4Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } }, + { MODKEY|Mod1Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } }, + { MODKEY|Mod1Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } }, #endif // TAGSWAPMON_PATCH #if BAR_ALTERNATIVE_TAGS_PATCH { MODKEY, XK_n, togglealttag, {0} }, @@ -1186,10 +1211,10 @@ static const Key keys[] = { { MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } }, { MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } }, { MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } }, - { MODKEY|Mod4Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod4Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod4Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod4Mask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, + { MODKEY|Mod1Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, + { MODKEY|Mod1Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, + { MODKEY|Mod1Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, + { MODKEY|Mod1Mask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, #endif // BAR_TAGGRID_PATCH #if MOVEPLACE_PATCH { MODKEY, XK_KP_7, moveplace, {.ui = WIN_NW }}, /* XK_KP_Home, */ @@ -1403,9 +1428,6 @@ static const Signal signals[] = { { "focusstack", focusstack }, { "setmfact", setmfact }, { "togglebar", togglebar }, - #if TOGGLETOPBAR_PATCH - { "toggletopbar", toggletopbar }, - #endif // TOGGLETOPBAR_PATCH { "incnmaster", incnmaster }, { "togglefloating", togglefloating }, { "focusmon", focusmon }, @@ -1604,9 +1626,6 @@ static IPCCommand ipccommands[] = { IPCCOMMAND( tag, 1, {ARG_TYPE_UINT} ), IPCCOMMAND( tagmon, 1, {ARG_TYPE_UINT} ), IPCCOMMAND( togglebar, 1, {ARG_TYPE_NONE} ), - #if TOGGLETOPBAR_PATCH - IPCCOMMAND( toggletopbar, 1, {ARG_TYPE_NONE} ), - #endif // TOGGLETOPBAR_PATCH IPCCOMMAND( togglefloating, 1, {ARG_TYPE_NONE} ), IPCCOMMAND( toggletag, 1, {ARG_TYPE_UINT} ), IPCCOMMAND( toggleview, 1, {ARG_TYPE_UINT} ), diff --git a/config.mk b/config.mk index 69b8092..1e6b15d 100644 --- a/config.mk +++ b/config.mk @@ -52,15 +52,15 @@ XRENDER = -lXrender #IMLIB2LIBS = -lImlib2 # Uncomment for the bidi patch -#BDINC = `pkg-config --cflags fribidi` -#BDLIBS = `pkg-config --libs fribidi` +#BDINC = -I/usr/include/fribidi +#BDLIBS = -lfribidi # includes and libs INCS = -I${X11INC} -I${FREETYPEINC} ${YAJLINC} ${PANGOINC} ${BDINC} LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT} ${XEXTLIB} ${XCBLIBS} ${KVMLIB} ${PANGOLIB} ${YAJLLIBS} ${IMLIB2LIBS} $(BDLIBS) # flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D__XSI_VISIBLE=1 -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} CFLAGS = -std=c99 -pedantic -Wall -Wno-unused-function -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} diff --git a/dwm.c b/dwm.c index 74f3ee2..f95d86d 100644 --- a/dwm.c +++ b/dwm.c @@ -484,7 +484,7 @@ struct Monitor { int gappov; /* vertical outer gaps */ #endif // VANITYGAPS_PATCH #if SETBORDERPX_PATCH - int borderpx; + unsigned int borderpx; #endif // SETBORDERPX_PATCH unsigned int seltags; unsigned int sellt; @@ -568,9 +568,6 @@ typedef struct { #if RENAMED_SCRATCHPADS_PATCH const char scratchkey; #endif // RENAMED_SCRATCHPADS_PATCH - #if UNMANAGED_PATCH - int unmanaged; - #endif // UNMANAGED_PATCH #if XKB_PATCH int xkb_layout; #endif // XKB_PATCH @@ -778,9 +775,6 @@ static int xkbEventType = 0; static int screen; static int sw, sh; /* X display screen geometry width, height */ static int bh; /* bar geometry */ -#if UNMANAGED_PATCH -static int unmanaged = 0; /* whether the window manager should manage the new window or not */ -#endif // UNMANAGED_PATCH static int lrpad; /* sum of left and right padding for text */ /* Some clients (e.g. alacritty) helpfully send configure requests with a new size or position * when they detect that they have been moved to another monitor. This can cause visual glitches @@ -938,9 +932,6 @@ applyrules(Client *c) c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); } #endif // SCRATCHPADS_PATCH - #if UNMANAGED_PATCH - unmanaged = r->unmanaged; - #endif // UNMANAGED_PATCH for (m = mons; m && m->num != r->monitor; m = m->next); if (m) c->mon = m; @@ -974,7 +965,12 @@ applyrules(Client *c) if (r->switchtag == 3 || r->switchtag == 4) c->switchtag = c->mon->tagset[c->mon->seltags]; if (r->switchtag == 1 || r->switchtag == 3) { + #if PERTAG_PATCH + pertagview(&((Arg) { .ui = newtagset })); + arrange(c->mon); + #else view(&((Arg) { .ui = newtagset })); + #endif // PERTAG_PATCH } else { #if TAGSYNC_PATCH for (m = mons; m; m = m->next) @@ -1498,8 +1494,8 @@ configurenotify(XEvent *e) createpreview(m); #endif // BAR_TAGPREVIEW_PATCH } - arrange(NULL); focus(NULL); + arrange(NULL); } } } @@ -1685,7 +1681,7 @@ createmon(void) bar->showbar = 1; bar->external = 0; #if BAR_BORDER_PATCH - bar->borderpx = (barborderpx ? barborderpx : borderpx); + bar->borderpx = borderpx; #else bar->borderpx = 0; #endif // BAR_BORDER_PATCH @@ -2046,10 +2042,6 @@ expose(XEvent *e) void focus(Client *c) { - #if FOCUSFOLLOWMOUSE_PATCH - if (!c || !ISVISIBLE(c)) - c = getpointerclient(); - #endif // FOCUSFOLLOWMOUSE_PATCH if (!c || !ISVISIBLE(c)) for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); if (selmon->sel && selmon->sel != c) @@ -2511,25 +2503,6 @@ manage(Window w, XWindowAttributes *wa) #endif // SWALLOW_PATCH } - #if UNMANAGED_PATCH - if (unmanaged) { - XMapWindow(dpy, c->win); - if (unmanaged == 1) - XRaiseWindow(dpy, c->win); - else if (unmanaged == 2) - XLowerWindow(dpy, c->win); - - updatewmhints(c); - if (!c->neverfocus) - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - sendevent(c, wmatom[WMTakeFocus]); - - free(c); - unmanaged = 0; - return; - } - #endif // UNMANAGED_PATCH - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) c->x = c->mon->wx + c->mon->ww - WIDTH(c); if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) @@ -3379,12 +3352,11 @@ sendmon(Client *c, Monitor *m) if (hadfocus) { focus(c); restack(m); - } else { + } else focus(NULL); - } #else - arrange(NULL); focus(NULL); + arrange(NULL); #endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH #if SWITCHTAG_PATCH if (c->switchtag) @@ -4107,7 +4079,6 @@ tag(const Arg *arg) if (selmon->sel->switchtag) selmon->sel->switchtag = 0; #endif // SWITCHTAG_PATCH - arrange(selmon); focus(NULL); #if SWAPFOCUS_PATCH && PERTAG_PATCH selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; @@ -4115,6 +4086,7 @@ tag(const Arg *arg) if (tagmask & 1) selmon->pertag->prevclient[tagindex] = NULL; #endif // SWAPFOCUS_PATCH + arrange(selmon); #if VIEWONTAG_PATCH if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags]) view(arg); @@ -4246,13 +4218,13 @@ toggletag(const Arg *arg) newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); if (newtags) { selmon->sel->tags = newtags; - arrange(selmon); focus(NULL); #if SWAPFOCUS_PATCH && PERTAG_PATCH for (tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++) if (tagmask & 1) selmon->pertag->prevclient[tagindex] = NULL; #endif // SWAPFOCUS_PATCH + arrange(selmon); } #if BAR_EWMHTAGS_PATCH updatecurrentdesktop(); @@ -4339,8 +4311,8 @@ toggleview(const Arg *arg) #endif // PERTAGBAR_PATCH #endif // PERTAG_PATCH #if !TAGSYNC_PATCH - arrange(selmon); focus(NULL); + arrange(selmon); #endif // TAGSYNC_PATCH #if !EMPTYVIEW_PATCH } @@ -4351,8 +4323,8 @@ toggleview(const Arg *arg) #if !EMPTYVIEW_PATCH if (newtagset) { #endif // EMPTYVIEW_PATCH - arrange(NULL); focus(NULL); + arrange(NULL); #if !EMPTYVIEW_PATCH } #endif // EMPTYVIEW_PATCH @@ -4489,9 +4461,9 @@ unmanage(Client *c, int destroyed) if (s) return; #endif // SWALLOW_PATCH - arrange(m); focus(NULL); updateclientlist(); + arrange(m); #if SWITCHTAG_PATCH if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags])) view(&((Arg) { .ui = switchtag })); @@ -4986,12 +4958,12 @@ view(const Arg *arg) } selmon = origselmon; #endif // TAGSYNC_PATCH + focus(NULL); #if TAGSYNC_PATCH arrange(NULL); #else arrange(selmon); #endif // TAGSYNC_PATCH - focus(NULL); #if BAR_EWMHTAGS_PATCH updatecurrentdesktop(); #endif // BAR_EWMHTAGS_PATCH diff --git a/patch/bar_layoutmenu.c b/patch/bar_layoutmenu.c index bab4e47..1b95069 100644 --- a/patch/bar_layoutmenu.c +++ b/patch/bar_layoutmenu.c @@ -9,7 +9,7 @@ layoutmenu(const Arg *arg) { s = fgets(c, sizeof(c), p); pclose(p); - if (!s || *s == '\0' || c[0] == '\0') + if (!s || *s == '\0' || c == '\0') return; i = atoi(c); diff --git a/patch/combo.c b/patch/combo.c index 0b0bc5a..58b31f1 100644 --- a/patch/combo.c +++ b/patch/combo.c @@ -22,8 +22,8 @@ combotag(const Arg *arg) combo = 1; selmon->sel->tags = arg->ui & TAGMASK; } - arrange(selmon); focus(NULL); + arrange(selmon); } } diff --git a/patch/distributetags.c b/patch/distributetags.c index d786774..f20f53f 100644 --- a/patch/distributetags.c +++ b/patch/distributetags.c @@ -22,10 +22,10 @@ distributetags(const Arg *arg) #if TAGSYNC_PATCH } selmon = origselmon; + focus(NULL); arrange(NULL); - focus(NULL); #else - arrange(selmon); focus(NULL); + arrange(selmon); #endif // TAGSYNC_PATCH } diff --git a/patch/dwmc b/patch/dwmc index 2500ba7..c2ddbe8 100755 --- a/patch/dwmc +++ b/patch/dwmc @@ -30,7 +30,6 @@ case $# in transferall) ;& togglealttag) ;& togglebar) ;& - toggletopbar) ;& togglefloating) ;& togglefullscreen) ;& fullscreen) ;& diff --git a/patch/focusadjacenttag.c b/patch/focusadjacenttag.c index f0244a2..67dd768 100644 --- a/patch/focusadjacenttag.c +++ b/patch/focusadjacenttag.c @@ -6,8 +6,8 @@ tagtoleft(const Arg *arg) && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { selmon->sel->tags >>= 1; - arrange(selmon); focus(NULL); + arrange(selmon); } } @@ -19,8 +19,8 @@ tagtoright(const Arg *arg) && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] & (MASK >> 1)) { selmon->sel->tags <<= 1; - arrange(selmon); focus(NULL); + arrange(selmon); } } diff --git a/patch/focusfollowmouse.c b/patch/focusfollowmouse.c deleted file mode 100644 index d75a9da..0000000 --- a/patch/focusfollowmouse.c +++ /dev/null @@ -1,9 +0,0 @@ -Client * -getpointerclient(void) -{ - Window dummy, win; - int di; - unsigned int dui; - XQueryPointer(dpy, root, &dummy, &win, &di, &di, &di, &di, &dui); - return wintoclient(win); -} diff --git a/patch/focusfollowmouse.h b/patch/focusfollowmouse.h deleted file mode 100644 index 6b24d5f..0000000 --- a/patch/focusfollowmouse.h +++ /dev/null @@ -1 +0,0 @@ -static Client *getpointerclient(void); diff --git a/patch/include.c b/patch/include.c index 440633a..326323c 100644 --- a/patch/include.c +++ b/patch/include.c @@ -151,9 +151,6 @@ #if FOCUSDIR_PATCH #include "focusdir.c" #endif -#if FOCUSFOLLOWMOUSE_PATCH -#include "focusfollowmouse.c" -#endif #if FOCUSMASTER_PATCH #include "focusmaster.c" #endif @@ -313,9 +310,6 @@ #if TOGGLEFULLSCREEN_PATCH #include "togglefullscreen.c" #endif -#if TOGGLETOPBAR_PATCH -#include "toggletopbar.c" -#endif #if TRANSFER_PATCH #include "transfer.c" #endif diff --git a/patch/include.h b/patch/include.h index 2879103..9ab7527 100644 --- a/patch/include.h +++ b/patch/include.h @@ -154,9 +154,6 @@ #if FOCUSADJACENTTAG_PATCH #include "focusadjacenttag.h" #endif -#if FOCUSFOLLOWMOUSE_PATCH -#include "focusfollowmouse.h" -#endif #if FOCUSMASTER_PATCH #include "focusmaster.h" #endif @@ -315,9 +312,6 @@ #if TOGGLEFULLSCREEN_PATCH #include "togglefullscreen.h" #endif -#if TOGGLETOPBAR_PATCH -#include "toggletopbar.h" -#endif #if TRANSFER_PATCH #include "transfer.h" #endif diff --git a/patch/pertag.c b/patch/pertag.c index 8a4f4d2..292076e 100644 --- a/patch/pertag.c +++ b/patch/pertag.c @@ -21,7 +21,7 @@ struct Pertag { #endif // ZOOMSWAP_PATCH #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH int enablegaps[NUMTAGS + 1]; - int gaps[NUMTAGS + 1]; + unsigned int gaps[NUMTAGS + 1]; #endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH }; diff --git a/patch/scratchpad.c b/patch/scratchpad.c index 013e35f..9e24ff6 100644 --- a/patch/scratchpad.c +++ b/patch/scratchpad.c @@ -62,8 +62,8 @@ togglescratch(const Arg *arg) if (found) { if (newtagset) { selmon->tagset[selmon->seltags] = newtagset; - arrange(selmon); focus(NULL); + arrange(selmon); } if (ISVISIBLE(found)) { focus(found); diff --git a/patch/scratchpad_alt_1.c b/patch/scratchpad_alt_1.c index 8704582..6724d5c 100644 --- a/patch/scratchpad_alt_1.c +++ b/patch/scratchpad_alt_1.c @@ -6,8 +6,8 @@ scratchpad_hide() if (selmon->sel) { selmon->sel->tags = SCRATCHPAD_MASK; selmon->sel->isfloating = 1; - arrange(selmon); focus(NULL); + arrange(selmon); } } @@ -36,8 +36,8 @@ scratchpad_show() if (scratchpad_last_showed->tags != SCRATCHPAD_MASK) { scratchpad_last_showed->tags = SCRATCHPAD_MASK; - arrange(selmon); focus(NULL); + arrange(selmon); return; } diff --git a/patch/setborderpx.c b/patch/setborderpx.c index 250a939..6cc0b34 100644 --- a/patch/setborderpx.c +++ b/patch/setborderpx.c @@ -15,15 +15,13 @@ setborderpx(const Arg *arg) int delta = 2 * (m->borderpx - prev_borderpx); #if BAR_BORDER_PATCH - if (!barborderpx) { - for (bar = m->bar; bar; bar = bar->next) { - bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx; - bar->borderpx = m->borderpx; - } - updatebarpos(m); - for (bar = m->bar; bar; bar = bar->next) - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + for (bar = m->bar; bar; bar = bar->next) { + bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx; + bar->borderpx = m->borderpx; } + updatebarpos(m); + for (bar = m->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); #endif // BAR_BORDER_PATCH for (c = m->clients; c; c = c->next) { diff --git a/patch/swallow.c b/patch/swallow.c index df8f927..8a63cc0 100644 --- a/patch/swallow.c +++ b/patch/swallow.c @@ -91,8 +91,8 @@ unswallow(Client *c) setfloatinghint(c); #endif // BAR_EWMHTAGS_PATCH setclientstate(c, NormalState); - arrange(c->mon); focus(NULL); + arrange(c->mon); } pid_t diff --git a/patch/tagallmon.c b/patch/tagallmon.c index 3dee569..d6b879a 100644 --- a/patch/tagallmon.c +++ b/patch/tagallmon.c @@ -43,7 +43,7 @@ tagallmon(const Arg *arg) } } - arrange(NULL); focus(NULL); + arrange(NULL); } diff --git a/patch/tagothermonitor.c b/patch/tagothermonitor.c index 90739dc..d12f6ff 100644 --- a/patch/tagothermonitor.c +++ b/patch/tagothermonitor.c @@ -37,8 +37,8 @@ tagothermon(const Arg *arg, int dir) sendmon(sel, newmon); if (arg->ui & TAGMASK) { sel->tags = arg->ui & TAGMASK; - arrange(newmon); focus(NULL); + arrange(newmon); } } diff --git a/patch/tagswapmon.c b/patch/tagswapmon.c index 915512e..4719b8c 100644 --- a/patch/tagswapmon.c +++ b/patch/tagswapmon.c @@ -69,7 +69,7 @@ tagswapmon(const Arg *arg) } } - arrange(NULL); focus(NULL); + arrange(NULL); } diff --git a/patch/toggletopbar.c b/patch/toggletopbar.c deleted file mode 100644 index 8ccc9ac..0000000 --- a/patch/toggletopbar.c +++ /dev/null @@ -1,20 +0,0 @@ -void -toggletopbar(const Arg *arg) -{ - Bar *bar; - Monitor *m = selmon; - - for (bar = m->bar; bar; bar = bar->next) - bar->topbar = !bar->topbar; - - if (!m->showbar) { - togglebar(NULL); - return; - } - - updatebarpos(m); - - for (bar = m->bar; bar; bar = bar->next) - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - arrange(m); -} diff --git a/patch/toggletopbar.h b/patch/toggletopbar.h deleted file mode 100644 index af8e443..0000000 --- a/patch/toggletopbar.h +++ /dev/null @@ -1 +0,0 @@ -static void toggletopbar(const Arg *arg); diff --git a/patch/xrdb.c b/patch/xrdb.c index aa14969..aa32854 100644 --- a/patch/xrdb.c +++ b/patch/xrdb.c @@ -132,6 +132,7 @@ xrdb(const Arg *arg) #endif // BAR_ALPHA_PATCH ColCount ); - arrange(NULL); focus(NULL); + arrange(NULL); } + diff --git a/patches.def.h b/patches.def.h index e82af9a..46644e6 100644 --- a/patches.def.h +++ b/patches.def.h @@ -19,7 +19,7 @@ * Awesomebar takes precedence over fancybar. * https://dwm.suckless.org/patches/awesomebar/ */ -#define BAR_AWESOMEBAR_PATCH 0 +#define BAR_AWESOMEBAR_PATCH 1 /* This patch depends on statuscmd patch and adds integration with a (patched) * dwmblocks instance to give a clickable status bar. One must not necessarily @@ -151,7 +151,7 @@ * This patch is incompatible with the extrabar patch. * https://dwm.suckless.org/patches/status2d/ */ -#define BAR_STATUS2D_PATCH 0 +#define BAR_STATUS2D_PATCH 1 /* Supplementary patch should you want to disable alpha for the status2d section */ #define BAR_STATUS2D_NO_ALPHA_PATCH 0 @@ -167,7 +167,7 @@ /* The systray patch adds systray for the status bar. * https://dwm.suckless.org/patches/systray/ */ -#define BAR_SYSTRAY_PATCH 0 +#define BAR_SYSTRAY_PATCH 1 /* Show tag symbols in the bar. */ #define BAR_TAGS_PATCH 1 @@ -180,7 +180,7 @@ /* This patch underlines the selected tag, or optionally all tags. * https://dwm.suckless.org/patches/underlinetags/ */ -#define BAR_UNDERLINETAGS_PATCH 0 +#define BAR_UNDERLINETAGS_PATCH 1 /* This patch adds the window icon next to the window title in the bar. * @@ -290,7 +290,7 @@ * modules. * https://dwm.suckless.org/patches/centeredwindowname/ */ -#define BAR_CENTEREDWINDOWNAME_PATCH 0 +#define BAR_CENTEREDWINDOWNAME_PATCH 1 /* Draws a dot indicator overlayed on each tag icon for each client. The selected client * is drawn as a larger horizontal line. @@ -331,7 +331,7 @@ /* Allows the bar height to be explicitly set rather than being derived from font. * https://dwm.suckless.org/patches/bar_height/ */ -#define BAR_HEIGHT_PATCH 0 +#define BAR_HEIGHT_PATCH 1 /* This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the bar. * https://dwm.suckless.org/patches/hide_vacant_tags/ @@ -367,7 +367,7 @@ * toggled in unison when vanitygaps are toggled. Increasing or decreasing gaps during runtime * will not affect the bar padding. */ -#define BAR_PADDING_VANITYGAPS_PATCH 0 +#define BAR_PADDING_VANITYGAPS_PATCH 1 /* This patch adds simple markup for status messages using pango markup. * This depends on the pango library v1.44 or greater. @@ -400,7 +400,7 @@ /* This patch draws and updates the statusbar on all monitors. * https://dwm.suckless.org/patches/statusallmons/ */ -#define BAR_STATUSALLMONS_PATCH 0 +#define BAR_STATUSALLMONS_PATCH 1 /* This patch enables colored text in the status bar. It changes the way colors are defined * in config.h allowing multiple color combinations for use in the status script. @@ -441,7 +441,7 @@ /* Adds a window task switcher toggled using alt-tab. * https://dwm.suckless.org/patches/alt-tab/ */ -#define ALT_TAB_PATCH 0 +#define ALT_TAB_PATCH 1 /* All floating windows are centered, like the center patch, but without a rule. * The center patch takes precedence over this patch. @@ -466,13 +466,13 @@ * This patch takes precedence over ATTACHBELOW_PATCH. * https://dwm.suckless.org/patches/attachaside/ */ -#define ATTACHASIDE_PATCH 0 +#define ATTACHASIDE_PATCH 1 /* This patch adds new clients below the selected client. * This patch takes precedence over ATTACHBOTTOM_PATCH. * https://dwm.suckless.org/patches/attachbelow/ */ -#define ATTACHBELOW_PATCH 0 +#define ATTACHBELOW_PATCH 1 /* This patch adds new clients at the bottom of the stack. * https://dwm.suckless.org/patches/attachbottom/ @@ -509,7 +509,7 @@ * This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches. * https://dwm.suckless.org/patches/center/ */ -#define CENTER_PATCH 0 +#define CENTER_PATCH 1 /* A transient window is one that is meant to be short lived and is usually raised by a * parent window. Such windows are typically dialog boxes and the like. @@ -555,7 +555,7 @@ /* The cyclelayouts patch lets you cycle through all your layouts. * https://dwm.suckless.org/patches/cyclelayouts/ */ -#define CYCLELAYOUTS_PATCH 0 +#define CYCLELAYOUTS_PATCH 1 /* Make dwm respect _MOTIF_WM_HINTS property, and not draw borders around windows requesting * for it. Some applications use this property to notify window managers to not draw window @@ -564,7 +564,7 @@ * like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode. * https://dwm.suckless.org/patches/decoration_hints/ */ -#define DECORATION_HINTS_PATCH 0 +#define DECORATION_HINTS_PATCH 1 /* This feature distributes all clients on the current monitor evenly across all tags. * It is a variant of the reorganizetags patch. @@ -590,7 +590,7 @@ * #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin * http://dwm.suckless.org/patches/dwmc/ */ -#define DWMC_PATCH 0 +#define DWMC_PATCH 1 /* This patch allows no tag at all to be selected. The result is that dwm will start with * no tag selected and when you start a client with no tag rule and no tag selected then @@ -621,7 +621,7 @@ * Also see the selectivefakefullscreen option that adds a rule option to enabled this on client * startup. */ -#define FAKEFULLSCREEN_CLIENT_PATCH 0 +#define FAKEFULLSCREEN_CLIENT_PATCH 1 /* This patch adds a float rule allowing the size and position of floating windows to be specified * It also allows the size and position of floating windows to be controlled similar to the @@ -646,12 +646,6 @@ */ #define FOCUSDIR_PATCH 0 -/* When changing tags, closing windows or moving clients out of view then focus will revert to the - * client window that remains under the mouse cursor rather than the most recently focused window. - * https://github.com/bakkeby/patches/wiki/focusfollowmouse - */ -#define FOCUSFOLLOWMOUSE_PATCH 0 - /* A simple patch that just puts focus back to the master client. * https://dwm.suckless.org/patches/focusmaster/ */ @@ -686,7 +680,7 @@ * again it shows the bar and restores the layout that was active before going fullscreen. * https://dwm.suckless.org/patches/fullscreen/ */ -#define FULLSCREEN_PATCH 0 +#define FULLSCREEN_PATCH 1 /* This patch provides a keybinding to rotate all clients in the currently selected * area (master or stack) without affecting the other area. @@ -743,7 +737,7 @@ * in such scenarios the previous window loses fullscreen. * https://github.com/bakkeby/patches/blob/master/dwm/dwm-losefullscreen-6.2.diff */ -#define LOSEFULLSCREEN_PATCH 0 +#define LOSEFULLSCREEN_PATCH 1 /* This patch adds helper functions for maximizing, horizontally and vertically, floating * windows using keybindings. @@ -826,7 +820,7 @@ /* Removes the border when there is only one window visible. * https://dwm.suckless.org/patches/noborder/ */ -#define NOBORDER_PATCH 0 +#define NOBORDER_PATCH 1 /* Enable modifying or removing dmenu in config.def.h which resulted previously in a * compilation error because two lines of code hardcode dmenu into dwm. @@ -948,7 +942,7 @@ * Additionally dwm can quit cleanly by using kill -TERM dwmpid. * https://dwm.suckless.org/patches/restartsig/ */ -#define RESTARTSIG_PATCH 0 +#define RESTARTSIG_PATCH 1 /* Adds rio-like drawing to resize the selected client. * This depends on an external tool slop being installed. @@ -987,10 +981,10 @@ * https://lists.suckless.org/hackers/2004/17205.html * https://dwm.suckless.org/patches/scratchpads/ */ -#define SCRATCHPADS_PATCH 0 +#define SCRATCHPADS_PATCH 1 /* Minor alteration of the above allowing clients to keep their size and position when shown */ -#define SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH 0 +#define SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH 1 /* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad * feature in i3wm. @@ -1008,7 +1002,7 @@ * * The above is not persisted across reboots, however. */ -#define SEAMLESS_RESTART_PATCH 0 +#define SEAMLESS_RESTART_PATCH 1 /* As opposed to the original patch this only adds a rule option allowing fake fullscreen * to be enabled for applications when they start. This is intended to be used in combination @@ -1128,7 +1122,7 @@ * * https://github.com/bakkeby/patches/wiki/steam */ -#define STEAM_PATCH 0 +#define STEAM_PATCH 1 /* Adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags. * https://dwm.suckless.org/patches/sticky/ @@ -1240,7 +1234,7 @@ * adjacent monitor. * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagswapmon-6.2.diff */ -#define TAGSWAPMON_PATCH 0 +#define TAGSWAPMON_PATCH 1 /* Sync tag actions across all monitors. * This is comparable to a sort of pseudo-desktop environment. @@ -1261,11 +1255,6 @@ */ #define TOGGLEFULLSCREEN_PATCH 0 -/* This patch allows for the bar position (top or bottom) to be toggled during runtime. - * https://dwm.suckless.org/patches/toggletopbar/ - */ -#define TOGGLETOPBAR_PATCH 0 - /* Minor patch that lets you use the same keyboard shortcut to toggle to the previous layout if the * designated layout is already active. * @@ -1309,19 +1298,12 @@ */ #define UNFLOATVISIBLE_PATCH 0 -/* This patch adds a client rule that allows for windows that do not specify the override-redirect - * to not be managed by the window manager. This can be useful for external bars, widgets, - * launchers, docks, desktop icons and more. - * https://github.com/bakkeby/patches/wiki/unmanaged - */ -#define UNMANAGED_PATCH 0 - /* This patch adds configurable gaps between windows differentiating between outer, inner, * horizontal and vertical gaps. * https://github.com/bakkeby/patches/blob/master/dwm/dwm-vanitygaps-6.2.diff * https://github.com/bakkeby/patches/blob/master/dwm/dwm-cfacts-vanitygaps-6.2.diff */ -#define VANITYGAPS_PATCH 0 +#define VANITYGAPS_PATCH 1 /* This patch adds outer gaps for the monocle layout. * Most gaps patches tries to avoid gaps on the monocle layout, as it is often used as a @@ -1376,7 +1358,7 @@ * the float border color, awesomebar, urgentborder and titlecolor patches. * https://dwm.suckless.org/patches/xrdb/ */ -#define XRDB_PATCH 0 +#define XRDB_PATCH 1 /* Simple patch that allows floating windows to be zoomed into the master stack position. * https://www.reddit.com/r/suckless/comments/ie5fe3/zoomfloating_my_own_simple_original_patch/ @@ -1396,7 +1378,7 @@ /* Bottomstack layout. * https://dwm.suckless.org/patches/bottomstack/ */ -#define BSTACK_LAYOUT 0 +#define BSTACK_LAYOUT 1 /* Bottomstack horizontal layout. * https://dwm.suckless.org/patches/bottomstack/ @@ -1406,7 +1388,7 @@ /* Centered master layout. * https://dwm.suckless.org/patches/centeredmaster/ */ -#define CENTEREDMASTER_LAYOUT 0 +#define CENTEREDMASTER_LAYOUT 1 /* Centered floating master layout. * https://dwm.suckless.org/patches/centeredmaster/ @@ -1427,7 +1409,7 @@ /* Fibonacci dwindle layout. * https://dwm.suckless.org/patches/fibonacci/ */ -#define FIBONACCI_DWINDLE_LAYOUT 0 +#define FIBONACCI_DWINDLE_LAYOUT 1 /* Fibonacci spiral layout. * https://dwm.suckless.org/patches/fibonacci/ @@ -1448,7 +1430,7 @@ /* Gridmode (grid) layout. * https://dwm.suckless.org/patches/gridmode/ */ -#define GRIDMODE_LAYOUT 0 +#define GRIDMODE_LAYOUT 1 /* Horizontal grid (horizgrid) layout. * https://dwm.suckless.org/patches/horizgrid/ diff --git a/recompile b/recompile new file mode 100755 index 0000000..2793a9a --- /dev/null +++ b/recompile @@ -0,0 +1,4 @@ +#!/bin/bash + +rm -f ./config.h ./patches.h +sudo make clean install