From f4b6ba9ea635428f39bfee9a1417fda41dda2cab Mon Sep 17 00:00:00 2001 From: Yigit Colakoglu Date: Sat, 10 Apr 2021 08:50:43 +0300 Subject: [PATCH] Alpha focus patch applied to st, dwm fallback to flexipatch --- .config/weechat/irc.conf | 2 +- .config/weechat/python/anotify.py | 4 +- .config/weechat/sec.conf | 8 +- .config/weechat/weechat.conf | 2 +- .../dwm/.ccls-cache/@home@yigit@dwm/rules.h | 50 + .../.ccls-cache/@home@yigit@dwm/rules.h.blob | Bin 0 -> 186 bytes .local/src/dwm/.gitignore | 58 + .local/src/dwm/Makefile | 6 +- .local/src/dwm/config.bak | 33 + .local/src/dwm/drw.c | 241 ++ .local/src/dwm/drw.h | 36 + .local/src/dwm/dwm.c | 1996 +++++++++++- .local/src/dwm/patch/aspectresize.c | 24 + .local/src/dwm/patch/aspectresize.h | 1 + .local/src/dwm/patch/attachx.c | 42 + .local/src/dwm/patch/attachx.h | 1 + .local/src/dwm/patch/autostart.c | 2 +- .local/src/dwm/patch/autostart.h | 2 +- .local/src/dwm/patch/bar_alpha.c | 42 + .local/src/dwm/patch/bar_alpha.h | 3 + .local/src/dwm/patch/bar_alternativetags.c | 6 + .local/src/dwm/patch/bar_alternativetags.h | 1 + .local/src/dwm/patch/bar_anybar.c | 82 + .local/src/dwm/patch/bar_anybar.h | 4 + .local/src/dwm/patch/bar_awesomebar.c | 79 + .local/src/dwm/patch/bar_awesomebar.h | 3 + .local/src/dwm/patch/bar_dwmblocks.c | 2 +- .local/src/dwm/patch/bar_dwmblocks.h | 2 +- .local/src/dwm/patch/bar_ewmhtags.c | 52 + .local/src/dwm/patch/bar_ewmhtags.h | 6 + .local/src/dwm/patch/bar_fancybar.c | 70 + .local/src/dwm/patch/bar_fancybar.h | 3 + .local/src/dwm/patch/bar_flexwintitle.c | 436 +++ .local/src/dwm/patch/bar_flexwintitle.h | 10 + .local/src/dwm/patch/bar_holdbar.c | 37 + .local/src/dwm/patch/bar_holdbar.h | 2 + .local/src/dwm/patch/bar_indicators.c | 9 +- .local/src/dwm/patch/bar_indicators.h | 2 +- .local/src/dwm/patch/bar_ltsymbol.c | 2 +- .local/src/dwm/patch/bar_powerline_status.c | 121 + .local/src/dwm/patch/bar_powerline_status.h | 11 + .local/src/dwm/patch/bar_powerline_tags.c | 106 + .local/src/dwm/patch/bar_powerline_tags.h | 3 + .local/src/dwm/patch/bar_status.c | 14 + .local/src/dwm/patch/bar_status.h | 8 +- .local/src/dwm/patch/bar_status2d.c | 103 +- .local/src/dwm/patch/bar_status2d.h | 11 +- .local/src/dwm/patch/bar_statusbutton.c | 17 + .local/src/dwm/patch/bar_statusbutton.h | 3 + .local/src/dwm/patch/bar_statuscmd.c | 29 + .local/src/dwm/patch/bar_statuscmd.h | 5 +- .local/src/dwm/patch/bar_statuscolors.c | 23 + .local/src/dwm/patch/bar_systray.c | 18 +- .local/src/dwm/patch/bar_tabgroups.c | 220 ++ .local/src/dwm/patch/bar_tabgroups.h | 7 + .local/src/dwm/patch/bar_taggrid.c | 149 + .local/src/dwm/patch/bar_taggrid.h | 4 + .local/src/dwm/patch/bar_tagicons.c | 14 +- .local/src/dwm/patch/bar_tagicons.h | 2 +- .local/src/dwm/patch/bar_tags.c | 29 + .local/src/dwm/patch/bar_tags.h | 2 +- .local/src/dwm/patch/bar_vtcolors.c | 68 + .local/src/dwm/patch/bar_vtcolors.h | 2 + .local/src/dwm/patch/bar_wintitle.c | 51 + .local/src/dwm/patch/bar_wintitle.h | 3 + .local/src/dwm/patch/bar_wintitle_floating.c | 45 + .local/src/dwm/patch/bar_wintitle_floating.h | 8 + .local/src/dwm/patch/bar_wintitle_hidden.c | 45 + .local/src/dwm/patch/bar_wintitle_hidden.h | 8 + .local/src/dwm/patch/bar_wintitleactions.c | 93 + .local/src/dwm/patch/bar_wintitleactions.h | 5 + .local/src/dwm/patch/cfacts.c | 23 + .local/src/dwm/patch/cfacts.h | 1 + .local/src/dwm/patch/cmdcustomize.c | 5 + .local/src/dwm/patch/cmdcustomize.h | 1 + .local/src/dwm/patch/combo.c | 12 +- .local/src/dwm/patch/combo.h | 4 +- .local/src/dwm/patch/cool_autostart.c | 28 + .local/src/dwm/patch/cool_autostart.h | 1 + .local/src/dwm/patch/cyclelayouts.h | 2 +- .local/src/dwm/patch/decorationhints.c | 38 + .local/src/dwm/patch/decorationhints.h | 8 + .local/src/dwm/patch/dragcfact.c | 82 + .local/src/dwm/patch/dragcfact.h | 1 + .local/src/dwm/patch/dragmfact.c | 231 ++ .local/src/dwm/patch/dragmfact.h | 1 + .local/src/dwm/patch/dwmc | 129 + .local/src/dwm/patch/dwmc.c | 100 + .local/src/dwm/patch/dwmc.h | 13 + .local/src/dwm/patch/exresize.c | 195 ++ .local/src/dwm/patch/exresize.h | 8 + .local/src/dwm/patch/fakefullscreenclient.c | 18 + .local/src/dwm/patch/fakefullscreenclient.h | 1 + .local/src/dwm/patch/floatpos.c | 11 + .local/src/dwm/patch/floatpos.h | 2 +- .local/src/dwm/patch/focusadjacenttag.c | 73 + .local/src/dwm/patch/focusadjacenttag.h | 6 + .local/src/dwm/patch/focusdir.c | 65 + .local/src/dwm/patch/focusdir.h | 1 + .local/src/dwm/patch/focusmaster.c | 13 + .local/src/dwm/patch/focusmaster.h | 1 + .local/src/dwm/patch/focusurgent.c | 15 + .local/src/dwm/patch/focusurgent.h | 1 + .local/src/dwm/patch/fsignal.c | 40 + .local/src/dwm/patch/fsignal.h | 7 + .local/src/dwm/patch/fullscreen.c | 4 +- .local/src/dwm/patch/fullscreen.h | 2 +- .local/src/dwm/patch/include.c | 307 ++ .local/src/dwm/patch/include.h | 298 ++ .local/src/dwm/patch/inplacerotate.c | 53 + .local/src/dwm/patch/inplacerotate.h | 1 + .local/src/dwm/patch/insets.c | 18 + .local/src/dwm/patch/insets.h | 2 + .local/src/dwm/patch/ipc.c | 101 + .local/src/dwm/patch/ipc.h | 6 + .local/src/dwm/patch/ipc/IPCClient.c | 66 + .local/src/dwm/patch/ipc/ipc.c | 1201 +++++++ .local/src/dwm/patch/ipc/ipc.h | 319 ++ .local/src/dwm/patch/ipc/util.c | 135 + .local/src/dwm/patch/ipc/util.h | 4 + .local/src/dwm/patch/ipc/yajl_dumps.c | 351 +++ .local/src/dwm/patch/keymodes.c | 143 + .local/src/dwm/patch/keymodes.h | 21 + .local/src/dwm/patch/killunsel.c | 27 + .local/src/dwm/patch/killunsel.h | 1 + .local/src/dwm/patch/layout_bstack.c | 74 + .local/src/dwm/patch/layout_bstack.h | 1 + .local/src/dwm/patch/layout_bstackhoriz.c | 76 + .local/src/dwm/patch/layout_bstackhoriz.h | 1 + .../dwm/patch/layout_centeredfloatingmaster.c | 40 + .../dwm/patch/layout_centeredfloatingmaster.h | 2 +- .local/src/dwm/patch/layout_centeredmaster.c | 77 +- .local/src/dwm/patch/layout_centeredmaster.h | 2 +- .local/src/dwm/patch/layout_columns.c | 73 + .local/src/dwm/patch/layout_columns.h | 1 + .local/src/dwm/patch/layout_deck.c | 27 +- .local/src/dwm/patch/layout_deck.h | 2 +- .local/src/dwm/patch/layout_facts.c | 28 + .local/src/dwm/patch/layout_fibonacci.c | 92 + .local/src/dwm/patch/layout_fibonacci.h | 4 + .local/src/dwm/patch/layout_flextile-deluxe.c | 890 ++++++ .local/src/dwm/patch/layout_flextile-deluxe.h | 120 + .local/src/dwm/patch/layout_gapplessgrid.c | 98 + .local/src/dwm/patch/layout_gapplessgrid.h | 1 + .local/src/dwm/patch/layout_grid.c | 31 + .local/src/dwm/patch/layout_grid.h | 2 +- .local/src/dwm/patch/layout_horizgrid.c | 103 + .local/src/dwm/patch/layout_horizgrid.h | 1 + .local/src/dwm/patch/layout_monocle.c | 23 + .local/src/dwm/patch/layout_monocle.h | 2 +- .local/src/dwm/patch/layout_nrowgrid.c | 103 + .local/src/dwm/patch/layout_nrowgrid.h | 1 + .local/src/dwm/patch/layout_tile.c | 35 +- .local/src/dwm/patch/layout_tile.h | 2 +- .local/src/dwm/patch/maximize.c | 69 + .local/src/dwm/patch/maximize.h | 4 + .local/src/dwm/patch/moveplace.c | 29 + .local/src/dwm/patch/moveplace.h | 3 + .local/src/dwm/patch/moveresize.c | 64 + .local/src/dwm/patch/moveresize.h | 1 + .local/src/dwm/patch/movestack.c | 2 +- .local/src/dwm/patch/movestack.h | 2 +- .local/src/dwm/patch/mpdcontrol.c | 144 + .local/src/dwm/patch/mpdcontrol.h | 2 + .local/src/dwm/patch/nomodbuttons.c | 7 + .local/src/dwm/patch/nomodbuttons.h | 1 + .local/src/dwm/patch/pertag.c | 36 +- .local/src/dwm/patch/pertag.h | 2 +- .local/src/dwm/patch/placemouse.c | 151 + .local/src/dwm/patch/placemouse.h | 6 + .local/src/dwm/patch/push.c | 71 + .local/src/dwm/patch/push.h | 4 + .local/src/dwm/patch/push_no_master.c | 43 + .local/src/dwm/patch/push_no_master.h | 3 + .local/src/dwm/patch/reorganizetags.c | 27 + .local/src/dwm/patch/reorganizetags.h | 1 + .local/src/dwm/patch/restartsig.c | 15 + .local/src/dwm/patch/restartsig.h | 2 + .local/src/dwm/patch/riodraw.c | 103 + .local/src/dwm/patch/riodraw.h | 5 + .local/src/dwm/patch/rotatestack.c | 52 + .local/src/dwm/patch/rotatestack.h | 3 + .local/src/dwm/patch/roundedcorners.c | 50 + .local/src/dwm/patch/roundedcorners.h | 1 + .local/src/dwm/patch/scratchpad.c | 2 +- .local/src/dwm/patch/scratchpad.h | 2 +- .local/src/dwm/patch/scratchpad_alt_1.c | 92 + .local/src/dwm/patch/scratchpad_alt_1.h | 8 + .local/src/dwm/patch/selfrestart.c | 68 + .local/src/dwm/patch/selfrestart.h | 2 + .local/src/dwm/patch/setborderpx.c | 44 + .local/src/dwm/patch/setborderpx.h | 1 + .local/src/dwm/patch/shiftview.c | 4 + .local/src/dwm/patch/shiftview.h | 2 +- .local/src/dwm/patch/shiftviewclients.c | 42 + .local/src/dwm/patch/shiftviewclients.h | 1 + .local/src/dwm/patch/sizehints_ruled.c | 24 + .local/src/dwm/patch/sizehints_ruled.h | 1 + .local/src/dwm/patch/sortscreens.c | 15 + .local/src/dwm/patch/sortscreens.h | 3 + .local/src/dwm/patch/stacker.c | 106 + .local/src/dwm/patch/stacker.h | 10 + .local/src/dwm/patch/sticky.c | 8 + .local/src/dwm/patch/sticky.h | 1 + .local/src/dwm/patch/swallow.c | 205 ++ .local/src/dwm/patch/swallow.h | 7 + .local/src/dwm/patch/swapfocus.c | 21 + .local/src/dwm/patch/swapfocus.h | 1 + .local/src/dwm/patch/swaptags.c | 22 + .local/src/dwm/patch/swaptags.h | 1 + .local/src/dwm/patch/switchcol.c | 2 +- .local/src/dwm/patch/switchcol.h | 2 +- .local/src/dwm/patch/tagall.c | 25 + .local/src/dwm/patch/tagall.h | 1 + .local/src/dwm/patch/tagallmon.c | 48 + .local/src/dwm/patch/tagallmon.h | 1 + .local/src/dwm/patch/tagothermonitor.c | 43 + .local/src/dwm/patch/tagothermonitor.h | 8 + .local/src/dwm/patch/tagswapmon.c | 74 + .local/src/dwm/patch/tagswapmon.h | 1 + .local/src/dwm/patch/togglefullscreen.c | 8 + .local/src/dwm/patch/togglefullscreen.h | 2 +- .local/src/dwm/patch/transfer.c | 33 + .local/src/dwm/patch/transfer.h | 1 + .local/src/dwm/patch/transferall.c | 25 + .local/src/dwm/patch/transferall.h | 1 + .local/src/dwm/patch/unfloatvisible.c | 14 + .local/src/dwm/patch/unfloatvisible.h | 1 + .local/src/dwm/patch/vanitygaps.c | 66 + .local/src/dwm/patch/vanitygaps.h | 5 + .local/src/dwm/patch/warp.c | 37 + .local/src/dwm/patch/warp.h | 1 + .local/src/dwm/patch/winview.c | 2 +- .local/src/dwm/patch/winview.h | 2 +- .local/src/dwm/patch/xrdb.c | 125 + .local/src/dwm/patch/xrdb.h | 21 + .local/src/dwm/patch/zoomswap.c | 13 + .local/src/dwm/patch/zoomswap.h | 1 + .local/src/dwm/patches.def.h | 1178 +++++++ .local/src/dwm/patches.h | 1178 +++++++ .local/src/dwm/theme.h | 39 + .../@usr@include@bits@byteswap.h | 79 + .../@usr@include@bits@byteswap.h.blob | Bin 0 -> 2992 bytes .../@usr@include@bits@endian.h | 49 + .../@usr@include@bits@endian.h.blob | Bin 0 -> 2069 bytes .../@usr@include@bits@endianness.h | 11 + .../@usr@include@bits@endianness.h.blob | Bin 0 -> 1726 bytes .../@usr@include@bits@libc-header-start.h | 86 + ...@usr@include@bits@libc-header-start.h.blob | Bin 0 -> 2266 bytes .../@usr@include@bits@long-double.h | 21 + .../@usr@include@bits@long-double.h.blob | Bin 0 -> 1647 bytes .../@usr@include@bits@pthreadtypes-arch.h | 55 + ...@usr@include@bits@pthreadtypes-arch.h.blob | Bin 0 -> 2688 bytes .../@usr@include@bits@pthreadtypes.h | 121 + .../@usr@include@bits@pthreadtypes.h.blob | Bin 0 -> 6668 bytes .../@usr@include@bits@select.h | 37 + .../@usr@include@bits@select.h.blob | Bin 0 -> 1969 bytes .../@usr@include@bits@stdint-intn.h | 29 + .../@usr@include@bits@stdint-intn.h.blob | Bin 0 -> 2146 bytes .../@usr@include@bits@stdint-uintn.h | 29 + .../@usr@include@bits@stdint-uintn.h.blob | Bin 0 -> 2188 bytes .../@usr@include@bits@struct_mutex.h | 63 + .../@usr@include@bits@struct_mutex.h.blob | Bin 0 -> 2936 bytes .../@usr@include@bits@struct_rwlock.h | 65 + .../@usr@include@bits@struct_rwlock.h.blob | Bin 0 -> 3348 bytes .../@usr@include@bits@thread-shared-types.h | 129 + ...sr@include@bits@thread-shared-types.h.blob | Bin 0 -> 4800 bytes .../@usr@include@bits@time64.h | 36 + .../@usr@include@bits@time64.h.blob | Bin 0 -> 1731 bytes .../@usr@include@bits@timesize.h | 25 + .../@usr@include@bits@timesize.h.blob | Bin 0 -> 1641 bytes .../@usr@include@bits@types.h | 228 ++ .../@usr@include@bits@types.h.blob | Bin 0 -> 9013 bytes .../@usr@include@bits@types@__sigset_t.h | 10 + .../@usr@include@bits@types@__sigset_t.h.blob | Bin 0 -> 1948 bytes .../@usr@include@bits@types@clock_t.h | 9 + .../@usr@include@bits@types@clock_t.h.blob | Bin 0 -> 1781 bytes .../@usr@include@bits@types@clockid_t.h | 9 + .../@usr@include@bits@types@clockid_t.h.blob | Bin 0 -> 1811 bytes .../@usr@include@bits@types@sigset_t.h | 9 + .../@usr@include@bits@types@sigset_t.h.blob | Bin 0 -> 1881 bytes .../@usr@include@bits@types@struct_timespec.h | 28 + ...@include@bits@types@struct_timespec.h.blob | Bin 0 -> 2233 bytes .../@usr@include@bits@types@struct_timeval.h | 13 + ...r@include@bits@types@struct_timeval.h.blob | Bin 0 -> 2083 bytes .../@usr@include@bits@types@time_t.h | 9 + .../@usr@include@bits@types@time_t.h.blob | Bin 0 -> 1776 bytes .../@usr@include@bits@types@timer_t.h | 9 + .../@usr@include@bits@types@timer_t.h.blob | Bin 0 -> 1798 bytes .../@usr@include@bits@typesizes.h | 106 + .../@usr@include@bits@typesizes.h.blob | Bin 0 -> 5543 bytes .../@usr@include@bits@uintn-identity.h | 50 + .../@usr@include@bits@uintn-identity.h.blob | Bin 0 -> 2558 bytes .../@usr@include@bits@wchar.h | 49 + .../@usr@include@bits@wchar.h.blob | Bin 0 -> 1774 bytes .../@usr@include@bits@wordsize.h | 17 + .../@usr@include@bits@wordsize.h.blob | Bin 0 -> 1783 bytes .../@usr@include@endian.h | 72 + .../@usr@include@endian.h.blob | Bin 0 -> 2991 bytes .../@usr@include@features.h | 500 +++ .../@usr@include@features.h.blob | Bin 0 -> 6002 bytes .../@usr@include@gnu@stubs-64.h | 17 + .../@usr@include@gnu@stubs-64.h.blob | Bin 0 -> 2099 bytes .../@usr@include@gnu@stubs.h | 14 + .../@usr@include@gnu@stubs.h.blob | Bin 0 -> 1579 bytes .../@usr@include@stdc-predef.h | 60 + .../@usr@include@stdc-predef.h.blob | Bin 0 -> 1868 bytes .../@usr@include@stdint.h | 319 ++ .../@usr@include@stdint.h.blob | Bin 0 -> 12441 bytes .../@usr@include@sys@cdefs.h | 580 ++++ .../@usr@include@sys@cdefs.h.blob | Bin 0 -> 9133 bytes .../@usr@include@sys@select.h | 128 + .../@usr@include@sys@select.h.blob | Bin 0 -> 5672 bytes .../@usr@include@sys@types.h | 232 ++ .../@usr@include@sys@types.h.blob | Bin 0 -> 8887 bytes .../@usr@lib@clang@11.1.0@include@stddef.h | 121 + ...usr@lib@clang@11.1.0@include@stddef.h.blob | Bin 0 -> 1765 bytes .../@usr@lib@clang@11.1.0@include@stdint.h | 693 +++++ ...usr@lib@clang@11.1.0@include@stdint.h.blob | Bin 0 -> 2101 bytes .../@home@yigit@.local@src@st/config.h | 505 +++ .../@home@yigit@.local@src@st/config.h.blob | Bin 0 -> 8372 bytes .../@home@yigit@.local@src@st/st.h | 136 + .../@home@yigit@.local@src@st/st.h.blob | Bin 0 -> 8869 bytes .local/src/st/config.h | 4 +- .../st-focus-20200731-patch_alpha.diff | 167 + .local/src/st/st | Bin 0 -> 111832 bytes .local/src/st/st.c | 1 - .local/src/st/st.c.orig | 2758 +++++++++++++++++ .local/src/st/st.h | 2 + .local/src/st/st.h.orig | 131 + .local/src/st/st.o | Bin 0 -> 79560 bytes .local/src/st/x.c | 44 +- .local/src/st/x.c.orig | 2221 +++++++++++++ .local/src/st/x.o | Bin 0 -> 82304 bytes 334 files changed, 25265 insertions(+), 72 deletions(-) create mode 100644 .local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h create mode 100644 .local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h.blob create mode 100644 .local/src/dwm/.gitignore create mode 100644 .local/src/dwm/config.bak create mode 100644 .local/src/dwm/patch/aspectresize.c create mode 100644 .local/src/dwm/patch/aspectresize.h create mode 100644 .local/src/dwm/patch/attachx.c create mode 100644 .local/src/dwm/patch/attachx.h create mode 100644 .local/src/dwm/patch/bar_alpha.c create mode 100644 .local/src/dwm/patch/bar_alpha.h create mode 100644 .local/src/dwm/patch/bar_alternativetags.c create mode 100644 .local/src/dwm/patch/bar_alternativetags.h create mode 100644 .local/src/dwm/patch/bar_anybar.c create mode 100644 .local/src/dwm/patch/bar_anybar.h create mode 100644 .local/src/dwm/patch/bar_awesomebar.c create mode 100644 .local/src/dwm/patch/bar_awesomebar.h create mode 100644 .local/src/dwm/patch/bar_ewmhtags.c create mode 100644 .local/src/dwm/patch/bar_ewmhtags.h create mode 100644 .local/src/dwm/patch/bar_fancybar.c create mode 100644 .local/src/dwm/patch/bar_fancybar.h create mode 100644 .local/src/dwm/patch/bar_flexwintitle.c create mode 100644 .local/src/dwm/patch/bar_flexwintitle.h create mode 100644 .local/src/dwm/patch/bar_holdbar.c create mode 100644 .local/src/dwm/patch/bar_holdbar.h create mode 100644 .local/src/dwm/patch/bar_powerline_status.c create mode 100644 .local/src/dwm/patch/bar_powerline_status.h create mode 100644 .local/src/dwm/patch/bar_powerline_tags.c create mode 100644 .local/src/dwm/patch/bar_powerline_tags.h create mode 100644 .local/src/dwm/patch/bar_statusbutton.c create mode 100644 .local/src/dwm/patch/bar_statusbutton.h create mode 100644 .local/src/dwm/patch/bar_statuscolors.c create mode 100644 .local/src/dwm/patch/bar_tabgroups.c create mode 100644 .local/src/dwm/patch/bar_tabgroups.h create mode 100644 .local/src/dwm/patch/bar_taggrid.c create mode 100644 .local/src/dwm/patch/bar_taggrid.h create mode 100644 .local/src/dwm/patch/bar_vtcolors.c create mode 100644 .local/src/dwm/patch/bar_vtcolors.h create mode 100644 .local/src/dwm/patch/bar_wintitle.c create mode 100644 .local/src/dwm/patch/bar_wintitle.h create mode 100644 .local/src/dwm/patch/bar_wintitle_floating.c create mode 100644 .local/src/dwm/patch/bar_wintitle_floating.h create mode 100644 .local/src/dwm/patch/bar_wintitle_hidden.c create mode 100644 .local/src/dwm/patch/bar_wintitle_hidden.h create mode 100644 .local/src/dwm/patch/bar_wintitleactions.c create mode 100644 .local/src/dwm/patch/bar_wintitleactions.h create mode 100644 .local/src/dwm/patch/cfacts.c create mode 100644 .local/src/dwm/patch/cfacts.h create mode 100644 .local/src/dwm/patch/cmdcustomize.c create mode 100644 .local/src/dwm/patch/cmdcustomize.h create mode 100644 .local/src/dwm/patch/cool_autostart.c create mode 100644 .local/src/dwm/patch/cool_autostart.h create mode 100644 .local/src/dwm/patch/decorationhints.c create mode 100644 .local/src/dwm/patch/decorationhints.h create mode 100644 .local/src/dwm/patch/dragcfact.c create mode 100644 .local/src/dwm/patch/dragcfact.h create mode 100644 .local/src/dwm/patch/dragmfact.c create mode 100644 .local/src/dwm/patch/dragmfact.h create mode 100755 .local/src/dwm/patch/dwmc create mode 100644 .local/src/dwm/patch/dwmc.c create mode 100644 .local/src/dwm/patch/dwmc.h create mode 100644 .local/src/dwm/patch/exresize.c create mode 100644 .local/src/dwm/patch/exresize.h create mode 100644 .local/src/dwm/patch/fakefullscreenclient.c create mode 100644 .local/src/dwm/patch/fakefullscreenclient.h create mode 100644 .local/src/dwm/patch/focusadjacenttag.c create mode 100644 .local/src/dwm/patch/focusadjacenttag.h create mode 100644 .local/src/dwm/patch/focusdir.c create mode 100644 .local/src/dwm/patch/focusdir.h create mode 100644 .local/src/dwm/patch/focusmaster.c create mode 100644 .local/src/dwm/patch/focusmaster.h create mode 100644 .local/src/dwm/patch/focusurgent.c create mode 100644 .local/src/dwm/patch/focusurgent.h create mode 100644 .local/src/dwm/patch/fsignal.c create mode 100644 .local/src/dwm/patch/fsignal.h create mode 100644 .local/src/dwm/patch/inplacerotate.c create mode 100644 .local/src/dwm/patch/inplacerotate.h create mode 100644 .local/src/dwm/patch/insets.c create mode 100644 .local/src/dwm/patch/insets.h create mode 100644 .local/src/dwm/patch/ipc.c create mode 100644 .local/src/dwm/patch/ipc.h create mode 100644 .local/src/dwm/patch/ipc/IPCClient.c create mode 100644 .local/src/dwm/patch/ipc/ipc.c create mode 100644 .local/src/dwm/patch/ipc/ipc.h create mode 100644 .local/src/dwm/patch/ipc/util.c create mode 100644 .local/src/dwm/patch/ipc/util.h create mode 100644 .local/src/dwm/patch/ipc/yajl_dumps.c create mode 100644 .local/src/dwm/patch/keymodes.c create mode 100644 .local/src/dwm/patch/keymodes.h create mode 100644 .local/src/dwm/patch/killunsel.c create mode 100644 .local/src/dwm/patch/killunsel.h create mode 100644 .local/src/dwm/patch/layout_bstack.c create mode 100644 .local/src/dwm/patch/layout_bstack.h create mode 100644 .local/src/dwm/patch/layout_bstackhoriz.c create mode 100644 .local/src/dwm/patch/layout_bstackhoriz.h create mode 100644 .local/src/dwm/patch/layout_columns.c create mode 100644 .local/src/dwm/patch/layout_columns.h create mode 100644 .local/src/dwm/patch/layout_flextile-deluxe.c create mode 100644 .local/src/dwm/patch/layout_flextile-deluxe.h create mode 100644 .local/src/dwm/patch/layout_gapplessgrid.c create mode 100644 .local/src/dwm/patch/layout_gapplessgrid.h create mode 100644 .local/src/dwm/patch/layout_horizgrid.c create mode 100644 .local/src/dwm/patch/layout_horizgrid.h create mode 100644 .local/src/dwm/patch/layout_nrowgrid.c create mode 100644 .local/src/dwm/patch/layout_nrowgrid.h create mode 100644 .local/src/dwm/patch/maximize.c create mode 100644 .local/src/dwm/patch/maximize.h create mode 100644 .local/src/dwm/patch/moveplace.c create mode 100644 .local/src/dwm/patch/moveplace.h create mode 100644 .local/src/dwm/patch/moveresize.c create mode 100644 .local/src/dwm/patch/moveresize.h create mode 100644 .local/src/dwm/patch/mpdcontrol.c create mode 100644 .local/src/dwm/patch/mpdcontrol.h create mode 100644 .local/src/dwm/patch/nomodbuttons.c create mode 100644 .local/src/dwm/patch/nomodbuttons.h create mode 100644 .local/src/dwm/patch/placemouse.c create mode 100644 .local/src/dwm/patch/placemouse.h create mode 100644 .local/src/dwm/patch/push.c create mode 100644 .local/src/dwm/patch/push.h create mode 100644 .local/src/dwm/patch/push_no_master.c create mode 100644 .local/src/dwm/patch/push_no_master.h create mode 100644 .local/src/dwm/patch/reorganizetags.c create mode 100644 .local/src/dwm/patch/reorganizetags.h create mode 100644 .local/src/dwm/patch/restartsig.c create mode 100644 .local/src/dwm/patch/restartsig.h create mode 100644 .local/src/dwm/patch/riodraw.c create mode 100644 .local/src/dwm/patch/riodraw.h create mode 100644 .local/src/dwm/patch/rotatestack.c create mode 100644 .local/src/dwm/patch/rotatestack.h create mode 100644 .local/src/dwm/patch/roundedcorners.c create mode 100644 .local/src/dwm/patch/roundedcorners.h create mode 100644 .local/src/dwm/patch/scratchpad_alt_1.c create mode 100644 .local/src/dwm/patch/scratchpad_alt_1.h create mode 100644 .local/src/dwm/patch/selfrestart.c create mode 100644 .local/src/dwm/patch/selfrestart.h create mode 100644 .local/src/dwm/patch/setborderpx.c create mode 100644 .local/src/dwm/patch/setborderpx.h create mode 100644 .local/src/dwm/patch/shiftviewclients.c create mode 100644 .local/src/dwm/patch/shiftviewclients.h create mode 100644 .local/src/dwm/patch/sizehints_ruled.c create mode 100644 .local/src/dwm/patch/sizehints_ruled.h create mode 100644 .local/src/dwm/patch/sortscreens.c create mode 100644 .local/src/dwm/patch/sortscreens.h create mode 100644 .local/src/dwm/patch/stacker.c create mode 100644 .local/src/dwm/patch/stacker.h create mode 100644 .local/src/dwm/patch/sticky.c create mode 100644 .local/src/dwm/patch/sticky.h create mode 100644 .local/src/dwm/patch/swallow.c create mode 100644 .local/src/dwm/patch/swallow.h create mode 100644 .local/src/dwm/patch/swapfocus.c create mode 100644 .local/src/dwm/patch/swapfocus.h create mode 100644 .local/src/dwm/patch/swaptags.c create mode 100644 .local/src/dwm/patch/swaptags.h create mode 100644 .local/src/dwm/patch/tagall.c create mode 100644 .local/src/dwm/patch/tagall.h create mode 100644 .local/src/dwm/patch/tagallmon.c create mode 100644 .local/src/dwm/patch/tagallmon.h create mode 100644 .local/src/dwm/patch/tagothermonitor.c create mode 100644 .local/src/dwm/patch/tagothermonitor.h create mode 100644 .local/src/dwm/patch/tagswapmon.c create mode 100644 .local/src/dwm/patch/tagswapmon.h create mode 100644 .local/src/dwm/patch/transfer.c create mode 100644 .local/src/dwm/patch/transfer.h create mode 100644 .local/src/dwm/patch/transferall.c create mode 100644 .local/src/dwm/patch/transferall.h create mode 100644 .local/src/dwm/patch/unfloatvisible.c create mode 100644 .local/src/dwm/patch/unfloatvisible.h create mode 100644 .local/src/dwm/patch/warp.c create mode 100644 .local/src/dwm/patch/warp.h create mode 100644 .local/src/dwm/patch/xrdb.c create mode 100644 .local/src/dwm/patch/xrdb.h create mode 100644 .local/src/dwm/patch/zoomswap.c create mode 100644 .local/src/dwm/patch/zoomswap.h create mode 100644 .local/src/dwm/patches.def.h create mode 100644 .local/src/dwm/patches.h create mode 100644 .local/src/dwm/theme.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endian.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endian.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endianness.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endianness.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@select.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@select.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_mutex.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_mutex.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_rwlock.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_rwlock.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@thread-shared-types.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@thread-shared-types.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@timesize.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@timesize.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@sigset_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@sigset_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timespec.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timespec.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@timer_t.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@timer_t.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@endian.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@endian.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdc-predef.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdc-predef.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@types.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@types.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h.blob create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h create mode 100644 .local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h.blob create mode 100644 .local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h create mode 100644 .local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h.blob create mode 100644 .local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h create mode 100644 .local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h.blob create mode 100644 .local/src/st/patches/st-focus-20200731-patch_alpha.diff create mode 100755 .local/src/st/st create mode 100644 .local/src/st/st.c.orig create mode 100644 .local/src/st/st.h.orig create mode 100644 .local/src/st/st.o create mode 100644 .local/src/st/x.c.orig create mode 100644 .local/src/st/x.o diff --git a/.config/weechat/irc.conf b/.config/weechat/irc.conf index 2c7472aa..c76862f6 100644 --- a/.config/weechat/irc.conf +++ b/.config/weechat/irc.conf @@ -276,7 +276,7 @@ rizon.local_hostname rizon.usermode rizon.command rizon.command_delay -rizon.autojoin +rizon.autojoin = "#rice" rizon.autorejoin rizon.autorejoin_delay rizon.connection_timeout diff --git a/.config/weechat/python/anotify.py b/.config/weechat/python/anotify.py index 74100779..0a047b42 100644 --- a/.config/weechat/python/anotify.py +++ b/.config/weechat/python/anotify.py @@ -419,9 +419,9 @@ def a_notify(notification, title, description, priority=notify2.URGENCY_LOW): # wn.set_urgency(priority) # wn.set_timeout(time_out) # wn.show() - subprocess.run(["notify-send", "-a", " WeeChat", title, description]) + subprocess.Popen(["notify-send", "-a", " WeeChat", title, description]) if title != "Server Connected" and title != "Server Disconnected": - subprocess.run(["canberra-gtk-play", "-i", "message-new-instant", "-V", "15"]) + subprocess.Popen(["canberra-gtk-play", "-i", "message-new-instant", "-V", "15"]) except Exception as error: weechat.prnt('', 'anotify: {0}'.format(error)) diff --git a/.config/weechat/sec.conf b/.config/weechat/sec.conf index 876a1165..0753b1bf 100644 --- a/.config/weechat/sec.conf +++ b/.config/weechat/sec.conf @@ -17,7 +17,7 @@ salt = on [data] __passphrase__ = on -oftc_password = "6A1394A95D299628527AD64E4BC96AF45BA825FFC73A705589094656F7CF395118CE72DED23927C2EF99D508B0B80BDA68586298D5649C" -sec.data.oftc_password = "934B8154AE8D858066550348DCE4268FA7234B971839A507AD967CBC4F651E0D83C7706A8067A9373F340A71A55DA78735F8D9AB34DAC6B5BD631C35C86802DECADF" -freenode = "34BF74C27F99E29D665B40817C64C4FB342E30BAC7DA7F1A574C14162FD53103A016B39CC8795EF13B3263B4171292E610F3CE400A31B3E428F5FF" -rizon_password = "A3A62CF495ED51DCC989C2CFC2C4E8F38C28D8417446B6ABC5B6E98D2C2CD32BC57CA6BBFD64BB7FEC1562FAE9842DDCD7650BA2B2B2614202494AE4F2E531A8FCA3" +oftc_password = "FFCB9AADF837EE7AE670326367FCDCBFBDF39D98C76E1302BE6DECE7F598B2CC8E8E577F058A2458AC35AD522E9B8D99E5C13A8CA38507" +sec.data.oftc_password = "AC02B320FCBEA984F00FE8FDE315B5CED3D529040022131F87CB33A1611EE4F21ED49F1290573437031444ABC70E6ABE0E4C7AEAB53564218B112C2243EACBA65CF4" +freenode = "EF3D92B85A003280767BE887892D3337B4331BED353F6CC641C2F818828A89C0EB71A394DD949C6DAFA7A362F55D24957CDC49454E631D4E5FD045" +rizon_password = "7B2C30B10D8FFDF2EF3E534E4E16A24B22552821133EF2D255B8096B951A51C02EEA146FF399EDABBF4D939F6D31972CEC286C58F5E088A10882CB3075EC66CE8CB0" diff --git a/.config/weechat/weechat.conf b/.config/weechat/weechat.conf index 85ceeaa5..a6aadf62 100644 --- a/.config/weechat/weechat.conf +++ b/.config/weechat/weechat.conf @@ -163,7 +163,7 @@ chat_nick_offline_highlight = default chat_nick_offline_highlight_bg = blue chat_nick_other = cyan chat_nick_prefix = green -chat_nick_self = white +chat_nick_self = 2 chat_nick_suffix = green chat_prefix_action = white chat_prefix_buffer = brown diff --git a/.local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h b/.local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h new file mode 100644 index 00000000..d9c17732 --- /dev/null +++ b/.local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h @@ -0,0 +1,50 @@ +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + * WM_WINDOW_ROLE(STRING) = role + * _NET_WM_WINDOW_TYPE(ATOM) = wintype + */ + RULE(.class = "discord", .tags = 1 << 8) + RULE(.class = "firefoxdeveloperedition", .tags = 1 << 1) + RULE(.class = "Brave-browser", .tags = 1 << 1) + RULE(.class = "firefox", .tags = 1 << 1) + RULE(.class = "tabbed-surf", .tags = 1 << 1) + RULE(.class = "bitwarden", .tags = 1 << 6) + RULE(.class = "QtPass", .tags = 1 << 6) + RULE(.class = "qtpass", .tags = 1 << 6) + RULE(.class = "Bitwarden", .tags = 1 << 6) + RULE(.class = "Mailspring", .tags = 1 << 7) + RULE(.class = "Thunderbird", .tags = 1 << 7) + RULE(.class = "st-256color", .tags = 1 << 0, .isfloating=0) + RULE(.class = "Tor Browser", .tags = 1 << 1) + RULE(.class = "Chromium", .tags = 1 << 1) + RULE(.class = "TelegramDesktop", .tags = 1 << 8) + RULE(.class = "whatsapp-nativefier-d52542", .tags = 1 << 8) + RULE(.class = "Sublime_Text", .tags = 1 << 2) + RULE(.class = "code-oss", .tags = 1 << 2) + RULE(.class = "jetbrains-idea", .tags = 1 << 2) + RULE(.class = "Nemo", .isfloating = 1, .floatpos="50% 50% 1200W 800H") + RULE(.class = "Spotify", .tags = 1 << 9) + RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1) + RULE(.class = "spfeh", .tags = SPTAG(1), .isfloating = 1) + RULE(.instance = "spmutt", .tags = SPTAG(2), .isfloating = 1) + RULE(.instance = "spfile", .tags = SPTAG(3), .isfloating = 1) + RULE(.instance = "spmusic", .tags = SPTAG(4), .isfloating = 1) + RULE(.instance = "spcal", .tags = SPTAG(5), .isfloating = 1) + /* Terminal Window Rules */ + RULE(.class = "ranger", 0, .isfloating = 1, .floatpos="50% 50% 800W 560H") + RULE(.class = "lf", 0, .isfloating = 1, .floatpos="50% 50% 800W 560H") + RULE(.class = "vim", 0, .isfloating = 1, .floatpos="50% 50% 1000W 700H") + RULE(.class = "stpulse", 0, .isfloating = 1, .floatpos="50% 50% 800W 560H") + RULE(.class = "mpv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H") + RULE(.instance = "sxiv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H") + RULE(.class = "neomutt-send", 0, .isfloating = 1, .floatpos="50% 50% 1000W 700H") + //RULE(.class = "Zathura", 0, .isfloating = 1, .floatpos="100% 50% 700W 1000H") + //RULE(.class = "Surf", 0, .isfloating = 1, .floatpos="100% 100% 800W 1200H") + RULE(.class = "weather", 0, .isfloating = 1, .floatpos="50% 50% 1200W 800H") + RULE(.class = "center", 0, .isfloating = 1, .floatpos="50% 50% 1000W 600H") + RULE(.class = "htop", 0, .isfloating = 1, .floatpos="50% 50% 1200W 600H") + RULE(.title = "SimCrop", 0, .isfloating = 1, .floatpos="50% 50% 800W 500H") + +}; diff --git a/.local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h.blob b/.local/src/dwm/.ccls-cache/@home@yigit@dwm/rules.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..1d9ce4ddddd4ca539044f376f550ff76bbf4283e GIT binary patch literal 186 zcmdO5_&2BY(E$cV2K|iu+*JL_%=F9>{gm=t{i4#G)MC912A1TU#JqF{-HQCAtkmR^ z%(7J7WNmHTjMT)G)FPa^bj$OLvNQA2byG5nfV%RFDs9m%U;qQg|Fw%>3z +/* appearance */ +static const int rmaster = 0; /* 1 = master at right*/ +static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ +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 int tag_padding = 0; +static const int vertpad = 0; /* vertical padding of bar */ +static const int sidepad = 0; /* horizontal padding of bar */ + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}; +//static const char *alttags[] = { "󰄯", "󰄯", "󰄯", "󰄯"}; + +/* layout(s) */ +static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "鉶", tile }, /* first entry is default */ +/* { "", dwindle }, */ + { "ﱖ", grid }, + { "", centeredmaster }, + { "", centeredfloatingmaster }, + { "[M]", monocle }, + { "[D]", deck }, + { NULL, NULL }, +}; diff --git a/.local/src/dwm/drw.c b/.local/src/dwm/drw.c index cb9e1176..da9101ae 100644 --- a/.local/src/dwm/drw.c +++ b/.local/src/dwm/drw.c @@ -5,9 +5,11 @@ #include #include +#include "patches.h" #include "drw.h" #include "util.h" +#if !BAR_PANGO_PATCH #define UTF_INVALID 0xFFFD #define UTF_SIZ 4 @@ -15,8 +17,13 @@ static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0} static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; +#endif // BAR_PANGO_PATCH +#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH +Clr transcheme[3]; +#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH +#if !BAR_PANGO_PATCH static long utf8decodebyte(const char c, size_t *i) { @@ -60,9 +67,14 @@ utf8decode(const char *c, long *u, size_t clen) return len; } +#endif // BAR_PANGO_PATCH Drw * +#if BAR_ALPHA_PATCH +drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) +#else drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) +#endif // BAR_ALPHA_PATCH { Drw *drw = ecalloc(1, sizeof(Drw)); @@ -72,8 +84,16 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h drw->w = w; drw->h = h; + #if BAR_ALPHA_PATCH + drw->visual = visual; + drw->depth = depth; + drw->cmap = cmap; + drw->drawable = XCreatePixmap(dpy, root, w, h, depth); + drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); + #else drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); drw->gc = XCreateGC(dpy, root, 0, NULL); + #endif // BAR_ALPHA_PATCH XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); return drw; @@ -89,7 +109,11 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h) drw->h = h; if (drw->drawable) XFreePixmap(drw->dpy, drw->drawable); + #if BAR_ALPHA_PATCH + drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); + #else drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); + #endif // BAR_ALPHA_PATCH } void @@ -101,6 +125,41 @@ drw_free(Drw *drw) free(drw); } +#if BAR_PANGO_PATCH +/* This function is an implementation detail. Library users should use + * drw_font_create instead. + */ +static Fnt * +xfont_create(Drw *drw, const char *fontname) +{ + Fnt *font; + PangoFontMap *fontmap; + PangoContext *context; + PangoFontDescription *desc; + PangoFontMetrics *metrics; + + if (!fontname) { + die("no font specified."); + } + + font = ecalloc(1, sizeof(Fnt)); + font->dpy = drw->dpy; + + fontmap = pango_xft_get_font_map(drw->dpy, drw->screen); + context = pango_font_map_create_context(fontmap); + desc = pango_font_description_from_string(fontname); + font->layout = pango_layout_new(context); + pango_layout_set_font_description(font->layout, desc); + + metrics = pango_context_get_metrics(context, desc, pango_language_from_string ("en-us")); + font->h = pango_font_metrics_get_height(metrics) / PANGO_SCALE; + + pango_font_metrics_unref(metrics); + g_object_unref(context); + + return font; +} +#else /* This function is an implementation detail. Library users should use * drw_fontset_create instead. */ @@ -135,6 +194,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) die("no font specified."); } + #if !BAR_COLOR_EMOJI_PATCH /* 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 @@ -147,6 +207,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) XftFontClose(drw->dpy, xfont); return NULL; } + #endif // BAR_COLOR_EMOJI_PATCH font = ecalloc(1, sizeof(Fnt)); font->xfont = xfont; @@ -156,18 +217,38 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) return font; } +#endif // BAR_PANGO_PATCH static void xfont_free(Fnt *font) { if (!font) return; + #if BAR_PANGO_PATCH + if (font->layout) + g_object_unref(font->layout); + #else if (font->pattern) FcPatternDestroy(font->pattern); XftFontClose(font->dpy, font->xfont); + #endif // BAR_PANGO_PATCH free(font); } +#if BAR_PANGO_PATCH +Fnt* +drw_font_create(Drw* drw, const char font[]) +{ + Fnt *fnt = NULL; + + if (!drw || !font) + return NULL; + + fnt = xfont_create(drw, font); + + return (drw->fonts = fnt); +} +#else Fnt* drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) { @@ -185,12 +266,15 @@ drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) } return (drw->fonts = ret); } +#endif // BAR_PANGO_PATCH void drw_fontset_free(Fnt *font) { if (font) { + #if !BAR_PANGO_PATCH drw_fontset_free(font->next); + #endif // BAR_PANGO_PATCH xfont_free(font); } } @@ -200,16 +284,29 @@ drw_clr_create( Drw *drw, Clr *dest, const char *clrname + #if BAR_ALPHA_PATCH + , unsigned int alpha + #endif // BAR_ALPHA_PATCH ) { if (!drw || !dest || !clrname) return; + #if BAR_ALPHA_PATCH + if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, + clrname, dest)) + die("error, cannot allocate color '%s'", clrname); + + dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); + #else if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), DefaultColormap(drw->dpy, drw->screen), clrname, dest)) die("error, cannot allocate color '%s'", clrname); + #if NO_TRANSPARENT_BORDERS_PATCH dest->pixel |= 0xff << 24; + #endif // NO_TRANSPARENT_BORDERS_PATCH + #endif // BAR_ALPHA_PATCH } /* Wrapper to create color schemes. The caller has to call free(3) on the @@ -218,6 +315,9 @@ Clr * drw_scm_create( Drw *drw, char *clrnames[], + #if BAR_ALPHA_PATCH + const unsigned int alphas[], + #endif // BAR_ALPHA_PATCH size_t clrcount ) { size_t i; @@ -228,16 +328,22 @@ drw_scm_create( return NULL; for (i = 0; i < clrcount; i++) + #if BAR_ALPHA_PATCH + drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); + #else drw_clr_create(drw, &ret[i], clrnames[i]); + #endif // BAR_ALPHA_PATCH return ret; } +#if !BAR_PANGO_PATCH void drw_setfontset(Drw *drw, Fnt *set) { if (drw) drw->fonts = set; } +#endif // BAR_PANGO_PATCH void drw_setscheme(Drw *drw, Clr *scm) @@ -246,6 +352,16 @@ drw_setscheme(Drw *drw, Clr *scm) drw->scheme = scm; } +#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH +void +drw_settrans(Drw *drw, Clr *psc, Clr *nsc) +{ + if (drw) { + transcheme[0] = psc[ColBg]; transcheme[1] = nsc[ColBg]; transcheme[2] = psc[ColBorder]; + drw->scheme = transcheme; + } +} +#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) @@ -259,6 +375,72 @@ drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); } +#if BAR_PANGO_PATCH +int +drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup) +{ + char buf[1024]; + int ty; + unsigned int ew; + XftDraw *d = NULL; + size_t i, len; + int render = x || y || w || h; + + if (!drw || (render && !drw->scheme) || !text || !drw->fonts) + return 0; + + if (!render) { + w = ~w; + } else { + XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); + #if BAR_ALPHA_PATCH + d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); + #else + d = XftDrawCreate(drw->dpy, drw->drawable, + DefaultVisual(drw->dpy, drw->screen), + DefaultColormap(drw->dpy, drw->screen)); + #endif // BAR_ALPHA_PATCH + x += lpad; + w -= lpad; + } + + len = strlen(text); + + if (len) { + drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup); + /* shorten text if necessary */ + for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--) + drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup); + + if (len) { + memcpy(buf, text, len); + buf[len] = '\0'; + if (len < strlen(text)) + for (i = len; i && i > len - 3; buf[--i] = '.') + ; /* NOP */ + + if (render) { + ty = y + (h - drw->fonts->h) / 2; + if (markup) + pango_layout_set_markup(drw->fonts->layout, buf, len); + else + pango_layout_set_text(drw->fonts->layout, buf, len); + pango_xft_render_layout(d, &drw->scheme[invert ? ColBg : ColFg], + drw->fonts->layout, x * PANGO_SCALE, ty * PANGO_SCALE); + if (markup) /* clear markup attributes */ + pango_layout_set_attributes(drw->fonts->layout, NULL); + } + x += ew; + w -= ew; + } + } + if (d) + XftDrawDestroy(d); + + return x + (render ? w : 0); +} +#else int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool ignored) { @@ -285,9 +467,13 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp } else { XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); + #if BAR_ALPHA_PATCH + d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); + #else d = XftDrawCreate(drw->dpy, drw->drawable, DefaultVisual(drw->dpy, drw->screen), DefaultColormap(drw->dpy, drw->screen)); + #endif // BAR_ALPHA_PATCH x += lpad; w -= lpad; } @@ -389,7 +575,40 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp return x + (render ? w : 0); } +#endif // BAR_PANGO_PATCH + +#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH +void +drw_arrow(Drw *drw, int x, int y, unsigned int w, unsigned int h, int direction, int slash) +{ + if (!drw || !drw->scheme) + return; + /* direction=1 draws right arrow */ + x = direction ? x : x + w; + w = direction ? w : -w; + /* slash=1 draws slash instead of arrow */ + unsigned int hh = slash ? (direction ? 0 : h) : h/2; + + XPoint points[] = { + {x , y }, + {x + w, y + hh }, + {x , y + h }, + }; + + XPoint bg[] = { + {x , y }, + {x + w, y }, + {x + w, y + h}, + {x , y + h}, + }; + + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillPolygon(drw->dpy, drw->drawable, drw->gc, bg, 4, Convex, CoordModeOrigin); + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColFg].pixel); + XFillPolygon(drw->dpy, drw->drawable, drw->gc, points, 3, Nonconvex, CoordModeOrigin); +} +#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) @@ -409,6 +628,27 @@ drw_fontset_getwidth(Drw *drw, const char *text, Bool markup) return drw_text(drw, 0, 0, 0, 0, 0, text, 0, markup); } +#if BAR_PANGO_PATCH +void +drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup) +{ + if (!font || !text) + return; + + PangoRectangle r; + if (markup) + pango_layout_set_markup(font->layout, text, len); + else + pango_layout_set_text(font->layout, text, len); + pango_layout_get_extents(font->layout, 0, &r); + if (markup) /* clear markup attributes */ + pango_layout_set_attributes(font->layout, NULL); + if (w) + *w = r.width / PANGO_SCALE; + if (h) + *h = font->h; +} +#else void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) { @@ -423,6 +663,7 @@ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, if (h) *h = font->h; } +#endif // BAR_PANGO_PATCH Cur * drw_cur_create(Drw *drw, int shape) diff --git a/.local/src/dwm/drw.h b/.local/src/dwm/drw.h index 61c1d90d..f4eac030 100644 --- a/.local/src/dwm/drw.h +++ b/.local/src/dwm/drw.h @@ -1,5 +1,9 @@ /* See LICENSE file for copyright and license details. */ +#if BAR_PANGO_PATCH +#include +#include +#endif // BAR_PANGO_PATCH typedef struct { Cursor cursor; @@ -8,9 +12,13 @@ typedef struct { typedef struct Fnt { Display *dpy; unsigned int h; + #if BAR_PANGO_PATCH + PangoLayout *layout; + #else XftFont *xfont; FcPattern *pattern; struct Fnt *next; + #endif // BAR_PANGO_PATCH } Fnt; enum { ColFg, ColBg, ColBorder, ColFloat, ColCount }; /* Clr scheme index */ @@ -21,6 +29,11 @@ typedef struct { Display *dpy; int screen; Window root; + #if BAR_ALPHA_PATCH + Visual *visual; + unsigned int depth; + Colormap cmap; + #endif // BAR_ALPHA_PATCH Drawable drawable; GC gc; Clr *scheme; @@ -28,13 +41,22 @@ typedef struct { } Drw; /* Drawable abstraction */ +#if BAR_ALPHA_PATCH +Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); +#else Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); +#endif // BAR_ALPHA_PATCH void drw_resize(Drw *drw, unsigned int w, unsigned int h); void drw_free(Drw *drw); /* Fnt abstraction */ +#if BAR_PANGO_PATCH +Fnt *drw_font_create(Drw* drw, const char font[]); +void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup); +#else Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); +#endif // BAR_PANGO_PATCH void drw_fontset_free(Fnt* set); unsigned int drw_fontset_getwidth(Drw *drw, const char *text, Bool markup); @@ -43,10 +65,16 @@ void drw_clr_create( Drw *drw, Clr *dest, const char *clrname + #if BAR_ALPHA_PATCH + , unsigned int alpha + #endif // BAR_ALPHA_PATCH ); Clr *drw_scm_create( Drw *drw, char *clrnames[], + #if BAR_ALPHA_PATCH + const unsigned int alphas[], + #endif // BAR_ALPHA_PATCH size_t clrcount ); @@ -55,12 +83,20 @@ Cur *drw_cur_create(Drw *drw, int shape); void drw_cur_free(Drw *drw, Cur *cursor); /* Drawing context manipulation */ +#if !BAR_PANGO_PATCH void drw_setfontset(Drw *drw, Fnt *set); +#endif // BAR_PANGO_PATCH void drw_setscheme(Drw *drw, Clr *scm); +#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH +void drw_settrans(Drw *drw, Clr *psc, Clr *nsc); +#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH /* Drawing functions */ void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup); +#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH +void drw_arrow(Drw *drw, int x, int y, unsigned int w, unsigned int h, int direction, int slash); +#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH /* Map functions */ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/.local/src/dwm/dwm.c b/.local/src/dwm/dwm.c index de83bf8e..599fa3d5 100644 --- a/.local/src/dwm/dwm.c +++ b/.local/src/dwm/dwm.c @@ -41,11 +41,26 @@ #endif /* XINERAMA */ #include +#include "patches.h" #include "drw.h" #include "util.h" +#if BAR_FLEXWINTITLE_PATCH +#ifndef FLEXTILE_DELUXE_LAYOUT +#define FLEXTILE_DELUXE_LAYOUT 1 +#endif +#endif +#if BAR_PANGO_PATCH +#include +#endif // BAR_PANGO_PATCH +#if SPAWNCMD_PATCH +#include +#include +#include +#define SPAWN_CWD_DELIM " []{}()<>\"':" +#endif // SPAWNCMD_PATCH /* macros */ #define Button6 6 @@ -56,24 +71,56 @@ #define BARRULES 20 #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) +#if BAR_ANYBAR_PATCH +#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->mx+(m)->mw) - MAX((x),(m)->mx)) \ + * MAX(0, MIN((y)+(h),(m)->my+(m)->mh) - MAX((y),(m)->my))) +#else #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) +#endif // BAR_ANYBAR_PATCH +#if ATTACHASIDE_PATCH && STICKY_PATCH +#define ISVISIBLEONTAG(C, T) ((C->tags & T) || C->issticky) +#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) +#elif ATTACHASIDE_PATCH +#define ISVISIBLEONTAG(C, T) ((C->tags & T)) +#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) +#elif STICKY_PATCH +#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->issticky) +#else #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) +#endif // ATTACHASIDE_PATCH #define LENGTH(X) (sizeof X / sizeof X[0]) #define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define WIDTH(X) ((X)->w + 2 * (X)->bw) #define HEIGHT(X) ((X)->h + 2 * (X)->bw) #define WTYPE "_NET_WM_WINDOW_TYPE_" +#if SCRATCHPADS_PATCH #define TOTALTAGS (NUMTAGS + LENGTH(scratchpads)) #define TAGMASK ((1 << TOTALTAGS) - 1) #define SPTAG(i) ((1 << NUMTAGS) << (i)) #define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << NUMTAGS) +#else +#define TAGMASK ((1 << NUMTAGS) - 1) +#endif // SCRATCHPADS_PATCH #define TEXTWM(X) (drw_fontset_getwidth(drw, (X), True) + lrpad) #define TEXTW(X) (drw_fontset_getwidth(drw, (X), False) + lrpad) #define HIDDEN(C) ((getstate(C->win) == IconicState)) /* enums */ enum { + #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH + CurResizeBR, + CurResizeBL, + CurResizeTR, + CurResizeTL, + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH + #if DRAGMFACT_PATCH + CurResizeHorzArrow, + CurResizeVertArrow, + #endif // DRAGMFACT_PATCH + #if DRAGCFACT_PATCH + CurIronCross, + #endif // DRAGCFACT_PATCH CurNormal, CurResize, CurMove, @@ -89,14 +136,57 @@ enum { SchemeTagsSel, SchemeHid, SchemeUrg, + #if BAR_FLEXWINTITLE_PATCH + SchemeFlexActTTB, + SchemeFlexActLTR, + SchemeFlexActMONO, + SchemeFlexActGRID, + SchemeFlexActGRD1, + SchemeFlexActGRD2, + SchemeFlexActGRDM, + SchemeFlexActHGRD, + SchemeFlexActDWDL, + SchemeFlexActSPRL, + SchemeFlexInaTTB, + SchemeFlexInaLTR, + SchemeFlexInaMONO, + SchemeFlexInaGRID, + SchemeFlexInaGRD1, + SchemeFlexInaGRD2, + SchemeFlexInaGRDM, + SchemeFlexInaHGRD, + SchemeFlexInaDWDL, + SchemeFlexInaSPRL, + SchemeFlexSelTTB, + SchemeFlexSelLTR, + SchemeFlexSelMONO, + SchemeFlexSelGRID, + SchemeFlexSelGRD1, + SchemeFlexSelGRD2, + SchemeFlexSelGRDM, + SchemeFlexSelHGRD, + SchemeFlexSelDWDL, + SchemeFlexSelSPRL, + SchemeFlexActFloat, + SchemeFlexInaFloat, + SchemeFlexSelFloat, + #endif // BAR_FLEXWINTITLE_PATCH }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, + #if BAR_SYSTRAY_PATCH NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayVisual, NetWMWindowTypeDock, NetSystemTrayOrientationHorz, + #endif // BAR_SYSTRAY_PATCH + #if BAR_EWMHTAGS_PATCH + NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop, + #endif // BAR_EWMHTAGS_PATCH NetClientList, + #if NET_CLIENT_LIST_STACKING_PATCH + NetClientListStacking, + #endif // NET_CLIENT_LIST_STACKING_PATCH NetLast }; /* EWMH atoms */ @@ -105,10 +195,16 @@ enum { WMDelete, WMState, WMTakeFocus, + #if WINDOWROLERULE_PATCH + WMWindowRole, + #endif // WINDOWROLERULE_PATCH WMLast }; /* default atoms */ enum { + #if BAR_STATUSBUTTON_PATCH + ClkButton, + #endif // BAR_STATUSBUTTON_PATCH ClkTagBar, ClkLtSymbol, ClkStatusText, @@ -132,10 +228,28 @@ enum { BAR_ALIGN_LAST }; /* bar alignment */ +#if IPC_PATCH +typedef struct TagState TagState; +struct TagState { + int selected; + int occupied; + int urgent; +}; + +typedef struct ClientState ClientState; +struct ClientState { + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; +}; +#endif // IPC_PATCH typedef union { + #if IPC_PATCH + long i; + unsigned long ui; + #else int i; unsigned int ui; + #endif // IPC_PATCH float f; const void *v; } Arg; @@ -187,17 +301,66 @@ typedef struct Client Client; struct Client { char name[256]; float mina, maxa; + #if CFACTS_PATCH + float cfact; + #endif // CFACTS_PATCH int x, y, w, h; + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH int oldx, oldy, oldw, oldh; int basew, baseh, incw, inch, maxw, maxh, minw, minh; int bw, oldbw; unsigned int tags; + #if SWITCHTAG_PATCH + unsigned int switchtag; + #endif // SWITCHTAG_PATCH int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; + #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + int fakefullscreen; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #if EXRESIZE_PATCH + unsigned char expandmask; + int expandx1, expandy1, expandx2, expandy2; + #if !MAXIMIZE_PATCH + int wasfloating; + #endif // MAXIMIZE_PATCH + #endif // EXRESIZE_PATCH + #if MAXIMIZE_PATCH + int ismax, wasfloating; + #endif // MAXIMIZE_PATCH + #if AUTORESIZE_PATCH + int needresize; + #endif // AUTORESIZE_PATCH + #if CENTER_PATCH + int iscentered; + #endif // CENTER_PATCH + #if ISPERMANENT_PATCH + int ispermanent; + #endif // ISPERMANENT_PATCH + #if PLACEMOUSE_PATCH + int beingmoved; + #endif // PLACEMOUSE_PATCH + #if SWALLOW_PATCH + int isterminal, noswallow; + pid_t pid; + #endif // SWALLOW_PATCH + #if STEAM_PATCH + int issteam; + #endif // STEAM_PATCH + #if STICKY_PATCH + int issticky; + #endif // STICKY_PATCH Client *next; Client *snext; + #if SWALLOW_PATCH + Client *swallowing; + #endif // SWALLOW_PATCH Monitor *mon; Window win; + #if IPC_PATCH + ClientState prevstate; + #endif // IPC_PATCH }; typedef struct { @@ -207,26 +370,59 @@ typedef struct { const Arg arg; } Key; +#if FLEXTILE_DELUXE_LAYOUT +typedef struct { + int nmaster; + int nstack; + int layout; + int masteraxis; // master stack area + int stack1axis; // primary stack area + int stack2axis; // secondary stack area, e.g. centered master + void (*symbolfunc)(Monitor *, unsigned int); +} LayoutPreset; +#endif // FLEXTILE_DELUXE_LAYOUT typedef struct { const char *symbol; void (*arrange)(Monitor *); + #if FLEXTILE_DELUXE_LAYOUT + LayoutPreset preset; + #endif // FLEXTILE_DELUXE_LAYOUT } Layout; +#if INSETS_PATCH +typedef struct { + int x; + int y; + int w; + int h; +} Inset; +#endif // INSETS_PATCH +#if PERTAG_PATCH typedef struct Pertag Pertag; +#endif // PERTAG_PATCH struct Monitor { int index; char ltsymbol[16]; float mfact; + #if FLEXTILE_DELUXE_LAYOUT + int ltaxis[4]; + int nstack; + #endif // FLEXTILE_DELUXE_LAYOUT int nmaster; int num; int mx, my, mw, mh; /* screen size */ int wx, wy, ww, wh; /* window area */ + #if VANITYGAPS_PATCH int gappih; /* horizontal gap between windows */ int gappiv; /* vertical gap between windows */ int gappoh; /* horizontal outer gaps */ int gappov; /* vertical outer gaps */ + #endif // VANITYGAPS_PATCH + #if SETBORDERPX_PATCH + unsigned int borderpx; + #endif // SETBORDERPX_PATCH unsigned int seltags; unsigned int sellt; unsigned int tagset[2]; @@ -237,17 +433,52 @@ struct Monitor { Monitor *next; Bar *bar; const Layout *lt[2]; + #if BAR_ALTERNATIVE_TAGS_PATCH + unsigned int alttag; + #endif // BAR_ALTERNATIVE_TAGS_PATCH + #if PERTAG_PATCH Pertag *pertag; + #endif // PERTAG_PATCH + #if INSETS_PATCH + Inset inset; + #endif // INSETS_PATCH + #if IPC_PATCH + char lastltsymbol[16]; + TagState tagstate; + Client *lastsel; + const Layout *lastlt; + #endif // IPC_PATCH }; typedef struct { const char *class; + #if WINDOWROLERULE_PATCH + const char *role; + #endif // WINDOWROLERULE_PATCH const char *instance; const char *title; const char *wintype; unsigned int tags; + #if SWITCHTAG_PATCH + int switchtag; + #endif // SWITCHTAG_PATCH + #if CENTER_PATCH + int iscentered; + #endif // CENTER_PATCH int isfloating; + #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + int isfakefullscreen; + #endif // SELECTIVEFAKEFULLSCREEN_PATCH + #if ISPERMANENT_PATCH + int ispermanent; + #endif // ISPERMANENT_PATCH + #if SWALLOW_PATCH + int isterminal; + int noswallow; + #endif // SWALLOW_PATCH + #if FLOATPOS_PATCH const char *floatpos; + #endif // FLOATPOS_PATCH int monitor; } Rule; @@ -255,13 +486,47 @@ typedef struct { /* Cross patch compatibility rule macro helper macros */ #define FLOATING , .isfloating = 1 +#if CENTER_PATCH +#define CENTERED , .iscentered = 1 +#else #define CENTERED +#endif // CENTER_PATCH +#if ISPERMANENT_PATCH +#define PERMANENT , .ispermanent = 1 +#else #define PERMANENT +#endif // ISPERMANENT_PATCH +#if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH +#define FAKEFULLSCREEN , .isfakefullscreen = 1 +#else #define FAKEFULLSCREEN +#endif // SELECTIVEFAKEFULLSCREEN_PATCH +#if SWALLOW_PATCH +#define NOSWALLOW , .noswallow = 1 +#define TERMINAL , .isterminal = 1 +#else #define NOSWALLOW #define TERMINAL +#endif // SWALLOW_PATCH +#if SWITCHTAG_PATCH +#define SWITCHTAG , .switchtag = 1 +#else #define SWITCHTAG +#endif // SWITCHTAG_PATCH +#if MONITOR_RULES_PATCH +typedef struct { + int monitor; + #if PERTAG_PATCH + int tag; + #endif // PERTAG_PATCH + int layout; + float mfact; + int nmaster; + int showbar; + int topbar; +} MonitorRule; +#endif // MONITOR_RULES_PATCH /* function declarations */ static void applyrules(Client *c); @@ -286,28 +551,44 @@ static Monitor *dirtomon(int dir); static void drawbar(Monitor *m); static void drawbars(void); static void drawbarwin(Bar *bar); +#if !FOCUSONCLICK_PATCH static void enternotify(XEvent *e); +#endif // FOCUSONCLICK_PATCH static void expose(XEvent *e); static void focus(Client *c); static void focusin(XEvent *e); static void focusmon(const Arg *arg); +#if !STACKER_PATCH static void focusstack(const Arg *arg); +#endif // STACKER_PATCH static Atom getatomprop(Client *c, Atom prop); static int getrootptr(int *x, int *y); static long getstate(Window w); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, int focused); +#if KEYMODES_PATCH +static void grabdefkeys(void); +#else static void grabkeys(void); +#endif // KEYMODES_PATCH static void incnmaster(const Arg *arg); +#if KEYMODES_PATCH +static void keydefpress(XEvent *e); +#else static void keypress(XEvent *e); +#endif // KEYMODES_PATCH static void killclient(const Arg *arg); static void manage(Window w, XWindowAttributes *wa); static void mappingnotify(XEvent *e); static void maprequest(XEvent *e); +#if !FOCUSONCLICK_PATCH static void motionnotify(XEvent *e); +#endif // FOCUSONCLICK_PATCH static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); +#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH static void pop(Client *); +#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH static void propertynotify(XEvent *e); static void quit(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); @@ -317,7 +598,11 @@ static void resizemouse(const Arg *arg); static void restack(Monitor *m); static void run(void); static void scan(void); +#if BAR_SYSTRAY_PATCH static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4); +#else +static int sendevent(Client *c, Atom proto); +#endif // BAR_SYSTRAY_PATCH static void sendmon(Client *c, Monitor *m); static void setclientstate(Client *c, long state); static void setfocus(Client *c); @@ -329,6 +614,9 @@ static void seturgent(Client *c, int urg); static void showhide(Client *c); static void sigchld(int unused); static void spawn(const Arg *arg); +#if RIODRAW_PATCH +static pid_t spawncmd(const Arg *arg); +#endif // RIODRAW_PATCH static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void togglebar(const Arg *arg); @@ -361,8 +649,28 @@ static void zoom(const Arg *arg); /* variables */ static const char broken[] = "broken"; +#if BAR_PANGO_PATCH || BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH static char stext[1024]; +#else +static char stext[512]; +#endif // BAR_PANGO_PATCH | BAR_STATUS2D_PATCH +#if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH +#if BAR_STATUS2D_PATCH static char rawstext[1024]; +#else +static char rawstext[512]; +#endif // BAR_STATUS2D_PATCH +#endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH +#if BAR_EXTRASTATUS_PATCH +#if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH +static char estext[1024]; +#else +static char estext[512]; +#endif // BAR_STATUS2D_PATCH +#if BAR_STATUSCMD_PATCH +static char rawestext[1024]; +#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH +#endif // BAR_EXTRASTATUS_PATCH static int screen; static int sw, sh; /* X display screen geometry width, height */ @@ -373,28 +681,53 @@ static int lrpad; /* sum of left and right padding for text */ * when moving (or resizing) client windows from one monitor to another. This variable is used * internally to ignore such configure requests while movemouse or resizemouse are being used. */ static int ignoreconfigurerequests = 0; +#if WARP_PATCH +static int force_warp = 0; // force warp in some situations, e.g. killclient +static int ignore_warp = 0; // force skip warp in some situations, e.g. dragmfact, dragcfact +#endif // WARP_PATCH static int (*xerrorxlib)(Display *, XErrorEvent *); static unsigned int numlockmask = 0; +#if RIODRAW_PATCH +static int riodimensions[4] = { -1, -1, -1, -1 }; +static pid_t riopid = 0; +#endif // RIODRAW_PATCH static void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, + #if COMBO_PATCH || BAR_HOLDBAR_PATCH [ButtonRelease] = keyrelease, + #endif // COMBO_PATCH / BAR_HOLDBAR_PATCH [ClientMessage] = clientmessage, [ConfigureRequest] = configurerequest, [ConfigureNotify] = configurenotify, [DestroyNotify] = destroynotify, + #if !FOCUSONCLICK_PATCH [EnterNotify] = enternotify, + #endif // FOCUSONCLICK_PATCH [Expose] = expose, [FocusIn] = focusin, [KeyPress] = keypress, + #if COMBO_PATCH || BAR_HOLDBAR_PATCH [KeyRelease] = keyrelease, + #endif // COMBO_PATCH / BAR_HOLDBAR_PATCH [MappingNotify] = mappingnotify, [MapRequest] = maprequest, + #if !FOCUSONCLICK_PATCH [MotionNotify] = motionnotify, + #endif // FOCUSONCLICK_PATCH [PropertyNotify] = propertynotify, + #if BAR_SYSTRAY_PATCH [ResizeRequest] = resizerequest, + #endif // BAR_SYSTRAY_PATCH [UnmapNotify] = unmapnotify }; +#if BAR_SYSTRAY_PATCH static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast]; +#else +static Atom wmatom[WMLast], netatom[NetLast]; +#endif // BAR_SYSTRAY_PATCH +#if ON_EMPTY_KEYS_PATCH +static int isempty = 0; +#endif // ON_EMPTY_KEYS_PATCH static int running = 1; static Cur *cursor[CurLast]; static Clr **scheme; @@ -406,7 +739,7 @@ static Window root, wmcheckwin; /* configuration, allows nested code to access above variables */ #include "config.h" -#include "colors.h" +#include "theme.h" #include "rules.h" #include "keybind.h" @@ -414,7 +747,11 @@ static Window root, wmcheckwin; /* compile-time check if all tags fit into an unsigned int bit array. */ +#if SCRATCHPAD_ALT_1_PATCH +struct NumTags { char limitexceeded[NUMTAGS > 30 ? -1 : 1]; }; +#else struct NumTags { char limitexceeded[NUMTAGS > 31 ? -1 : 1]; }; +#endif // SCRATCHPAD_ALT_1_PATCH /* function implementations */ void @@ -422,47 +759,140 @@ applyrules(Client *c) { const char *class, *instance; Atom wintype; + #if WINDOWROLERULE_PATCH + char role[64]; + #endif // WINDOWROLERULE_PATCH unsigned int i; + #if SWITCHTAG_PATCH + unsigned int newtagset; + #endif // SWITCHTAG_PATCH const Rule *r; Monitor *m; XClassHint ch = { NULL, NULL }; /* rule matching */ + #if SWALLOW_PATCH + c->noswallow = -1; + #endif // SWALLOW_PATCH c->isfloating = 0; c->tags = 0; XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; instance = ch.res_name ? ch.res_name : broken; wintype = getatomprop(c, netatom[NetWMWindowType]); + #if WINDOWROLERULE_PATCH + gettextprop(c->win, wmatom[WMWindowRole], role, sizeof(role)); + #endif // WINDOWROLERULE_PATCH + #if STEAM_PATCH + if (strstr(class, "Steam") || strstr(class, "steam_app_")) + c->issteam = 1; + #endif // STEAM_PATCH for (i = 0; i < LENGTH(rules); i++) { r = &rules[i]; if ((!r->title || strstr(c->name, r->title)) && (!r->class || strstr(class, r->class)) + #if WINDOWROLERULE_PATCH + && (!r->role || strstr(role, r->role)) + #endif // WINDOWROLERULE_PATCH && (!r->instance || strstr(instance, r->instance)) && (!r->wintype || wintype == XInternAtom(dpy, r->wintype, False))) { + #if CENTER_PATCH + c->iscentered = r->iscentered; + #endif // CENTER_PATCH + #if ISPERMANENT_PATCH + c->ispermanent = r->ispermanent; + #endif // ISPERMANENT_PATCH + #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + c->fakefullscreen = r->isfakefullscreen; + #endif // SELECTIVEFAKEFULLSCREEN_PATCH + #if SWALLOW_PATCH + c->isterminal = r->isterminal; + c->noswallow = r->noswallow; + #endif // SWALLOW_PATCH c->isfloating = r->isfloating; c->tags |= r->tags; + #if SCRATCHPADS_PATCH if ((r->tags & SPTAGMASK) && r->isfloating) { c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); } + #endif // SCRATCHPADS_PATCH for (m = mons; m && m->num != r->monitor; m = m->next); if (m) c->mon = m; + #if FLOATPOS_PATCH if (c->isfloating && r->floatpos) { + #if CENTER_PATCH + c->iscentered = 0; + #endif // CENTER_PATCH setfloatpos(c, r->floatpos); } - + #endif // FLOATPOS_PATCH + + #if SWITCHTAG_PATCH + #if SWALLOW_PATCH + if (r->switchtag && ( + c->noswallow > 0 || + !termforwin(c) || + !(c->isfloating && swallowfloating && c->noswallow < 0))) + #else + if (r->switchtag) + #endif // SWALLOW_PATCH + { + selmon = c->mon; + if (r->switchtag == 2 || r->switchtag == 4) + newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags; + else + newtagset = c->tags; + + /* Switch to the client's tag, but only if that tag is not already shown */ + if (newtagset && !(c->tags & c->mon->tagset[c->mon->seltags])) { + 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 { + c->mon->tagset[c->mon->seltags] = newtagset; + arrange(c->mon); + } + } + } + #endif // SWITCHTAG_PATCH + #if ONLY_ONE_RULE_MATCH_PATCH + break; + #endif // ONLY_ONE_RULE_MATCH_PATCH } } if (ch.res_class) XFree(ch.res_class); if (ch.res_name) XFree(ch.res_name); + #if EMPTYVIEW_PATCH + if (c->tags & TAGMASK) c->tags = c->tags & TAGMASK; + #if SCRATCHPADS_PATCH + else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags] & ~SPTAGMASK; + #elif SCRATCHPAD_ALT_1_PATCH + else if (c->tags != SCRATCHPAD_MASK && c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags]; + #else + else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags]; + #endif // SCRATCHPADS_PATCH + else c->tags = 1; + #elif SCRATCHPADS_PATCH c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK); + #elif SCRATCHPAD_ALT_1_PATCH + if (c->tags != SCRATCHPAD_MASK) + c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; + #else + c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; + #endif // EMPTYVIEW_PATCH } int @@ -551,6 +981,11 @@ arrangemon(Monitor *m) strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); if (m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); + #if ROUNDED_CORNERS_PATCH + Client *c; + for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) + drawroundedcorners(c); + #endif // ROUNDED_CORNERS_PATCH } void @@ -581,6 +1016,9 @@ buttonpress(XEvent *e) click = ClkRootWin; /* focus monitor if necessary */ if ((m = wintomon(ev->window)) && m != selmon + #if FOCUSONCLICK_PATCH + && (focusonwheel || (ev->button != Button4 && ev->button != Button5)) + #endif // FOCUSONCLICK_PATCH ) { unfocus(selmon->sel, 1, NULL); selmon = m; @@ -611,8 +1049,13 @@ buttonpress(XEvent *e) } if (click == ClkRootWin && (c = wintoclient(ev->window))) { + #if FOCUSONCLICK_PATCH + if (focusonwheel || (ev->button != Button4 && ev->button != Button5)) + focus(c); + #else focus(c); restack(selmon); + #endif // FOCUSONCLICK_PATCH XAllowEvents(dpy, ReplayPointer, CurrentTime); click = ClkClientWin; } @@ -620,7 +1063,11 @@ buttonpress(XEvent *e) for (i = 0; i < LENGTH(buttons); i++) { if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) { + #if BAR_WINTITLEACTIONS_PATCH + buttons[i].func((click == ClkTagBar || click == ClkWinTitle) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); + #else buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); + #endif // BAR_WINTITLEACTIONS_PATCH } } } @@ -651,6 +1098,7 @@ cleanup(void) XUngrabKey(dpy, AnyKey, AnyModifier, root); while (mons) cleanupmon(mons); + #if BAR_SYSTRAY_PATCH if (showsystray && systray) { if (systray->win) { XUnmapWindow(dpy, systray->win); @@ -658,9 +1106,14 @@ cleanup(void) } free(systray); } + #endif // BAR_SYSTRAY_PATCH for (i = 0; i < CurLast; i++) drw_cur_free(drw, cursor[i]); + #if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH for (i = 0; i < LENGTH(colors) + 1; i++) + #else + for (i = 0; i < LENGTH(colors); i++) + #endif // BAR_STATUS2D_PATCH free(scheme[i]); free(scheme); XDestroyWindow(dpy, wmcheckwin); @@ -669,6 +1122,12 @@ cleanup(void) XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); XDeleteProperty(dpy, root, netatom[NetActiveWindow]); + #if IPC_PATCH + ipc_cleanup(); + + if (close(epoll_fd) < 0) + fprintf(stderr, "Failed to close epoll file descriptor\n"); + #endif // IPC_PATCH } void @@ -689,8 +1148,10 @@ cleanupmon(Monitor *mon) XDestroyWindow(dpy, bar->win); } mon->bar = bar->next; + #if BAR_SYSTRAY_PATCH if (systray && bar == systray->bar) systray->bar = NULL; + #endif // BAR_SYSTRAY_PATCH free(bar); } free(mon); @@ -699,11 +1160,17 @@ cleanupmon(Monitor *mon) void clientmessage(XEvent *e) { + #if BAR_SYSTRAY_PATCH XWindowAttributes wa; XSetWindowAttributes swa; + #endif // BAR_SYSTRAY_PATCH XClientMessageEvent *cme = &e->xclient; Client *c = wintoclient(cme->window); + #if FOCUSONNETACTIVE_PATCH + unsigned int i; + #endif // FOCUSONNETACTIVE_PATCH + #if BAR_SYSTRAY_PATCH if (showsystray && systray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) { /* add systray icons */ if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { @@ -742,20 +1209,44 @@ clientmessage(XEvent *e) } return; } + #endif // BAR_SYSTRAY_PATCH if (!c) return; if (cme->message_type == netatom[NetWMState]) { if (cme->data.l[1] == netatom[NetWMFullscreen] || cme->data.l[2] == netatom[NetWMFullscreen]) { + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen == 2 && c->isfullscreen) + c->fakefullscreen = 3; + #endif // FAKEFULLSCREEN_CLIENT_PATCH setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ + #if !FAKEFULLSCREEN_PATCH && !c->isfullscreen + #endif // !FAKEFULLSCREEN_PATCH ))); } } else if (cme->message_type == netatom[NetActiveWindow]) { + #if FOCUSONNETACTIVE_PATCH + if (c->tags & c->mon->tagset[c->mon->seltags]) + focus(c); + else { + for (i = 0; i < NUMTAGS && !((1 << i) & c->tags); i++); + if (i < NUMTAGS) { + if (c != selmon->sel) + unfocus(selmon->sel, 0, NULL); + selmon = c->mon; + if (((1 << i) & TAGMASK) != selmon->tagset[selmon->seltags]) + view(&((Arg) { .ui = 1 << i })); + focus(c); + restack(selmon); + } + } + #else if (c != selmon->sel && !c->isurgent) seturgent(c, 1); + #endif // FOCUSONNETACTIVE_PATCH } } @@ -783,7 +1274,9 @@ configurenotify(XEvent *e) { Monitor *m; Bar *bar; + #if !FAKEFULLSCREEN_PATCH Client *c; + #endif // !FAKEFULLSCREEN_PATCH XConfigureEvent *ev = &e->xconfigure; int dirty; /* TODO: updategeom handling sucks, needs to be simplified */ @@ -795,9 +1288,15 @@ configurenotify(XEvent *e) drw_resize(drw, sw, sh); updatebars(); for (m = mons; m; m = m->next) { + #if !FAKEFULLSCREEN_PATCH for (c = m->clients; c; c = c->next) + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && c->fakefullscreen != 1) + #else if (c->isfullscreen) + #endif // FAKEFULLSCREEN_CLIENT_PATCH resizeclient(c, m->mx, m->my, m->mw, m->mh); + #endif // !FAKEFULLSCREEN_PATCH for (bar = m->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); } @@ -812,6 +1311,9 @@ configurerequest(XEvent *e) { Client *c; Monitor *m; + #if BAR_ANYBAR_PATCH + Bar *bar; + #endif // BAR_ANYBAR_PATCH XConfigureRequestEvent *ev = &e->xconfigurerequest; XWindowChanges wc; @@ -823,6 +1325,18 @@ configurerequest(XEvent *e) c->bw = ev->border_width; else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { m = c->mon; + #if STEAM_PATCH + if (!c->issteam) { + if (ev->value_mask & CWX) { + c->oldx = c->x; + c->x = m->mx + ev->x; + } + if (ev->value_mask & CWY) { + c->oldy = c->y; + c->y = m->my + ev->y; + } + } + #else if (ev->value_mask & CWX) { c->oldx = c->x; c->x = m->mx + ev->x; @@ -831,6 +1345,7 @@ configurerequest(XEvent *e) c->oldy = c->y; c->y = m->my + ev->y; } + #endif // STEAM_PATCH if (ev->value_mask & CWWidth) { c->oldw = c->w; c->w = ev->width; @@ -847,11 +1362,24 @@ configurerequest(XEvent *e) configure(c); if (ISVISIBLE(c)) XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); + #if AUTORESIZE_PATCH + else + c->needresize = 1; + #endif // AUTORESIZE_PATCH } else configure(c); } else { wc.x = ev->x; wc.y = ev->y; + #if BAR_ANYBAR_PATCH + m = wintomon(ev->window); + for (bar = m->bar; bar; bar = bar->next) { + if (bar->win == ev->window) { + wc.y = bar->by; + wc.x = bar->bx; + } + } + #endif // BAR_ANYBAR_PATCH wc.width = ev->width; wc.height = ev->height; wc.border_width = ev->border_width; @@ -867,24 +1395,70 @@ createmon(void) { Monitor *m, *mon; int i, n, mi, max_bars = 2, istopbar = topbar; + #if MONITOR_RULES_PATCH + int layout; + #endif // MONITOR_RULES_PATCH const BarRule *br; Bar *bar; + #if MONITOR_RULES_PATCH + int j; + const MonitorRule *mr; + #endif // MONITOR_RULES_PATCH m = ecalloc(1, sizeof(Monitor)); + #if EMPTYVIEW_PATCH + m->tagset[0] = m->tagset[1] = 0; + #else m->tagset[0] = m->tagset[1] = 1; + #endif // EMPTYVIEW_PATCH m->mfact = mfact; m->nmaster = nmaster; + #if FLEXTILE_DELUXE_LAYOUT + m->nstack = nstack; + #endif // FLEXTILE_DELUXE_LAYOUT m->showbar = showbar; + #if SETBORDERPX_PATCH + m->borderpx = borderpx; + #endif // SETBORDERPX_PATCH + #if VANITYGAPS_PATCH m->gappih = gappih; m->gappiv = gappiv; m->gappoh = gappoh; m->gappov = gappov; + #endif // VANITYGAPS_PATCH for (mi = 0, mon = mons; mon; mon = mon->next, mi++); // monitor index m->index = mi; + #if MONITOR_RULES_PATCH + for (j = 0; j < LENGTH(monrules); j++) { + mr = &monrules[j]; + if ((mr->monitor == -1 || mr->monitor == mi) + #if PERTAG_PATCH + && (mr->tag <= 0 || (m->tagset[0] & (1 << (mr->tag - 1)))) + #endif // PERTAG_PATCH + ) { + layout = MAX(mr->layout, 0); + layout = MIN(layout, LENGTH(layouts) - 1); + m->lt[0] = &layouts[layout]; + m->lt[1] = &layouts[1 % LENGTH(layouts)]; + strncpy(m->ltsymbol, layouts[layout].symbol, sizeof m->ltsymbol); + + if (mr->mfact > -1) + m->mfact = mr->mfact; + if (mr->nmaster > -1) + m->nmaster = mr->nmaster; + if (mr->showbar > -1) + m->showbar = mr->showbar; + if (mr->topbar > -1) + istopbar = mr->topbar; + break; + } + } + #else m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); + #endif // MONITOR_RULES_PATCH /* Derive the number of bars for this monitor based on bar rules */ for (n = -1, i = 0; i < LENGTH(barrules); i++) { @@ -903,32 +1477,92 @@ createmon(void) istopbar = !istopbar; bar->showbar = 1; bar->external = 0; + #if BAR_BORDER_PATCH + bar->borderpx = borderpx; + #else bar->borderpx = 0; + #endif // BAR_BORDER_PATCH bar->bh = bh + bar->borderpx * 2; bar->borderscheme = SchemeNorm; } + #if FLEXTILE_DELUXE_LAYOUT + m->ltaxis[LAYOUT] = m->lt[0]->preset.layout; + m->ltaxis[MASTER] = m->lt[0]->preset.masteraxis; + m->ltaxis[STACK] = m->lt[0]->preset.stack1axis; + m->ltaxis[STACK2] = m->lt[0]->preset.stack2axis; + #endif // FLEXTILE_DELUXE_LAYOUT + #if PERTAG_PATCH if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag)))) die("fatal: could not malloc() %u bytes\n", sizeof(Pertag)); m->pertag->curtag = m->pertag->prevtag = 1; for (i = 0; i <= NUMTAGS; i++) { + #if FLEXTILE_DELUXE_LAYOUT + m->pertag->nstacks[i] = m->nstack; + #endif // FLEXTILE_DELUXE_LAYOUT + #if !MONITOR_RULES_PATCH /* init nmaster */ m->pertag->nmasters[i] = m->nmaster; /* init mfacts */ m->pertag->mfacts[i] = m->mfact; + #if PERTAGBAR_PATCH + /* init showbar */ + m->pertag->showbars[i] = m->showbar; + #endif // PERTAGBAR_PATCH + #endif // MONITOR_RULES_PATCH + #if ZOOMSWAP_PATCH + m->pertag->prevzooms[i] = NULL; + #endif // ZOOMSWAP_PATCH /* init layouts */ + #if MONITOR_RULES_PATCH + for (j = 0; j < LENGTH(monrules); j++) { + mr = &monrules[j]; + if ((mr->monitor == -1 || mr->monitor == mi) && (mr->tag == -1 || mr->tag == i)) { + layout = MAX(mr->layout, 0); + layout = MIN(layout, LENGTH(layouts) - 1); + m->pertag->ltidxs[i][0] = &layouts[layout]; + m->pertag->ltidxs[i][1] = m->lt[0]; + m->pertag->nmasters[i] = (mr->nmaster > -1 ? mr->nmaster : m->nmaster); + m->pertag->mfacts[i] = (mr->mfact > -1 ? mr->mfact : m->mfact); + #if PERTAGBAR_PATCH + m->pertag->showbars[i] = (mr->showbar > -1 ? mr->showbar : m->showbar); + #endif // PERTAGBAR_PATCH + #if FLEXTILE_DELUXE_LAYOUT + m->pertag->ltaxis[i][LAYOUT] = m->pertag->ltidxs[i][0]->preset.layout; + m->pertag->ltaxis[i][MASTER] = m->pertag->ltidxs[i][0]->preset.masteraxis; + m->pertag->ltaxis[i][STACK] = m->pertag->ltidxs[i][0]->preset.stack1axis; + m->pertag->ltaxis[i][STACK2] = m->pertag->ltidxs[i][0]->preset.stack2axis; + #endif // FLEXTILE_DELUXE_LAYOUT + break; + } + } + #else m->pertag->ltidxs[i][0] = m->lt[0]; m->pertag->ltidxs[i][1] = m->lt[1]; + #if FLEXTILE_DELUXE_LAYOUT + /* init flextile axes */ + m->pertag->ltaxis[i][LAYOUT] = m->ltaxis[LAYOUT]; + m->pertag->ltaxis[i][MASTER] = m->ltaxis[MASTER]; + m->pertag->ltaxis[i][STACK] = m->ltaxis[STACK]; + m->pertag->ltaxis[i][STACK2] = m->ltaxis[STACK2]; + #endif // FLEXTILE_DELUXE_LAYOUT + #endif // MONITOR_RULES_PATCH m->pertag->sellts[i] = m->sellt; + #if VANITYGAPS_PATCH m->pertag->enablegaps[i] = 1; + #endif // VANITYGAPS_PATCH } + #endif // PERTAG_PATCH + #if INSETS_PATCH + m->inset = default_inset; + #endif // INSETS_PATCH return m; } @@ -936,14 +1570,35 @@ void destroynotify(XEvent *e) { Client *c; + #if BAR_ANYBAR_PATCH + Monitor *m; + Bar *bar; + #endif // BAR_ANYBAR_PATCH XDestroyWindowEvent *ev = &e->xdestroywindow; if ((c = wintoclient(ev->window))) unmanage(c, 1); + #if SWALLOW_PATCH + else if ((c = swallowingclient(ev->window))) + unmanage(c->swallowing, 1); + #endif // SWALLOW_PATCH + #if BAR_SYSTRAY_PATCH else if (showsystray && (c = wintosystrayicon(ev->window))) { removesystrayicon(c); drawbarwin(systray->bar); } + #endif // BAR_SYSTRAY_PATCH + #if BAR_ANYBAR_PATCH + else { + m = wintomon(ev->window); + for (bar = m->bar; bar; bar = bar->next) { + if (bar->win == ev->window) { + unmanagealtbar(ev->window); + break; + } + } + } + #endif // BAR_ANYBAR_PATCH } void @@ -1121,11 +1776,14 @@ drawbarwin(Bar *bar) drw_map(drw, bar->win, 0, 0, bar->bw, bar->bh); } +#if !FOCUSONCLICK_PATCH void enternotify(XEvent *e) { Client *c; + #if LOSEFULLSCREEN_PATCH Client *sel; + #endif // LOSEFULLSCREEN_PATCH Monitor *m; XCrossingEvent *ev = &e->xcrossing; @@ -1134,13 +1792,19 @@ enternotify(XEvent *e) c = wintoclient(ev->window); m = c ? c->mon : wintomon(ev->window); if (m != selmon) { + #if LOSEFULLSCREEN_PATCH sel = selmon->sel; selmon = m; unfocus(sel, 1, c); + #else + unfocus(selmon->sel, 1, c); + selmon = m; + #endif // LOSEFULLSCREEN_PATCH } else if (!c || c == selmon->sel) return; focus(c); } +#endif // FOCUSONCLICK_PATCH void expose(XEvent *e) @@ -1167,10 +1831,12 @@ focus(Client *c) detachstack(c); attachstack(c); grabbuttons(c, 1); + #if !BAR_FLEXWINTITLE_PATCH if (c->isfloating) XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); else XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); + #endif // BAR_FLEXWINTITLE_PATCH setfocus(c); } else { XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); @@ -1179,6 +1845,12 @@ focus(Client *c) selmon->sel = c; drawbars(); + #if ON_EMPTY_KEYS_PATCH + if ((isempty && selmon->sel) || (!isempty && !selmon->sel)) { + isempty = !isempty; + grabkeys(); + } + #endif // ON_EMPTY_KEYS_PATCH } /* there are some broken focus acquiring clients needing extra handling */ @@ -1195,18 +1867,29 @@ void focusmon(const Arg *arg) { Monitor *m; + #if LOSEFULLSCREEN_PATCH Client *sel; + #endif // LOSEFULLSCREEN_PATCH if (!mons->next) return; if ((m = dirtomon(arg->i)) == selmon) return; + #if LOSEFULLSCREEN_PATCH sel = selmon->sel; selmon = m; unfocus(sel, 0, NULL); + #else + unfocus(selmon->sel, 0, NULL); + selmon = m; + #endif // LOSEFULLSCREEN_PATCH focus(NULL); + #if WARP_PATCH + warp(selmon->sel); + #endif // WARP_PATCH } +#if !STACKER_PATCH void focusstack(const Arg *arg) { @@ -1214,8 +1897,25 @@ focusstack(const Arg *arg) if (!selmon->sel) return; + #if ALWAYSFULLSCREEN_PATCH if (selmon->sel->isfullscreen) return; + #endif // ALWAYSFULLSCREEN_PATCH + #if BAR_WINTITLEACTIONS_PATCH + if (arg->i > 0) { + for (c = selmon->sel->next; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next); + if (!c) + for (c = selmon->clients; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next); + } else { + for (i = selmon->clients; i != selmon->sel; i = i->next) + if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i))) + c = i; + if (!c) + for (; i; i = i->next) + if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i))) + c = i; + } + #else if (arg->i > 0) { for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); if (!c) @@ -1229,11 +1929,13 @@ focusstack(const Arg *arg) if (ISVISIBLE(i)) c = i; } + #endif // BAR_WINTITLEACTIONS_PATCH if (c) { focus(c); restack(selmon); } } +#endif // STACKER_PATCH Atom getatomprop(Client *c, Atom prop) @@ -1243,6 +1945,7 @@ getatomprop(Client *c, Atom prop) unsigned char *p = NULL; Atom da, atom = None; + #if BAR_SYSTRAY_PATCH /* FIXME getatomprop should return the number of items and a pointer to * the stored data instead of this workaround */ Atom req = XA_ATOM; @@ -1256,6 +1959,13 @@ getatomprop(Client *c, Atom prop) atom = ((Atom *)p)[1]; XFree(p); } + #else + if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, + &da, &di, &dl, &dl, &p) == Success && p) { + atom = *(Atom *)p; + XFree(p); + } + #endif // BAR_SYSTRAY_PATCH return atom; } @@ -1325,6 +2035,9 @@ grabbuttons(Client *c, int focused) BUTTONMASK, GrabModeSync, GrabModeSync, None, None); for (i = 0; i < LENGTH(buttons); i++) if (buttons[i].click == ClkClientWin + #if NO_MOD_BUTTONS_PATCH + && (nomodbuttons || buttons[i].mask != 0) + #endif // NO_MOD_BUTTONS_PATCH ) for (j = 0; j < LENGTH(modifiers); j++) XGrabButton(dpy, buttons[i].button, @@ -1335,7 +2048,11 @@ grabbuttons(Client *c, int focused) } void +#if KEYMODES_PATCH +grabdefkeys(void) +#else grabkeys(void) +#endif // KEYMODES_PATCH { updatenumlockmask(); { @@ -1349,13 +2066,25 @@ grabkeys(void) for (j = 0; j < LENGTH(modifiers); j++) XGrabKey(dpy, code, keys[i].mod | modifiers[j], root, True, GrabModeAsync, GrabModeAsync); + #if ON_EMPTY_KEYS_PATCH + if (!selmon->sel) + for (i = 0; i < LENGTH(on_empty_keys); i++) + if ((code = XKeysymToKeycode(dpy, on_empty_keys[i].keysym))) + for (j = 0; j < LENGTH(modifiers); j++) + XGrabKey(dpy, code, on_empty_keys[i].mod | modifiers[j], root, + True, GrabModeAsync, GrabModeAsync); + #endif // ON_EMPTY_KEYS_PATCH } } void incnmaster(const Arg *arg) { + #if PERTAG_PATCH selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); + #else + selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); + #endif // PERTAG_PATCH arrange(selmon); } @@ -1372,7 +2101,11 @@ isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) #endif /* XINERAMA */ void +#if KEYMODES_PATCH +keydefpress(XEvent *e) +#else keypress(XEvent *e) +#endif // KEYMODES_PATCH { unsigned int i; int keysyms_return; @@ -1386,15 +2119,31 @@ keypress(XEvent *e) && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && keys[i].func) keys[i].func(&(keys[i].arg)); + #if ON_EMPTY_KEYS_PATCH + if (!selmon->sel) + for (i = 0; i < LENGTH(on_empty_keys); i++) + if (*keysym == on_empty_keys[i].keysym + && CLEANMASK(on_empty_keys[i].mod) == CLEANMASK(ev->state) + && on_empty_keys[i].func) + on_empty_keys[i].func(&(on_empty_keys[i].arg)); + #endif // ON_EMPTY_KEYS_PATCH XFree(keysym); } void killclient(const Arg *arg) { + #if ISPERMANENT_PATCH + if (!selmon->sel || selmon->sel->ispermanent) + #else if (!selmon->sel) + #endif // ISPERMANENT_PATCH return; + #if BAR_SYSTRAY_PATCH if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) + #else + if (!sendevent(selmon->sel, wmatom[WMDelete])) + #endif // BAR_SYSTRAY_PATCH { XGrabServer(dpy); XSetErrorHandler(xerrordummy); @@ -1403,33 +2152,77 @@ killclient(const Arg *arg) XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); + #if WARP_PATCH + force_warp = 1; + #endif // WARP_PATCH } + #if SWAPFOCUS_PATCH && PERTAG_PATCH + selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; + #endif // SWAPFOCUS_PATCH } void manage(Window w, XWindowAttributes *wa) { Client *c, *t = NULL; + #if SWALLOW_PATCH + Client *term = NULL; + #endif // SWALLOW_PATCH Window trans = None; XWindowChanges wc; c = ecalloc(1, sizeof(Client)); c->win = w; + #if SWALLOW_PATCH + c->pid = winpid(w); + #endif // SWALLOW_PATCH /* geometry */ c->x = c->oldx = wa->x; c->y = c->oldy = wa->y; c->w = c->oldw = wa->width; c->h = c->oldh = wa->height; c->oldbw = wa->border_width; + #if CFACTS_PATCH + c->cfact = 1.0; + #endif // CFACTS_PATCH updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { c->mon = t->mon; c->tags = t->tags; + #if SETBORDERPX_PATCH + c->bw = c->mon->borderpx; + #else c->bw = borderpx; + #endif // SETBORDERPX_PATCH + #if CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH + c->x = t->x + WIDTH(t) / 2 - WIDTH(c) / 2; + c->y = t->y + HEIGHT(t) / 2 - HEIGHT(c) / 2; + #elif CENTER_PATCH && CENTER_TRANSIENT_WINDOWS_PATCH + c->iscentered = 1; + #elif CENTER_TRANSIENT_WINDOWS_PATCH + c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; + c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; + #elif CENTER_PATCH + if (c->x == c->mon->wx && c->y == c->mon->wy) + c->iscentered = 1; + #endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH } else { c->mon = selmon; + #if CENTER_PATCH + if (c->x == c->mon->wx && c->y == c->mon->wy) + c->iscentered = 1; + #endif // CENTER_PATCH + #if SETBORDERPX_PATCH + c->bw = c->mon->borderpx; + #else c->bw = borderpx; + #endif // SETBORDERPX_PATCH applyrules(c); + #if SWALLOW_PATCH + term = termforwin(c); + if (term) + c->mon = term->mon; + #endif // SWALLOW_PATCH } if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) @@ -1443,21 +2236,43 @@ manage(Window w, XWindowAttributes *wa) wc.border_width = c->bw; XConfigureWindow(dpy, w, CWBorderWidth, &wc); + #if !BAR_FLEXWINTITLE_PATCH if (c->isfloating) XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel); else XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); + #endif // BAR_FLEXWINTITLE_PATCH configure(c); /* propagates border_width, if size doesn't change */ + #if !FLOATPOS_PATCH + updatesizehints(c); + #endif // FLOATPOS_PATCH if (getatomprop(c, netatom[NetWMState]) == netatom[NetWMFullscreen]) setfullscreen(c, 1); updatewmhints(c); + #if DECORATION_HINTS_PATCH + updatemotifhints(c); + #endif // DECORATION_HINTS_PATCH + #if CENTER_PATCH + if (c->iscentered) { + c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; + c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; + } + #endif // CENTER_PATCH + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH c->sfx = -9999; c->sfy = -9999; c->sfw = c->w; c->sfh = c->h; + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); grabbuttons(c, 0); + #if MAXIMIZE_PATCH + c->wasfloating = 0; + c->ismax = 0; + #elif EXRESIZE_PATCH + c->wasfloating = 0; + #endif // MAXIMIZE_PATCH / EXRESIZE_PATCH if (!c->isfloating) c->isfloating = c->oldstate = trans != None || c->isfixed; @@ -1465,20 +2280,73 @@ manage(Window w, XWindowAttributes *wa) XRaiseWindow(dpy, c->win); XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel); } + #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH + attachx(c); + #else attach(c); + #endif attachstack(c); XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); + #if NET_CLIENT_LIST_STACKING_PATCH + XChangeProperty(dpy, root, netatom[NetClientListStacking], XA_WINDOW, 32, PropModePrepend, + (unsigned char *) &(c->win), 1); + #endif // NET_CLIENT_LIST_STACKING_PATCH XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ + #if BAR_WINTITLEACTIONS_PATCH + if (!HIDDEN(c)) + setclientstate(c, NormalState); + #else setclientstate(c, NormalState); + #endif // BAR_WINTITLEACTIONS_PATCH if (c->mon == selmon) unfocus(selmon->sel, 0, c); c->mon->sel = c; + #if SWALLOW_PATCH + if (!(term && swallow(term, c))) { + #if RIODRAW_PATCH + if (riopid && (!riodraw_matchpid || isdescprocess(riopid, c->pid))) { + if (riodimensions[3] != -1) + rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); + else { + killclient(&((Arg) { .v = c })); + return; + } + } + #endif // RIODRAW_PATCH + arrange(c->mon); + #if BAR_WINTITLEACTIONS_PATCH + if (!HIDDEN(c)) + XMapWindow(dpy, c->win); + #else + XMapWindow(dpy, c->win); + #endif // BAR_WINTITLEACTIONS_PATCH + } + #else + #if RIODRAW_PATCH + if (riopid) { + if (riodimensions[3] != -1) + rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); + else { + killclient(&((Arg) { .v = c })); + return; + } + } + #endif // RIODRAW_PATCH arrange(c->mon); + #if BAR_WINTITLEACTIONS_PATCH + if (!HIDDEN(c)) + XMapWindow(dpy, c->win); + #else XMapWindow(dpy, c->win); + #endif // BAR_WINTITLEACTIONS_PATCH + #endif // SWALLOW_PATCH focus(NULL); + #if BAR_EWMHTAGS_PATCH + setfloatinghint(c); + #endif // BAR_EWMHTAGS_PATCH } void @@ -1497,38 +2365,54 @@ maprequest(XEvent *e) static XWindowAttributes wa; XMapRequestEvent *ev = &e->xmaprequest; + #if BAR_SYSTRAY_PATCH Client *i; if (showsystray && systray && (i = wintosystrayicon(ev->window))) { sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); drawbarwin(systray->bar); } + #endif // BAR_SYSTRAY_PATCH if (!XGetWindowAttributes(dpy, ev->window, &wa)) return; if (wa.override_redirect) return; + #if BAR_ANYBAR_PATCH + if (wmclasscontains(ev->window, altbarclass, "")) + managealtbar(ev->window, &wa); + else + #endif // BAR_ANYBAR_PATCH if (!wintoclient(ev->window)) manage(ev->window, &wa); } +#if !FOCUSONCLICK_PATCH void motionnotify(XEvent *e) { static Monitor *mon = NULL; Monitor *m; + #if LOSEFULLSCREEN_PATCH Client *sel; + #endif // LOSEFULLSCREEN_PATCH XMotionEvent *ev = &e->xmotion; if (ev->window != root) return; if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { + #if LOSEFULLSCREEN_PATCH sel = selmon->sel; selmon = m; unfocus(sel, 1, NULL); + #else + unfocus(selmon->sel, 1, NULL); + selmon = m; + #endif // LOSEFULLSCREEN_PATCH focus(NULL); } mon = m; } +#endif // FOCUSONCLICK_PATCH void movemouse(const Arg *arg) @@ -1541,8 +2425,15 @@ movemouse(const Arg *arg) if (!(c = selmon->sel)) return; + #if !FAKEFULLSCREEN_PATCH + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && c->fakefullscreen != 1) /* no support moving fullscreen windows by mouse */ + return; + #else if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ return; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #endif // FAKEFULLSCREEN_PATCH restack(selmon); ocx = c->x; ocy = c->y; @@ -1577,38 +2468,57 @@ movemouse(const Arg *arg) ny = selmon->wy + selmon->wh - HEIGHT(c); if (!c->isfloating && selmon->lt[selmon->sellt]->arrange && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) { + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH c->sfx = -9999; // disable savefloats when using movemouse + #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH togglefloating(NULL); } if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH resize(c, nx, ny, c->w, c->h, 1); /* save last known float coordinates */ c->sfx = nx; c->sfy = ny; + #else + resize(c, nx, ny, c->w, c->h, 1); + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH } + #if ROUNDED_CORNERS_PATCH + drawroundedcorners(c); + #endif // ROUNDED_CORNERS_PATCH break; } } while (ev.type != ButtonRelease); XUngrabPointer(dpy, CurrentTime); if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { + #if SCRATCHPADS_PATCH if (c->tags & SPTAGMASK) { c->mon->tagset[c->mon->seltags] ^= (c->tags & SPTAGMASK); m->tagset[m->seltags] |= (c->tags & SPTAGMASK); } + #endif // SCRATCHPADS_PATCH sendmon(c, m); selmon = m; focus(NULL); } + #if ROUNDED_CORNERS_PATCH + drawroundedcorners(c); + #endif // ROUNDED_CORNERS_PATCH ignoreconfigurerequests = 0; } Client * nexttiled(Client *c) { + #if BAR_WINTITLEACTIONS_PATCH + for (; c && (c->isfloating || !ISVISIBLE(c) || HIDDEN(c)); c = c->next); + #else for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); + #endif // BAR_WINTITLEACTIONS_PATCH return c; } +#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH void pop(Client *c) { @@ -1617,6 +2527,7 @@ pop(Client *c) focus(c); arrange(c->mon); } +#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH void propertynotify(XEvent *e) @@ -1625,6 +2536,7 @@ propertynotify(XEvent *e) Window trans; XPropertyEvent *ev = &e->xproperty; + #if BAR_SYSTRAY_PATCH if (showsystray && (c = wintosystrayicon(ev->window))) { if (ev->atom == XA_WM_NORMAL_HINTS) { updatesizehints(c); @@ -1634,9 +2546,15 @@ propertynotify(XEvent *e) updatesystrayiconstate(c, ev); drawbarwin(systray->bar); } + #endif // BAR_SYSTRAY_PATCH if ((ev->window == root) && (ev->atom == XA_WM_NAME)) { + #if DWMC_PATCH || FSIGNAL_PATCH + if (!fake_signal()) + updatestatus(); + #else updatestatus(); + #endif // DWMC_PATCH / FSIGNAL_PATCH } else if (ev->state == PropertyDelete) { return; /* ignore */ } else if ((c = wintoclient(ev->window))) { @@ -1661,14 +2579,58 @@ propertynotify(XEvent *e) if (c == c->mon->sel) drawbar(c->mon); } + #if DECORATION_HINTS_PATCH + if (ev->atom == motifatom) + updatemotifhints(c); + #endif // DECORATION_HINTS_PATCH } } void quit(const Arg *arg) { + #if COOL_AUTOSTART_PATCH + size_t i; + #endif // COOL_AUTOSTART_PATCH + #if ONLYQUITONEMPTY_PATCH + unsigned int n; + Window *junk = malloc(1); + + XQueryTree(dpy, root, junk, junk, &junk, &n); + + #if COOL_AUTOSTART_PATCH + if (n - autostart_len <= quit_empty_window_count) + #else + if (n <= quit_empty_window_count) + #endif // COOL_AUTOSTART_PATCH + { + #if RESTARTSIG_PATCH + if (arg->i) + restart = 1; + #endif // RESTARTSIG_PATCH + running = 0; + } + else + printf("[dwm] not exiting (n=%d)\n", n); + + free(junk); + #else + #if RESTARTSIG_PATCH + if (arg->i) + restart = 1; + #endif // RESTARTSIG_PATCH running = 0; - + #endif // ONLYQUITONEMPTY_PATCH + + #if COOL_AUTOSTART_PATCH + /* kill child processes */ + for (i = 0; i < autostart_len; i++) { + if (0 < autostart_pids[i]) { + kill(autostart_pids[i], SIGTERM); + waitpid(autostart_pids[i], NULL, 0); + } + } + #endif // COOL_AUTOSTART_PATCH } Monitor * @@ -1701,16 +2663,66 @@ resizeclient(Client *c, int x, int y, int w, int h) c->oldy = c->y; c->y = wc.y = y; c->oldw = c->w; c->w = wc.width = w; c->oldh = c->h; c->h = wc.height = h; + #if EXRESIZE_PATCH + c->expandmask = 0; + #endif // EXRESIZE_PATCH wc.border_width = c->bw; + #if NOBORDER_PATCH + if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) + #if MONOCLE_LAYOUT + || &monocle == c->mon->lt[c->mon->sellt]->arrange + #endif // MONOCLE_LAYOUT + #if DECK_LAYOUT + || (&deck == c->mon->lt[c->mon->sellt]->arrange && + c->mon->nmaster == 0) + #endif // DECK_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + || (&flextile == c->mon->lt[c->mon->sellt]->arrange && ( + (c->mon->ltaxis[LAYOUT] == NO_SPLIT && + c->mon->ltaxis[MASTER] == MONOCLE) || + (c->mon->ltaxis[STACK] == MONOCLE && + c->mon->nmaster == 0))) + #endif //FLEXTILE_DELUXE_LAYOUT + ) + #if FAKEFULLSCREEN_CLIENT_PATCH + && (c->fakefullscreen == 1 || !c->isfullscreen) + #else + && !c->isfullscreen + #endif // FAKEFULLSCREEN_CLIENT_PATCH + && !c->isfloating + && c->mon->lt[c->mon->sellt]->arrange) { + wc.width += c->bw * 2; + wc.height += c->bw * 2; + wc.border_width = 0; + } + #endif // NOBORDER_PATCH XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen == 1) + /* Exception: if the client was in actual fullscreen and we exit out to fake fullscreen + * mode, then the focus would drift to whichever window is under the mouse cursor at the + * time. To avoid this we pass True to XSync which will make the X server disregard any + * other events in the queue thus cancelling the EnterNotify event that would otherwise + * have changed focus. */ + XSync(dpy, True); + else + XSync(dpy, False); + #else XSync(dpy, False); + #endif // FAKEFULLSCREEN_CLIENT_PATCH } void resizemouse(const Arg *arg) { int ocx, ocy, nw, nh; + #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH + int opx, opy, och, ocw, nx, ny; + int horizcorner, vertcorner; + unsigned int dui; + Window dummy; + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH Client *c; Monitor *m; XEvent ev; @@ -1718,15 +2730,44 @@ resizemouse(const Arg *arg) if (!(c = selmon->sel)) return; + #if !FAKEFULLSCREEN_PATCH + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && c->fakefullscreen != 1) /* no support resizing fullscreen windows by mouse */ + return; + #else if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ return; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #endif // !FAKEFULLSCREEN_PATCH restack(selmon); ocx = c->x; ocy = c->y; + #if RESIZEPOINT_PATCH + och = c->h; + ocw = c->w; + #elif RESIZECORNERS_PATCH + och = c->y + c->h; + ocw = c->x + c->w; + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH + #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH + if (!XQueryPointer(dpy, c->win, &dummy, &dummy, &opx, &opy, &nx, &ny, &dui)) + return; + horizcorner = nx < c->w / 2; + vertcorner = ny < c->h / 2; + if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, + None, cursor[horizcorner | (vertcorner << 1)]->cursor, CurrentTime) != GrabSuccess) + return; + #if RESIZECORNERS_PATCH + XWarpPointer (dpy, None, c->win, 0, 0, 0, 0, + horizcorner ? (-c->bw) : (c->w + c->bw - 1), + vertcorner ? (-c->bw) : (c->h + c->bw - 1)); + #endif // RESIZECORNERS_PATCH + #else if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) return; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH ignoreconfigurerequests = 1; do { XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); @@ -1741,35 +2782,75 @@ resizemouse(const Arg *arg) continue; lasttime = ev.xmotion.time; + #if RESIZEPOINT_PATCH + nx = horizcorner ? (ocx + ev.xmotion.x - opx) : c->x; + ny = vertcorner ? (ocy + ev.xmotion.y - opy) : c->y; + nw = MAX(horizcorner ? (ocx + ocw - nx) : (ocw + (ev.xmotion.x - opx)), 1); + nh = MAX(vertcorner ? (ocy + och - ny) : (och + (ev.xmotion.y - opy)), 1); + #elif RESIZECORNERS_PATCH + nx = horizcorner ? ev.xmotion.x : c->x; + ny = vertcorner ? ev.xmotion.y : c->y; + nw = MAX(horizcorner ? (ocw - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1); + nh = MAX(vertcorner ? (och - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1); + #else nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) { if (!c->isfloating && selmon->lt[selmon->sellt]->arrange && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) { + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH c->sfx = -9999; // disable savefloats when using resizemouse + #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH togglefloating(NULL); } } if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { + #if RESIZECORNERS_PATCH || RESIZEPOINT_PATCH + resizeclient(c, nx, ny, nw, nh); + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH + /* save last known float dimensions */ + c->sfx = nx; + c->sfy = ny; + c->sfw = nw; + c->sfh = nh; + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH + #else resize(c, c->x, c->y, nw, nh, 1); + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH c->sfx = c->x; c->sfy = c->y; c->sfw = nw; c->sfh = nh; + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH + #endif // RESIZECORNERS_PATCH + #if ROUNDED_CORNERS_PATCH + drawroundedcorners(c); + #endif // ROUNDED_CORNERS_PATCH } break; } } while (ev.type != ButtonRelease); + #if !RESIZEPOINT_PATCH + #if RESIZECORNERS_PATCH + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, + horizcorner ? (-c->bw) : (c->w + c->bw - 1), + vertcorner ? (-c->bw) : (c->h + c->bw - 1)); + #else XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); + #endif // RESIZECORNERS_PATCH + #endif // RESIZEPOINT_PATCH XUngrabPointer(dpy, CurrentTime); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { + #if SCRATCHPADS_PATCH if (c->tags & SPTAGMASK) { c->mon->tagset[c->mon->seltags] ^= (c->tags & SPTAGMASK); m->tagset[m->seltags] |= (c->tags & SPTAGMASK); } + #endif // SCRATCHPADS_PATCH sendmon(c, m); selmon = m; focus(NULL); @@ -1783,6 +2864,9 @@ restack(Monitor *m) Client *c; XEvent ev; XWindowChanges wc; + #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT + int n; + #endif // WARP_PATCH drawbar(m); if (!m->sel) @@ -1800,8 +2884,65 @@ restack(Monitor *m) } XSync(dpy, False); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); + #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT || WARP_PATCH && MONOCLE_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // FLEXTILE_DELUXE_LAYOUT + if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && ( + #if MONOCLE_LAYOUT && FLEXTILE_DELUXE_LAYOUT + (m->lt[m->sellt]->arrange != &monocle + && !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster)))) + #elif MONOCLE_LAYOUT + m->lt[m->sellt]->arrange != &monocle + #else + !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster))) + #endif // FLEXTILE_DELUXE_LAYOUT + || m->sel->isfloating) + ) + warp(m->sel); + #endif // WARP_PATCH } +#if IPC_PATCH +void +run(void) +{ + int event_count = 0; + const int MAX_EVENTS = 10; + struct epoll_event events[MAX_EVENTS]; + + XSync(dpy, False); + + /* main event loop */ + while (running) { + event_count = epoll_wait(epoll_fd, events, MAX_EVENTS, -1); + + for (int i = 0; i < event_count; i++) { + int event_fd = events[i].data.fd; + DEBUG("Got event from fd %d\n", event_fd); + + if (event_fd == dpy_fd) { + // -1 means EPOLLHUP + if (handlexevent(events + i) == -1) + return; + } else if (event_fd == ipc_get_sock_fd()) { + ipc_handle_socket_epoll_event(events + i); + } else if (ipc_is_client_registered(event_fd)) { + if (ipc_handle_client_epoll_event(events + i, mons, &lastselmon, selmon, + NUMTAGS, layouts, LENGTH(layouts)) < 0) { + fprintf(stderr, "Error handling IPC event on fd %d\n", event_fd); + } + } else { + fprintf(stderr, "Got event from unknown fd %d, ptr %p, u32 %d, u64 %lu", + event_fd, events[i].data.ptr, events[i].data.u32, + events[i].data.u64); + fprintf(stderr, " with events %d\n", events[i].events); + return; + } + } + } +} +#else void run(void) { @@ -1812,10 +2953,15 @@ run(void) if (handler[ev.type]) handler[ev.type](&ev); /* call handler */ } +#endif // IPC_PATCH void scan(void) { + #if SWALLOW_PATCH + scanner = 1; + char swin[256]; + #endif // SWALLOW_PATCH unsigned int i, num; Window d1, d2, *wins = NULL; XWindowAttributes wa; @@ -1825,8 +2971,17 @@ scan(void) if (!XGetWindowAttributes(dpy, wins[i], &wa) || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) continue; + #if BAR_ANYBAR_PATCH + if (wmclasscontains(wins[i], altbarclass, "")) + managealtbar(wins[i], &wa); + else + #endif // BAR_ANYBAR_PATCH if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) manage(wins[i], &wa); + #if SWALLOW_PATCH + else if (gettextprop(wins[i], netatom[NetClientList], swin, sizeof swin)) + manage(wins[i], &wa); + #endif // SWALLOW_PATCH } for (i = 0; i < num; i++) { /* now the transients */ if (!XGetWindowAttributes(dpy, wins[i], &wa)) @@ -1837,23 +2992,64 @@ scan(void) } XFree(wins); } + #if SWALLOW_PATCH + scanner = 0; + #endif // SWALLOW_PATCH } void sendmon(Client *c, Monitor *m) { + #if EXRESIZE_PATCH + Monitor *oldm = selmon; + #endif // EXRESIZE_PATCH if (c->mon == m) return; + #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH + int hadfocus = (c == selmon->sel); + #endif // SENDMON_KEEPFOCUS_PATCH unfocus(c, 1, NULL); detach(c); detachstack(c); + #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH + arrange(c->mon); + #endif // SENDMON_KEEPFOCUS_PATCH c->mon = m; + #if SCRATCHPADS_PATCH if (!(c->tags & SPTAGMASK)) + #endif // SCRATCHPADS_PATCH + #if EMPTYVIEW_PATCH + c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1); + #else c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ + #endif // EMPTYVIEW_PATCH + #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH + attachx(c); + #else attach(c); + #endif attachstack(c); + #if EXRESIZE_PATCH + if (oldm != m) + arrange(oldm); + arrange(m); + focus(c); + restack(m); + #elif SENDMON_KEEPFOCUS_PATCH + arrange(m); + if (hadfocus) { + focus(c); + restack(m); + } else + focus(NULL); + #else focus(NULL); arrange(NULL); + #endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH + #if SWITCHTAG_PATCH + if (c->switchtag) + c->switchtag = 0; + #endif // SWITCHTAG_PATCH } void @@ -1866,14 +3062,21 @@ setclientstate(Client *c, long state) } int +#if BAR_SYSTRAY_PATCH sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4) +#else +sendevent(Client *c, Atom proto) +#endif // BAR_SYSTRAY_PATCH { int n; Atom *protocols; + #if BAR_SYSTRAY_PATCH Atom mt; + #endif // BAR_SYSTRAY_PATCH int exists = 0; XEvent ev; + #if BAR_SYSTRAY_PATCH if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) { mt = wmatom[WMProtocols]; if (XGetWMProtocols(dpy, w, &protocols, &n)) { @@ -1885,8 +3088,16 @@ sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, lo exists = True; mt = proto; } + #else + if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { + while (!exists && n--) + exists = protocols[n] == proto; + XFree(protocols); + } + #endif // BAR_SYSTRAY_PATCH if (exists) { + #if BAR_SYSTRAY_PATCH ev.type = ClientMessage; ev.xclient.window = w; ev.xclient.message_type = mt; @@ -1897,6 +3108,15 @@ sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, lo ev.xclient.data.l[3] = d3; ev.xclient.data.l[4] = d4; XSendEvent(dpy, w, False, mask, &ev); + #else + ev.type = ClientMessage; + ev.xclient.window = c->win; + ev.xclient.message_type = wmatom[WMProtocols]; + ev.xclient.format = 32; + ev.xclient.data.l[0] = proto; + ev.xclient.data.l[1] = CurrentTime; + XSendEvent(dpy, c->win, False, NoEventMask, &ev); + #endif // BAR_SYSTRAY_PATCH } return exists; } @@ -1910,9 +3130,76 @@ setfocus(Client *c) XA_WINDOW, 32, PropModeReplace, (unsigned char *) &(c->win), 1); } + #if BAR_SYSTRAY_PATCH sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); + #else + sendevent(c, wmatom[WMTakeFocus]); + #endif // BAR_SYSTRAY_PATCH } +#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH +void +setfullscreen(Client *c, int fullscreen) +{ + int savestate = 0, restorestate = 0; + + if ((c->fakefullscreen == 0 && fullscreen && !c->isfullscreen) // normal fullscreen + || (c->fakefullscreen == 2 && fullscreen)) // fake fullscreen --> actual fullscreen + savestate = 1; // go actual fullscreen + else if ((c->fakefullscreen == 0 && !fullscreen && c->isfullscreen) // normal fullscreen exit + || (c->fakefullscreen >= 2 && !fullscreen)) // fullscreen exit --> fake fullscreen + restorestate = 1; // go back into tiled + + /* If leaving fullscreen and the window was previously fake fullscreen (2), then restore + * that while staying in fullscreen. The exception to this is if we are in said state, but + * the client itself disables fullscreen (3) then we let the client go out of fullscreen + * while keeping fake fullscreen enabled (as otherwise there will be a mismatch between the + * client and the window manager's perception of the client's fullscreen state). */ + if (c->fakefullscreen == 2 && !fullscreen && c->isfullscreen) { + c->fakefullscreen = 1; + c->isfullscreen = 1; + fullscreen = 1; + } else if (c->fakefullscreen == 3) // client exiting actual fullscreen + c->fakefullscreen = 1; + + if (fullscreen != c->isfullscreen) { // only send property change if necessary + if (fullscreen) + XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, + PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); + else + XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, + PropModeReplace, (unsigned char*)0, 0); + } + + c->isfullscreen = fullscreen; + + /* Some clients, e.g. firefox, will send a client message informing the window manager + * that it is going into fullscreen after receiving the above signal. This has the side + * effect of this function (setfullscreen) sometimes being called twice when toggling + * fullscreen on and off via the window manager as opposed to the application itself. + * To protect against obscure issues where the client settings are stored or restored + * when they are not supposed to we add an additional bit-lock on the old state so that + * settings can only be stored and restored in that precise order. */ + if (savestate && !(c->oldstate & (1 << 1))) { + c->oldbw = c->bw; + c->oldstate = c->isfloating | (1 << 1); + c->bw = 0; + c->isfloating = 1; + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } else if (restorestate && (c->oldstate & (1 << 1))) { + c->bw = c->oldbw; + c->isfloating = c->oldstate = c->oldstate & 1; + c->x = c->oldx; + c->y = c->oldy; + c->w = c->oldw; + c->h = c->oldh; + resizeclient(c, c->x, c->y, c->w, c->h); + restack(c->mon); + } else + resizeclient(c, c->x, c->y, c->w, c->h); +} +#else void setfullscreen(Client *c, int fullscreen) { @@ -1920,16 +3207,19 @@ setfullscreen(Client *c, int fullscreen) XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); c->isfullscreen = 1; + #if !FAKEFULLSCREEN_PATCH c->oldbw = c->bw; c->oldstate = c->isfloating; c->bw = 0; c->isfloating = 1; resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); XRaiseWindow(dpy, c->win); + #endif // !FAKEFULLSCREEN_PATCH } else if (!fullscreen && c->isfullscreen){ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)0, 0); c->isfullscreen = 0; + #if !FAKEFULLSCREEN_PATCH c->bw = c->oldbw; c->isfloating = c->oldstate; c->x = c->oldx; @@ -1938,20 +3228,59 @@ setfullscreen(Client *c, int fullscreen) c->h = c->oldh; resizeclient(c, c->x, c->y, c->w, c->h); arrange(c->mon); + #endif // !FAKEFULLSCREEN_PATCH } } +#endif // FAKEFULLSCREEN_CLIENT_PATCH void setlayout(const Arg *arg) { if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { + #if PERTAG_PATCH selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; + #else + selmon->sellt ^= 1; + #endif // PERTAG_PATCH + #if EXRESIZE_PATCH + if (!selmon->lt[selmon->sellt]->arrange) { + for (Client *c = selmon->clients ; c ; c = c->next) { + if (!c->isfloating) { + /*restore last known float dimensions*/ + resize(c, selmon->mx + c->sfx, selmon->my + c->sfy, + c->sfw, c->sfh, False); + } + } + } + #endif // EXRESIZE_PATCH } if (arg && arg->v) + #if PERTAG_PATCH selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - + #else + selmon->lt[selmon->sellt] = (Layout *)arg->v; + #endif // PERTAG_PATCH + + #if FLEXTILE_DELUXE_LAYOUT + if (selmon->lt[selmon->sellt]->preset.nmaster && selmon->lt[selmon->sellt]->preset.nmaster != -1) + selmon->nmaster = selmon->lt[selmon->sellt]->preset.nmaster; + if (selmon->lt[selmon->sellt]->preset.nstack && selmon->lt[selmon->sellt]->preset.nstack != -1) + selmon->nstack = selmon->lt[selmon->sellt]->preset.nstack; + + selmon->ltaxis[LAYOUT] = selmon->lt[selmon->sellt]->preset.layout; + selmon->ltaxis[MASTER] = selmon->lt[selmon->sellt]->preset.masteraxis; + selmon->ltaxis[STACK] = selmon->lt[selmon->sellt]->preset.stack1axis; + selmon->ltaxis[STACK2] = selmon->lt[selmon->sellt]->preset.stack2axis; + + #if PERTAG_PATCH + selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT] = selmon->ltaxis[LAYOUT]; + selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER] = selmon->ltaxis[MASTER]; + selmon->pertag->ltaxis[selmon->pertag->curtag][STACK] = selmon->ltaxis[STACK]; + selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2] = selmon->ltaxis[STACK2]; + #endif // PERTAG_PATCH + #endif // FLEXTILE_DELUXE_LAYOUT strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); if (selmon->sel) arrange(selmon); @@ -1970,7 +3299,11 @@ setmfact(const Arg *arg) f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; if (f < 0.05 || f > 0.95) return; + #if PERTAG_PATCH selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; + #else + selmon->mfact = f; + #endif // PERTAG_PATCH arrange(selmon); } @@ -1984,17 +3317,39 @@ setup(void) /* clean up any zombies immediately */ sigchld(0); + #if RESTARTSIG_PATCH + signal(SIGHUP, sighup); + signal(SIGTERM, sigterm); + #endif // RESTARTSIG_PATCH /* init screen */ screen = DefaultScreen(dpy); sw = DisplayWidth(dpy, screen); sh = DisplayHeight(dpy, screen); root = RootWindow(dpy, screen); + #if BAR_ALPHA_PATCH + xinitvisual(); + drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap); + #else drw = drw_create(dpy, screen, root, sw, sh); + #endif // BAR_ALPHA_PATCH + #if BAR_PANGO_PATCH + if (!drw_font_create(drw, font)) + #else if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) + #endif // BAR_PANGO_PATCH die("no fonts could be loaded."); + #if BAR_STATUSPADDING_PATCH + lrpad = drw->fonts->h + horizpadbar; + bh = drw->fonts->h + vertpadbar; + #else lrpad = drw->fonts->h; + #if BAR_HEIGHT_PATCH bh = bar_height ? bar_height : drw->fonts->h + 2; + #else + bh = drw->fonts->h + 2; + #endif // BAR_HEIGHT_PATCH + #endif // BAR_STATUSPADDING_PATCH updategeom(); /* init atoms */ utf8string = XInternAtom(dpy, "UTF8_STRING", False); @@ -2002,8 +3357,12 @@ setup(void) wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); + #if WINDOWROLERULE_PATCH + wmatom[WMWindowRole] = XInternAtom(dpy, "WM_WINDOW_ROLE", False); + #endif // WINDOWROLERULE_PATCH netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); + #if BAR_SYSTRAY_PATCH netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False); netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False); netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False); @@ -2013,21 +3372,78 @@ setup(void) xatom[Manager] = XInternAtom(dpy, "MANAGER", False); xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); + #endif // BAR_SYSTRAY_PATCH + #if BAR_EWMHTAGS_PATCH + netatom[NetDesktopViewport] = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False); + netatom[NetNumberOfDesktops] = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False); + netatom[NetCurrentDesktop] = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); + netatom[NetDesktopNames] = XInternAtom(dpy, "_NET_DESKTOP_NAMES", False); + #endif // BAR_EWMHTAGS_PATCH netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); + #if NET_CLIENT_LIST_STACKING_PATCH + netatom[NetClientListStacking] = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False); + #endif // NET_CLIENT_LIST_STACKING_PATCH + #if DECORATION_HINTS_PATCH + motifatom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); + #endif // DECORATION_HINTS_PATCH /* init cursors */ cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); cursor[CurResize] = drw_cur_create(drw, XC_sizing); + #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH + cursor[CurResizeBR] = drw_cur_create(drw, XC_bottom_right_corner); + cursor[CurResizeBL] = drw_cur_create(drw, XC_bottom_left_corner); + cursor[CurResizeTR] = drw_cur_create(drw, XC_top_right_corner); + cursor[CurResizeTL] = drw_cur_create(drw, XC_top_left_corner); + #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH + #if DRAGMFACT_PATCH + cursor[CurResizeHorzArrow] = drw_cur_create(drw, XC_sb_h_double_arrow); + cursor[CurResizeVertArrow] = drw_cur_create(drw, XC_sb_v_double_arrow); + #endif // DRAGMFACT_PATCH + #if DRAGCFACT_PATCH + cursor[CurIronCross] = drw_cur_create(drw, XC_iron_cross); + #endif // DRAGCFACT_PATCH cursor[CurMove] = drw_cur_create(drw, XC_fleur); /* init appearance */ + #if BAR_VTCOLORS_PATCH + get_vt_colors(); + if (get_luminance(colors[SchemeTagsNorm][ColBg]) > 50) { + strcpy(colors[SchemeTitleNorm][ColBg], title_bg_light); + strcpy(colors[SchemeTitleSel][ColBg], title_bg_light); + } else { + strcpy(colors[SchemeTitleNorm][ColBg], title_bg_dark); + strcpy(colors[SchemeTitleSel][ColBg], title_bg_dark); + } + #endif // BAR_VTCOLORS_PATCH + #if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *)); + #if BAR_ALPHA_PATCH + scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], alphas[0], ColCount); + #else scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], ColCount); + #endif // BAR_ALPHA_PATCH + #else + scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); + #endif // BAR_STATUS2D_PATCH for (i = 0; i < LENGTH(colors); i++) + #if BAR_ALPHA_PATCH + scheme[i] = drw_scm_create(drw, colors[i], alphas[i], ColCount); + #else scheme[i] = drw_scm_create(drw, colors[i], ColCount); + #endif // BAR_ALPHA_PATCH + #if BAR_POWERLINE_STATUS_PATCH + statusscheme = ecalloc(LENGTH(statuscolors), sizeof(Clr *)); + for (i = 0; i < LENGTH(statuscolors); i++) + #if BAR_ALPHA_PATCH + statusscheme[i] = drw_scm_create(drw, statuscolors[i], alphas[0], ColCount); + #else + statusscheme[i] = drw_scm_create(drw, statuscolors[i], ColCount); + #endif // BAR_ALPHA_PATCH + #endif // BAR_POWERLINE_STATUS_PATCH updatebars(); updatestatus(); @@ -2043,7 +3459,16 @@ setup(void) /* EWMH support per view */ XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast); + #if BAR_EWMHTAGS_PATCH + setnumdesktops(); + setcurrentdesktop(); + setdesktopnames(); + setviewport(); + #endif // BAR_EWMHTAGS_PATCH XDeleteProperty(dpy, root, netatom[NetClientList]); + #if NET_CLIENT_LIST_STACKING_PATCH + XDeleteProperty(dpy, root, netatom[NetClientListStacking]); + #endif // NET_CLIENT_LIST_STACKING_PATCH /* select events */ wa.cursor = cursor[CurNormal]->cursor; wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask @@ -2053,6 +3478,13 @@ setup(void) XSelectInput(dpy, root, wa.event_mask); grabkeys(); focus(NULL); + #if IPC_PATCH + setupepoll(); + #endif // IPC_PATCH + #if BAR_ANYBAR_PATCH + if (usealtbar) + spawnbar(); + #endif // BAR_ANYBAR_PATCH } @@ -2075,20 +3507,49 @@ showhide(Client *c) if (!c) return; if (ISVISIBLE(c)) { + #if SCRATCHPADS_PATCH && SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH + if ( + (c->tags & SPTAGMASK) && + c->isfloating && + ( + c->x < c->mon->mx || + c->x > c->mon->mx + c->mon->mw || + c->y < c->mon->my || + c->y > c->mon->my + c->mon->mh + ) + ) { + c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); + c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); + } + #elif SCRATCHPADS_PATCH if ((c->tags & SPTAGMASK) && c->isfloating) { c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); } + #endif // SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH | SCRATCHPADS_PATCH /* show clients top down */ + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH if (!c->mon->lt[c->mon->sellt]->arrange && c->sfx != -9999 && !c->isfullscreen) { XMoveWindow(dpy, c->win, c->sfx, c->sfy); resize(c, c->sfx, c->sfy, c->sfw, c->sfh, 0); showhide(c->snext); return; } + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH + #if AUTORESIZE_PATCH + if (c->needresize) { + c->needresize = 0; + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); + } else { + XMoveWindow(dpy, c->win, c->x, c->y); + } + #else XMoveWindow(dpy, c->win, c->x, c->y); + #endif // AUTORESIZE_PATCH if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) + #if !FAKEFULLSCREEN_PATCH && !c->isfullscreen + #endif // !FAKEFULLSCREEN_PATCH ) resize(c, c->x, c->y, c->w, c->h, 0); showhide(c->snext); @@ -2102,53 +3563,198 @@ showhide(Client *c) void sigchld(int unused) { + #if COOL_AUTOSTART_PATCH + pid_t pid; + #endif // COOL_AUTOSTART_PATCH if (signal(SIGCHLD, sigchld) == SIG_ERR) die("can't install SIGCHLD handler:"); + #if COOL_AUTOSTART_PATCH + while (0 < (pid = waitpid(-1, NULL, WNOHANG))) { + pid_t *p, *lim; + + if (!(p = autostart_pids)) + continue; + lim = &p[autostart_len]; + + for (; p < lim; p++) { + if (*p == pid) { + *p = -1; + break; + } + } + } + #else while (0 < waitpid(-1, NULL, WNOHANG)); + #endif // COOL_AUTOSTART_PATCH +} + +#if RIODRAW_PATCH +void +spawn(const Arg *arg) +{ + spawncmd(arg); } +pid_t +spawncmd(const Arg *arg) +#else void spawn(const Arg *arg) +#endif // RIODRAW_PATCH { + #if RIODRAW_PATCH + pid_t pid; + #endif // RIODRAW_PATCH + #if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH + char *cmd = NULL; + #endif // BAR_STATUSCMD_PATCH | BAR_DWMBLOCKS_PATCH + #if !NODMENU_PATCH if (arg->v == dmenucmd) dmenumon[0] = '0' + selmon->num; + #endif // NODMENU_PATCH + #if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH + #if !NODMENU_PATCH + else if (arg->v == statuscmd) + #else + if (arg->v == statuscmd) + #endif // NODMENU_PATCH + { + int len = strlen(statuscmds[statuscmdn]) + 1; + if (!(cmd = malloc(sizeof(char)*len + sizeof(statusexport)))) + die("malloc:"); + strcpy(cmd, statusexport); + strcat(cmd, statuscmds[statuscmdn]); + cmd[LENGTH(statusexport)-3] = '0' + lastbutton; + statuscmd[2] = cmd; + } + #endif // BAR_STATUSCMD_PATCH | BAR_DWMBLOCKS_PATCH + #if RIODRAW_PATCH + if ((pid = fork()) == 0) + #else if (fork() == 0) + #endif // RIODRAW_PATCH { if (dpy) close(ConnectionNumber(dpy)); + #if SPAWNCMD_PATCH + if (selmon->sel) { + const char* const home = getenv("HOME"); + assert(home && strchr(home, '/')); + const size_t homelen = strlen(home); + char *cwd, *pathbuf = NULL; + struct stat statbuf; + + cwd = strtok(selmon->sel->name, SPAWN_CWD_DELIM); + /* NOTE: strtok() alters selmon->sel->name in-place, + * but that does not matter because we are going to + * exec() below anyway; nothing else will use it */ + while (cwd) { + if (*cwd == '~') { /* replace ~ with $HOME */ + if (!(pathbuf = malloc(homelen + strlen(cwd)))) /* ~ counts for NULL term */ + die("fatal: could not malloc() %u bytes\n", homelen + strlen(cwd)); + strcpy(strcpy(pathbuf, home) + homelen, cwd + 1); + cwd = pathbuf; + } + + if (strchr(cwd, '/') && !stat(cwd, &statbuf)) { + if (!S_ISDIR(statbuf.st_mode)) + cwd = dirname(cwd); + + if (!chdir(cwd)) + break; + } + + cwd = strtok(NULL, SPAWN_CWD_DELIM); + } + + free(pathbuf); + } + #endif // SPAWNCMD_PATCH setsid(); execvp(((char **)arg->v)[0], (char **)arg->v); fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); perror(" failed"); exit(EXIT_SUCCESS); } + #if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH + free(cmd); + #endif // BAR_STATUSCMD_PATCH | BAR_DWMBLOCKS_PATCH + #if RIODRAW_PATCH + return pid; + #endif // RIODRAW_PATCH } void tag(const Arg *arg) { + #if SWAPFOCUS_PATCH && PERTAG_PATCH + unsigned int tagmask, tagindex; + #endif // SWAPFOCUS_PATCH if (selmon->sel && arg->ui & TAGMASK) { selmon->sel->tags = arg->ui & TAGMASK; + #if SWITCHTAG_PATCH + if (selmon->sel->switchtag) + selmon->sel->switchtag = 0; + #endif // SWITCHTAG_PATCH focus(NULL); + #if SWAPFOCUS_PATCH && PERTAG_PATCH + selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; + 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 VIEWONTAG_PATCH + if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags]) + view(arg); + #endif // VIEWONTAG_PATCH } } void tagmon(const Arg *arg) { + #if TAGMONFIXFS_PATCH + Client *c = selmon->sel; + if (!c || !mons->next) + return; + if (c->isfullscreen) { + c->isfullscreen = 0; + sendmon(c, dirtomon(arg->i)); + c->isfullscreen = 1; + #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen != 1) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + #elif !FAKEFULLSCREEN_PATCH + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + #endif // FAKEFULLSCREEN_CLIENT_PATCH + } else + sendmon(c, dirtomon(arg->i)); + #else if (!selmon->sel || !mons->next) return; sendmon(selmon->sel, dirtomon(arg->i)); + #endif // TAGMONFIXFS_PATCH } void togglebar(const Arg *arg) { Bar *bar; + #if BAR_HOLDBAR_PATCH && PERTAG_PATCH && PERTAGBAR_PATCH + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = (selmon->showbar == 2 ? 1 : !selmon->showbar); + #elif BAR_HOLDBAR_PATCH + selmon->showbar = (selmon->showbar == 2 ? 1 : !selmon->showbar); + #elif PERTAG_PATCH && PERTAGBAR_PATCH + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; + #else selmon->showbar = !selmon->showbar; + #endif // BAR_HOLDBAR_PATCH | PERTAG_PATCH updatebarpos(selmon); for (bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); @@ -2163,34 +3769,53 @@ togglefloating(const Arg *arg) c = (Client*)arg->v; if (!c) return; + #if !FAKEFULLSCREEN_PATCH + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && c->fakefullscreen != 1) /* no support for fullscreen windows */ + return; + #else if (c->isfullscreen) /* no support for fullscreen windows */ return; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #endif // !FAKEFULLSCREEN_PATCH c->isfloating = !c->isfloating || c->isfixed; + #if !BAR_FLEXWINTITLE_PATCH if (c->isfloating) XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); else XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); + #endif // BAR_FLEXWINTITLE_PATCH if (c->isfloating) { + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH if (c->sfx != -9999) { /* restore last known float dimensions */ resize(c, c->sfx, c->sfy, c->sfw, c->sfh, 0); } else + #endif // SAVEFLOATS_PATCH // EXRESIZE_PATCH resize(c, c->x, c->y, c->w, c->h, 0); + #if SAVEFLOATS_PATCH || EXRESIZE_PATCH } else { /* save last known float dimensions */ c->sfx = c->x; c->sfy = c->y; c->sfw = c->w; c->sfh = c->h; + #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH } arrange(c->mon); + #if BAR_EWMHTAGS_PATCH + setfloatinghint(c); + #endif // BAR_EWMHTAGS_PATCH } void toggletag(const Arg *arg) { unsigned int newtags; + #if SWAPFOCUS_PATCH && PERTAG_PATCH + unsigned int tagmask, tagindex; + #endif // SWAPFOCUS_PATCH if (!selmon->sel) return; @@ -2198,21 +3823,70 @@ toggletag(const Arg *arg) if (newtags) { selmon->sel->tags = newtags; 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(); + #endif // BAR_EWMHTAGS_PATCH } void toggleview(const Arg *arg) { unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); + #if PERTAG_PATCH int i; + #endif // PERTAG_PATCH + #if TAGINTOSTACK_ALLMASTER_PATCH + Client *const selected = selmon->sel; + // clients in the master area should be the same after we add a new tag + Client **const masters = calloc(selmon->nmaster, sizeof(Client *)); + if (!masters) { + die("fatal: could not calloc() %u bytes \n", selmon->nmaster * sizeof(Client *)); + } + // collect (from last to first) references to all clients in the master area + Client *c; + size_t j; + for (c = nexttiled(selmon->clients), j = 0; c && j < selmon->nmaster; c = nexttiled(c->next), ++j) + masters[selmon->nmaster - (j + 1)] = c; + // put the master clients at the front of the list + // > go from the 'last' master to the 'first' + for (j = 0; j < selmon->nmaster; ++j) + if (masters[j]) + pop(masters[j]); + free(masters); + + // we also want to be sure not to mutate the focus + focus(selected); + #elif TAGINTOSTACK_ONEMASTER_PATCH + // the first visible client should be the same after we add a new tag + // we also want to be sure not to mutate the focus + Client *const c = nexttiled(selmon->clients); + if (c) { + Client * const selected = selmon->sel; + pop(c); + focus(selected); + } + #endif // TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH + + #if !EMPTYVIEW_PATCH if (newtagset) { + #endif // EMPTYVIEW_PATCH selmon->tagset[selmon->seltags] = newtagset; + #if PERTAG_PATCH + #if SCRATCHPADS_PATCH if (newtagset == ~SPTAGMASK) + #else + if (newtagset == ~0) + #endif // SCRATCHPADS_PATCH { selmon->pertag->prevtag = selmon->pertag->curtag; selmon->pertag->curtag = 0; @@ -2230,9 +3904,19 @@ toggleview(const Arg *arg) selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; + #if PERTAGBAR_PATCH + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) + togglebar(NULL); + #endif // PERTAGBAR_PATCH + #endif // PERTAG_PATCH focus(NULL); arrange(selmon); + #if !EMPTYVIEW_PATCH } + #endif // EMPTYVIEW_PATCH + #if BAR_EWMHTAGS_PATCH + updatecurrentdesktop(); + #endif // BAR_EWMHTAGS_PATCH } void @@ -2240,13 +3924,25 @@ unfocus(Client *c, int setfocus, Client *nextfocus) { if (!c) return; + #if SWAPFOCUS_PATCH && PERTAG_PATCH + selmon->pertag->prevclient[selmon->pertag->curtag] = c; + #endif // SWAPFOCUS_PATCH + #if LOSEFULLSCREEN_PATCH if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating) + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen != 1) + setfullscreen(c, 0); + #else setfullscreen(c, 0); + #endif // #if FAKEFULLSCREEN_CLIENT_PATCH + #endif // LOSEFULLSCREEN_PATCH grabbuttons(c, 0); + #if !BAR_FLEXWINTITLE_PATCH if (c->isfloating) XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColFloat].pixel); else XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); + #endif // BAR_FLEXWINTITLE_PATCH if (setfocus) { XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); XDeleteProperty(dpy, root, netatom[NetActiveWindow]); @@ -2257,8 +3953,26 @@ void unmanage(Client *c, int destroyed) { Monitor *m = c->mon; + #if SWITCHTAG_PATCH + unsigned int switchtag = c->switchtag; + #endif // SWITCHTAG_PATCH XWindowChanges wc; + #if SWALLOW_PATCH + if (c->swallowing) { + unswallow(c); + return; + } + + Client *s = swallowingclient(c->win); + if (s) { + free(s->swallowing); + s->swallowing = NULL; + arrange(m); + focus(NULL); + return; + } + #endif // SWALLOW_PATCH detach(c); detachstack(c); @@ -2274,15 +3988,27 @@ unmanage(Client *c, int destroyed) XUngrabServer(dpy); } free(c); + #if SWALLOW_PATCH + if (s) + return; + #endif // SWALLOW_PATCH focus(NULL); updateclientlist(); arrange(m); + #if SWITCHTAG_PATCH + if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags])) + view(&((Arg) { .ui = switchtag })); + #endif // SWITCHTAG_PATCH } void unmapnotify(XEvent *e) { Client *c; + #if BAR_ANYBAR_PATCH + Monitor *m; + Bar *bar; + #endif // BAR_ANYBAR_PATCH XUnmapEvent *ev = &e->xunmap; if ((c = wintoclient(ev->window))) { @@ -2290,13 +4016,26 @@ unmapnotify(XEvent *e) setclientstate(c, WithdrawnState); else unmanage(c, 0); + #if BAR_SYSTRAY_PATCH } else if (showsystray && (c = wintosystrayicon(ev->window))) { /* KLUDGE! sometimes icons occasionally unmap their windows, but do * _not_ destroy them. We map those windows back */ XMapRaised(dpy, c->win); removesystrayicon(c); drawbarwin(systray->bar); + #endif // BAR_SYSTRAY_PATCH + } + #if BAR_ANYBAR_PATCH + else { + m = wintomon(ev->window); + for (bar = m->bar; bar; bar = bar->next) { + if (bar->win == ev->window) { + unmanagealtbar(ev->window); + break; + } + } } + #endif // BAR_ANYBAR_PATCH } void @@ -2306,7 +4045,13 @@ updatebars(void) Monitor *m; XSetWindowAttributes wa = { .override_redirect = True, + #if BAR_ALPHA_PATCH + .background_pixel = 0, + .border_pixel = 0, + .colormap = cmap, + #else .background_pixmap = ParentRelative, + #endif // BAR_ALPHA_PATCH .event_mask = ButtonPressMask|ExposureMask }; XClassHint ch = {"dwm", "dwm"}; @@ -2315,9 +4060,15 @@ updatebars(void) if (bar->external) continue; if (!bar->win) { + #if BAR_ALPHA_PATCH + bar->win = XCreateWindow(dpy, root, bar->bx, bar->by, bar->bw, bar->bh, 0, depth, + InputOutput, visual, + CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); + #else bar->win = XCreateWindow(dpy, root, bar->bx, bar->by, bar->bw, bar->bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); + #endif // BAR_ALPHA_PATCH XDefineCursor(dpy, bar->win, cursor[CurNormal]->cursor); XMapRaised(dpy, bar->win); XSetClassHint(dpy, bar->win, &ch); @@ -2334,9 +4085,22 @@ updatebarpos(Monitor *m) m->ww = m->mw; m->wh = m->mh; Bar *bar; + #if BAR_PADDING_PATCH int y_pad = vertpad; int x_pad = sidepad; - + #else + int y_pad = 0; + int x_pad = 0; + #endif // BAR_PADDING_PATCH + + #if INSETS_PATCH + // Custom insets + Inset inset = m->inset; + m->wx += inset.x; + m->wy += inset.y; + m->ww -= inset.w + inset.x; + m->wh -= inset.h + inset.y; + #endif // INSETS_PATCH for (bar = m->bar; bar; bar = bar->next) { bar->bx = m->wx + x_pad; @@ -2372,6 +4136,14 @@ updateclientlist() XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); + #if NET_CLIENT_LIST_STACKING_PATCH + XDeleteProperty(dpy, root, netatom[NetClientListStacking]); + for (m = mons; m; m = m->next) + for (c = m->stack; c; c = c->snext) + XChangeProperty(dpy, root, netatom[NetClientListStacking], + XA_WINDOW, 32, PropModeAppend, + (unsigned char *) &(c->win), 1); + #endif // NET_CLIENT_LIST_STACKING_PATCH } int @@ -2395,6 +4167,9 @@ updategeom(void) memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); XFree(info); nn = j; + #if SORTSCREENS_PATCH + sortscreens(unique, nn); + #endif // SORTSCREENS_PATCH if (n <= nn) { /* new monitors available */ for (i = 0; i < (nn - n); i++) { for (m = mons; m && m->next; m = m->next); @@ -2479,7 +4254,11 @@ updatesizehints(Client *c) if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) /* size is uninitialized, ensure that size.flags aren't used */ + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH + size.flags = 0; + #else size.flags = PSize; + #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH if (size.flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height; @@ -2511,6 +4290,16 @@ updatesizehints(Client *c) c->maxa = (float)size.max_aspect.x / size.max_aspect.y; } else c->maxa = c->mina = 0.0; + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH + if (size.flags & PSize) { + c->basew = size.base_width; + c->baseh = size.base_height; + c->isfloating = 1; + } + #if SIZEHINTS_RULED_PATCH + checkfloatingrules(c); + #endif // SIZEHINTS_RULED_PATCH + #endif // SIZEHINTS_PATCH c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); } @@ -2518,10 +4307,38 @@ void updatestatus(void) { Monitor *m; + #if BAR_EXTRASTATUS_PATCH + if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) { + strcpy(stext, "dwm-"VERSION); + estext[0] = '\0'; + } else { + char *e = strchr(rawstext, statussep); + if (e) { + *e = '\0'; e++; + #if BAR_STATUSCMD_PATCH + strncpy(rawestext, e, sizeof(estext) - 1); + copyvalidchars(estext, rawestext); + #else + strncpy(estext, e, sizeof(estext) - 1); + #endif // BAR_STATUSCMD_PATCH + } else { + estext[0] = '\0'; + } + #if BAR_STATUSCMD_PATCH + copyvalidchars(stext, rawstext); + #else + strncpy(stext, rawstext, sizeof(stext) - 1); + #endif // BAR_STATUSCMD_PATCH + } + #elif BAR_STATUSCMD_PATCH if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) strcpy(stext, "dwm-"VERSION); else copyvalidchars(stext, rawstext); + #else + if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) + strcpy(stext, "dwm-"VERSION); + #endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH for (m = mons; m; m = m->next) drawbar(m); } @@ -2529,12 +4346,22 @@ updatestatus(void) void updatetitle(Client *c) { + #if IPC_PATCH + char oldname[sizeof(c->name)]; + strcpy(oldname, c->name); + #endif // IPC_PATCH if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); if (c->name[0] == '\0') /* hack to mark broken clients */ strcpy(c->name, broken); + #if IPC_PATCH + for (Monitor *m = mons; m; m = m->next) { + if (m->sel == c && strcmp(oldname, c->name) != 0) + ipc_focused_title_change_event(m->num, c->win, oldname, c->name); + } + #endif // IPC_PATCH } void @@ -2565,14 +4392,35 @@ updatewmhints(Client *c) void view(const Arg *arg) { + #if EMPTYVIEW_PATCH + if (arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) + #else if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) + #endif // EMPTYVIEW_PATCH { + #if VIEW_SAME_TAG_GIVES_PREVIOUS_TAG_PATCH + view(&((Arg) { .ui = 0 })); + #endif // VIEW_SAME_TAG_GIVES_PREVIOUS_TAG_PATCH return; } selmon->seltags ^= 1; /* toggle sel tagset */ + #if PERTAG_PATCH pertagview(arg); + #if SWAPFOCUS_PATCH + Client *unmodified = selmon->pertag->prevclient[selmon->pertag->curtag]; + #endif // SWAPFOCUS_PATCH + #else + if (arg->ui & TAGMASK) + selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; + #endif // PERTAG_PATCH focus(NULL); + #if SWAPFOCUS_PATCH && PERTAG_PATCH + selmon->pertag->prevclient[selmon->pertag->curtag] = unmodified; + #endif // SWAPFOCUS_PATCH arrange(selmon); + #if BAR_EWMHTAGS_PATCH + updatecurrentdesktop(); + #endif // BAR_EWMHTAGS_PATCH } Client * @@ -2651,40 +4499,178 @@ zoom(const Arg *arg) c = (Client*)arg->v; if (!c) return; + #if ZOOMSWAP_PATCH + Client *at = NULL, *cold, *cprevious = NULL, *p; + #endif // ZOOMSWAP_PATCH + #if ZOOMFLOATING_PATCH + if (c && c->isfloating) + togglefloating(&((Arg) { .v = c })); + #endif // ZOOMFLOATING_PATCH + #if SWAPFOCUS_PATCH && PERTAG_PATCH + c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->mon->clients); + #endif // SWAPFOCUS_PATCH if (!c->mon->lt[c->mon->sellt]->arrange || (c && c->isfloating) + #if ZOOMSWAP_PATCH + || !c + #endif // ZOOMSWAP_PATCH ) return; + #if ZOOMSWAP_PATCH + if (c == nexttiled(c->mon->clients)) { + #if PERTAG_PATCH + p = c->mon->pertag->prevzooms[c->mon->pertag->curtag]; + #else + p = prevzoom; + #endif // PERTAG_PATCH + at = findbefore(p); + if (at) + cprevious = nexttiled(at->next); + if (!cprevious || cprevious != p) { + #if PERTAG_PATCH + c->mon->pertag->prevzooms[c->mon->pertag->curtag] = NULL; + #else + prevzoom = NULL; + #endif // PERTAG_PATCH + #if SWAPFOCUS_PATCH && PERTAG_PATCH + if (!c || !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) + #else + if (!c || !(c = nexttiled(c->next))) + #endif // SWAPFOCUS_PATCH + return; + } else + #if SWAPFOCUS_PATCH && PERTAG_PATCH + c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = cprevious; + #else + c = cprevious; + #endif // SWAPFOCUS_PATCH + } + + cold = nexttiled(c->mon->clients); + if (c != cold && !at) + at = findbefore(c); + detach(c); + attach(c); + /* swap windows instead of pushing the previous one down */ + if (c != cold && at) { + #if PERTAG_PATCH + c->mon->pertag->prevzooms[c->mon->pertag->curtag] = cold; + #else + prevzoom = cold; + #endif // PERTAG_PATCH + if (cold && at != cold) { + detach(cold); + cold->next = at->next; + at->next = cold; + } + } + focus(c); + arrange(c->mon); + #else if (c == nexttiled(c->mon->clients)) + #if SWAPFOCUS_PATCH && PERTAG_PATCH + if (!c || !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) + #else if (!c || !(c = nexttiled(c->next))) + #endif // SWAPFOCUS_PATCH return; pop(c); + #endif // ZOOMSWAP_PATCH } int main(int argc, char *argv[]) { + #if CMDCUSTOMIZE_PATCH + for (int i=1;isel; + float ratio; + int w, h,nw, nh; + + if (!c || !arg) + return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + return; + + ratio = (float)c->w / (float)c->h; + h = arg->i; + w = (int)(ratio * h); + + nw = c->w + w; + nh = c->h + h; + + XRaiseWindow(dpy, c->win); + resize(c, c->x, c->y, nw, nh, True); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/aspectresize.h b/.local/src/dwm/patch/aspectresize.h new file mode 100644 index 00000000..ad0d0546 --- /dev/null +++ b/.local/src/dwm/patch/aspectresize.h @@ -0,0 +1 @@ +static void aspectresize(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/attachx.c b/.local/src/dwm/patch/attachx.c new file mode 100644 index 00000000..a9b99b62 --- /dev/null +++ b/.local/src/dwm/patch/attachx.c @@ -0,0 +1,42 @@ +void +attachx(Client *c) +{ + #if ATTACHABOVE_PATCH + Client *at; + if (!(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating)) { + for (at = c->mon->clients; at->next != c->mon->sel; at = at->next); + c->next = at->next; + at->next = c; + return; + } + #elif ATTACHASIDE_PATCH + Client *at; + unsigned int n; + + for (at = c->mon->clients, n = 0; at; at = at->next) + if (!at->isfloating && ISVISIBLEONTAG(at, c->tags)) + if (++n >= c->mon->nmaster) + break; + + if (at && c->mon->nmaster) { + c->next = at->next; + at->next = c; + return; + } + #elif ATTACHBELOW_PATCH + if (!(c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating)) { + c->next = c->mon->sel->next; + c->mon->sel->next = c; + return; + } + #elif ATTACHBOTTOM_PATCH + Client *at; + for (at = c->mon->clients; at && at->next; at = at->next); + if (at) { + at->next = c; + c->next = NULL; + return; + } + #endif + attach(c); // master (default) +} diff --git a/.local/src/dwm/patch/attachx.h b/.local/src/dwm/patch/attachx.h new file mode 100644 index 00000000..46a8c392 --- /dev/null +++ b/.local/src/dwm/patch/attachx.h @@ -0,0 +1 @@ +static void attachx(Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patch/autostart.c b/.local/src/dwm/patch/autostart.c index 3c214eb7..b829c593 100644 --- a/.local/src/dwm/patch/autostart.c +++ b/.local/src/dwm/patch/autostart.c @@ -80,4 +80,4 @@ runautostart(void) free(pathpfx); free(path); } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/autostart.h b/.local/src/dwm/patch/autostart.h index 10a6f88f..299eaef4 100644 --- a/.local/src/dwm/patch/autostart.h +++ b/.local/src/dwm/patch/autostart.h @@ -1 +1 @@ -static void runautostart(void); +static void runautostart(void); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_alpha.c b/.local/src/dwm/patch/bar_alpha.c new file mode 100644 index 00000000..d86bc1d4 --- /dev/null +++ b/.local/src/dwm/patch/bar_alpha.c @@ -0,0 +1,42 @@ + +static int useargb = 0; +static Visual *visual; +static int depth; +static Colormap cmap; + +void +xinitvisual() +{ + XVisualInfo *infos; + XRenderPictFormat *fmt; + int nitems; + int i; + + XVisualInfo tpl = { + .screen = screen, + .depth = 32, + .class = TrueColor + }; + long masks = VisualScreenMask | VisualDepthMask | VisualClassMask; + + infos = XGetVisualInfo(dpy, masks, &tpl, &nitems); + visual = NULL; + for (i = 0; i < nitems; i ++) { + fmt = XRenderFindVisualFormat(dpy, infos[i].visual); + if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) { + visual = infos[i].visual; + depth = infos[i].depth; + cmap = XCreateColormap(dpy, root, visual, AllocNone); + useargb = 1; + break; + } + } + + XFree(infos); + + if (!visual) { + visual = DefaultVisual(dpy, screen); + depth = DefaultDepth(dpy, screen); + cmap = DefaultColormap(dpy, screen); + } +} diff --git a/.local/src/dwm/patch/bar_alpha.h b/.local/src/dwm/patch/bar_alpha.h new file mode 100644 index 00000000..3c81522c --- /dev/null +++ b/.local/src/dwm/patch/bar_alpha.h @@ -0,0 +1,3 @@ +#define OPAQUE 0xffU + +static void xinitvisual(); diff --git a/.local/src/dwm/patch/bar_alternativetags.c b/.local/src/dwm/patch/bar_alternativetags.c new file mode 100644 index 00000000..3c329bc5 --- /dev/null +++ b/.local/src/dwm/patch/bar_alternativetags.c @@ -0,0 +1,6 @@ +void +togglealttag() +{ + selmon->alttag = !selmon->alttag; + drawbar(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_alternativetags.h b/.local/src/dwm/patch/bar_alternativetags.h new file mode 100644 index 00000000..2c130f30 --- /dev/null +++ b/.local/src/dwm/patch/bar_alternativetags.h @@ -0,0 +1 @@ +static void togglealttag(); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_anybar.c b/.local/src/dwm/patch/bar_anybar.c new file mode 100644 index 00000000..05b2513f --- /dev/null +++ b/.local/src/dwm/patch/bar_anybar.c @@ -0,0 +1,82 @@ +void +managealtbar(Window win, XWindowAttributes *wa) +{ + Monitor *m; + Bar *bar; + int i; + if (!(m = recttomon(wa->x, wa->y, wa->width, wa->height))) + return; + for (i = 0, bar = m->bar; bar && bar->win && bar->next; bar = bar->next, ++i); // find last bar + if (!bar) { + bar = m->bar = ecalloc(1, sizeof(Bar)); + bar->topbar = topbar; + } else if (bar && bar->win) { + bar->next = ecalloc(1, sizeof(Bar)); + bar->next->topbar = !bar->topbar; + bar = bar->next; + } + bar->external = 1; + bar->showbar = 1; + bar->mon = m; + bar->idx = i; + bar->borderpx = 0; + bar->win = win; + bar->bh = wa->height; + updatebarpos(m); + arrange(m); + XSelectInput(dpy, win, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); + XMapWindow(dpy, win); + XMoveResizeWindow(dpy, bar->win, bar->bx, -bar->by, wa->width, bar->bh); + arrange(selmon); + XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, + (unsigned char *) &win, 1); +} + +void +spawnbar() +{ + if (*altbarcmd) + system(altbarcmd); +} + +void +unmanagealtbar(Window w) +{ + Monitor *m = wintomon(w); + Bar *bar; + + if (!m) + return; + + for (bar = m->bar; bar && bar->win; bar = bar->next) + if (bar->win == w) { + bar->win = 0; + bar->by = 0; + bar->bh = 0; + break; + } + updatebarpos(m); + arrange(m); +} + +int +wmclasscontains(Window win, const char *class, const char *name) +{ + XClassHint ch = { NULL, NULL }; + int res = 1; + + if (XGetClassHint(dpy, win, &ch)) { + if (ch.res_name && strstr(ch.res_name, name) == NULL) + res = 0; + if (ch.res_class && strstr(ch.res_class, class) == NULL) + res = 0; + } else + res = 0; + + if (ch.res_class) + XFree(ch.res_class); + if (ch.res_name) + XFree(ch.res_name); + + return res; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_anybar.h b/.local/src/dwm/patch/bar_anybar.h new file mode 100644 index 00000000..99f439ac --- /dev/null +++ b/.local/src/dwm/patch/bar_anybar.h @@ -0,0 +1,4 @@ +static void managealtbar(Window win, XWindowAttributes *wa); +static void spawnbar(); +static void unmanagealtbar(Window w); +static int wmclasscontains(Window win, const char *class, const char *name); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_awesomebar.c b/.local/src/dwm/patch/bar_awesomebar.c new file mode 100644 index 00000000..ec5fa55a --- /dev/null +++ b/.local/src/dwm/patch/bar_awesomebar.c @@ -0,0 +1,79 @@ +int +width_awesomebar(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_awesomebar(Bar *bar, BarArg *a) +{ + int n = 0, scm, remainder = 0, tabw, pad; + unsigned int i; + #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad; + #elif BAR_TITLE_LEFT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad / 2; + #elif BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x, w = a->w - lrpad / 2; + #else + int x = a->x, w = a->w; + #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH + + Client *c; + for (c = bar->mon->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; + + if (n > 0) { + remainder = w % n; + tabw = w / n; + for (i = 0, c = bar->mon->clients; c; c = c->next, i++) { + if (!ISVISIBLE(c)) + continue; + if (bar->mon->sel == c) + scm = SchemeTitleSel; + else if (HIDDEN(c)) + scm = SchemeHid; + else + scm = SchemeTitleNorm; + + pad = lrpad / 2; + #if BAR_CENTEREDWINDOWNAME_PATCH + if (TEXTW(c->name) < tabw) + pad = (tabw - TEXTW(c->name) + lrpad) / 2; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + drw_setscheme(drw, scheme[scm]); + drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, 0, 0, c->isfixed); + x += tabw + (i < remainder ? 1 : 0); + } + } + return n; +} + +int +click_awesomebar(Bar *bar, Arg *arg, BarArg *a) +{ + int x = 0, n = 0; + Client *c; + + for (c = bar->mon->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; + + c = bar->mon->clients; + + do { + if (!c || !ISVISIBLE(c)) + continue; + else + x += (1.0 / (double)n) * a->w; + } while (c && a->x > x && (c = c->next)); + + if (c) { + arg->v = c; + return ClkWinTitle; + } + return -1; +} diff --git a/.local/src/dwm/patch/bar_awesomebar.h b/.local/src/dwm/patch/bar_awesomebar.h new file mode 100644 index 00000000..25bd98f1 --- /dev/null +++ b/.local/src/dwm/patch/bar_awesomebar.h @@ -0,0 +1,3 @@ +static int width_awesomebar(Bar *bar, BarArg *a); +static int draw_awesomebar(Bar *bar, BarArg *a); +static int click_awesomebar(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_dwmblocks.c b/.local/src/dwm/patch/bar_dwmblocks.c index e510a826..442b0bcd 100644 --- a/.local/src/dwm/patch/bar_dwmblocks.c +++ b/.local/src/dwm/patch/bar_dwmblocks.c @@ -28,4 +28,4 @@ sigdwmblocks(const Arg *arg) sigqueue(dwmblockspid, SIGUSR1, sv); } } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_dwmblocks.h b/.local/src/dwm/patch/bar_dwmblocks.h index b52a5785..f08f1d56 100644 --- a/.local/src/dwm/patch/bar_dwmblocks.h +++ b/.local/src/dwm/patch/bar_dwmblocks.h @@ -1,2 +1,2 @@ static int getdwmblockspid(); -static void sigdwmblocks(const Arg *arg); +static void sigdwmblocks(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_ewmhtags.c b/.local/src/dwm/patch/bar_ewmhtags.c new file mode 100644 index 00000000..99774c95 --- /dev/null +++ b/.local/src/dwm/patch/bar_ewmhtags.c @@ -0,0 +1,52 @@ +void +setcurrentdesktop(void) +{ + long data[] = { 0 }; + XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} + +void +setdesktopnames(void) +{ + int i; + XTextProperty text; + char *tags[NUMTAGS]; + for (i = 0; i < NUMTAGS; i++) + tags[i] = tagicon(selmon, i); + Xutf8TextListToTextProperty(dpy, tags, NUMTAGS, XUTF8StringStyle, &text); + XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]); +} + +void +setfloatinghint(Client *c) +{ + Atom target = XInternAtom(dpy, "_IS_FLOATING", 0); + unsigned int floating[1] = {c->isfloating}; + XChangeProperty(dpy, c->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1); +} + +void +setnumdesktops(void) +{ + long data[] = { NUMTAGS }; + XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} + +void +setviewport(void) +{ + long data[] = { 0, 0 }; + XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); +} + +void +updatecurrentdesktop(void) +{ + long rawdata[] = { selmon->tagset[selmon->seltags] }; + int i = 0; + while (*rawdata >> (i + 1)) { + i++; + } + long data[] = { i }; + XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_ewmhtags.h b/.local/src/dwm/patch/bar_ewmhtags.h new file mode 100644 index 00000000..959ab75a --- /dev/null +++ b/.local/src/dwm/patch/bar_ewmhtags.h @@ -0,0 +1,6 @@ +static void setcurrentdesktop(void); +static void setdesktopnames(void); +static void setfloatinghint(Client *c); +static void setnumdesktops(void); +static void setviewport(void); +static void updatecurrentdesktop(void); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_fancybar.c b/.local/src/dwm/patch/bar_fancybar.c new file mode 100644 index 00000000..0222ca74 --- /dev/null +++ b/.local/src/dwm/patch/bar_fancybar.c @@ -0,0 +1,70 @@ +int +width_fancybar(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_fancybar(Bar *bar, BarArg *a) +{ + int ftw, mw, ew = 0, n = 0; + unsigned int i; + Client *c; + Monitor *m = bar->mon; + + #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad; + #elif BAR_TITLE_LEFT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad / 2; + #elif BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x, w = a->w - lrpad / 2; + #else + int x = a->x, w = a->w; + #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH + + for (c = m->clients; c; c = c->next) { + if (ISVISIBLE(c)) + n++; + } + + if (n > 0) { + ftw = TEXTW(m->sel->name); + mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1); + + i = 0; + + for (c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c) || c == m->sel) + continue; + ftw = TEXTW(c->name); + if (ftw < mw) + ew += (mw - ftw); + else + i++; + } + + if (i > 0) + mw += ew / i; + + for (c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name)); + drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]); + if (ftw > 0) /* trap special handling of 0 in drw_text */ + drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, ftw, a->h, 0, 0, c->isfixed); + x += ftw; + w -= ftw; + } + } + return n; +} + +int +click_fancybar(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkWinTitle; +} + + diff --git a/.local/src/dwm/patch/bar_fancybar.h b/.local/src/dwm/patch/bar_fancybar.h new file mode 100644 index 00000000..b4f81749 --- /dev/null +++ b/.local/src/dwm/patch/bar_fancybar.h @@ -0,0 +1,3 @@ +static int width_fancybar(Bar *bar, BarArg *a); +static int draw_fancybar(Bar *bar, BarArg *a); +static int click_fancybar(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_flexwintitle.c b/.local/src/dwm/patch/bar_flexwintitle.c new file mode 100644 index 00000000..f7da241b --- /dev/null +++ b/.local/src/dwm/patch/bar_flexwintitle.c @@ -0,0 +1,436 @@ +/* Flexwintitle properties, you can override these in your config.h if you want. */ +#ifndef FLEXWINTITLE_BORDERS +#define FLEXWINTITLE_BORDERS 1 // 0 = off, 1 = on +#endif +#ifndef FLEXWINTITLE_SHOWFLOATING +#define FLEXWINTITLE_SHOWFLOATING 0 // whether to show titles for floating windows, hidden clients are always shown +#endif +#ifndef FLEXWINTITLE_MASTERWEIGHT +#define FLEXWINTITLE_MASTERWEIGHT 9 // master weight compared to stack, hidden and floating window titles +#endif +#ifndef FLEXWINTITLE_STACKWEIGHT +#define FLEXWINTITLE_STACKWEIGHT 3 // stack weight compared to master, hidden and floating window titles +#endif +#ifndef FLEXWINTITLE_HIDDENWEIGHT +#define FLEXWINTITLE_HIDDENWEIGHT 1 // hidden window title weight +#endif +#ifndef FLEXWINTITLE_FLOATWEIGHT +#define FLEXWINTITLE_FLOATWEIGHT 1 // floating window title weight, set to 0 to not show floating windows +#endif + +#define SCHEMEFOR(c) getschemefor(m, c, groupactive == c) + +enum { GRP_NOSELECTION, GRP_MASTER, GRP_STACK1, GRP_STACK2, GRP_FLOAT, GRP_HIDDEN }; + +int +width_flexwintitle(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_flexwintitle(Bar *bar, BarArg *a) +{ + drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); + return flextitlecalculate(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); +} + +int +click_flexwintitle(Bar *bar, Arg *arg, BarArg *a) +{ + flextitlecalculate(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); + return ClkWinTitle; +} + +Client * +flextitledrawarea(Monitor *m, Client *c, int x, int r, int w, int max_clients, int scheme, int draw_tiled, int draw_hidden, int draw_floating, + int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg) +{ + int i; + for (i = 0; c && i < max_clients; c = c->next) { + if ( + ISVISIBLE(c) && + ( + (draw_tiled && !c->isfloating && !HIDDEN(c)) || + (draw_floating && c->isfloating && !HIDDEN(c)) || + (draw_hidden && HIDDEN(c)) + ) + ) { + tabfn(m, c, passx, x, w + (i < r ? 1 : 0), scheme, arg, barg); + x += w + (i < r ? 1 : 0); + i++; + } + } + return c; +} + +int +getschemefor(Monitor *m, int group, int activegroup) +{ + switch (group) { + case GRP_NOSELECTION: + case GRP_MASTER: + case GRP_STACK1: + case GRP_STACK2: + #if BSTACK_LAYOUT + if (m->lt[m->sellt]->arrange == &bstack) + return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); + #endif // BSTACK_LAYOUT + #if BSTACKHORIZ_LAYOUT + if (m->lt[m->sellt]->arrange == &bstackhoriz) { + if (group == GRP_MASTER) + return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); + else + return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); + } + #endif // BSTACKHORIZ_LAYOUT + #if CENTEREDMASTER_LAYOUT + if (m->lt[m->sellt]->arrange == ¢eredmaster) + return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); + #endif // CENTEREDMASTER_LAYOUT + #if CENTEREDFLOATINGMASTER_LAYOUT + if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) + return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); + #endif // CENTEREDFLOATINGMASTER_LAYOUT + #if COLUMNS_LAYOUT + if (m->lt[m->sellt]->arrange == &col) { + if (group == GRP_MASTER) + return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); + else + return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); + } + #endif // COLUMNS_LAYOUT + #if DECK_LAYOUT + if (m->lt[m->sellt]->arrange == &deck) { + if (group == GRP_MASTER) + return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); + else + return (activegroup ? SchemeFlexActMONO : SchemeFlexInaMONO); + } + #endif // DECK_LAYOUT + #if FIBONACCI_DWINDLE_LAYOUT + if (m->lt[m->sellt]->arrange == &dwindle) + return (activegroup ? SchemeFlexActDWDL : SchemeFlexInaDWDL); + #endif // FIBONACCI_DWINDLE_LAYOUT + #if FIBONACCI_SPIRAL_LAYOUT + if (m->lt[m->sellt]->arrange == &spiral) + return (activegroup ? SchemeFlexActSPRL : SchemeFlexInaSPRL); + #endif // FIBONACCI_SPIRAL_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + if (m->lt[m->sellt]->arrange == &flextile) + return (activegroup ? SchemeFlexActTTB + m->ltaxis[group] : SchemeFlexInaTTB + m->ltaxis[group]); + #endif // FLEXTILE_DELUXE_LAYOUT + #if GAPPLESSGRID_LAYOUT + if (m->lt[m->sellt]->arrange == &gaplessgrid) + return (activegroup ? SchemeFlexActGRID : SchemeFlexInaGRID); + #endif // GAPPLESSGRID_LAYOUT + #if GRIDMODE_LAYOUT + if (m->lt[m->sellt]->arrange == &grid) + return (activegroup ? SchemeFlexActGRDM : SchemeFlexInaGRDM); + #endif // GRIDMODE_LAYOUT + #if HORIZGRID_LAYOUT + if (m->lt[m->sellt]->arrange == &horizgrid) + return (activegroup ? SchemeFlexActHGRD : SchemeFlexInaHGRD); + #endif // HORIZGRID_LAYOUT + #if NROWGRID_LAYOUT + if (m->lt[m->sellt]->arrange == &nrowgrid) + return (activegroup ? SchemeFlexActGRD1 : SchemeFlexInaGRD1); + #endif // NROWGRID_LAYOUT + #if TILE_LAYOUT + if (m->lt[m->sellt]->arrange == &tile) + return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); + #endif // TILE_LAYOUT + #if MONOCLE_LAYOUT + if (m->lt[m->sellt]->arrange == &monocle) + return (activegroup ? SchemeFlexActMONO : SchemeFlexInaMONO); + #endif // MONOCLE_LAYOUT + return SchemeTitleNorm; + case GRP_HIDDEN: + return SchemeHid; + case GRP_FLOAT: + return (activegroup ? SchemeFlexActFloat : SchemeFlexInaFloat); + } + return SchemeTitleNorm; +} + +int +getselschemefor(int scheme) +{ + if (scheme == SchemeFlexActFloat || scheme == SchemeFlexInaFloat) + return SchemeFlexSelFloat; + if (scheme >= SchemeFlexInaTTB) + return scheme + SchemeFlexInaTTB - SchemeFlexActTTB; + if (scheme >= SchemeFlexActTTB) + return scheme + SchemeFlexSelTTB - SchemeFlexActTTB; + return SchemeTitleSel; +} + +void +flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Arg *arg, BarArg *barg) +{ + if (!c) + return; + int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + int clientscheme = ( + c == selmon->sel + ? getselschemefor(tabscheme) + : HIDDEN(c) + ? SchemeHid + : c->isurgent + ? SchemeUrg + : tabscheme + ); + drw_setscheme(drw, scheme[clientscheme]); + XSetWindowBorder(dpy, c->win, scheme[clientscheme][ColBorder].pixel); + if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small + pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) < w) + pad = (w - TEXTW(c->name) + lrpad) / 2; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + drawstateindicator(m, c, 1, x + 2, barg->y, w, barg->h, 0, 0, 0); + + if (FLEXWINTITLE_BORDERS) { + XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + } + /* Optional tags icons */ + for (i = 0; i < NUMTAGS; i++) { + if ((m->tagset[m->seltags] >> i) & 1) + nviewtags++; + if ((c->tags >> i) & 1) + nclienttags++; + } + + if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) + drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); +} + +#ifndef HIDDEN +#define HIDDEN(C) 0 +#endif + +void +flextitleclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg) +{ + if (passx >= x && passx <= x + w) + arg->v = c; +} + +int +flextitlecalculate( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +) { + Client *c; + int n, center = 0, mirror = 0, fixed = 0; // layout configuration + int clientsnmaster = 0, clientsnstack = 0, clientsnfloating = 0, clientsnhidden = 0; + int i, w, r, num = 0, den, fulllayout = 0; + int clientsnstack2 = 0; + int groupactive = 0; + int selidx = 0; + int dualstack = 0; + int rw, rr; + + int mas_x = offx, st1_x = offx, st2_x = offx, hid_x = offx, flt_x = offx; + int mas_w, st1_w, st2_w, hid_w; + + for (i = 0, c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + if (HIDDEN(c)) { + if (FLEXWINTITLE_HIDDENWEIGHT) + clientsnhidden++; + continue; + } + + if (c->isfloating) { + if (FLEXWINTITLE_FLOATWEIGHT) + clientsnfloating++; + continue; + } + + if (m->sel == c) + selidx = i; + + if (i < m->nmaster) + clientsnmaster++; + #if FLEXTILE_DELUXE_LAYOUT + else if (m->nstack) { + if (clientsnstack < m->nstack) + clientsnstack++; + else + clientsnstack2++; + } + #endif // FLEXTILE_DELUXE_LAYOUT + else if ((i - m->nmaster) % 2) + clientsnstack2++; + else + clientsnstack++; + i++; + } + + if (!m->sel) + groupactive = GRP_NOSELECTION; + else if (HIDDEN(m->sel)) + groupactive = GRP_HIDDEN; + else if (m->sel->isfloating) + groupactive = GRP_FLOAT; + else if (selidx < clientsnmaster) + groupactive = GRP_MASTER; + else if (selidx < clientsnmaster + clientsnstack) + groupactive = GRP_STACK1; + else if (selidx < clientsnmaster + clientsnstack + clientsnstack2) + groupactive = GRP_STACK2; + + n = clientsnmaster + clientsnstack + clientsnstack2 + clientsnfloating + clientsnhidden; + if (n == 0) + return 0; + #if FLEXTILE_DELUXE_LAYOUT + else if (m->lt[m->sellt]->arrange == &flextile) { + int layout = m->ltaxis[LAYOUT]; + if (layout < 0) { + mirror = 1; + layout *= -1; + } + if (layout > FLOATING_MASTER) { + layout -= FLOATING_MASTER; + fixed = 1; + } + + if (layout == SPLIT_HORIZONTAL_DUAL_STACK || layout == SPLIT_HORIZONTAL_DUAL_STACK_FIXED) + dualstack = 1; + else if (layout == SPLIT_CENTERED_VERTICAL && (fixed || n - m->nmaster > 1)) + center = 1; + else if (layout == FLOATING_MASTER) + center = 1; + else if (layout == SPLIT_CENTERED_HORIZONTAL) { + if (fixed || n - m->nmaster > 1) + center = 1; + } + } + #endif // FLEXTILE_DELUXE_LAYOUT + #if CENTEREDMASTER_LAYOUT + else if (m->lt[m->sellt]->arrange == ¢eredmaster && (fixed || n - m->nmaster > 1)) + center = 1; + #endif // CENTEREDMASTER_LAYOUT + #if CENTEREDFLOATINGMASTER_LAYOUT + else if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) + center = 1; + #endif // CENTEREDFLOATINGMASTER_LAYOUT + + /* Certain layouts have no master / stack areas */ + if (!m->lt[m->sellt]->arrange // floating layout + || (!n || (!fixed && m->nmaster && n <= m->nmaster)) // no master + #if MONOCLE_LAYOUT + || m->lt[m->sellt]->arrange == &monocle + #endif // MONOCLE_LAYOUT + #if GRIDMODE_LAYOUT + || m->lt[m->sellt]->arrange == &grid + #endif // GRIDMODE_LAYOUT + #if HORIZGRID_LAYOUT + || m->lt[m->sellt]->arrange == &horizgrid + #endif // HORIZGRID_LAYOUT + #if GAPPLESSGRID_LAYOUT + || m->lt[m->sellt]->arrange == &gaplessgrid + #endif // GAPPLESSGRID_LAYOUT + #if NROWGRID_LAYOUT + || m->lt[m->sellt]->arrange == &nrowgrid + #endif // NROWGRID_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) + #endif // FLEXTILE_DELUXE_LAYOUT + ) + fulllayout = 1; + + num = tabw; + c = m->clients; + + /* floating mode */ + if ((fulllayout && FLEXWINTITLE_FLOATWEIGHT > 0) || clientsnmaster + clientsnstack == 0 || !m->lt[m->sellt]->arrange) { + den = clientsnmaster + clientsnstack + clientsnstack2 + clientsnfloating + clientsnhidden; + w = num / den; + r = num % den; // rest + c = flextitledrawarea(m, c, mas_x, r, w, den, !m->lt[m->sellt]->arrange ? SchemeFlexActFloat : SCHEMEFOR(GRP_MASTER), 1, FLEXWINTITLE_HIDDENWEIGHT, FLEXWINTITLE_FLOATWEIGHT, passx, tabfn, arg, barg); // floating + /* no master and stack mode, e.g. monocole, grid layouts, fibonacci */ + } else if (fulllayout) { + den = clientsnmaster + clientsnstack + clientsnstack2 + clientsnhidden; + w = num / den; + r = num % den; // rest + c = flextitledrawarea(m, c, mas_x, r, w, den, SCHEMEFOR(GRP_MASTER), 1, FLEXWINTITLE_HIDDENWEIGHT, 0, passx, tabfn, arg, barg); // full + /* tiled mode */ + } else { + den = clientsnmaster * FLEXWINTITLE_MASTERWEIGHT + (clientsnstack + clientsnstack2) * FLEXWINTITLE_STACKWEIGHT + clientsnfloating * FLEXWINTITLE_FLOATWEIGHT + clientsnhidden * FLEXWINTITLE_HIDDENWEIGHT; + w = num / den; // weight width per client + r = num % den; // weight rest width + rw = r / n; // rest incr per client + rr = r % n; // rest rest + #if FLEXTILE_DELUXE_LAYOUT + if ((!center && !dualstack) || (center && n <= m->nmaster + (m->nstack ? m->nstack : 1))) + #else + if ((!center && !dualstack) || (center && n <= m->nmaster + 1)) + #endif // FLEXTILE_DELUXE_LAYOUT + { + clientsnstack += clientsnstack2; + clientsnstack2 = 0; + if (groupactive == GRP_STACK2) + groupactive = GRP_STACK1; + } + + mas_w = clientsnmaster * rw + w * clientsnmaster * FLEXWINTITLE_MASTERWEIGHT + (rr > 0 ? MIN(rr, clientsnmaster) : 0); + rr -= clientsnmaster; + st1_w = clientsnstack * (rw + w * FLEXWINTITLE_STACKWEIGHT) + (rr > 0 ? MIN(rr, clientsnstack) : 0); + rr -= clientsnstack; + st2_w = clientsnstack2 * (rw + w * FLEXWINTITLE_STACKWEIGHT) + (rr > 0 ? MIN(rr, clientsnstack2) : 0); + rr -= clientsnstack2; + hid_w = clientsnhidden * (rw + w * FLEXWINTITLE_HIDDENWEIGHT) + (rr > 0 ? MIN(rr, clientsnhidden) : 0); + rr -= clientsnhidden; + rr = r % n; + + if (mirror) { + if (center && clientsnstack2) { + mas_x = st1_x + st1_w; + st2_x = mas_x + mas_w; + hid_x = st2_x + st2_w; + } else { + if (clientsnstack2) { + st2_x = st1_x + st1_w; + mas_x = st2_x + st2_w; + } else + mas_x = st1_x + st1_w; + hid_x = mas_x + mas_w; + } + } else { + if (center && clientsnstack2) { + mas_x = st2_x + st2_w; + st1_x = mas_x + mas_w; + hid_x = st1_x + st1_w; + } else { + st1_x = mas_x + mas_w; + if (clientsnstack2) { + st2_x = st1_x + st1_w; + hid_x = st2_x + st2_w; + } else + hid_x = st1_x + st1_w; + } + } + + flt_x = hid_x + hid_w; + c = flextitledrawarea(m, c, mas_x, rr, w * FLEXWINTITLE_MASTERWEIGHT + rw, clientsnmaster, SCHEMEFOR(GRP_MASTER), 1, 0, 0, passx, tabfn, arg, barg); // master + rr -= clientsnmaster; + c = flextitledrawarea(m, c, st1_x, rr, w * FLEXWINTITLE_STACKWEIGHT + rw, clientsnstack, SCHEMEFOR(GRP_STACK1), 1, 0, 0, passx, tabfn, arg, barg); // stack1 + rr -= clientsnstack; + if (clientsnstack2) { + c = flextitledrawarea(m, c, st2_x, rr, w * FLEXWINTITLE_STACKWEIGHT + rw, clientsnstack2, SCHEMEFOR(GRP_STACK2), 1, 0, 0, passx, tabfn, arg, barg); // stack2 + rr -= clientsnstack2; + } + c = flextitledrawarea(m, m->clients, hid_x, rr, w * FLEXWINTITLE_HIDDENWEIGHT + rw, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg, barg); // hidden + rr -= clientsnhidden; + c = flextitledrawarea(m, m->clients, flt_x, rr, w * FLEXWINTITLE_FLOATWEIGHT + rw, clientsnfloating, SCHEMEFOR(GRP_FLOAT), 0, 0, 1, passx, tabfn, arg, barg); // floating + } + return 1; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_flexwintitle.h b/.local/src/dwm/patch/bar_flexwintitle.h new file mode 100644 index 00000000..6183c8e6 --- /dev/null +++ b/.local/src/dwm/patch/bar_flexwintitle.h @@ -0,0 +1,10 @@ +static int width_flexwintitle(Bar *bar, BarArg *a); +static int draw_flexwintitle(Bar *bar, BarArg *a); +static int click_flexwintitle(Bar *bar, Arg *arg, BarArg *a); + +static void flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg); +static void flextitleclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg); +static int flextitlecalculate(Monitor *m, int offx, int w, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); +static int getschemefor(Monitor *m, int group, int activegroup); +static int getselschemefor(int scheme); +static Client *flextitledrawarea(Monitor *m, Client *c, int x, int r, int w, int max_clients, int tabscheme, int draw_tiled, int draw_hidden, int draw_floating, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_holdbar.c b/.local/src/dwm/patch/bar_holdbar.c new file mode 100644 index 00000000..358cbec3 --- /dev/null +++ b/.local/src/dwm/patch/bar_holdbar.c @@ -0,0 +1,37 @@ +void +holdbar(const Arg *arg) +{ + if (selmon->showbar) + return; + Bar *bar; + selmon->showbar = 2; + updatebarpos(selmon); + for (bar = selmon->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); +} + +void +keyrelease(XEvent *e) +{ + Bar *bar; + if (XEventsQueued(dpy, QueuedAfterReading)) { + XEvent ne; + XPeekEvent(dpy, &ne); + + if (ne.type == KeyPress && ne.xkey.time == e->xkey.time && + ne.xkey.keycode == e->xkey.keycode) { + XNextEvent(dpy, &ne); + return; + } + } + if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) { + selmon->showbar = 0; + updatebarpos(selmon); + for (bar = selmon->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + arrange(selmon); + } + #if COMBO_PATCH + combo = 0; + #endif // COMBO_PATCH +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_holdbar.h b/.local/src/dwm/patch/bar_holdbar.h new file mode 100644 index 00000000..53944251 --- /dev/null +++ b/.local/src/dwm/patch/bar_holdbar.h @@ -0,0 +1,2 @@ +static void keyrelease(XEvent *e); +static void holdbar(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_indicators.c b/.local/src/dwm/patch/bar_indicators.c index 298eb196..644e0726 100644 --- a/.local/src/dwm/patch/bar_indicators.c +++ b/.local/src/dwm/patch/bar_indicators.c @@ -96,8 +96,15 @@ drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int void drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert) { + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen && c->isfloating) + drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatfakefsindicatortype); + else if (c->fakefullscreen) + drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, fakefsindicatortype); + else + #endif // FAKEFULLSCREEN_CLIENT_PATCH if (c->isfloating) drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatindicatortype); else drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, tiledindicatortype); -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_indicators.h b/.local/src/dwm/patch/bar_indicators.h index bc667dd4..d015101a 100644 --- a/.local/src/dwm/patch/bar_indicators.h +++ b/.local/src/dwm/patch/bar_indicators.h @@ -17,4 +17,4 @@ enum { }; static void drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert, int type); -static void drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert); +static void drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_ltsymbol.c b/.local/src/dwm/patch/bar_ltsymbol.c index 1004378e..4c861f87 100644 --- a/.local/src/dwm/patch/bar_ltsymbol.c +++ b/.local/src/dwm/patch/bar_ltsymbol.c @@ -14,4 +14,4 @@ int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a) { return ClkLtSymbol; -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_powerline_status.c b/.local/src/dwm/patch/bar_powerline_status.c new file mode 100644 index 00000000..2f95570a --- /dev/null +++ b/.local/src/dwm/patch/bar_powerline_status.c @@ -0,0 +1,121 @@ +static Clr **statusscheme; + +int +width_pwrl_status(Bar *bar, BarArg *a) +{ + #if BAR_STATUSCMD_PATCH + return widthpowerlinestatus(rawstext); + #else + return widthpowerlinestatus(stext); + #endif // BAR_STATUSCMD_PATCH +} + +#if BAR_EXTRASTATUS_PATCH +int +width_pwrl_status_es(Bar *bar, BarArg *a) +{ + #if BAR_STATUSCMD_PATCH + return widthpowerlinestatus(rawestext); + #else + return widthpowerlinestatus(estext); + #endif // BAR_STATUSCMD_PATCH +} +#endif // BAR_EXTRASTATUS_PATCH + +int +draw_pwrl_status(Bar *bar, BarArg *a) +{ + #if BAR_STATUSCMD_PATCH + return drawpowerlinestatus(a->x + a->w, rawstext, a); + #else + return drawpowerlinestatus(a->x + a->w, stext, a); + #endif // BAR_STATUSCMD_PATCH +} + +#if BAR_EXTRASTATUS_PATCH +int +draw_pwrl_status_es(Bar *bar, BarArg *a) +{ + #if BAR_STATUSCMD_PATCH + return drawpowerlinestatus(a->x + a->w, rawestext, a); + #else + return drawpowerlinestatus(a->x + a->w, estext, a); + #endif // BAR_STATUSCMD_PATCH +} +#endif // BAR_EXTRASTATUS_PATCH + +int +click_pwrl_status(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkStatusText; +} + +int +widthpowerlinestatus(char *stext) +{ + char status[512]; + int w = 0, i, n = strlen(stext); + int plw = drw->fonts->h / 2 + 1; + char *bs, bp = '|'; + strcpy(status, stext); + + for (i = n, bs = &status[n-1]; i >= 0; i--, bs--) { + if (*bs == '<' || *bs == '/' || *bs == '\\' || *bs == '>' || *bs == '|') { /* block start */ + if (bp != '|') + w += plw; + w += TEXTW(bs+2); + bp = *bs; + *bs = 0; + } + } + if (bp != '|') + w += plw * 2; + + return w; +} + +int +drawpowerlinestatus(int xpos, char *stext, BarArg *barg) +{ + char status[512]; + int i, n = strlen(stext), cn = 0; + int x = xpos, w = 0; + int plw = drw->fonts->h / 2 + 1; + char *bs, bp = '|'; + Clr *prevscheme = statusscheme[0], *nxtscheme; + strcpy(status, stext); + + for (i = n, bs = &status[n-1]; i >= 0; i--, bs--) { + if (*bs == '<' || *bs == '/' || *bs == '\\' || *bs == '>' || *bs == '|') { /* block start */ + cn = ((int) *(bs+1)) - 1; + + if (cn < LENGTH(statuscolors)) { + drw_settrans(drw, prevscheme, (nxtscheme = statusscheme[cn])); + } else { + drw_settrans(drw, prevscheme, (nxtscheme = statusscheme[0])); + } + + if (bp != '|') { + drw_arrow(drw, x - plw, barg->y, plw, barg->h, bp == '\\' || bp == '>' ? 1 : 0, bp == '<' ? 0 : 1); + x -= plw; + } + + drw_setscheme(drw, nxtscheme); + w = TEXTW(bs+2); + drw_text(drw, x - w, barg->y, w, barg->h, lrpad / 2, bs+2, 0, False); + x -= w; + + bp = *bs; + *bs = 0; + prevscheme = nxtscheme; + } + } + if (bp != '|') { + drw_settrans(drw, prevscheme, scheme[SchemeNorm]); + drw_arrow(drw, x - plw, barg->y, plw, barg->h, bp == '\\' || bp == '>' ? 1 : 0, bp == '<' ? 0 : 1); + drw_rect(drw, x - 2 * plw, barg->y, plw, barg->h, 1, 1); + x -= plw * 2; + } + + return xpos - x; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_powerline_status.h b/.local/src/dwm/patch/bar_powerline_status.h new file mode 100644 index 00000000..1eb68240 --- /dev/null +++ b/.local/src/dwm/patch/bar_powerline_status.h @@ -0,0 +1,11 @@ +static int width_pwrl_status(Bar *bar, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int width_pwrl_status_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH +static int draw_pwrl_status(Bar *bar, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int draw_pwrl_status_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH +static int click_pwrl_status(Bar *bar, Arg *arg, BarArg *a); +static int drawpowerlinestatus(int x, char *stext, BarArg *a); +static int widthpowerlinestatus(char *stext); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_powerline_tags.c b/.local/src/dwm/patch/bar_powerline_tags.c new file mode 100644 index 00000000..f4dd9237 --- /dev/null +++ b/.local/src/dwm/patch/bar_powerline_tags.c @@ -0,0 +1,106 @@ +int +width_pwrl_tags(Bar *bar, BarArg *a) +{ + int w, i; + int plw = drw->fonts->h / 2 + 1; + #if BAR_HIDEVACANTTAGS_PATCH + Client *c; + unsigned int occ = 0; + for (c = bar->mon->clients; c; c = c->next) + occ |= c->tags == 255 ? 0 : c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH + + for (w = 0, i = 0; i < NUMTAGS; i++) { + #if BAR_HIDEVACANTTAGS_PATCH + if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH + w += TEXTW(tagicon(bar->mon, i)) + plw; + } + return w + lrpad; +} + +int +draw_pwrl_tags(Bar *bar, BarArg *a) +{ + int x, w; + int invert; + int plw = drw->fonts->h / 2 + 1; + unsigned int i, occ = 0, urg = 0; + char *icon; + Client *c; + Clr *prevscheme, *nxtscheme; + + for (c = bar->mon->clients; c; c = c->next) { + #if BAR_HIDEVACANTTAGS_PATCH + occ |= c->tags == 255 ? 0 : c->tags; + #else + occ |= c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH + if (c->isurgent) + urg |= c->tags; + } + x = a->x; + prevscheme = scheme[SchemeNorm]; + for (i = 0; i < NUMTAGS; i++) { + #if BAR_HIDEVACANTTAGS_PATCH + /* do not draw vacant tags */ + if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH + + icon = tagicon(bar->mon, i); + invert = 0; + w = TEXTW(icon); + if (urg & 1 << i ) { + drw_settrans(drw, prevscheme, (nxtscheme = scheme[bar->mon->tagset[bar->mon->seltags] & 1 << i ? SchemeSel : SchemeUrg])); + } else { + drw_settrans(drw, prevscheme, (nxtscheme = scheme[bar->mon->tagset[bar->mon->seltags] & 1 << i ? SchemeSel : SchemeNorm])); + } + #if BAR_POWERLINE_TAGS_SLASH_PATCH + drw_arrow(drw, x, a->y, plw, a->h, 1, 1); + #else + drw_arrow(drw, x, a->y, plw, a->h, 1, 0); + #endif // BAR_POWERLINE_TAGS_SLASH_PATCH + x += plw; + drw_setscheme(drw, nxtscheme); + drw_text(drw, x, a->y, w, a->h, lrpad / 2, icon, invert, False); + drawindicator(bar->mon, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); + x += w; + prevscheme = nxtscheme; + } + nxtscheme = scheme[SchemeNorm]; + + drw_settrans(drw, prevscheme, nxtscheme); + #if BAR_POWERLINE_TAGS_SLASH_PATCH + drw_arrow(drw, x, a->y, plw, a->h, 1, 1); + #else + drw_arrow(drw, x, a->y, plw, a->h, 1, 0); + #endif // BAR_POWERLINE_TAGS_SLASH_PATCH + return 1; +} + +int +click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a) +{ + int i = 0, x = lrpad / 2; + int plw = drw->fonts->h / 2 + 1; + #if BAR_HIDEVACANTTAGS_PATCH + Client *c; + unsigned int occ = 0; + for (c = bar->mon->clients; c; c = c->next) + occ |= c->tags == 255 ? 0 : c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH + + do { + #if BAR_HIDEVACANTTAGS_PATCH + if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH + x += TEXTW(tagicon(bar->mon, i)) + plw; + } while (a->x >= x && ++i < NUMTAGS); + if (i < NUMTAGS) { + arg->ui = 1 << i; + } + return ClkTagBar; +} diff --git a/.local/src/dwm/patch/bar_powerline_tags.h b/.local/src/dwm/patch/bar_powerline_tags.h new file mode 100644 index 00000000..f942ff10 --- /dev/null +++ b/.local/src/dwm/patch/bar_powerline_tags.h @@ -0,0 +1,3 @@ +static int width_pwrl_tags(Bar *bar, BarArg *a); +static int draw_pwrl_tags(Bar *bar, BarArg *a); +static int click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_status.c b/.local/src/dwm/patch/bar_status.c index f21cefdb..d37424df 100644 --- a/.local/src/dwm/patch/bar_status.c +++ b/.local/src/dwm/patch/bar_status.c @@ -4,6 +4,13 @@ width_status(Bar *bar, BarArg *a) return TEXTWM(stext); } +#if BAR_EXTRASTATUS_PATCH +int +width_status_es(Bar *bar, BarArg *a) +{ + return TEXTWM(estext) - lrpad; +} +#endif // BAR_EXTRASTATUS_PATCH int draw_status(Bar *bar, BarArg *a) @@ -11,6 +18,13 @@ draw_status(Bar *bar, BarArg *a) return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, stext, 0, True); } +#if BAR_EXTRASTATUS_PATCH +int +draw_status_es(Bar *bar, BarArg *a) +{ + return drw_text(drw, a->x, a->y, a->w, a->h, 0, estext, 0, True); +} +#endif // BAR_EXTRASTATUS_PATCH int click_status(Bar *bar, Arg *arg, BarArg *a) diff --git a/.local/src/dwm/patch/bar_status.h b/.local/src/dwm/patch/bar_status.h index 867d5774..e6d8ab01 100644 --- a/.local/src/dwm/patch/bar_status.h +++ b/.local/src/dwm/patch/bar_status.h @@ -1,3 +1,9 @@ static int width_status(Bar *bar, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int width_status_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH static int draw_status(Bar *bar, BarArg *a); -static int click_status(Bar *bar, Arg *arg, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int draw_status_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH +static int click_status(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_status2d.c b/.local/src/dwm/patch/bar_status2d.c index a884aa60..54e008d4 100644 --- a/.local/src/dwm/patch/bar_status2d.c +++ b/.local/src/dwm/patch/bar_status2d.c @@ -1,20 +1,81 @@ +#if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH +static char termcol0[] = "#000000"; /* black */ +static char termcol1[] = "#ff0000"; /* red */ +static char termcol2[] = "#33ff00"; /* green */ +static char termcol3[] = "#ff0099"; /* yellow */ +static char termcol4[] = "#0066ff"; /* blue */ +static char termcol5[] = "#cc00ff"; /* magenta */ +static char termcol6[] = "#00ffff"; /* cyan */ +static char termcol7[] = "#d0d0d0"; /* white */ +static char termcol8[] = "#808080"; /* black */ +static char termcol9[] = "#ff0000"; /* red */ +static char termcol10[] = "#33ff00"; /* green */ +static char termcol11[] = "#ff0099"; /* yellow */ +static char termcol12[] = "#0066ff"; /* blue */ +static char termcol13[] = "#cc00ff"; /* magenta */ +static char termcol14[] = "#00ffff"; /* cyan */ +static char termcol15[] = "#ffffff"; /* white */ +static char *termcolor[] = { + termcol0, termcol1, termcol2, termcol3, termcol4, termcol5, termcol6, termcol7, + termcol8, termcol9, termcol10, termcol11, termcol12, termcol13, termcol14, termcol15, +}; +#endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH int width_status2d(Bar *bar, BarArg *a) { int width; + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH width = status2dtextlength(rawstext); + #else + width = status2dtextlength(stext); + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH return width ? width + lrpad : 0; } +#if BAR_EXTRASTATUS_PATCH +int +width_status2d_es(Bar *bar, BarArg *a) +{ + int width; + #if BAR_STATUSCMD_PATCH + width = status2dtextlength(rawestext); + #else + width = status2dtextlength(estext); + #endif // BAR_STATUSCMD_PATCH + return width ? width + lrpad : 0; +} +#endif // BAR_EXTRASTATUS_PATCH int draw_status2d(Bar *bar, BarArg *a) { + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH return drawstatusbar(a, rawstext); + #else + return drawstatusbar(a, stext); + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH } +#if BAR_EXTRASTATUS_PATCH +int +draw_status2d_es(Bar *bar, BarArg *a) +{ + #if BAR_STATUSCMD_PATCH + return drawstatusbar(a, rawestext); + #else + return drawstatusbar(a, estext); + #endif // BAR_STATUSCMD_PATCH +} +#endif // BAR_EXTRASTATUS_PATCH +#if !BAR_STATUSCMD_PATCH +int +click_status2d(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkStatusText; +} +#endif // BAR_STATUSCMD_PATCH int drawstatusbar(BarArg *a, char* stext) @@ -30,7 +91,11 @@ drawstatusbar(BarArg *a, char* stext) if (!(text = (char*) malloc(sizeof(char)*len))) die("malloc"); p = text; + #if BAR_STATUSCMD_PATCH copyvalidchars(text, stext); + #else + memcpy(text, stext, len); + #endif // BAR_STATUSCMD_PATCH x += lrpad / 2; drw_setscheme(drw, scheme[LENGTH(colors)]); @@ -59,7 +124,13 @@ drawstatusbar(BarArg *a, char* stext) } memcpy(buf, (char*)text+i+1, 7); buf[7] = '\0'; + #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColFg], buf, 0xff); + #elif BAR_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColFg], buf, alphas[SchemeNorm][ColFg]); + #else drw_clr_create(drw, &drw->scheme[ColFg], buf); + #endif // BAR_ALPHA_PATCH i += 7; } else if (text[i] == 'b') { char buf[8]; @@ -69,8 +140,34 @@ drawstatusbar(BarArg *a, char* stext) } memcpy(buf, (char*)text+i+1, 7); buf[7] = '\0'; + #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColBg], buf, 0xff); + #elif BAR_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColBg], buf, alphas[SchemeNorm][ColBg]); + #else drw_clr_create(drw, &drw->scheme[ColBg], buf); + #endif // BAR_ALPHA_PATCH i += 7; + #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH + } else if (text[i] == 'C') { + int c = atoi(text + ++i) % 16; + #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], 0xff); + #elif BAR_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], alphas[SchemeNorm][ColBg]); + #else + drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c]); + #endif // BAR_ALPHA_PATCH + } else if (text[i] == 'B') { + int c = atoi(text + ++i) % 16; + #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], 0xff); + #elif BAR_ALPHA_PATCH + drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], alphas[SchemeNorm][ColBg]); + #else + drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c]); + #endif // BAR_ALPHA_PATCH + #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH } else if (text[i] == 'd') { drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; @@ -133,7 +230,11 @@ status2dtextlength(char* stext) if (!(text = (char*) malloc(sizeof(char)*len))) die("malloc"); p = text; + #if BAR_STATUSCMD_PATCH copyvalidchars(text, stext); + #else + memcpy(text, stext, len); + #endif // BAR_STATUSCMD_PATCH /* compute width of the status text */ w = 0; @@ -158,4 +259,4 @@ status2dtextlength(char* stext) w += TEXTWM(text) - lrpad; free(p); return w; -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_status2d.h b/.local/src/dwm/patch/bar_status2d.h index 2efed765..868a5681 100644 --- a/.local/src/dwm/patch/bar_status2d.h +++ b/.local/src/dwm/patch/bar_status2d.h @@ -1,4 +1,13 @@ static int width_status2d(Bar *bar, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int width_status2d_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH static int draw_status2d(Bar *bar, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int draw_status2d_es(Bar *bar, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH +#if !BAR_STATUSCMD_PATCH +static int click_status2d(Bar *bar, Arg *arg, BarArg *a); +#endif // BAR_STATUSCMD_PATCH static int drawstatusbar(BarArg *a, char *text); -static int status2dtextlength(char *stext); +static int status2dtextlength(char *stext); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_statusbutton.c b/.local/src/dwm/patch/bar_statusbutton.c new file mode 100644 index 00000000..7f52af41 --- /dev/null +++ b/.local/src/dwm/patch/bar_statusbutton.c @@ -0,0 +1,17 @@ +int +width_stbutton(Bar *bar, BarArg *a) +{ + return TEXTW(buttonbar); +} + +int +draw_stbutton(Bar *bar, BarArg *a) +{ + return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar, 0, False); +} + +int +click_stbutton(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkButton; +} diff --git a/.local/src/dwm/patch/bar_statusbutton.h b/.local/src/dwm/patch/bar_statusbutton.h new file mode 100644 index 00000000..68ae839a --- /dev/null +++ b/.local/src/dwm/patch/bar_statusbutton.h @@ -0,0 +1,3 @@ +static int width_stbutton(Bar *bar, BarArg *a); +static int draw_stbutton(Bar *bar, BarArg *a); +static int click_stbutton(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_statuscmd.c b/.local/src/dwm/patch/bar_statuscmd.c index 85182063..0a4ad722 100644 --- a/.local/src/dwm/patch/bar_statuscmd.c +++ b/.local/src/dwm/patch/bar_statuscmd.c @@ -1,3 +1,8 @@ +#if !BAR_DWMBLOCKS_PATCH +static const char statusexport[] = "export BUTTON=-;"; +static int statuscmdn; +static int lastbutton; +#endif // BAR_DWMBLOCKS_PATCH int click_statuscmd(Bar *bar, Arg *arg, BarArg *a) @@ -5,6 +10,13 @@ click_statuscmd(Bar *bar, Arg *arg, BarArg *a) return click_statuscmd_text(arg, a->x, rawstext); } +#if BAR_EXTRASTATUS_PATCH +int +click_statuscmd_es(Bar *bar, Arg *arg, BarArg *a) +{ + return click_statuscmd_text(arg, a->x, rawestext); +} +#endif // BAR_EXTRASTATUS_PATCH int click_statuscmd_text(Arg *arg, int rel_x, char *text) @@ -12,22 +24,39 @@ click_statuscmd_text(Arg *arg, int rel_x, char *text) int i = -1; int x = 0; char ch; + #if BAR_DWMBLOCKS_PATCH dwmblockssig = -1; + #else + statuscmdn = 0; + #endif // BAR_DWMBLOCKS_PATCH while (text[++i]) { if ((unsigned char)text[i] < ' ') { ch = text[i]; text[i] = '\0'; + #if BAR_STATUS2D_PATCH && !BAR_BAR_STATUSCOLORS_PATCH x += status2dtextlength(text); + #else + x += TEXTWM(text) - lrpad; + #endif // BAR_STATUS2D_PATCH text[i] = ch; text += i+1; i = -1; + #if BAR_DWMBLOCKS_PATCH if (x >= rel_x && dwmblockssig != -1) break; dwmblockssig = ch; + #else + if (x >= rel_x) + break; + if (ch <= LENGTH(statuscmds)) + statuscmdn = ch - 1; + #endif // BAR_DWMBLOCKS_PATCH } } + #if BAR_DWMBLOCKS_PATCH if (dwmblockssig == -1) dwmblockssig = 0; + #endif // BAR_DWMBLOCKS_PATCH return ClkStatusText; } diff --git a/.local/src/dwm/patch/bar_statuscmd.h b/.local/src/dwm/patch/bar_statuscmd.h index 35a41eb2..e2e75b16 100644 --- a/.local/src/dwm/patch/bar_statuscmd.h +++ b/.local/src/dwm/patch/bar_statuscmd.h @@ -1,3 +1,6 @@ static int click_statuscmd(Bar *bar, Arg *arg, BarArg *a); +#if BAR_EXTRASTATUS_PATCH +static int click_statuscmd_es(Bar *bar, Arg *arg, BarArg *a); +#endif // BAR_EXTRASTATUS_PATCH static int click_statuscmd_text(Arg *arg, int rel_x, char *text); -static void copyvalidchars(char *text, char *rawtext); +static void copyvalidchars(char *text, char *rawtext); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_statuscolors.c b/.local/src/dwm/patch/bar_statuscolors.c new file mode 100644 index 00000000..a443056f --- /dev/null +++ b/.local/src/dwm/patch/bar_statuscolors.c @@ -0,0 +1,23 @@ +int +textw_wosc(char *s) +{ + char *ts = s; + char *tp = s; + int sw = 0; + char ctmp; + while (1) { + if ((unsigned int)*ts > LENGTH(colors)) { + ts++; + continue; + } + ctmp = *ts; + *ts = '\0'; + sw += drw_fontset_getwidth(drw, tp, True); + *ts = ctmp; + if (ctmp == '\0') + break; + tp = ++ts; + } + + return sw; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_systray.c b/.local/src/dwm/patch/bar_systray.c index 82be1e22..b20b45e2 100644 --- a/.local/src/dwm/patch/bar_systray.c +++ b/.local/src/dwm/patch/bar_systray.c @@ -33,13 +33,25 @@ draw_systray(Bar *bar, BarArg *a) wa.event_mask = ButtonPressMask|ExposureMask; wa.border_pixel = 0; systray->h = MIN(a->h, drw->fonts->h); + #if BAR_ALPHA_PATCH + wa.background_pixel = 0; + wa.colormap = cmap; + systray->win = XCreateWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by + a->y + (a->h - systray->h) / 2, MAX(a->w + 40, 1), systray->h, 0, depth, + InputOutput, visual, + CWOverrideRedirect|CWBorderPixel|CWBackPixel|CWColormap|CWEventMask, &wa); // CWBackPixmap + #else wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; systray->win = XCreateSimpleWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by + a->y + (a->h - systray->h) / 2, MIN(a->w, 1), systray->h, 0, 0, scheme[SchemeNorm][ColBg].pixel); XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa); + #endif // BAR_ALPHA_PATCH XSelectInput(dpy, systray->win, SubstructureNotifyMask); XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&systrayorientation, 1); + #if BAR_ALPHA_PATCH + XChangeProperty(dpy, systray->win, netatom[NetSystemTrayVisual], XA_VISUALID, 32, + PropModeReplace, (unsigned char *)&visual->visualid, 1); + #endif // BAR_ALPHA_PATCH XChangeProperty(dpy, systray->win, netatom[NetWMWindowType], XA_ATOM, 32, PropModeReplace, (unsigned char *)&netatom[NetWMWindowTypeDock], 1); XMapRaised(dpy, systray->win); @@ -63,7 +75,11 @@ draw_systray(Bar *bar, BarArg *a) drw_setscheme(drw, scheme[SchemeNorm]); for (w = 0, i = systray->icons; i; i = i->next) { + #if BAR_ALPHA_PATCH + wa.background_pixel = 0; + #else wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; + #endif // BAR_ALPHA_PATCH XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); XMapRaised(dpy, i->win); i->x = w; @@ -178,4 +194,4 @@ wintosystrayicon(Window w) return i; for (i = systray->icons; i && i->win != w; i = i->next); return i; -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_tabgroups.c b/.local/src/dwm/patch/bar_tabgroups.c new file mode 100644 index 00000000..28a39fa9 --- /dev/null +++ b/.local/src/dwm/patch/bar_tabgroups.c @@ -0,0 +1,220 @@ +/* Bartabgroups properties, you can override these in your config.h if you want. */ +#ifndef BARTAB_BORDERS +#define BARTAB_BORDERS 1 // 0 = off, 1 = on +#endif +#ifndef BARTAB_SHOWFLOATING +#define BARTAB_SHOWFLOATING 0 // whether to show titles for floating windows, hidden clients are always shown +#endif +#ifndef BARTAB_STACKWEIGHT +#define BARTAB_STACKWEIGHT 1 // stack weight compared to hidden and floating window titles +#endif +#ifndef BARTAB_HIDDENWEIGHT +#define BARTAB_HIDDENWEIGHT 1 // hidden window title weight +#endif +#ifndef BARTAB_FLOATWEIGHT +#define BARTAB_FLOATWEIGHT 1 // floating window title weight, set to 0 to not show floating windows +#endif + +int +width_bartabgroups(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_bartabgroups(Bar *bar, BarArg *a) +{ + drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); + return bartabcalculate(bar->mon, a->x, a->w, -1, bartabdraw, NULL, a); +} + +int +click_bartabgroups(Bar *bar, Arg *arg, BarArg *a) +{ + bartabcalculate(bar->mon, 0, a->w, a->x, bartabclick, arg, a); + return ClkWinTitle; +} + +void +bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg) +{ + if (!c) + return; + int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + drw_setscheme(drw, scheme[ + m->sel == c + ? SchemeSel + #ifdef HIDDEN + : HIDDEN(c) + ? SchemeHid + #endif + : groupactive + ? SchemeTitleSel + : SchemeTitleNorm + ]); + if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small + pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) < w) + pad = (w - TEXTW(c->name) + lrpad) / 2; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + drawstateindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, c->isfixed); + + if (BARTAB_BORDERS) { + XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + } + /* Optional tags icons */ + for (i = 0; i < NUMTAGS; i++) { + if ((m->tagset[m->seltags] >> i) & 1) + nviewtags++; + if ((c->tags >> i) & 1) + nclienttags++; + } + + if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) + drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); +} + +#ifndef HIDDEN +#define HIDDEN(C) 0 +#endif + +void +bartabclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg) +{ + if (passx >= x && passx <= x + w) + arg->v = c; +} + +int +bartabcalculate( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +) { + Client *c; + int + i, clientsnmaster = 0, clientsnstack = 0, clientsnfloating = 0, clientsnhidden = 0, + masteractive = 0, fulllayout = 0, + x = offx, w, r, num = 0, den, tgactive; + + for (i = 0; i < LENGTH(bartabmonfns); i++) + if (m ->lt[m->sellt]->arrange == bartabmonfns[i]) { + fulllayout = 1; + break; + } + + for (i = 0, c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + if (HIDDEN(c)) { + clientsnhidden++; + continue; + } + if (c->isfloating) { + clientsnfloating++; + continue; + } + if (m->sel == c) + masteractive = i < m->nmaster; + if (i < m->nmaster) + clientsnmaster++; + else + clientsnstack++; + i++; + } + + if (clientsnmaster + clientsnstack + clientsnfloating + clientsnhidden == 0) + return 0; + + tgactive = 1; + num = tabw; + /* floating mode */ + if ((fulllayout && BARTAB_FLOATWEIGHT) || clientsnmaster + clientsnstack == 0 || !m->lt[m->sellt]->arrange) { + den = clientsnmaster + clientsnstack + clientsnfloating + clientsnhidden; + r = num % den; + w = num / den; + for (c = m->clients, i = 0; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); + x += w + (i < r ? 1 : 0); + i++; + } + /* no master and stack mode, e.g. monocole, grid layouts, fibonacci */ + } else if (fulllayout) { + den = clientsnmaster + clientsnstack + clientsnhidden; + r = num % den; + w = num / den; + for (c = m->clients, i = 0; c; c = c->next) { + if (!ISVISIBLE(c) || (c->isfloating && !HIDDEN(c))) + continue; + tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); + x += w + (i < r ? 1 : 0); + i++; + } + /* tiled mode */ + } else { + den = clientsnmaster; + c = m->clients; + i = 0; + if (den) { + if (clientsnstack + clientsnfloating * BARTAB_FLOATWEIGHT + clientsnhidden) { + tgactive = masteractive; + num = tabw * m->mfact; + } + r = num % den; + w = num / den; + for (; c && i < m->nmaster; c = c->next) { // tiled master + if (!ISVISIBLE(c) || c->isfloating || HIDDEN(c)) + continue; + tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); + x += w + (i < r ? 1 : 0); + i++; + } + tgactive = !tgactive; + num = tabw - num; + } + + den = clientsnstack * BARTAB_STACKWEIGHT + clientsnfloating * BARTAB_FLOATWEIGHT + clientsnhidden * BARTAB_HIDDENWEIGHT; + if (!den) + return 1; + + r = num % den; + w = num / den; + #if BARTAB_STACKWEIGHT + for (; c; c = c->next) { // tiled stack + if (!ISVISIBLE(c) || HIDDEN(c) || c->isfloating) + continue; + tabfn(m, c, passx, x, w * BARTAB_STACKWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); + x += w * BARTAB_STACKWEIGHT + (i - m->nmaster < r ? 1 : 0); + i++; + } + #endif // BARTAB_STACKWEIGHT + + #if BARTAB_HIDDENWEIGHT + for (c = m->clients; c; c = c->next) { // hidden windows + if (!ISVISIBLE(c) || !HIDDEN(c)) + continue; + tabfn(m, c, passx, x, w * BARTAB_HIDDENWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); + x += w * BARTAB_HIDDENWEIGHT + (i - m->nmaster < r ? 1 : 0); + i++; + } + #endif // BARTAB_HIDDENWEIGHT + + #if BARTAB_FLOATWEIGHT + for (c = m->clients; c; c = c->next) { // floating windows + if (!ISVISIBLE(c) || HIDDEN(c) || !c->isfloating) + continue; + tabfn(m, c, passx, x, w * BARTAB_FLOATWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); + x += w * BARTAB_FLOATWEIGHT + (i - m->nmaster < r ? 1 : 0); + i++; + } + #endif // BARTAB_FLOATWEIGHT + } + return 1; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_tabgroups.h b/.local/src/dwm/patch/bar_tabgroups.h new file mode 100644 index 00000000..e118c0d2 --- /dev/null +++ b/.local/src/dwm/patch/bar_tabgroups.h @@ -0,0 +1,7 @@ +static int width_bartabgroups(Bar *bar, BarArg *a); +static int draw_bartabgroups(Bar *bar, BarArg *a); +static int click_bartabgroups(Bar *bar, Arg *arg, BarArg *a); + +static void bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg); +static void bartabclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg); +static int bartabcalculate(Monitor *m, int offx, int w, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_taggrid.c b/.local/src/dwm/patch/bar_taggrid.c new file mode 100644 index 00000000..387f25ba --- /dev/null +++ b/.local/src/dwm/patch/bar_taggrid.c @@ -0,0 +1,149 @@ +int +width_taggrid(Bar *bar, BarArg *a) +{ + return (a->h / 2) * (NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0)) + lrpad; +} + +int +draw_taggrid(Bar *bar, BarArg *a) +{ + unsigned int x, y, h, max_x = 0, columns, occ = 0; + int invert, i,j, k; + Client *c; + + for (c = bar->mon->clients; c; c = c->next) + occ |= c->tags; + + max_x = x = a->x + lrpad / 2; + h = a->h / tagrows - 1; + y = a->y; + columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); + + /* Firstly we will fill the borders of squares */ + XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel); + XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, a->h); + + /* We will draw NUMTAGS squares in tagraws raws. */ + for (j = 0, i = 0; j < tagrows; j++) { + x = a->x + lrpad / 2; + for (k = 0; k < columns; k++, i++) { + if (i < NUMTAGS) { + invert = bar->mon->tagset[bar->mon->seltags] & 1 << i ? 0 : 1; + + /* Select active color for current square */ + XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColBg].pixel : + scheme[SchemeTagsNorm][ColFg].pixel); + XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1); + + /* Mark square if tag has client */ + if (occ & 1 << i) { + XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColFg].pixel : + scheme[SchemeTagsNorm][ColBg].pixel); + XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1, + h / 2, h / 2); + } + } else { + XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel); + XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h); + } + x += h; + if (x > max_x) { + max_x = x; + } + } + y += h; + } + return 1; +} + +int +click_taggrid(Bar *bar, Arg *arg, BarArg *a) +{ + unsigned int i, h, columns; + + h = a->h / tagrows - 1; + columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); + i = (a->x - lrpad / 2) / h + columns * (a->y / h); + if (i >= NUMTAGS) { + i = NUMTAGS - 1; + } + arg->ui = 1 << i; + return ClkTagBar; +} + +void +switchtag(const Arg *arg) +{ + unsigned int columns; + unsigned int new_tagset = 0; + unsigned int pos, i; + int col, row; + Arg new_arg; + + columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); + + for (i = 0; i < NUMTAGS; ++i) { + if (!(selmon->tagset[selmon->seltags] & 1 << i)) { + continue; + } + pos = i; + row = pos / columns; + col = pos % columns; + if (arg->ui & SWITCHTAG_UP) { /* UP */ + row --; + if (row < 0) { + row = tagrows - 1; + } + do { + pos = row * columns + col; + row --; + } while (pos >= NUMTAGS); + } + if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */ + row ++; + if (row >= tagrows) { + row = 0; + } + pos = row * columns + col; + if (pos >= NUMTAGS) { + row = 0; + } + pos = row * columns + col; + } + if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */ + col --; + if (col < 0) { + col = columns - 1; + } + do { + pos = row * columns + col; + col --; + } while (pos >= NUMTAGS); + } + if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */ + col ++; + if (col >= columns) { + col = 0; + } + pos = row * columns + col; + if (pos >= NUMTAGS) { + col = 0; + pos = row * columns + col; + } + } + new_tagset |= 1 << pos; + } + new_arg.ui = new_tagset; + if (arg->ui & SWITCHTAG_TOGGLETAG) { + toggletag(&new_arg); + } + if (arg->ui & SWITCHTAG_TAG) { + tag(&new_arg); + } + if (arg->ui & SWITCHTAG_VIEW) { + view (&new_arg); + } + if (arg->ui & SWITCHTAG_TOGGLEVIEW) { + toggleview (&new_arg); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_taggrid.h b/.local/src/dwm/patch/bar_taggrid.h new file mode 100644 index 00000000..e0c824e8 --- /dev/null +++ b/.local/src/dwm/patch/bar_taggrid.h @@ -0,0 +1,4 @@ +static int width_taggrid(Bar *bar, BarArg *a); +static int draw_taggrid(Bar *bar, BarArg *a); +static int click_taggrid(Bar *bar, Arg *arg, BarArg *a); +static void switchtag(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_tagicons.c b/.local/src/dwm/patch/bar_tagicons.c index 1307b253..d472407c 100644 --- a/.local/src/dwm/patch/bar_tagicons.c +++ b/.local/src/dwm/patch/bar_tagicons.c @@ -1,8 +1,20 @@ char * tagicon(Monitor *m, int tag) { + #if BAR_ALTTAGSDECORATION_PATCH + Client *c; + #endif // BAR_ALTTAGSDECORATION_PATCH int tagindex = tag + NUMTAGS * m->index; if (tagindex >= LENGTH(tagicons[DEFAULT_TAGS])) tagindex = tagindex % LENGTH(tagicons[DEFAULT_TAGS]); + #if BAR_ALTTAGSDECORATION_PATCH + for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); + if (c) + return tagicons[ALT_TAGS_DECORATION][tagindex]; + #endif // BAR_ALTTAGSDECORATION_PATCH + #if BAR_ALTERNATIVE_TAGS_PATCH + if (m->alttag) + return tagicons[ALTERNATIVE_TAGS][tagindex]; + #endif // BAR_ALTERNATIVE_TAGS_PATCH return tagicons[DEFAULT_TAGS][tagindex]; -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_tagicons.h b/.local/src/dwm/patch/bar_tagicons.h index f2eafb4c..be5d35c9 100644 --- a/.local/src/dwm/patch/bar_tagicons.h +++ b/.local/src/dwm/patch/bar_tagicons.h @@ -4,4 +4,4 @@ enum { ALT_TAGS_DECORATION, }; -static char * tagicon(Monitor *m, int tag); +static char * tagicon(Monitor *m, int tag); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_tags.c b/.local/src/dwm/patch/bar_tags.c index 82f3a537..df83144f 100644 --- a/.local/src/dwm/patch/bar_tags.c +++ b/.local/src/dwm/patch/bar_tags.c @@ -2,8 +2,18 @@ int width_tags(Bar *bar, BarArg *a) { int w, i; + #if BAR_HIDEVACANTTAGS_PATCH + Client *c; + unsigned int occ = 0; + for (c = bar->mon->clients; c; c = c->next) + occ |= c->tags == 255 ? 0 : c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH for (w = 0, i = 0; i < NUMTAGS; i++) { + #if BAR_HIDEVACANTTAGS_PATCH + if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH w += TEXTW(tagicon(bar->mon, i)); } return w; @@ -20,11 +30,20 @@ draw_tags(Bar *bar, BarArg *a) Monitor *m = bar->mon; for (c = m->clients; c; c = c->next) { + #if BAR_HIDEVACANTTAGS_PATCH + occ |= c->tags == 255 ? 0 : c->tags; + #else occ |= c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH if (c->isurgent) urg |= c->tags; } for (i = 0; i < NUMTAGS; i++) { + #if BAR_HIDEVACANTTAGS_PATCH + /* do not draw vacant tags */ + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH icon = tagicon(bar->mon, i); invert = 0; @@ -48,8 +67,18 @@ int click_tags(Bar *bar, Arg *arg, BarArg *a) { int i = 0, x = lrpad / 2; + #if BAR_HIDEVACANTTAGS_PATCH + Client *c; + unsigned int occ = 0; + for (c = bar->mon->clients; c; c = c->next) + occ |= c->tags == 255 ? 0 : c->tags; + #endif // BAR_HIDEVACANTTAGS_PATCH do { + #if BAR_HIDEVACANTTAGS_PATCH + if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH x += TEXTW(tagicon(bar->mon, i)); } while (a->x >= x && ++i < NUMTAGS); if (i < NUMTAGS) { diff --git a/.local/src/dwm/patch/bar_tags.h b/.local/src/dwm/patch/bar_tags.h index f6987d68..9ab784b7 100644 --- a/.local/src/dwm/patch/bar_tags.h +++ b/.local/src/dwm/patch/bar_tags.h @@ -1,3 +1,3 @@ static int width_tags(Bar *bar, BarArg *a); static int draw_tags(Bar *bar, BarArg *a); -static int click_tags(Bar *bar, Arg *arg, BarArg *a); +static int click_tags(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_vtcolors.c b/.local/src/dwm/patch/bar_vtcolors.c new file mode 100644 index 00000000..2002985f --- /dev/null +++ b/.local/src/dwm/patch/bar_vtcolors.c @@ -0,0 +1,68 @@ +void +get_vt_colors(void) +{ + char *cfs[3] = { + "/sys/module/vt/parameters/default_red", + "/sys/module/vt/parameters/default_grn", + "/sys/module/vt/parameters/default_blu", + }; + char vtcs[16][8]; + char tk[] = ","; + char cl[64]; + char *tp = NULL; + FILE *fp; + size_t r; + int i, c, n, len; + for (i = 0; i < 16; i++) + strcpy(vtcs[i], "#000000"); + + for (i = 0, r = 0; i < 3; i++) { + if ((fp = fopen(cfs[i], "r")) == NULL) + continue; + while ((cl[r] = fgetc(fp)) != EOF && cl[r] != '\n') + r++; + cl[r] = '\0'; + for (c = 0, tp = cl, n = 0; c < 16; c++, tp++) { + if ((r = strcspn(tp, tk)) == -1) + break; + for (n = 0; r && *tp >= 48 && *tp < 58; r--, tp++) + n = n * 10 - 48 + *tp; + vtcs[c][i * 2 + 1] = n / 16 < 10 ? n / 16 + 48 : n / 16 + 87; + vtcs[c][i * 2 + 2] = n % 16 < 10 ? n % 16 + 48 : n % 16 + 87; + } + fclose(fp); + } + + len = LENGTH(colors); + if (len > LENGTH(color_ptrs)) + len = LENGTH(color_ptrs); + for (i = 0; i < len; i++) { + for (c = 0; c < ColCount; c++) { + n = color_ptrs[i][c]; + if (n > -1 && strlen(colors[i][c]) >= strlen(vtcs[n])) + memcpy(colors[i][c], vtcs[n], 7); + } + } +} + +int get_luminance(char *r) +{ + char *c = r; + int n[3] = {0}; + int i = 0; + + while (*c) { + if (*c >= 48 && *c < 58) + n[i / 2] = n[i / 2] * 16 - 48 + *c; + else if (*c >= 65 && *c < 71) + n[i / 2] = n[i / 2] * 16 - 55 + *c; + else if (*c >= 97 && *c < 103) + n[i / 2] = n[i / 2] * 16 - 87 + *c; + else + i--; + i++; + c++; + } + + return (0.299 * n[0] + 0.587 * n[1] + 0.114 * n[2]) / 2.55; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_vtcolors.h b/.local/src/dwm/patch/bar_vtcolors.h new file mode 100644 index 00000000..7341e6a4 --- /dev/null +++ b/.local/src/dwm/patch/bar_vtcolors.h @@ -0,0 +1,2 @@ +static void get_vt_colors(void); +static int get_luminance(char *rgb); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitle.c b/.local/src/dwm/patch/bar_wintitle.c new file mode 100644 index 00000000..1e9fb772 --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle.c @@ -0,0 +1,51 @@ +int +width_wintitle(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_wintitle(Bar *bar, BarArg *a) +{ + #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad; + #elif BAR_TITLE_LEFT_PAD_PATCH + int x = a->x + lrpad / 2, w = a->w - lrpad / 2; + #elif BAR_TITLE_RIGHT_PAD_PATCH + int x = a->x, w = a->w - lrpad / 2; + #else + int x = a->x, w = a->w; + #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH + Monitor *m = bar->mon; + int pad = lrpad / 2; + + if (!m->sel) { + drw_setscheme(drw, scheme[SchemeTitleNorm]); + drw_rect(drw, x, a->y, w, a->h, 1, 1); + return 0; + } + + drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]); + #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH + XSetErrorHandler(xerrordummy); + #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + if (TEXTW(m->sel->name) < w) + pad = (w - TEXTW(m->sel->name) + lrpad) / 2; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + drw_text(drw, x, a->y, w, a->h, pad, m->sel->name, 0, False); + #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH + XSync(dpy, False); + XSetErrorHandler(xerror); + #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH + drawstateindicator(m, m->sel, 1, x, a->y, w, a->h, 0, 0, m->sel->isfixed); + return 1; +} + +int +click_wintitle(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkWinTitle; +} + + diff --git a/.local/src/dwm/patch/bar_wintitle.h b/.local/src/dwm/patch/bar_wintitle.h new file mode 100644 index 00000000..349f948f --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle.h @@ -0,0 +1,3 @@ +static int width_wintitle(Bar *bar, BarArg *a); +static int draw_wintitle(Bar *bar, BarArg *a); +static int click_wintitle(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitle_floating.c b/.local/src/dwm/patch/bar_wintitle_floating.c new file mode 100644 index 00000000..001486b5 --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle_floating.c @@ -0,0 +1,45 @@ +int +width_wintitle_floating(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_wintitle_floating(Bar *bar, BarArg *a) +{ + drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); + return calc_wintitle_floating(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); +} + +int +click_wintitle_floating(Bar *bar, Arg *arg, BarArg *a) +{ + calc_wintitle_floating(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); + return ClkWinTitle; +} + +int +calc_wintitle_floating( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +) { + Client *c; + int clientsnfloating = 0, w, r; + int groupactive = GRP_FLOAT; + + for (c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c) || HIDDEN(c)) + continue; + if (c->isfloating) + clientsnfloating++; + } + + if (!clientsnfloating) + return 0; + + w = tabw / clientsnfloating; + r = tabw % clientsnfloating; + c = flextitledrawarea(m, m->clients, offx, r, w, clientsnfloating, SCHEMEFOR(GRP_FLOAT), 0, 0, 1, passx, tabfn, arg, barg); + return 1; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitle_floating.h b/.local/src/dwm/patch/bar_wintitle_floating.h new file mode 100644 index 00000000..d04569ca --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle_floating.h @@ -0,0 +1,8 @@ +static int width_wintitle_floating(Bar *bar, BarArg *a); +static int draw_wintitle_floating(Bar *bar, BarArg *a); +static int click_wintitle_floating(Bar *bar, Arg *arg, BarArg *a); +static int calc_wintitle_floating( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitle_hidden.c b/.local/src/dwm/patch/bar_wintitle_hidden.c new file mode 100644 index 00000000..1fa12bc7 --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle_hidden.c @@ -0,0 +1,45 @@ +int +width_wintitle_hidden(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_wintitle_hidden(Bar *bar, BarArg *a) +{ + drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); + return calc_wintitle_hidden(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); +} + +int +click_wintitle_hidden(Bar *bar, Arg *arg, BarArg *a) +{ + calc_wintitle_hidden(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); + return ClkWinTitle; +} + +int +calc_wintitle_hidden( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +) { + Client *c; + int clientsnhidden = 0, w, r; + int groupactive = GRP_HIDDEN; + + for (c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + if (HIDDEN(c)) + clientsnhidden++; + } + + if (!clientsnhidden) + return 0; + + w = tabw / clientsnhidden; + r = tabw % clientsnhidden; + c = flextitledrawarea(m, m->clients, offx, r, w, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg, barg); + return 1; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitle_hidden.h b/.local/src/dwm/patch/bar_wintitle_hidden.h new file mode 100644 index 00000000..e757391d --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitle_hidden.h @@ -0,0 +1,8 @@ +static int width_wintitle_hidden(Bar *bar, BarArg *a); +static int draw_wintitle_hidden(Bar *bar, BarArg *a); +static int click_wintitle_hidden(Bar *bar, Arg *arg, BarArg *a); +static int calc_wintitle_hidden( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), + Arg *arg, BarArg *barg +); \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitleactions.c b/.local/src/dwm/patch/bar_wintitleactions.c new file mode 100644 index 00000000..e94fe067 --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitleactions.c @@ -0,0 +1,93 @@ +void +hide(Client *c) { + + Client *n; + if (!c || HIDDEN(c)) + return; + + Window w = c->win; + static XWindowAttributes ra, ca; + + // more or less taken directly from blackbox's hide() function + XGrabServer(dpy); + XGetWindowAttributes(dpy, root, &ra); + XGetWindowAttributes(dpy, w, &ca); + // prevent UnmapNotify events + XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask); + XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask); + XUnmapWindow(dpy, w); + setclientstate(c, IconicState); + XSelectInput(dpy, root, ra.your_event_mask); + XSelectInput(dpy, w, ca.your_event_mask); + XUngrabServer(dpy); + + if (c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { + for (n = c->snext; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); + if (!n) + for (n = c->mon->stack; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); + } else { + n = nexttiled(c); + if (!n) + n = prevtiled(c); + } + focus(n); + arrange(c->mon); +} + +void +show(Client *c) +{ + if (!c || !HIDDEN(c)) + return; + + XMapWindow(dpy, c->win); + setclientstate(c, NormalState); + arrange(c->mon); +} + +void +togglewin(const Arg *arg) +{ + Client *c = (Client*)arg->v; + if (!c) + return; + if (c == selmon->sel) + hide(c); + else { + if (HIDDEN(c)) + show(c); + focus(c); + restack(c->mon); + } +} + +Client * +prevtiled(Client *c) +{ + Client *p, *i; + for (p = NULL, i = c->mon->clients; c && i != c; i = i->next) + if (ISVISIBLE(i) && !HIDDEN(i)) + p = i; + return p; +} + +void +showhideclient(const Arg *arg) +{ + Client *c = (Client*)arg->v; + if (!c) + c = selmon->sel; + if (!c) + return; + + #if WARP_PATCH + force_warp = 1; + #endif // WARP_PATCH + if (HIDDEN(c)) { + show(c); + focus(c); + restack(c->mon); + } else { + hide(c); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/bar_wintitleactions.h b/.local/src/dwm/patch/bar_wintitleactions.h new file mode 100644 index 00000000..67a9d791 --- /dev/null +++ b/.local/src/dwm/patch/bar_wintitleactions.h @@ -0,0 +1,5 @@ +static void hide(Client *c); +static void show(Client *c); +static void togglewin(const Arg *arg); +static Client * prevtiled(Client *c); +static void showhideclient(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/cfacts.c b/.local/src/dwm/patch/cfacts.c new file mode 100644 index 00000000..ece210f4 --- /dev/null +++ b/.local/src/dwm/patch/cfacts.c @@ -0,0 +1,23 @@ +void +setcfact(const Arg *arg) +{ + float f; + Client *c; + + c = selmon->sel; + + if (!arg || !c || !selmon->lt[selmon->sellt]->arrange) + return; + if (!arg->f) + f = 1.0; + else if (arg->f > 4.0) // set fact absolutely + f = arg->f - 4.0; + else + f = arg->f + c->cfact; + if (f < 0.25) + f = 0.25; + else if (f > 4.0) + f = 4.0; + c->cfact = f; + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/cfacts.h b/.local/src/dwm/patch/cfacts.h new file mode 100644 index 00000000..b8d8b041 --- /dev/null +++ b/.local/src/dwm/patch/cfacts.h @@ -0,0 +1 @@ +static void setcfact(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/cmdcustomize.c b/.local/src/dwm/patch/cmdcustomize.c new file mode 100644 index 00000000..1e62d205 --- /dev/null +++ b/.local/src/dwm/patch/cmdcustomize.c @@ -0,0 +1,5 @@ +char* +help(void) +{ + return "usage: dwm [-hv] [-fn font] [-nb color] [-nf color] [-sb color] [-sf color]\n[-df font] [-dnf color] [-dnb color] [-dsf color] [-dsb color]\n"; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/cmdcustomize.h b/.local/src/dwm/patch/cmdcustomize.h new file mode 100644 index 00000000..280f5b87 --- /dev/null +++ b/.local/src/dwm/patch/cmdcustomize.h @@ -0,0 +1 @@ +static char* help(); \ No newline at end of file diff --git a/.local/src/dwm/patch/combo.c b/.local/src/dwm/patch/combo.c index d668d4a2..43f7e5d4 100644 --- a/.local/src/dwm/patch/combo.c +++ b/.local/src/dwm/patch/combo.c @@ -1,15 +1,21 @@ static int combo = 0; +#if !BAR_HOLDBAR_PATCH void keyrelease(XEvent *e) { combo = 0; } +#endif // !BAR_HOLDBAR_PATCH void combotag(const Arg *arg) { if (selmon->sel && arg->ui & TAGMASK) { + #if SWITCHTAG_PATCH + if (selmon->sel->switchtag) + selmon->sel->switchtag = 0; + #endif // SWITCHTAG_PATCH if (combo) { selmon->sel->tags |= arg->ui & TAGMASK; } else { @@ -31,9 +37,13 @@ comboview(const Arg *arg) selmon->seltags ^= 1; /*toggle tagset*/ combo = 1; if (newtags) { + #if PERTAG_PATCH pertagview(&((Arg) { .ui = newtags })); + #else + selmon->tagset[selmon->seltags] = newtags; + #endif // PERTAG_PATCH } } focus(NULL); arrange(selmon); -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/combo.h b/.local/src/dwm/patch/combo.h index e90f5ecd..752f6363 100644 --- a/.local/src/dwm/patch/combo.h +++ b/.local/src/dwm/patch/combo.h @@ -1,3 +1,5 @@ +#if !BAR_HOLDBAR_PATCH static void keyrelease(XEvent *e); +#endif // !BAR_HOLDBAR_PATCH static void combotag(const Arg *arg); -static void comboview(const Arg *arg); +static void comboview(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/cool_autostart.c b/.local/src/dwm/patch/cool_autostart.c new file mode 100644 index 00000000..2bc3c3b4 --- /dev/null +++ b/.local/src/dwm/patch/cool_autostart.c @@ -0,0 +1,28 @@ +/* dwm will keep pid's of processes from autostart array and kill them at quit */ +static pid_t *autostart_pids; +static size_t autostart_len; + +/* execute command from autostart array */ +static void +autostart_exec() +{ + const char *const *p; + size_t i = 0; + + /* count entries */ + for (p = autostart; *p; autostart_len++, p++) + while (*++p); + + autostart_pids = malloc(autostart_len * sizeof(pid_t)); + for (p = autostart; *p; i++, p++) { + if ((autostart_pids[i] = fork()) == 0) { + setsid(); + execvp(*p, (char *const *)p); + fprintf(stderr, "dwm: execvp %s\n", *p); + perror(" failed"); + _exit(EXIT_FAILURE); + } + /* skip arguments */ + while (*++p); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/cool_autostart.h b/.local/src/dwm/patch/cool_autostart.h new file mode 100644 index 00000000..8dc0d192 --- /dev/null +++ b/.local/src/dwm/patch/cool_autostart.h @@ -0,0 +1 @@ +static void autostart_exec(void); \ No newline at end of file diff --git a/.local/src/dwm/patch/cyclelayouts.h b/.local/src/dwm/patch/cyclelayouts.h index c3918f8b..02c5f9d0 100644 --- a/.local/src/dwm/patch/cyclelayouts.h +++ b/.local/src/dwm/patch/cyclelayouts.h @@ -1 +1 @@ -static void cyclelayout(const Arg *arg); +static void cyclelayout(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/decorationhints.c b/.local/src/dwm/patch/decorationhints.c new file mode 100644 index 00000000..66369983 --- /dev/null +++ b/.local/src/dwm/patch/decorationhints.c @@ -0,0 +1,38 @@ +static Atom motifatom; + +void +updatemotifhints(Client *c) +{ + Atom real; + int format; + unsigned char *p = NULL; + unsigned long n, extra; + unsigned long *motif; + int width, height; + + if (!decorhints) + return; + + if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom, + &real, &format, &n, &extra, &p) == Success && p != NULL) { + motif = (unsigned long*)p; + if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) { + width = WIDTH(c); + height = HEIGHT(c); + + if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL || + motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER || + motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE) + #if SETBORDERPX_PATCH + c->bw = c->oldbw = c->mon->borderpx; + #else + c->bw = c->oldbw = borderpx; + #endif // SETBORDERPX_PATCH + else + c->bw = c->oldbw = 0; + + resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0); + } + XFree(p); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/decorationhints.h b/.local/src/dwm/patch/decorationhints.h new file mode 100644 index 00000000..3a9c641c --- /dev/null +++ b/.local/src/dwm/patch/decorationhints.h @@ -0,0 +1,8 @@ +#define MWM_HINTS_FLAGS_FIELD 0 +#define MWM_HINTS_DECORATIONS_FIELD 2 +#define MWM_HINTS_DECORATIONS (1 << 1) +#define MWM_DECOR_ALL (1 << 0) +#define MWM_DECOR_BORDER (1 << 1) +#define MWM_DECOR_TITLE (1 << 3) + +static void updatemotifhints(Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patch/dragcfact.c b/.local/src/dwm/patch/dragcfact.c new file mode 100644 index 00000000..fce5c92d --- /dev/null +++ b/.local/src/dwm/patch/dragcfact.c @@ -0,0 +1,82 @@ +void +dragcfact(const Arg *arg) +{ + int prev_x, prev_y, dist_x, dist_y; + float fact; + Client *c; + XEvent ev; + Time lasttime = 0; + + if (!(c = selmon->sel)) + return; + if (c->isfloating) { + resizemouse(arg); + return; + } + #if !FAKEFULLSCREEN_PATCH + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && !c->fakefullscreen) /* no support resizing fullscreen windows by mouse */ + return; + #else + if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ + return; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #endif // !FAKEFULLSCREEN_PATCH + restack(selmon); + + if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, + None, cursor[CurIronCross]->cursor, CurrentTime) != GrabSuccess) + return; + + #if WARP_PATCH + ignore_warp = 1; + #endif // WARP_PATCH + + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); + + prev_x = prev_y = -999999; + + do { + XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); + switch(ev.type) { + case ConfigureRequest: + case Expose: + case MapRequest: + handler[ev.type](&ev); + break; + case MotionNotify: + if ((ev.xmotion.time - lasttime) <= (1000 / 60)) + continue; + lasttime = ev.xmotion.time; + if (prev_x == -999999) { + prev_x = ev.xmotion.x_root; + prev_y = ev.xmotion.y_root; + } + + dist_x = ev.xmotion.x - prev_x; + dist_y = ev.xmotion.y - prev_y; + + if (abs(dist_x) > abs(dist_y)) { + fact = (float) 4.0 * dist_x / c->mon->ww; + } else { + fact = (float) -4.0 * dist_y / c->mon->wh; + } + + if (fact) + setcfact(&((Arg) { .f = fact })); + + prev_x = ev.xmotion.x; + prev_y = ev.xmotion.y; + break; + } + } while (ev.type != ButtonRelease); + + #if WARP_PATCH + ignore_warp = 0; + #endif // WARP_PATCH + + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); + + XUngrabPointer(dpy, CurrentTime); + while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/dragcfact.h b/.local/src/dwm/patch/dragcfact.h new file mode 100644 index 00000000..6cf6b9c0 --- /dev/null +++ b/.local/src/dwm/patch/dragcfact.h @@ -0,0 +1 @@ +static void dragcfact(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/dragmfact.c b/.local/src/dwm/patch/dragmfact.c new file mode 100644 index 00000000..257b5c1f --- /dev/null +++ b/.local/src/dwm/patch/dragmfact.c @@ -0,0 +1,231 @@ +void +dragmfact(const Arg *arg) +{ + unsigned int n; + int py, px; // pointer coordinates + int ax, ay, aw, ah; // area position, width and height + int center = 0, horizontal = 0, mirror = 0, fixed = 0; // layout configuration + double fact; + Monitor *m; + XEvent ev; + Time lasttime = 0; + + m = selmon; + + #if VANITYGAPS_PATCH + int oh, ov, ih, iv; + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + Client *c; + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + + ax = m->wx; + ay = m->wy; + ah = m->wh; + aw = m->ww; + + if (!n) + return; + #if FLEXTILE_DELUXE_LAYOUT + else if (m->lt[m->sellt]->arrange == &flextile) { + int layout = m->ltaxis[LAYOUT]; + if (layout < 0) { + mirror = 1; + layout *= -1; + } + if (layout > FLOATING_MASTER) { + layout -= FLOATING_MASTER; + fixed = 1; + } + + if (layout == SPLIT_HORIZONTAL || layout == SPLIT_HORIZONTAL_DUAL_STACK) + horizontal = 1; + else if (layout == SPLIT_CENTERED_VERTICAL && (fixed || n - m->nmaster > 1)) + center = 1; + else if (layout == FLOATING_MASTER) { + center = 1; + if (aw < ah) + horizontal = 1; + } + else if (layout == SPLIT_CENTERED_HORIZONTAL) { + if (fixed || n - m->nmaster > 1) + center = 1; + horizontal = 1; + } + } + #endif // FLEXTILE_DELUXE_LAYOUT + #if CENTEREDMASTER_LAYOUT + else if (m->lt[m->sellt]->arrange == ¢eredmaster && (fixed || n - m->nmaster > 1)) + center = 1; + #endif // CENTEREDMASTER_LAYOUT + #if CENTEREDFLOATINGMASTER_LAYOUT + else if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) + center = 1; + #endif // CENTEREDFLOATINGMASTER_LAYOUT + #if BSTACK_LAYOUT + else if (m->lt[m->sellt]->arrange == &bstack) + horizontal = 1; + #endif // BSTACK_LAYOUT + #if BSTACKHORIZ_LAYOUT + else if (m->lt[m->sellt]->arrange == &bstackhoriz) + horizontal = 1; + #endif // BSTACKHORIZ_LAYOUT + + /* do not allow mfact to be modified under certain conditions */ + if (!m->lt[m->sellt]->arrange // floating layout + || (!fixed && m->nmaster && n <= m->nmaster) // no master + #if MONOCLE_LAYOUT + || m->lt[m->sellt]->arrange == &monocle + #endif // MONOCLE_LAYOUT + #if GRIDMODE_LAYOUT + || m->lt[m->sellt]->arrange == &grid + #endif // GRIDMODE_LAYOUT + #if HORIZGRID_LAYOUT + || m->lt[m->sellt]->arrange == &horizgrid + #endif // HORIZGRID_LAYOUT + #if GAPPLESSGRID_LAYOUT + || m->lt[m->sellt]->arrange == &gaplessgrid + #endif // GAPPLESSGRID_LAYOUT + #if NROWGRID_LAYOUT + || m->lt[m->sellt]->arrange == &nrowgrid + #endif // NROWGRID_LAYOUT + #if FLEXTILE_DELUXE_LAYOUT + || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) + #endif // FLEXTILE_DELUXE_LAYOUT + ) + return; + + #if VANITYGAPS_PATCH + ay += oh; + ax += ov; + aw -= 2*ov; + ah -= 2*oh; + #endif // VANITYGAPS_PATCH + + if (center) { + if (horizontal) { + px = ax + aw / 2; + #if VANITYGAPS_PATCH + py = ay + ah / 2 + (ah - 2*ih) * (m->mfact / 2.0) + ih / 2; + #else + py = ay + ah / 2 + ah * m->mfact / 2.0; + #endif // VANITYGAPS_PATCH + } else { // vertical split + #if VANITYGAPS_PATCH + px = ax + aw / 2 + (aw - 2*iv) * m->mfact / 2.0 + iv / 2; + #else + px = ax + aw / 2 + aw * m->mfact / 2.0; + #endif // VANITYGAPS_PATCH + py = ay + ah / 2; + } + } else if (horizontal) { + px = ax + aw / 2; + if (mirror) + #if VANITYGAPS_PATCH + py = ay + (ah - ih) * (1.0 - m->mfact) + ih / 2; + #else + py = ay + (ah * (1.0 - m->mfact)); + #endif // VANITYGAPS_PATCH + else + #if VANITYGAPS_PATCH + py = ay + ((ah - ih) * m->mfact) + ih / 2; + #else + py = ay + (ah * m->mfact); + #endif // VANITYGAPS_PATCH + } else { // vertical split + if (mirror) + #if VANITYGAPS_PATCH + px = ax + (aw - iv) * (1.0 - m->mfact) + iv / 2; + #else + px = ax + (aw * m->mfact); + #endif // VANITYGAPS_PATCH + else + #if VANITYGAPS_PATCH + px = ax + ((aw - iv) * m->mfact) + iv / 2; + #else + px = ax + (aw * m->mfact); + #endif // VANITYGAPS_PATCH + py = ay + ah / 2; + } + + if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, + None, cursor[horizontal ? CurResizeVertArrow : CurResizeHorzArrow]->cursor, CurrentTime) != GrabSuccess) + return; + + #if WARP_PATCH + ignore_warp = 1; + #endif // WARP_PATCH + + XWarpPointer(dpy, None, root, 0, 0, 0, 0, px, py); + + do { + XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); + switch(ev.type) { + case ConfigureRequest: + case Expose: + case MapRequest: + handler[ev.type](&ev); + break; + case MotionNotify: + if ((ev.xmotion.time - lasttime) <= (1000 / 40)) + continue; + if (lasttime != 0) { + px = ev.xmotion.x; + py = ev.xmotion.y; + } + lasttime = ev.xmotion.time; + + #if VANITYGAPS_PATCH + if (center) + if (horizontal) + if (py - ay > ah / 2) + fact = (double) 1.0 - (ay + ah - py - ih / 2) * 2 / (double) (ah - 2*ih); + else + fact = (double) 1.0 - (py - ay - ih / 2) * 2 / (double) (ah - 2*ih); + else + if (px - ax > aw / 2) + fact = (double) 1.0 - (ax + aw - px - iv / 2) * 2 / (double) (aw - 2*iv); + else + fact = (double) 1.0 - (px - ax - iv / 2) * 2 / (double) (aw - 2*iv); + else + if (horizontal) + fact = (double) (py - ay - ih / 2) / (double) (ah - ih); + else + fact = (double) (px - ax - iv / 2) / (double) (aw - iv); + #else + if (center) + if (horizontal) + if (py - ay > ah / 2) + fact = (double) 1.0 - (ay + ah - py) * 2 / (double) ah; + else + fact = (double) 1.0 - (py - ay) * 2 / (double) ah; + else + if (px - ax > aw / 2) + fact = (double) 1.0 - (ax + aw - px) * 2 / (double) aw; + else + fact = (double) 1.0 - (px - ax) * 2 / (double) aw; + else + if (horizontal) + fact = (double) (py - ay) / (double) ah; + else + fact = (double) (px - ax) / (double) aw; + #endif // VANITYGAPS_PATCH + + if (!center && mirror) + fact = 1.0 - fact; + + setmfact(&((Arg) { .f = 1.0 + fact })); + px = ev.xmotion.x; + py = ev.xmotion.y; + break; + } + } while (ev.type != ButtonRelease); + + #if WARP_PATCH + ignore_warp = 0; + #endif // WARP_PATCH + + XUngrabPointer(dpy, CurrentTime); + while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/dragmfact.h b/.local/src/dwm/patch/dragmfact.h new file mode 100644 index 00000000..6390b717 --- /dev/null +++ b/.local/src/dwm/patch/dragmfact.h @@ -0,0 +1 @@ +static void dragmfact(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/dwmc b/.local/src/dwm/patch/dwmc new file mode 100755 index 00000000..66862311 --- /dev/null +++ b/.local/src/dwm/patch/dwmc @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +signal() { + xsetroot -name "fsignal:$*" +} + +case $# in +1) + case $1 in + focusurgent) ;& + mirrorlayout) ;& + mpdcontrol) ;& + pushdown) ;& + pushup) ;& + self_restart) ;& + setlayout) ;& + setcfact) ;& + switchcol) ;& + view) ;& + viewall) ;& + viewtoleft) ;& + viewtoright) ;& + tagtoleft) ;& + tagtoright) ;& + tagandviewtoleft) ;& + tagandviewtoright) ;& + transfer) ;& + transferall) ;& + togglealttag) ;& + togglebar) ;& + togglefloating) ;& + togglefullscreen) ;& + fullscreen) ;& + togglefakefullscreen) ;& + togglesticky) ;& + togglehorizontalmax) ;& + toggleverticalmax) ;& + togglemax) ;& + togglegaps) ;& + defaultgaps) ;& + unfloatvisible) ;& + winview) ;& + xrdb) ;& + zoom) ;& + killclient) ;& + quit) + signal $1 + ;; + *) + echo "Unknown command ($1) or missing one argument." + exit 1 + ;; + esac + ;; +2) + case $1 in + cyclelayout) ;& + explace) ;& + moveplace) ;& + mpdchange) ;& + setkeymode) ;& + switchtag) ;& + togglescratch) ;& + view) + signal $1 ui $2 + ;; + viewex) ;& + toggleviewex) ;& + tagallmon) ;& + tagswapmon) ;& + tagex) ;& + toggletagex) ;& + setborderpx) ;& + setgaps) ;& + setlayoutex) ;& + setlayoutaxisex) ;& + swapfocus) ;& + focusstack) ;& + pushstack) ;& + inplacerotate) ;& + rotatestack) ;& + rotatelayoutaxis) ;& + incnmaster) ;& + incnstack) ;& + incrgaps) ;& + incrigaps) ;& + incrogaps) ;& + incrihgaps) ;& + incrivgaps) ;& + incrohgaps) ;& + incrovgaps) ;& + movestack) ;& + shiftview) ;& + shiftviewclients) ;& + focusmon) ;& + tagmon) + signal $1 i $2 + ;; + setcfact) ;& + setmfact) + signal $1 f $2 + ;; + *) + echo "Unknown command ($1) or too many arguments" + exit 1 + ;; + esac + ;; +5) + case $1 in + setgaps) + # Expects "setgaps oh ov ih iv" where -1 means to keep existing values + [ $2 = -1 ] && oh=128 || oh=$2 + [ $3 = -1 ] && ov=128 || ov=$3 + [ $4 = -1 ] && ih=128 || ih=$4 + [ $5 = -1 ] && iv=128 || iv=$5 + signal $1 i $(((oh << 24) + (ov << 16) + (ih << 8) + iv)) + ;; + *) + echo "Unknown command ($1) or too many arguments" + exit 1 + ;; + esac + ;; +*) + echo "Unknown command ($1) or too many arguments" + exit 1 + ;; +esac diff --git a/.local/src/dwm/patch/dwmc.c b/.local/src/dwm/patch/dwmc.c new file mode 100644 index 00000000..9c2e8631 --- /dev/null +++ b/.local/src/dwm/patch/dwmc.c @@ -0,0 +1,100 @@ +void +setlayoutex(const Arg *arg) +{ + setlayout(&((Arg) { .v = &layouts[arg->i] })); +} + +void +viewex(const Arg *arg) +{ + view(&((Arg) { .ui = 1 << arg->ui })); +} + +void +viewallex(const Arg *arg) +{ + #if SCRATCHPADS_PATCH + view(&((Arg){.ui = ~SPTAGMASK})); + #else + view(&((Arg){.ui = ~0})); + #endif // SCRATCHPADS_PATCH +} + +void +toggleviewex(const Arg *arg) +{ + toggleview(&((Arg) { .ui = 1 << arg->ui })); +} + +void +tagex(const Arg *arg) +{ + tag(&((Arg) { .ui = 1 << arg->ui })); +} + +void +toggletagex(const Arg *arg) +{ + toggletag(&((Arg) { .ui = 1 << arg->ui })); +} + +void +tagallex(const Arg *arg) +{ + #if SCRATCHPADS_PATCH + tag(&((Arg){.ui = ~SPTAGMASK})); + #else + tag(&((Arg){.ui = ~0})); + #endif // SCRATCHPADS_PATCH +} + +int +fake_signal(void) +{ + char fsignal[256]; + char indicator[9] = "fsignal:"; + char str_sig[50]; + char param[16]; + int i, len_str_sig, n, paramn; + size_t len_fsignal, len_indicator = strlen(indicator); + Arg arg; + + // Get root name property + if (gettextprop(root, XA_WM_NAME, fsignal, sizeof(fsignal))) { + len_fsignal = strlen(fsignal); + + // Check if this is indeed a fake signal + if (len_indicator > len_fsignal ? 0 : strncmp(indicator, fsignal, len_indicator) == 0) { + paramn = sscanf(fsignal+len_indicator, "%s%n%s%n", str_sig, &len_str_sig, param, &n); + + if (paramn == 1) arg = (Arg) {0}; + else if (paramn > 2) return 1; + else if (strncmp(param, "i", n - len_str_sig) == 0) + #if IPC_PATCH + sscanf(fsignal + len_indicator + n, "%li", &(arg.i)); + #else + sscanf(fsignal + len_indicator + n, "%i", &(arg.i)); + #endif // IPC_PATCH + else if (strncmp(param, "ui", n - len_str_sig) == 0) + #if IPC_PATCH + sscanf(fsignal + len_indicator + n, "%lu", &(arg.ui)); + #else + sscanf(fsignal + len_indicator + n, "%u", &(arg.ui)); + #endif // IPC_PATCH + else if (strncmp(param, "f", n - len_str_sig) == 0) + sscanf(fsignal + len_indicator + n, "%f", &(arg.f)); + else return 1; + + // Check if a signal was found, and if so handle it + for (i = 0; i < LENGTH(signals); i++) + if (strncmp(str_sig, signals[i].sig, len_str_sig) == 0 && signals[i].func) + signals[i].func(&(arg)); + + // A fake signal was sent + return 1; + } + } + + // No fake signal was sent, so proceed with update + return 0; +} diff --git a/.local/src/dwm/patch/dwmc.h b/.local/src/dwm/patch/dwmc.h new file mode 100644 index 00000000..4fb04057 --- /dev/null +++ b/.local/src/dwm/patch/dwmc.h @@ -0,0 +1,13 @@ +typedef struct { + const char * sig; + void (*func)(const Arg *); +} Signal; + +static void setlayoutex(const Arg *arg); +static void viewex(const Arg *arg); +static void viewallex(const Arg *arg); +static void toggleviewex(const Arg *arg); +static void tagex(const Arg *arg); +static void toggletagex(const Arg *arg); +static void tagallex(const Arg *arg); +static int fake_signal(void); diff --git a/.local/src/dwm/patch/exresize.c b/.local/src/dwm/patch/exresize.c new file mode 100644 index 00000000..e9786b3d --- /dev/null +++ b/.local/src/dwm/patch/exresize.c @@ -0,0 +1,195 @@ +#define EXPAND_LEFT (1 << 0) +#define EXPAND_RIGHT (1 << 2) +#define EXPAND_UP (1 << 4) +#define EXPAND_DOWN (1 << 6) + +#define IS_SET(q, w) ((q & w) != 0) +#define IS_FORCED(q, w) IS_SET((q << 1), w) + +#define EXPANDALL (EXPAND_LEFT | EXPAND_RIGHT | EXPAND_UP | EXPAND_DOWN) +#define UNEXPAND (EXPANDALL << 1) // Force all directions to 0 +#define FORCE_EXPANDALL ~0 // Force expand in all directions + +void +exresize(const Arg *arg) +{ + Client *c; + int x, y, nx, ny, nw, nh; + c = selmon->sel; + + if (!c || !arg) return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + togglefloating(NULL); + if (c->expandmask != 0) + expand(UNEXPAND); + + x = ((int *)arg->v)[0]; + y = ((int *)arg->v)[1]; + + nw = MIN(selmon->ww - c->bw*2, c->w + x); + nh = MIN(selmon->wh - c->bw*2, c->h + y); + nx = c->x - x/2; + ny = c->y - y/2; + + if (!((abs(c->x + c->w/2 - (selmon->wx + selmon->ww/2)) < snap))) { + if ((nw == selmon->ww) || + (nx < selmon->wx) || + (abs(selmon->wx - c->x) < snap)) + nx = selmon->wx; + else if ((nx+nw > (selmon->wx + selmon->ww)) || + (abs((selmon->wx + selmon->ww) - (c->x + c->w)) < snap)) + nx = (selmon->wx + selmon->ww) - nw - c->bw*2; + } else + nx = selmon->wx + selmon->ww/2 - nw/2; + + if (!((abs(c->y + c->h/2 - (selmon->wy + selmon->wh/2)) < snap))) { + + if ((nh == selmon->wh) || + (ny < selmon->wy) || + (abs(selmon->wy - c->y) < snap)) + ny = selmon->wy; + else if ((ny+nh > (selmon->wy + selmon->wh)) || + (abs((selmon->wy + selmon->wh) - (c->y + c->h)) < snap)) + ny = (selmon->wy + selmon->wh) - nh - c->bw*2; + } else + ny = selmon->wy + selmon->wh/2 - nh/2; + + + resizeclient(c, nx, ny, MAX(nw, 32), MAX(nh, 32)); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); +} + +void +explace(const Arg *arg) +{ + Client *c; + int nx, ny; + + c = selmon->sel; + if (!c || (arg->ui >= 9)) return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + togglefloating(NULL); + + nx = (arg->ui % 3) - 1; + ny = (arg->ui / 3) - 1; + + if (nx < 0) nx = selmon->wx; + else if (nx > 0) nx = selmon->wx + selmon->ww - c->w - c->bw*2; + else nx = selmon->wx + selmon->ww/2 - c->w/2; + + if (ny < 0) ny = selmon->wy; + else if (ny > 0) ny = selmon->wy + selmon->wh - c->h - c->bw*2; + else ny = selmon->wy + selmon->wh/2 - c->h/2; + + resize(c, nx, ny, c->w, c->h, True); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); +} + +int +calculate_expand(unsigned char mask, unsigned char curmask, + unsigned char *newmask, unsigned char key, + int *reset_value, int new_reset_value, + int max_value, int old_value) +{ + if (IS_SET(key, mask) || + (IS_SET(key, curmask) && (!IS_SET(key, mask) && IS_FORCED(key, mask))) || + (!IS_SET(key, curmask) && (IS_SET(key, mask) && IS_FORCED(key, mask)))) { + + if (IS_SET(key, mask) && (!IS_SET(key,curmask) || IS_FORCED(key,mask))) { + if (!IS_SET(key, curmask)) + *reset_value = new_reset_value; + *newmask |= key; + return max_value; + } else if ((IS_SET(key,curmask) && IS_SET(key, mask)) || + (!IS_SET(key, mask) && IS_FORCED(key, mask))) { + *newmask &= ~key; + return *reset_value; + } else { + *newmask &= ~key; + return old_value; + } + } else + return new_reset_value; +} + +void +expand(unsigned char mask) +{ + XEvent ev; + int nx1, ny1, nx2, ny2; + #if SETBORDERPX_PATCH + int bp = selmon->borderpx; + #else + int bp = borderpx; + #endif // SETBORDERPX_PATCH + unsigned char curmask; + unsigned char newmask; + + if (!selmon->sel || selmon->sel->isfixed) + return; + XRaiseWindow(dpy, selmon->sel->win); + newmask = curmask = selmon->sel->expandmask; + + if (curmask == 0) { + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) + selmon->sel->wasfloating = 1; + else { + togglefloating(NULL); + selmon->sel->wasfloating = 0; + } + } + + nx1 = calculate_expand(mask, curmask, &newmask, + EXPAND_LEFT, &selmon->sel->expandx1, + selmon->sel->x, + selmon->wx, + selmon->sel->oldx); + nx2 = calculate_expand(mask, curmask, &newmask, + EXPAND_RIGHT, &selmon->sel->expandx2, + selmon->sel->x + selmon->sel->w, + selmon->wx + selmon->ww - 2*bp, + selmon->sel->oldw + selmon->sel->x); + ny1 = calculate_expand(mask, curmask, &newmask, + EXPAND_UP, &selmon->sel->expandy1, + selmon->sel->y, + selmon->wy, + selmon->sel->oldy); + ny2 = calculate_expand(mask, curmask, &newmask, + EXPAND_DOWN, &selmon->sel->expandy2, + selmon->sel->y + selmon->sel->h, + selmon->wy + selmon->wh - 2*bp, + selmon->sel->oldh + selmon->sel->y); + + + resizeclient(selmon->sel, nx1, ny1, MAX(nx2-nx1, 32), MAX(ny2-ny1, 32)); + + if ((newmask == 0) && (!selmon->sel->wasfloating)) + togglefloating(NULL); + selmon->sel->expandmask = newmask; + drawbar(selmon); + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} + +void +togglemaximize(const Arg *arg) +{ + if (arg->i > 0) expand(FORCE_EXPANDALL); + else if (arg->i < 0) expand(UNEXPAND); + else expand(EXPANDALL); +} + +void +toggleverticalexpand(const Arg *arg) +{ + if (arg->i < 0) expand(EXPAND_DOWN); + else if (arg->i > 0) expand(EXPAND_UP); + else expand(EXPAND_DOWN | EXPAND_UP); +} + +void +togglehorizontalexpand(const Arg *arg) +{ + if (arg->i < 0) expand(EXPAND_LEFT); + else if (arg->i > 0) expand(EXPAND_RIGHT); + else expand(EXPAND_LEFT | EXPAND_RIGHT); +} diff --git a/.local/src/dwm/patch/exresize.h b/.local/src/dwm/patch/exresize.h new file mode 100644 index 00000000..79695ba3 --- /dev/null +++ b/.local/src/dwm/patch/exresize.h @@ -0,0 +1,8 @@ +enum { EX_NW, EX_N, EX_NE, EX_W, EX_C, EX_E, EX_SW, EX_S, EX_SE }; + +void expand(unsigned char mask); +void togglemaximize(const Arg *arg); +void toggleverticalexpand(const Arg *arg); +void togglehorizontalexpand(const Arg *arg); +void exresize(const Arg *arg); +void explace(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/fakefullscreenclient.c b/.local/src/dwm/patch/fakefullscreenclient.c new file mode 100644 index 00000000..eb51652e --- /dev/null +++ b/.local/src/dwm/patch/fakefullscreenclient.c @@ -0,0 +1,18 @@ +void +togglefakefullscreen(const Arg *arg) +{ + Client *c = selmon->sel; + if (!c) + return; + + if (c->fakefullscreen != 1 && c->isfullscreen) { // exit fullscreen --> fake fullscreen + c->fakefullscreen = 2; + setfullscreen(c, 0); + } else if (c->fakefullscreen == 1) { + setfullscreen(c, 0); + c->fakefullscreen = 0; + } else { + c->fakefullscreen = 1; + setfullscreen(c, 1); + } +} diff --git a/.local/src/dwm/patch/fakefullscreenclient.h b/.local/src/dwm/patch/fakefullscreenclient.h new file mode 100644 index 00000000..e2a36d1a --- /dev/null +++ b/.local/src/dwm/patch/fakefullscreenclient.h @@ -0,0 +1 @@ +static void togglefakefullscreen(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/floatpos.c b/.local/src/dwm/patch/floatpos.c index 91ef9d12..5d3947a3 100644 --- a/.local/src/dwm/patch/floatpos.c +++ b/.local/src/dwm/patch/floatpos.c @@ -9,8 +9,10 @@ floatpos(const Arg *arg) setfloatpos(c, (char *)arg->v); resizeclient(c, c->x, c->y, c->w, c->h); + #if !FOCUSONCLICK_PATCH XRaiseWindow(dpy, c->win); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); + #endif // FOCUSONCLICK_PATCH } void @@ -18,8 +20,10 @@ setfloatpos(Client *c, const char *floatpos) { char xCh, yCh, wCh, hCh; int x, y, w, h, wx, ww, wy, wh; + #if FLOATPOS_RESPECT_GAPS_PATCH int oh, ov, ih, iv; unsigned int n; + #endif // FLOATPOS_RESPECT_GAPS_PATCH if (!c || !floatpos) return; @@ -53,11 +57,18 @@ setfloatpos(Client *c, const char *floatpos) return; } + #if FLOATPOS_RESPECT_GAPS_PATCH getgaps(c->mon, &oh, &ov, &ih, &iv, &n); wx = c->mon->wx + ov; wy = c->mon->wy + oh; ww = c->mon->ww - 2*ov; wh = c->mon->wh - 2*oh; + #else + wx = c->mon->wx; + wy = c->mon->wy; + ww = c->mon->ww; + wh = c->mon->wh; + #endif // FLOATPOS_RESPECT_GAPS_PATCH getfloatpos(x, xCh, w, wCh, wx, ww, c->x, c->w, c->bw, floatposgrid_x, &c->x, &c->w); getfloatpos(y, yCh, h, hCh, wy, wh, c->y, c->h, c->bw, floatposgrid_y, &c->y, &c->h); diff --git a/.local/src/dwm/patch/floatpos.h b/.local/src/dwm/patch/floatpos.h index ad0d826a..21e94efb 100644 --- a/.local/src/dwm/patch/floatpos.h +++ b/.local/src/dwm/patch/floatpos.h @@ -1,3 +1,3 @@ static void floatpos(const Arg *arg); static void setfloatpos(Client *c, const char *floatpos); -static void getfloatpos(int pos, char pCh, int size, char sCh, int min_p, int max_s, int cp, int cs, int cbw, int defgrid, int *out_p, int *out_s); +static void getfloatpos(int pos, char pCh, int size, char sCh, int min_p, int max_s, int cp, int cs, int cbw, int defgrid, int *out_p, int *out_s); \ No newline at end of file diff --git a/.local/src/dwm/patch/focusadjacenttag.c b/.local/src/dwm/patch/focusadjacenttag.c new file mode 100644 index 00000000..5b13b542 --- /dev/null +++ b/.local/src/dwm/patch/focusadjacenttag.c @@ -0,0 +1,73 @@ +void +tagtoleft(const Arg *arg) +{ + if (selmon->sel != NULL + && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] > 1) { + selmon->sel->tags >>= 1; + focus(NULL); + arrange(selmon); + } +} + +void +tagtoright(const Arg *arg) +{ + if (selmon->sel != NULL + && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + selmon->sel->tags <<= 1; + focus(NULL); + arrange(selmon); + } +} + +void +viewtoleft(const Arg *arg) +{ + if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] > 1) { + selmon->seltags ^= 1; /* toggle sel tagset */ + selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; + focus(NULL); + arrange(selmon); + } +} + +void +viewtoright(const Arg *arg) +{ + if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + selmon->seltags ^= 1; /* toggle sel tagset */ + selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; + focus(NULL); + arrange(selmon); + } +} + +void +tagandviewtoleft(const Arg *arg) +{ + if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] > 1) { + selmon->sel->tags >>= 1; + selmon->seltags ^= 1; /* toggle sel tagset */ + selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; + focus(selmon->sel); + arrange(selmon); + } +} + +void +tagandviewtoright(const Arg *arg) +{ + if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + selmon->sel->tags <<= 1; + selmon->seltags ^= 1; /* toggle sel tagset */ + selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; + focus(selmon->sel); + arrange(selmon); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/focusadjacenttag.h b/.local/src/dwm/patch/focusadjacenttag.h new file mode 100644 index 00000000..55b1019d --- /dev/null +++ b/.local/src/dwm/patch/focusadjacenttag.h @@ -0,0 +1,6 @@ +static void tagtoleft(const Arg *arg); +static void tagtoright(const Arg *arg); +static void viewtoleft(const Arg *arg); +static void viewtoright(const Arg *arg); +static void tagandviewtoleft(const Arg *arg); +static void tagandviewtoright(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/focusdir.c b/.local/src/dwm/patch/focusdir.c new file mode 100644 index 00000000..1807e42a --- /dev/null +++ b/.local/src/dwm/patch/focusdir.c @@ -0,0 +1,65 @@ +void +focusdir(const Arg *arg) +{ + Client *s = selmon->sel, *f = NULL, *c, *next; + + if (!s) + return; + + unsigned int score = -1; + unsigned int client_score; + int dist; + int dirweight = 20; + int isfloating = s->isfloating; + + next = s->next; + if (!next) + next = s->mon->clients; + for (c = next; c != s; c = next) { + + next = c->next; + if (!next) + next = s->mon->clients; + + if (!ISVISIBLE(c) || c->isfloating != isfloating) // || HIDDEN(c) + continue; + + switch (arg->i) { + case 0: // left + dist = s->x - c->x - c->w; + client_score = + dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + + abs(s->y - c->y); + break; + case 1: // right + dist = c->x - s->x - s->w; + client_score = + dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + + abs(c->y - s->y); + break; + case 2: // up + dist = s->y - c->y - c->h; + client_score = + dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + + abs(s->x - c->x); + break; + default: + case 3: // down + dist = c->y - s->y - s->h; + client_score = + dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + + abs(c->x - s->x); + break; + } + + if (((arg->i == 0 || arg->i == 2) && client_score <= score) || client_score < score) { + score = client_score; + f = c; + } + } + + if (f && f != s) { + focus(f); + restack(f->mon); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/focusdir.h b/.local/src/dwm/patch/focusdir.h new file mode 100644 index 00000000..f0f3e5e5 --- /dev/null +++ b/.local/src/dwm/patch/focusdir.h @@ -0,0 +1 @@ +static void focusdir(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/focusmaster.c b/.local/src/dwm/patch/focusmaster.c new file mode 100644 index 00000000..839fb436 --- /dev/null +++ b/.local/src/dwm/patch/focusmaster.c @@ -0,0 +1,13 @@ +void +focusmaster(const Arg *arg) +{ + Client *c; + + if (selmon->nmaster < 1) + return; + + c = nexttiled(selmon->clients); + + if (c) + focus(c); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/focusmaster.h b/.local/src/dwm/patch/focusmaster.h new file mode 100644 index 00000000..5732e4b4 --- /dev/null +++ b/.local/src/dwm/patch/focusmaster.h @@ -0,0 +1 @@ +static void focusmaster(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/focusurgent.c b/.local/src/dwm/patch/focusurgent.c new file mode 100644 index 00000000..74946ce6 --- /dev/null +++ b/.local/src/dwm/patch/focusurgent.c @@ -0,0 +1,15 @@ +void +focusurgent(const Arg *arg) +{ + Client *c; + int i; + for (c = selmon->clients; c && !c->isurgent; c = c->next); + if (c) { + for (i = 0; i < NUMTAGS && !((1 << i) & c->tags); i++); + if (i < NUMTAGS) { + if (((1 << i) & TAGMASK) != selmon->tagset[selmon->seltags]) + view(&((Arg) { .ui = 1 << i })); + focus(c); + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/focusurgent.h b/.local/src/dwm/patch/focusurgent.h new file mode 100644 index 00000000..27ab8acb --- /dev/null +++ b/.local/src/dwm/patch/focusurgent.h @@ -0,0 +1 @@ +static void focusurgent(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/fsignal.c b/.local/src/dwm/patch/fsignal.c new file mode 100644 index 00000000..8ae237b7 --- /dev/null +++ b/.local/src/dwm/patch/fsignal.c @@ -0,0 +1,40 @@ +int +fake_signal(void) +{ + char fsignal[256]; + char indicator[9] = "fsignal:"; + char str_signum[16]; + int i, v, signum; + size_t len_fsignal, len_indicator = strlen(indicator); + + // Get root name property + if (gettextprop(root, XA_WM_NAME, fsignal, sizeof(fsignal))) { + len_fsignal = strlen(fsignal); + + // Check if this is indeed a fake signal + if (len_indicator > len_fsignal ? 0 : strncmp(indicator, fsignal, len_indicator) == 0) { + memcpy(str_signum, &fsignal[len_indicator], len_fsignal - len_indicator); + str_signum[len_fsignal - len_indicator] = '\0'; + + // Convert string value into managable integer + for (i = signum = 0; i < strlen(str_signum); i++) { + v = str_signum[i] - '0'; + if (v >= 0 && v <= 9) { + signum = signum * 10 + v; + } + } + + // Check if a signal was found, and if so handle it + if (signum) + for (i = 0; i < LENGTH(signals); i++) + if (signum == signals[i].signum && signals[i].func) + signals[i].func(&(signals[i].arg)); + + // A fake signal was sent + return 1; + } + } + + // No fake signal was sent, so proceed with update + return 0; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/fsignal.h b/.local/src/dwm/patch/fsignal.h new file mode 100644 index 00000000..bfb56af1 --- /dev/null +++ b/.local/src/dwm/patch/fsignal.h @@ -0,0 +1,7 @@ +typedef struct { + unsigned int signum; + void (*func)(const Arg *); + const Arg arg; +} Signal; + +static int fake_signal(void); \ No newline at end of file diff --git a/.local/src/dwm/patch/fullscreen.c b/.local/src/dwm/patch/fullscreen.c index 72c24753..a89d40db 100644 --- a/.local/src/dwm/patch/fullscreen.c +++ b/.local/src/dwm/patch/fullscreen.c @@ -5,11 +5,13 @@ fullscreen(const Arg *arg) { int monocle_pos = 0; if (selmon->showbar || last_layout == NULL) { + #if MONOCLE_LAYOUT for (monocle_pos = 0, last_layout = (Layout *)layouts; !last_layout->arrange || last_layout->arrange != &monocle; monocle_pos++, last_layout++ ); + #endif // MONOCLE_LAYOUT for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++); setlayout(&((Arg) { .v = &layouts[monocle_pos] })); } else { setlayout(&((Arg) { .v = last_layout })); } togglebar(arg); -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/fullscreen.h b/.local/src/dwm/patch/fullscreen.h index 28a833b9..b380c2ed 100644 --- a/.local/src/dwm/patch/fullscreen.h +++ b/.local/src/dwm/patch/fullscreen.h @@ -1 +1 @@ -static void fullscreen(const Arg *arg); +static void fullscreen(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/include.c b/.local/src/dwm/patch/include.c index c25b9681..7f796240 100644 --- a/.local/src/dwm/patch/include.c +++ b/.local/src/dwm/patch/include.c @@ -2,35 +2,342 @@ #include "bar_indicators.c" #include "bar_tagicons.c" +#if BAR_ALPHA_PATCH +#include "bar_alpha.c" +#endif +#if BAR_ALTERNATIVE_TAGS_PATCH +#include "bar_alternativetags.c" +#endif +#if BAR_ANYBAR_PATCH +#include "bar_anybar.c" +#endif +#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.c" +#endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.c" +#endif +#if COMBO_PATCH #include "combo.c" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.c" +#endif +#if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.c" +#endif +#if BAR_POWERLINE_STATUS_PATCH +#include "bar_powerline_status.c" +#endif +#if BAR_POWERLINE_TAGS_PATCH +#include "bar_powerline_tags.c" +#endif +#if BAR_STATUS_PATCH #include "bar_status.c" +#endif +#if BAR_STATUS2D_PATCH #include "bar_status2d.c" +#endif +#if BAR_STATUSBUTTON_PATCH +#include "bar_statusbutton.c" +#endif +#if BAR_STATUSCMD_PATCH #include "bar_statuscmd.c" +#endif +#if BAR_STATUSCOLORS_PATCH +#include "bar_statuscolors.c" +#endif +#if BAR_TABGROUPS_PATCH +#include "bar_tabgroups.c" +#endif +#if BAR_TAGS_PATCH #include "bar_tags.c" +#endif +#if BAR_TAGGRID_PATCH +#include "bar_taggrid.c" +#endif +#if BAR_WINTITLE_PATCH +#include "bar_wintitle.c" +#endif +#if BAR_FANCYBAR_PATCH +#include "bar_fancybar.c" +#endif +#if BAR_FLEXWINTITLE_PATCH +#include "bar_flexwintitle.c" +#if BAR_WINTITLE_FLOATING_PATCH +#include "bar_wintitle_floating.c" +#endif +#if BAR_WINTITLE_HIDDEN_PATCH +#include "bar_wintitle_hidden.c" +#endif +#endif // BAR_FLEXWINTITLE_PATCH +#if BAR_AWESOMEBAR_PATCH +#include "bar_awesomebar.c" +#endif +#if BAR_SYSTRAY_PATCH #include "bar_systray.c" +#endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.c" +#endif +#if BAR_WINTITLEACTIONS_PATCH +#include "bar_wintitleactions.c" +#endif +#if BAR_LAYOUTMENU_PATCH #include "bar_layoutmenu.c" +#endif /* Other patches */ +#if ASPECTRESIZE_PATCH +#include "aspectresize.c" +#endif +#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH +#include "attachx.c" +#endif +#if AUTOSTART_PATCH #include "autostart.c" +#endif +#if CFACTS_PATCH +#include "cfacts.c" +#endif +#if CMDCUSTOMIZE_PATCH +#include "cmdcustomize.c" +#endif +#if COOL_AUTOSTART_PATCH +#include "cool_autostart.c" +#endif +#if CYCLELAYOUTS_PATCH #include "cyclelayouts.c" +#endif +#if DECORATION_HINTS_PATCH +#include "decorationhints.c" +#endif +#if DRAGCFACT_PATCH && CFACTS_PATCH +#include "dragcfact.c" +#endif +#if DWMC_PATCH +#include "dwmc.c" +#elif FSIGNAL_PATCH +#include "fsignal.c" +#endif +#if EXRESIZE_PATCH +#include "exresize.c" +#endif +#if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH +#include "fakefullscreenclient.c" +#endif +#if FLOATPOS_PATCH #include "floatpos.c" +#endif +#if FOCUSADJACENTTAG_PATCH +#include "focusadjacenttag.c" +#endif +#if FOCUSDIR_PATCH +#include "focusdir.c" +#endif +#if FOCUSMASTER_PATCH +#include "focusmaster.c" +#endif +#if FOCUSURGENT_PATCH +#include "focusurgent.c" +#endif +#if FULLSCREEN_PATCH #include "fullscreen.c" +#endif +#if INPLACEROTATE_PATCH +#include "inplacerotate.c" +#endif +#if IPC_PATCH +#include "ipc.c" +#ifdef VERSION +#include "ipc/IPCClient.c" +#include "ipc/yajl_dumps.c" +#include "ipc/ipc.c" +#include "ipc/util.c" +#endif +#endif // IPC_PATCH +#if INSETS_PATCH +#include "insets.c" +#endif +#if KEYMODES_PATCH +#include "keymodes.c" +#endif +#if KILLUNSEL_PATCH +#include "killunsel.c" +#endif +#if MAXIMIZE_PATCH +#include "maximize.c" +#endif +#if MPDCONTROL_PATCH +#include "mpdcontrol.c" +#endif +#if MOVEPLACE_PATCH +#include "moveplace.c" +#endif +#if MOVERESIZE_PATCH +#include "moveresize.c" +#endif +#if MOVESTACK_PATCH #include "movestack.c" +#endif +#if NO_MOD_BUTTONS_PATCH +#include "nomodbuttons.c" +#endif +#if PERTAG_PATCH #include "pertag.c" +#endif +#if PLACEMOUSE_PATCH +#include "placemouse.c" +#endif +#if PUSH_NO_MASTER_PATCH +#include "push_no_master.c" +#elif PUSH_PATCH +#include "push.c" +#endif +#if REORGANIZETAGS_PATCH +#include "reorganizetags.c" +#endif +#if RESTARTSIG_PATCH +#include "restartsig.c" +#endif +#if RIODRAW_PATCH +#include "riodraw.c" +#endif +#if ROTATESTACK_PATCH +#include "rotatestack.c" +#endif +#if ROUNDED_CORNERS_PATCH +#include "roundedcorners.c" +#endif +#if SCRATCHPADS_PATCH #include "scratchpad.c" +#endif +#if SCRATCHPAD_ALT_1_PATCH +#include "scratchpad_alt_1.c" +#endif +#if SELFRESTART_PATCH +#include "selfrestart.c" +#endif +#if SETBORDERPX_PATCH +#include "setborderpx.c" +#endif +#if SHIFTVIEW_PATCH #include "shiftview.c" +#endif +#if SHIFTVIEW_CLIENTS_PATCH +#include "shiftviewclients.c" +#endif +#if SIZEHINTS_RULED_PATCH +#include "sizehints_ruled.c" +#endif +#if SORTSCREENS_PATCH +#ifdef XINERAMA +#include "sortscreens.c" +#endif // XINERAMA +#endif +#if STACKER_PATCH +#include "stacker.c" +#endif +#if STICKY_PATCH +#include "sticky.c" +#endif +#if SWALLOW_PATCH +#include "swallow.c" +#endif +#if SWAPFOCUS_PATCH && PERTAG_PATCH +#include "swapfocus.c" +#endif +#if SWAPTAGS_PATCH +#include "swaptags.c" +#endif +#if SWITCHCOL_PATCH #include "switchcol.c" +#endif +#if TAGALL_PATCH +#include "tagall.c" +#endif +#if TAGALLMON_PATCH +#include "tagallmon.c" +#endif +#if TAGOTHERMONITOR_PATCH +#include "tagothermonitor.c" +#endif +#if TAGSWAPMON_PATCH +#include "tagswapmon.c" +#endif +#if TOGGLEFULLSCREEN_PATCH #include "togglefullscreen.c" +#endif +#if TRANSFER_PATCH +#include "transfer.c" +#endif +#if TRANSFER_ALL_PATCH +#include "transferall.c" +#endif +#if UNFLOATVISIBLE_PATCH +#include "unfloatvisible.c" +#endif +#if VANITYGAPS_PATCH #include "vanitygaps.c" +#endif +#if WARP_PATCH +#include "warp.c" +#endif +#if WINVIEW_PATCH #include "winview.c" +#endif +#if ZOOMSWAP_PATCH +#include "zoomswap.c" +#endif +#if XRDB_PATCH && !BAR_VTCOLORS_PATCH +#include "xrdb.c" +#endif +#if DRAGMFACT_PATCH +#include "dragmfact.c" +#endif /* Layouts */ +#if BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || TILE_LAYOUT #include "layout_facts.c" +#endif +#if BSTACK_LAYOUT +#include "layout_bstack.c" +#endif +#if BSTACKHORIZ_LAYOUT +#include "layout_bstackhoriz.c" +#endif +#if CENTEREDMASTER_LAYOUT #include "layout_centeredmaster.c" +#endif +#if CENTEREDFLOATINGMASTER_LAYOUT #include "layout_centeredfloatingmaster.c" +#endif +#if COLUMNS_LAYOUT +#include "layout_columns.c" +#endif +#if DECK_LAYOUT #include "layout_deck.c" +#endif +#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT #include "layout_fibonacci.c" +#endif +#if FLEXTILE_DELUXE_LAYOUT +#include "layout_flextile-deluxe.c" +#endif +#if GAPPLESSGRID_LAYOUT +#include "layout_gapplessgrid.c" +#endif +#if GRIDMODE_LAYOUT #include "layout_grid.c" +#endif +#if HORIZGRID_LAYOUT +#include "layout_horizgrid.c" +#endif +#if MONOCLE_LAYOUT #include "layout_monocle.c" +#endif +#if NROWGRID_LAYOUT +#include "layout_nrowgrid.c" +#endif +#if TILE_LAYOUT #include "layout_tile.c" +#endif diff --git a/.local/src/dwm/patch/include.h b/.local/src/dwm/patch/include.h index b14677b3..9b3de500 100644 --- a/.local/src/dwm/patch/include.h +++ b/.local/src/dwm/patch/include.h @@ -2,34 +2,332 @@ #include "bar_indicators.h" #include "bar_tagicons.h" +#if BAR_ALPHA_PATCH +#include "bar_alpha.h" +#endif +#if BAR_ALTERNATIVE_TAGS_PATCH +#include "bar_alternativetags.h" +#endif +#if BAR_ANYBAR_PATCH +#include "bar_anybar.h" +#endif +#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH #include "bar_dwmblocks.h" +#endif +#if BAR_EWMHTAGS_PATCH +#include "bar_ewmhtags.h" +#endif +#if COMBO_PATCH #include "combo.h" +#endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.h" +#endif +#if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.h" +#endif +#if BAR_POWERLINE_STATUS_PATCH +#include "bar_powerline_status.h" +#endif +#if BAR_POWERLINE_TAGS_PATCH +#include "bar_powerline_tags.h" +#endif +#if BAR_STATUS_PATCH #include "bar_status.h" +#endif +#if BAR_STATUS2D_PATCH #include "bar_status2d.h" +#endif +#if BAR_STATUSBUTTON_PATCH +#include "bar_statusbutton.h" +#endif +#if BAR_STATUSCMD_PATCH #include "bar_statuscmd.h" +#endif +#if BAR_TABGROUPS_PATCH +#include "bar_tabgroups.h" +#endif +#if BAR_TAGS_PATCH #include "bar_tags.h" +#endif +#if BAR_TAGGRID_PATCH +#include "bar_taggrid.h" +#endif +#if BAR_WINTITLE_PATCH +#include "bar_wintitle.h" +#endif +#if BAR_FANCYBAR_PATCH +#include "bar_fancybar.h" +#endif +#if BAR_FLEXWINTITLE_PATCH +#include "bar_flexwintitle.h" +#if BAR_WINTITLE_FLOATING_PATCH +#include "bar_wintitle_floating.h" +#endif +#if BAR_WINTITLE_HIDDEN_PATCH +#include "bar_wintitle_hidden.h" +#endif +#endif // BAR_FLEXWINTITLE_PATCH +#if BAR_AWESOMEBAR_PATCH +#include "bar_awesomebar.h" +#endif +#if BAR_SYSTRAY_PATCH #include "bar_systray.h" +#endif +#if BAR_VTCOLORS_PATCH +#include "bar_vtcolors.h" +#endif +#if BAR_WINTITLEACTIONS_PATCH +#include "bar_wintitleactions.h" +#endif +#if BAR_LAYOUTMENU_PATCH #include "bar_layoutmenu.h" +#endif /* Other patches */ +#if ASPECTRESIZE_PATCH +#include "aspectresize.h" +#endif +#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH +#include "attachx.h" +#endif +#if AUTOSTART_PATCH #include "autostart.h" +#endif +#if CFACTS_PATCH +#include "cfacts.h" +#endif +#if CMDCUSTOMIZE_PATCH +#include "cmdcustomize.h" +#endif +#if COOL_AUTOSTART_PATCH +#include "cool_autostart.h" +#endif +#if CYCLELAYOUTS_PATCH #include "cyclelayouts.h" +#endif +#if DECORATION_HINTS_PATCH +#include "decorationhints.h" +#endif +#if DRAGCFACT_PATCH && CFACTS_PATCH +#include "dragcfact.h" +#endif +#if DRAGMFACT_PATCH +#include "dragmfact.h" +#endif +#if DWMC_PATCH +#include "dwmc.h" +#elif FSIGNAL_PATCH +#include "fsignal.h" +#endif +#if EXRESIZE_PATCH +#include "exresize.h" +#endif +#if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH +#include "fakefullscreenclient.h" +#endif +#if FLOATPOS_PATCH #include "floatpos.h" +#endif +#if FOCUSDIR_PATCH +#include "focusdir.h" +#endif +#if FOCUSADJACENTTAG_PATCH +#include "focusadjacenttag.h" +#endif +#if FOCUSMASTER_PATCH +#include "focusmaster.h" +#endif +#if FOCUSURGENT_PATCH +#include "focusurgent.h" +#endif +#if FULLSCREEN_PATCH #include "fullscreen.h" +#endif +#if INPLACEROTATE_PATCH +#include "inplacerotate.h" +#endif +#if IPC_PATCH +#include "ipc.h" +#include "ipc/ipc.h" +#include "ipc/util.h" +#endif +#if INSETS_PATCH +#include "insets.h" +#endif +#if KEYMODES_PATCH +#include "keymodes.h" +#endif +#if KILLUNSEL_PATCH +#include "killunsel.h" +#endif +#if MAXIMIZE_PATCH +#include "maximize.h" +#endif +#if MPDCONTROL_PATCH +#include "mpdcontrol.h" +#endif +#if MOVEPLACE_PATCH +#include "moveplace.h" +#endif +#if MOVERESIZE_PATCH +#include "moveresize.h" +#endif +#if MOVESTACK_PATCH #include "movestack.h" +#endif +#if NO_MOD_BUTTONS_PATCH +#include "nomodbuttons.h" +#endif +#if PERTAG_PATCH #include "pertag.h" +#endif +#if PLACEMOUSE_PATCH +#include "placemouse.h" +#endif +#if PUSH_NO_MASTER_PATCH +#include "push_no_master.h" +#elif PUSH_PATCH +#include "push.h" +#endif +#if REORGANIZETAGS_PATCH +#include "reorganizetags.h" +#endif +#if RESTARTSIG_PATCH +#include "restartsig.h" +#endif +#if RIODRAW_PATCH +#include "riodraw.h" +#endif +#if ROTATESTACK_PATCH +#include "rotatestack.h" +#endif +#if ROUNDED_CORNERS_PATCH +#include "roundedcorners.h" +#endif +#if SCRATCHPADS_PATCH #include "scratchpad.h" +#endif +#if SCRATCHPAD_ALT_1_PATCH +#include "scratchpad_alt_1.h" +#endif +#if SELFRESTART_PATCH +#include "selfrestart.h" +#endif +#if SETBORDERPX_PATCH +#include "setborderpx.h" +#endif +#if SHIFTVIEW_PATCH #include "shiftview.h" +#endif +#if SHIFTVIEW_CLIENTS_PATCH +#include "shiftviewclients.h" +#endif +#if SIZEHINTS_RULED_PATCH +#include "sizehints_ruled.h" +#endif +#if SORTSCREENS_PATCH +#ifdef XINERAMA +#include "sortscreens.h" +#endif // XINERAMA +#endif +#if STACKER_PATCH +#include "stacker.h" +#endif +#if STICKY_PATCH +#include "sticky.h" +#endif +#if SWALLOW_PATCH +#include "swallow.h" +#endif +#if SWAPFOCUS_PATCH && PERTAG_PATCH +#include "swapfocus.h" +#endif +#if SWAPTAGS_PATCH +#include "swaptags.h" +#endif +#if SWITCHCOL_PATCH #include "switchcol.h" +#endif +#if TAGALL_PATCH +#include "tagall.h" +#endif +#if TAGALLMON_PATCH +#include "tagallmon.h" +#endif +#if TAGOTHERMONITOR_PATCH +#include "tagothermonitor.h" +#endif +#if TAGSWAPMON_PATCH +#include "tagswapmon.h" +#endif +#if TOGGLEFULLSCREEN_PATCH #include "togglefullscreen.h" +#endif +#if TRANSFER_PATCH +#include "transfer.h" +#endif +#if TRANSFER_ALL_PATCH +#include "transferall.h" +#endif +#if UNFLOATVISIBLE_PATCH +#include "unfloatvisible.h" +#endif +#if VANITYGAPS_PATCH #include "vanitygaps.h" +#endif +#if WARP_PATCH +#include "warp.h" +#endif +#if WINVIEW_PATCH #include "winview.h" +#endif +#if ZOOMSWAP_PATCH +#include "zoomswap.h" +#endif +#if XRDB_PATCH && !BAR_VTCOLORS_PATCH +#include "xrdb.h" +#endif /* Layouts */ +#if BSTACK_LAYOUT +#include "layout_bstack.h" +#endif +#if BSTACKHORIZ_LAYOUT +#include "layout_bstackhoriz.h" +#endif +#if CENTEREDMASTER_LAYOUT #include "layout_centeredmaster.h" +#endif +#if CENTEREDFLOATINGMASTER_LAYOUT #include "layout_centeredfloatingmaster.h" +#endif +#if COLUMNS_LAYOUT +#include "layout_columns.h" +#endif +#if DECK_LAYOUT #include "layout_deck.h" +#endif +#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT #include "layout_fibonacci.h" +#endif +#if FLEXTILE_DELUXE_LAYOUT +#include "layout_flextile-deluxe.h" +#endif +#if GAPPLESSGRID_LAYOUT +#include "layout_gapplessgrid.h" +#endif +#if GRIDMODE_LAYOUT #include "layout_grid.h" +#endif +#if HORIZGRID_LAYOUT +#include "layout_horizgrid.h" +#endif +#if MONOCLE_LAYOUT #include "layout_monocle.h" +#endif +#if NROWGRID_LAYOUT +#include "layout_nrowgrid.h" +#endif +#if TILE_LAYOUT #include "layout_tile.h" +#endif diff --git a/.local/src/dwm/patch/inplacerotate.c b/.local/src/dwm/patch/inplacerotate.c new file mode 100644 index 00000000..28eb2891 --- /dev/null +++ b/.local/src/dwm/patch/inplacerotate.c @@ -0,0 +1,53 @@ +void +insertclient(Client *item, Client *insertItem, int after) +{ + Client *c; + if (item == NULL || insertItem == NULL || item == insertItem) return; + detach(insertItem); + if (!after && selmon->clients == item) { + attach(insertItem); + return; + } + if (after) { + c = item; + } else { + for (c = selmon->clients; c; c = c->next) { if (c->next == item) break; } + } + insertItem->next = c->next; + c->next = insertItem; +} + +void +inplacerotate(const Arg *arg) +{ + if (!selmon->sel || (selmon->sel->isfloating && !arg->f)) return; + + unsigned int selidx = 0, i = 0; + Client *c = NULL, *stail = NULL, *mhead = NULL, *mtail = NULL, *shead = NULL; + + // Shift client + for (c = selmon->clients; c; c = c->next) { + if (ISVISIBLE(c) && !(c->isfloating)) { + if (selmon->sel == c) { selidx = i; } + if (i == selmon->nmaster - 1) { mtail = c; } + if (i == selmon->nmaster) { shead = c; } + if (mhead == NULL) { mhead = c; } + stail = c; + i++; + } + } + if (arg->i < 0 && selidx >= selmon->nmaster) insertclient(stail, shead, 1); + if (arg->i > 0 && selidx >= selmon->nmaster) insertclient(shead, stail, 0); + if (arg->i < 0 && selidx < selmon->nmaster) insertclient(mtail, mhead, 1); + if (arg->i > 0 && selidx < selmon->nmaster) insertclient(mhead, mtail, 0); + + // Restore focus position + i = 0; + for (c = selmon->clients; c; c = c->next) { + if (!ISVISIBLE(c) || (c->isfloating)) continue; + if (i == selidx) { focus(c); break; } + i++; + } + arrange(selmon); + focus(c); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/inplacerotate.h b/.local/src/dwm/patch/inplacerotate.h new file mode 100644 index 00000000..2767ad12 --- /dev/null +++ b/.local/src/dwm/patch/inplacerotate.h @@ -0,0 +1 @@ +static void inplacerotate(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/insets.c b/.local/src/dwm/patch/insets.c new file mode 100644 index 00000000..c0836cf1 --- /dev/null +++ b/.local/src/dwm/patch/insets.c @@ -0,0 +1,18 @@ +void +setinset(Monitor *m, Inset inset) +{ + Bar *bar; + m->inset = inset; + updatebarpos(m); + for (bar = m->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + arrange(m); +} + +void +updateinset(const Arg *arg) +{ + Inset *inset = (Inset *)arg->v; + for (Monitor *m = mons; m; m = m->next) + setinset(m, *inset); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/insets.h b/.local/src/dwm/patch/insets.h new file mode 100644 index 00000000..ab76278c --- /dev/null +++ b/.local/src/dwm/patch/insets.h @@ -0,0 +1,2 @@ +static void setinset(Monitor *m, Inset inset); +static void updateinset(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/ipc.c b/.local/src/dwm/patch/ipc.c new file mode 100644 index 00000000..e863afc9 --- /dev/null +++ b/.local/src/dwm/patch/ipc.c @@ -0,0 +1,101 @@ +static int epoll_fd; +static int dpy_fd; +static Monitor *lastselmon; + +int +handlexevent(struct epoll_event *ev) +{ + if (ev->events & EPOLLIN) { + XEvent ev; + while (running && XPending(dpy)) { + XNextEvent(dpy, &ev); + if (handler[ev.type]) { + handler[ev.type](&ev); /* call handler */ + ipc_send_events(mons, &lastselmon, selmon); + } + } + } else if (ev-> events & EPOLLHUP) + return -1; + + return 0; +} + +void +setlayoutsafe(const Arg *arg) +{ + const Layout *ltptr = (Layout *)arg->v; + if (ltptr == 0) + setlayout(arg); + for (int i = 0; i < LENGTH(layouts); i++) { + if (ltptr == &layouts[i]) + setlayout(arg); + } +} + +void +setupepoll(void) +{ + epoll_fd = epoll_create1(0); + dpy_fd = ConnectionNumber(dpy); + struct epoll_event dpy_event; + + // Initialize struct to 0 + memset(&dpy_event, 0, sizeof(dpy_event)); + + DEBUG("Display socket is fd %d\n", dpy_fd); + + if (epoll_fd == -1) + fputs("Failed to create epoll file descriptor", stderr); + + dpy_event.events = EPOLLIN; + dpy_event.data.fd = dpy_fd; + if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, dpy_fd, &dpy_event)) { + fputs("Failed to add display file descriptor to epoll", stderr); + close(epoll_fd); + exit(1); + } + + if (ipc_init(ipcsockpath, epoll_fd, ipccommands, LENGTH(ipccommands)) < 0) + fputs("Failed to initialize IPC\n", stderr); +} + +void +setstatus(const Arg *arg) +{ + Monitor *m; + #if BAR_EXTRASTATUS_PATCH + if (arg->v == NULL) { + strcpy(stext, "dwm-"VERSION); + estext[0] = '\0'; + } else { + strcpy(rawstext, arg->v); + char *e = strchr(rawstext, statussep); + if (e) { + *e = '\0'; e++; + #if BAR_STATUSCMD_PATCH + strncpy(rawestext, e, sizeof(estext) - 1); + copyvalidchars(estext, rawestext); + #else + strncpy(estext, e, sizeof(estext) - 1); + #endif // BAR_STATUSCMD_PATCH + } else { + estext[0] = '\0'; + } + #if BAR_STATUSCMD_PATCH + copyvalidchars(stext, rawstext); + #else + strncpy(stext, rawstext, sizeof(stext) - 1); + #endif // BAR_STATUSCMD_PATCH + } + #elif BAR_STATUSCMD_PATCH + if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) + strcpy(stext, "dwm-"VERSION); + else + copyvalidchars(stext, rawstext); + #else + if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) + strcpy(stext, "dwm-"VERSION); + #endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH + for (m = mons; m; m = m->next) + drawbar(m); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/ipc.h b/.local/src/dwm/patch/ipc.h new file mode 100644 index 00000000..a07a42f0 --- /dev/null +++ b/.local/src/dwm/patch/ipc.h @@ -0,0 +1,6 @@ +#include + +static int handlexevent(struct epoll_event *ev); +static void setlayoutsafe(const Arg *arg); +static void setupepoll(void); +static void setstatus(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/ipc/IPCClient.c b/.local/src/dwm/patch/ipc/IPCClient.c new file mode 100644 index 00000000..0d3eefb0 --- /dev/null +++ b/.local/src/dwm/patch/ipc/IPCClient.c @@ -0,0 +1,66 @@ +#include "IPCClient.h" + +#include +#include + +#include "util.h" + +IPCClient * +ipc_client_new(int fd) +{ + IPCClient *c = (IPCClient *)malloc(sizeof(IPCClient)); + + if (c == NULL) return NULL; + + // Initialize struct + memset(&c->event, 0, sizeof(struct epoll_event)); + + c->buffer_size = 0; + c->buffer = NULL; + c->fd = fd; + c->event.data.fd = fd; + c->next = NULL; + c->prev = NULL; + c->subscriptions = 0; + + return c; +} + +void +ipc_list_add_client(IPCClientList *list, IPCClient *nc) +{ + DEBUG("Adding client with fd %d to list\n", nc->fd); + + if (*list == NULL) { + // List is empty, point list at first client + *list = nc; + } else { + IPCClient *c; + // Go to last client in list + for (c = *list; c && c->next; c = c->next) + ; + c->next = nc; + nc->prev = c; + } +} + +void +ipc_list_remove_client(IPCClientList *list, IPCClient *c) +{ + IPCClient *cprev = c->prev; + IPCClient *cnext = c->next; + + if (cprev != NULL) cprev->next = c->next; + if (cnext != NULL) cnext->prev = c->prev; + if (c == *list) *list = c->next; +} + +IPCClient * +ipc_list_get_client(IPCClientList list, int fd) +{ + for (IPCClient *c = list; c; c = c->next) { + if (c->fd == fd) return c; + } + + return NULL; +} diff --git a/.local/src/dwm/patch/ipc/ipc.c b/.local/src/dwm/patch/ipc/ipc.c new file mode 100644 index 00000000..0cc76a73 --- /dev/null +++ b/.local/src/dwm/patch/ipc/ipc.c @@ -0,0 +1,1201 @@ +#include "ipc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "yajl_dumps.h" + +static struct sockaddr_un sockaddr; +static struct epoll_event sock_epoll_event; +static IPCClientList ipc_clients = NULL; +static int epoll_fd = -1; +static int sock_fd = -1; +static IPCCommand *ipc_commands; +static unsigned int ipc_commands_len; +// Max size is 1 MB +static const uint32_t MAX_MESSAGE_SIZE = 1000000; +static const int IPC_SOCKET_BACKLOG = 5; + +/** + * Create IPC socket at specified path and return file descriptor to socket. + * This initializes the static variable sockaddr. + */ +static int +ipc_create_socket(const char *filename) +{ + char *normal_filename; + char *parent; + const size_t addr_size = sizeof(struct sockaddr_un); + const int sock_type = SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC; + + normalizepath(filename, &normal_filename); + + // In case socket file exists + unlink(normal_filename); + + // For portability clear the addr structure, since some implementations have + // nonstandard fields in the structure + memset(&sockaddr, 0, addr_size); + + parentdir(normal_filename, &parent); + // Create parent directories + mkdirp(parent); + free(parent); + + sockaddr.sun_family = AF_LOCAL; + strcpy(sockaddr.sun_path, normal_filename); + free(normal_filename); + + sock_fd = socket(AF_LOCAL, sock_type, 0); + if (sock_fd == -1) { + fputs("Failed to create socket\n", stderr); + return -1; + } + + DEBUG("Created socket at %s\n", sockaddr.sun_path); + + if (bind(sock_fd, (const struct sockaddr *)&sockaddr, addr_size) == -1) { + fputs("Failed to bind socket\n", stderr); + return -1; + } + + DEBUG("Socket binded\n"); + + if (listen(sock_fd, IPC_SOCKET_BACKLOG) < 0) { + fputs("Failed to listen for connections on socket\n", stderr); + return -1; + } + + DEBUG("Now listening for connections on socket\n"); + + return sock_fd; +} + +/** + * Internal function used to receive IPC messages from a given file descriptor. + * + * Returns -1 on error reading (could be EAGAIN or EINTR) + * Returns -2 if EOF before header could be read + * Returns -3 if invalid IPC header + * Returns -4 if message length exceeds MAX_MESSAGE_SIZE + */ +static int +ipc_recv_message(int fd, uint8_t *msg_type, uint32_t *reply_size, + uint8_t **reply) +{ + uint32_t read_bytes = 0; + const int32_t to_read = sizeof(dwm_ipc_header_t); + char header[to_read]; + char *walk = header; + + // Try to read header + while (read_bytes < to_read) { + const ssize_t n = read(fd, header + read_bytes, to_read - read_bytes); + + if (n == 0) { + if (read_bytes == 0) { + fprintf(stderr, "Unexpectedly reached EOF while reading header."); + fprintf(stderr, + "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", + read_bytes, to_read); + return -2; + } else { + fprintf(stderr, "Unexpectedly reached EOF while reading header."); + fprintf(stderr, + "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", + read_bytes, to_read); + return -3; + } + } else if (n == -1) { + // errno will still be set + return -1; + } + + read_bytes += n; + } + + // Check if magic string in header matches + if (memcmp(walk, IPC_MAGIC, IPC_MAGIC_LEN) != 0) { + fprintf(stderr, "Invalid magic string. Got '%.*s', expected '%s'\n", + IPC_MAGIC_LEN, walk, IPC_MAGIC); + return -3; + } + + walk += IPC_MAGIC_LEN; + + // Extract reply size + memcpy(reply_size, walk, sizeof(uint32_t)); + walk += sizeof(uint32_t); + + if (*reply_size > MAX_MESSAGE_SIZE) { + fprintf(stderr, "Message too long: %" PRIu32 " bytes. ", *reply_size); + fprintf(stderr, "Maximum message size is: %d\n", MAX_MESSAGE_SIZE); + return -4; + } + + // Extract message type + memcpy(msg_type, walk, sizeof(uint8_t)); + walk += sizeof(uint8_t); + + if (*reply_size > 0) + (*reply) = malloc(*reply_size); + else + return 0; + + read_bytes = 0; + while (read_bytes < *reply_size) { + const ssize_t n = read(fd, *reply + read_bytes, *reply_size - read_bytes); + + if (n == 0) { + fprintf(stderr, "Unexpectedly reached EOF while reading payload."); + fprintf(stderr, "Read %" PRIu32 " bytes, expected %" PRIu32 " bytes.\n", + read_bytes, *reply_size); + free(*reply); + return -2; + } else if (n == -1) { + // TODO: Should we return and wait for another epoll event? + // This would require saving the partial read in some way. + if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) continue; + + free(*reply); + return -1; + } + + read_bytes += n; + } + + return 0; +} + +/** + * Internal function used to write a buffer to a file descriptor + * + * Returns number of bytes written if successful write + * Returns 0 if no bytes were written due to EAGAIN or EWOULDBLOCK + * Returns -1 on unknown error trying to write, errno will carry over from + * write() call + */ +static ssize_t +ipc_write_message(int fd, const void *buf, size_t count) +{ + size_t written = 0; + + while (written < count) { + const ssize_t n = write(fd, (uint8_t *)buf + written, count - written); + + if (n == -1) { + if (errno == EAGAIN || errno == EWOULDBLOCK) + return written; + else if (errno == EINTR) + continue; + else + return n; + } + + written += n; + DEBUG("Wrote %zu/%zu to client at fd %d\n", written, count, fd); + } + + return written; +} + +/** + * Initialization for generic event message. This is used to allocate the yajl + * handle, set yajl options, and in the future any other initialization that + * should occur for event messages. + */ +static void +ipc_event_init_message(yajl_gen *gen) +{ + *gen = yajl_gen_alloc(NULL); + yajl_gen_config(*gen, yajl_gen_beautify, 1); +} + +/** + * Prepares buffers of IPC subscribers of specified event using buffer from yajl + * handle. + */ +static void +ipc_event_prepare_send_message(yajl_gen gen, IPCEvent event) +{ + const unsigned char *buffer; + size_t len = 0; + + yajl_gen_get_buf(gen, &buffer, &len); + len++; // For null char + + for (IPCClient *c = ipc_clients; c; c = c->next) { + if (c->subscriptions & event) { + DEBUG("Sending selected client change event to fd %d\n", c->fd); + ipc_prepare_send_message(c, IPC_TYPE_EVENT, len, (char *)buffer); + } + } + + // Not documented, but this frees temp_buffer + yajl_gen_free(gen); +} + +/** + * Initialization for generic reply message. This is used to allocate the yajl + * handle, set yajl options, and in the future any other initialization that + * should occur for reply messages. + */ +static void +ipc_reply_init_message(yajl_gen *gen) +{ + *gen = yajl_gen_alloc(NULL); + yajl_gen_config(*gen, yajl_gen_beautify, 1); +} + +/** + * Prepares the IPC client's buffer with a message using the buffer of the yajl + * handle. + */ +static void +ipc_reply_prepare_send_message(yajl_gen gen, IPCClient *c, + IPCMessageType msg_type) +{ + const unsigned char *buffer; + size_t len = 0; + + yajl_gen_get_buf(gen, &buffer, &len); + len++; // For null char + + ipc_prepare_send_message(c, msg_type, len, (const char *)buffer); + + // Not documented, but this frees temp_buffer + yajl_gen_free(gen); +} + +/** + * Find the IPCCommand with the specified name + * + * Returns 0 if a command with the specified name was found + * Returns -1 if a command with the specified name could not be found + */ +static int +ipc_get_ipc_command(const char *name, IPCCommand *ipc_command) +{ + for (int i = 0; i < ipc_commands_len; i++) { + if (strcmp(ipc_commands[i].name, name) == 0) { + *ipc_command = ipc_commands[i]; + return 0; + } + } + + return -1; +} + +/** + * Parse a IPC_TYPE_RUN_COMMAND message from a client. This function extracts + * the arguments, argument count, argument types, and command name and returns + * the parsed information as an IPCParsedCommand. If this function returns + * successfully, the parsed_command must be freed using + * ipc_free_parsed_command_members. + * + * Returns 0 if the message was successfully parsed + * Returns -1 otherwise + */ +static int +ipc_parse_run_command(char *msg, IPCParsedCommand *parsed_command) +{ + char error_buffer[1000]; + yajl_val parent = yajl_tree_parse(msg, error_buffer, 1000); + + if (parent == NULL) { + fputs("Failed to parse command from client\n", stderr); + fprintf(stderr, "%s\n", error_buffer); + fprintf(stderr, "Tried to parse: %s\n", msg); + return -1; + } + + // Format: + // { + // "command": "" + // "args": [ "arg1", "arg2", ... ] + // } + const char *command_path[] = {"command", 0}; + yajl_val command_val = yajl_tree_get(parent, command_path, yajl_t_string); + + if (command_val == NULL) { + fputs("No command key found in client message\n", stderr); + yajl_tree_free(parent); + return -1; + } + + const char *command_name = YAJL_GET_STRING(command_val); + size_t command_name_len = strlen(command_name); + parsed_command->name = (char *)malloc((command_name_len + 1) * sizeof(char)); + strcpy(parsed_command->name, command_name); + + DEBUG("Received command: %s\n", parsed_command->name); + + const char *args_path[] = {"args", 0}; + yajl_val args_val = yajl_tree_get(parent, args_path, yajl_t_array); + + if (args_val == NULL) { + fputs("No args key found in client message\n", stderr); + yajl_tree_free(parent); + return -1; + } + + unsigned int *argc = &parsed_command->argc; + Arg **args = &parsed_command->args; + ArgType **arg_types = &parsed_command->arg_types; + + *argc = args_val->u.array.len; + + // If no arguments are specified, make a dummy argument to pass to the + // function. This is just the way dwm's void(Arg*) functions are setup. + if (*argc == 0) { + *args = (Arg *)malloc(sizeof(Arg)); + *arg_types = (ArgType *)malloc(sizeof(ArgType)); + (*arg_types)[0] = ARG_TYPE_NONE; + (*args)[0].f = 0; + (*argc)++; + } else if (*argc > 0) { + *args = (Arg *)calloc(*argc, sizeof(Arg)); + *arg_types = (ArgType *)malloc(*argc * sizeof(ArgType)); + + for (int i = 0; i < *argc; i++) { + yajl_val arg_val = args_val->u.array.values[i]; + + if (YAJL_IS_NUMBER(arg_val)) { + if (YAJL_IS_INTEGER(arg_val)) { + // Any values below 0 must be a signed int + if (YAJL_GET_INTEGER(arg_val) < 0) { + (*args)[i].i = YAJL_GET_INTEGER(arg_val); + (*arg_types)[i] = ARG_TYPE_SINT; + DEBUG("i=%ld\n", (*args)[i].i); + // Any values above 0 should be an unsigned int + } else if (YAJL_GET_INTEGER(arg_val) >= 0) { + (*args)[i].ui = YAJL_GET_INTEGER(arg_val); + (*arg_types)[i] = ARG_TYPE_UINT; + DEBUG("ui=%ld\n", (*args)[i].i); + } + // If the number is not an integer, it must be a float + } else { + (*args)[i].f = (float)YAJL_GET_DOUBLE(arg_val); + (*arg_types)[i] = ARG_TYPE_FLOAT; + DEBUG("f=%f\n", (*args)[i].f); + // If argument is not a number, it must be a string + } + } else if (YAJL_IS_STRING(arg_val)) { + char *arg_s = YAJL_GET_STRING(arg_val); + size_t arg_s_size = (strlen(arg_s) + 1) * sizeof(char); + (*args)[i].v = (char *)malloc(arg_s_size); + (*arg_types)[i] = ARG_TYPE_STR; + strcpy((char *)(*args)[i].v, arg_s); + } + } + } + + yajl_tree_free(parent); + + return 0; +} + +/** + * Free the members of a IPCParsedCommand struct + */ +static void +ipc_free_parsed_command_members(IPCParsedCommand *command) +{ + for (int i = 0; i < command->argc; i++) { + if (command->arg_types[i] == ARG_TYPE_STR) free((void *)command->args[i].v); + } + free(command->args); + free(command->arg_types); + free(command->name); +} + +/** + * Check if the given arguments are the correct length and type. Also do any + * casting to correct the types. + * + * Returns 0 if the arguments were the correct length and types + * Returns -1 if the argument count doesn't match + * Returns -2 if the argument types don't match + */ +static int +ipc_validate_run_command(IPCParsedCommand *parsed, const IPCCommand actual) +{ + if (actual.argc != parsed->argc) return -1; + + for (int i = 0; i < parsed->argc; i++) { + ArgType ptype = parsed->arg_types[i]; + ArgType atype = actual.arg_types[i]; + + if (ptype != atype) { + if (ptype == ARG_TYPE_UINT && atype == ARG_TYPE_PTR) + // If this argument is supposed to be a void pointer, cast it + parsed->args[i].v = (void *)parsed->args[i].ui; + else if (ptype == ARG_TYPE_UINT && atype == ARG_TYPE_SINT) + // If this argument is supposed to be a signed int, cast it + parsed->args[i].i = parsed->args[i].ui; + else + return -2; + } + } + + return 0; +} + +/** + * Convert event name to their IPCEvent equivalent enum value + * + * Returns 0 if a valid event name was given + * Returns -1 otherwise + */ +static int +ipc_event_stoi(const char *subscription, IPCEvent *event) +{ + if (strcmp(subscription, "tag_change_event") == 0) + *event = IPC_EVENT_TAG_CHANGE; + else if (strcmp(subscription, "client_focus_change_event") == 0) + *event = IPC_EVENT_CLIENT_FOCUS_CHANGE; + else if (strcmp(subscription, "layout_change_event") == 0) + *event = IPC_EVENT_LAYOUT_CHANGE; + else if (strcmp(subscription, "monitor_focus_change_event") == 0) + *event = IPC_EVENT_MONITOR_FOCUS_CHANGE; + else if (strcmp(subscription, "focused_title_change_event") == 0) + *event = IPC_EVENT_FOCUSED_TITLE_CHANGE; + else if (strcmp(subscription, "focused_state_change_event") == 0) + *event = IPC_EVENT_FOCUSED_STATE_CHANGE; + else + return -1; + return 0; +} + +/** + * Parse a IPC_TYPE_SUBSCRIBE message from a client. This function extracts the + * event name and the subscription action from the message. + * + * Returns 0 if message was successfully parsed + * Returns -1 otherwise + */ +static int +ipc_parse_subscribe(const char *msg, IPCSubscriptionAction *subscribe, + IPCEvent *event) +{ + char error_buffer[100]; + yajl_val parent = yajl_tree_parse((char *)msg, error_buffer, 100); + + if (parent == NULL) { + fputs("Failed to parse command from client\n", stderr); + fprintf(stderr, "%s\n", error_buffer); + return -1; + } + + // Format: + // { + // "event": "" + // "action": "" + // } + const char *event_path[] = {"event", 0}; + yajl_val event_val = yajl_tree_get(parent, event_path, yajl_t_string); + + if (event_val == NULL) { + fputs("No 'event' key found in client message\n", stderr); + return -1; + } + + const char *event_str = YAJL_GET_STRING(event_val); + DEBUG("Received event: %s\n", event_str); + + if (ipc_event_stoi(event_str, event) < 0) return -1; + + const char *action_path[] = {"action", 0}; + yajl_val action_val = yajl_tree_get(parent, action_path, yajl_t_string); + + if (action_val == NULL) { + fputs("No 'action' key found in client message\n", stderr); + return -1; + } + + const char *action = YAJL_GET_STRING(action_val); + + if (strcmp(action, "subscribe") == 0) + *subscribe = IPC_ACTION_SUBSCRIBE; + else if (strcmp(action, "unsubscribe") == 0) + *subscribe = IPC_ACTION_UNSUBSCRIBE; + else { + fputs("Invalid action specified for subscription\n", stderr); + return -1; + } + + yajl_tree_free(parent); + + return 0; +} + +/** + * Parse an IPC_TYPE_GET_DWM_CLIENT message from a client. This function + * extracts the window id from the message. + * + * Returns 0 if message was successfully parsed + * Returns -1 otherwise + */ +static int +ipc_parse_get_dwm_client(const char *msg, Window *win) +{ + char error_buffer[100]; + + yajl_val parent = yajl_tree_parse(msg, error_buffer, 100); + + if (parent == NULL) { + fputs("Failed to parse message from client\n", stderr); + fprintf(stderr, "%s\n", error_buffer); + return -1; + } + + // Format: + // { + // "client_window_id": + // } + const char *win_path[] = {"client_window_id", 0}; + yajl_val win_val = yajl_tree_get(parent, win_path, yajl_t_number); + + if (win_val == NULL) { + fputs("No client window id found in client message\n", stderr); + return -1; + } + + *win = YAJL_GET_INTEGER(win_val); + + yajl_tree_free(parent); + + return 0; +} + +/** + * Called when an IPC_TYPE_RUN_COMMAND message is received from a client. This + * function parses, executes the given command, and prepares a reply message to + * the client indicating success/failure. + * + * NOTE: There is currently no check for argument validity beyond the number of + * arguments given and types of arguments. There is also no way to check if the + * function succeeded based on dwm's void(const Arg*) function types. Pointer + * arguments can cause crashes if they are not validated in the function itself. + * + * Returns 0 if message was successfully parsed + * Returns -1 on failure parsing message + */ +static int +ipc_run_command(IPCClient *ipc_client, char *msg) +{ + IPCParsedCommand parsed_command; + IPCCommand ipc_command; + + // Initialize struct + memset(&parsed_command, 0, sizeof(IPCParsedCommand)); + + if (ipc_parse_run_command(msg, &parsed_command) < 0) { + ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, + "Failed to parse run command"); + return -1; + } + + if (ipc_get_ipc_command(parsed_command.name, &ipc_command) < 0) { + ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, + "Command %s not found", parsed_command.name); + ipc_free_parsed_command_members(&parsed_command); + return -1; + } + + int res = ipc_validate_run_command(&parsed_command, ipc_command); + if (res < 0) { + if (res == -1) + ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, + "%u arguments provided, %u expected", + parsed_command.argc, ipc_command.argc); + else if (res == -2) + ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, + "Type mismatch"); + ipc_free_parsed_command_members(&parsed_command); + return -1; + } + + if (parsed_command.argc == 1) + ipc_command.func.single_param(parsed_command.args); + else if (parsed_command.argc > 1) + ipc_command.func.array_param(parsed_command.args, parsed_command.argc); + + DEBUG("Called function for command %s\n", parsed_command.name); + + ipc_free_parsed_command_members(&parsed_command); + + ipc_prepare_reply_success(ipc_client, IPC_TYPE_RUN_COMMAND); + return 0; +} + +/** + * Called when an IPC_TYPE_GET_MONITORS message is received from a client. It + * prepares a reply with the properties of all of the monitors in JSON. + */ +static void +ipc_get_monitors(IPCClient *c, Monitor *mons, Monitor *selmon) +{ + yajl_gen gen; + ipc_reply_init_message(&gen); + dump_monitors(gen, mons, selmon); + + ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_MONITORS); +} + +/** + * Called when an IPC_TYPE_GET_TAGS message is received from a client. It + * prepares a reply with info about all the tags in JSON. + */ +static void +ipc_get_tags(IPCClient *c, const int tags_len) +{ + yajl_gen gen; + ipc_reply_init_message(&gen); + + dump_tags(gen, tags_len); + + ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_TAGS); +} + +/** + * Called when an IPC_TYPE_GET_LAYOUTS message is received from a client. It + * prepares a reply with a JSON array of available layouts + */ +static void +ipc_get_layouts(IPCClient *c, const Layout layouts[], const int layouts_len) +{ + yajl_gen gen; + ipc_reply_init_message(&gen); + + dump_layouts(gen, layouts, layouts_len); + + ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_LAYOUTS); +} + +/** + * Called when an IPC_TYPE_GET_DWM_CLIENT message is received from a client. It + * prepares a JSON reply with the properties of the client with the specified + * window XID. + * + * Returns 0 if the message was successfully parsed and if the client with the + * specified window XID was found + * Returns -1 if the message could not be parsed + */ +static int +ipc_get_dwm_client(IPCClient *ipc_client, const char *msg, const Monitor *mons) +{ + Window win; + + if (ipc_parse_get_dwm_client(msg, &win) < 0) return -1; + + // Find client with specified window XID + for (const Monitor *m = mons; m; m = m->next) + for (Client *c = m->clients; c; c = c->next) + if (c->win == win) { + yajl_gen gen; + ipc_reply_init_message(&gen); + + dump_client(gen, c); + + ipc_reply_prepare_send_message(gen, ipc_client, + IPC_TYPE_GET_DWM_CLIENT); + + return 0; + } + + ipc_prepare_reply_failure(ipc_client, IPC_TYPE_GET_DWM_CLIENT, + "Client with window id %d not found", win); + return -1; +} + +/** + * Called when an IPC_TYPE_SUBSCRIBE message is received from a client. It + * subscribes/unsubscribes the client from the specified event and replies with + * the result. + * + * Returns 0 if the message was successfully parsed. + * Returns -1 if the message could not be parsed + */ +static int +ipc_subscribe(IPCClient *c, const char *msg) +{ + IPCSubscriptionAction action = IPC_ACTION_SUBSCRIBE; + IPCEvent event = 0; + + if (ipc_parse_subscribe(msg, &action, &event)) { + ipc_prepare_reply_failure(c, IPC_TYPE_SUBSCRIBE, "Event does not exist"); + return -1; + } + + if (action == IPC_ACTION_SUBSCRIBE) { + DEBUG("Subscribing client on fd %d to %d\n", c->fd, event); + c->subscriptions |= event; + } else if (action == IPC_ACTION_UNSUBSCRIBE) { + DEBUG("Unsubscribing client on fd %d to %d\n", c->fd, event); + c->subscriptions ^= event; + } else { + ipc_prepare_reply_failure(c, IPC_TYPE_SUBSCRIBE, + "Invalid subscription action"); + return -1; + } + + ipc_prepare_reply_success(c, IPC_TYPE_SUBSCRIBE); + return 0; +} + +int +ipc_init(const char *socket_path, const int p_epoll_fd, IPCCommand commands[], + const int commands_len) +{ + // Initialize struct to 0 + memset(&sock_epoll_event, 0, sizeof(sock_epoll_event)); + + int socket_fd = ipc_create_socket(socket_path); + if (socket_fd < 0) return -1; + + ipc_commands = commands; + ipc_commands_len = commands_len; + + epoll_fd = p_epoll_fd; + + // Wake up to incoming connection requests + sock_epoll_event.data.fd = socket_fd; + sock_epoll_event.events = EPOLLIN; + if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, socket_fd, &sock_epoll_event)) { + fputs("Failed to add sock file descriptor to epoll", stderr); + return -1; + } + + return socket_fd; +} + +void +ipc_cleanup() +{ + IPCClient *c = ipc_clients; + // Free clients and their buffers + while (c) { + ipc_drop_client(c); + c = ipc_clients; + } + + // Stop waking up for socket events + epoll_ctl(epoll_fd, EPOLL_CTL_DEL, sock_fd, &sock_epoll_event); + + // Uninitialize all static variables + epoll_fd = -1; + sock_fd = -1; + ipc_commands = NULL; + ipc_commands_len = 0; + memset(&sock_epoll_event, 0, sizeof(struct epoll_event)); + memset(&sockaddr, 0, sizeof(struct sockaddr_un)); + + // Delete socket + unlink(sockaddr.sun_path); + + shutdown(sock_fd, SHUT_RDWR); + close(sock_fd); +} + +int +ipc_get_sock_fd() +{ + return sock_fd; +} + +IPCClient * +ipc_get_client(int fd) +{ + return ipc_list_get_client(ipc_clients, fd); +} + +int +ipc_is_client_registered(int fd) +{ + return (ipc_get_client(fd) != NULL); +} + +int +ipc_accept_client() +{ + int fd = -1; + + struct sockaddr_un client_addr; + socklen_t len = 0; + + // For portability clear the addr structure, since some implementations + // have nonstandard fields in the structure + memset(&client_addr, 0, sizeof(struct sockaddr_un)); + + fd = accept(sock_fd, (struct sockaddr *)&client_addr, &len); + if (fd < 0 && errno != EINTR) { + fputs("Failed to accept IPC connection from client", stderr); + return -1; + } + + if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) { + shutdown(fd, SHUT_RDWR); + close(fd); + fputs("Failed to set flags on new client fd", stderr); + } + + IPCClient *nc = ipc_client_new(fd); + if (nc == NULL) return -1; + + // Wake up to messages from this client + nc->event.data.fd = fd; + nc->event.events = EPOLLIN | EPOLLHUP; + epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &nc->event); + + ipc_list_add_client(&ipc_clients, nc); + + DEBUG("%s%d\n", "New client at fd: ", fd); + + return fd; +} + +int +ipc_drop_client(IPCClient *c) +{ + int fd = c->fd; + shutdown(fd, SHUT_RDWR); + int res = close(fd); + + if (res == 0) { + struct epoll_event ev; + + // Stop waking up to messages from this client + epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &ev); + ipc_list_remove_client(&ipc_clients, c); + + free(c->buffer); + free(c); + + DEBUG("Successfully removed client on fd %d\n", fd); + } else if (res < 0 && res != EINTR) { + fprintf(stderr, "Failed to close fd %d\n", fd); + } + + return res; +} + +int +ipc_read_client(IPCClient *c, IPCMessageType *msg_type, uint32_t *msg_size, + char **msg) +{ + int fd = c->fd; + int ret = + ipc_recv_message(fd, (uint8_t *)msg_type, msg_size, (uint8_t **)msg); + + if (ret < 0) { + // This will happen if these errors occur while reading header + if (ret == -1 && + (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) + return -2; + + fprintf(stderr, "Error reading message: dropping client at fd %d\n", fd); + ipc_drop_client(c); + + return -1; + } + + // Make sure receive message is null terminated to avoid parsing issues + if (*msg_size > 0) { + size_t len = *msg_size; + nullterminate(msg, &len); + *msg_size = len; + } + + DEBUG("[fd %d] ", fd); + if (*msg_size > 0) + DEBUG("Received message: '%.*s' ", *msg_size, *msg); + else + DEBUG("Received empty message "); + DEBUG("Message type: %" PRIu8 " ", (uint8_t)*msg_type); + DEBUG("Message size: %" PRIu32 "\n", *msg_size); + + return 0; +} + +ssize_t +ipc_write_client(IPCClient *c) +{ + const ssize_t n = ipc_write_message(c->fd, c->buffer, c->buffer_size); + + if (n < 0) return n; + + // TODO: Deal with client timeouts + + if (n == c->buffer_size) { + c->buffer_size = 0; + free(c->buffer); + // No dangling pointers! + c->buffer = NULL; + // Stop waking up when client is ready to receive messages + if (c->event.events & EPOLLOUT) { + c->event.events -= EPOLLOUT; + epoll_ctl(epoll_fd, EPOLL_CTL_MOD, c->fd, &c->event); + } + return n; + } + + // Shift unwritten buffer to beginning of buffer and reallocate + c->buffer_size -= n; + memmove(c->buffer, c->buffer + n, c->buffer_size); + c->buffer = (char *)realloc(c->buffer, c->buffer_size); + + return n; +} + +void +ipc_prepare_send_message(IPCClient *c, const IPCMessageType msg_type, + const uint32_t msg_size, const char *msg) +{ + dwm_ipc_header_t header = { + .magic = IPC_MAGIC_ARR, .type = msg_type, .size = msg_size}; + + uint32_t header_size = sizeof(dwm_ipc_header_t); + uint32_t packet_size = header_size + msg_size; + + if (c->buffer == NULL) + c->buffer = (char *)malloc(c->buffer_size + packet_size); + else + c->buffer = (char *)realloc(c->buffer, c->buffer_size + packet_size); + + // Copy header to end of client buffer + memcpy(c->buffer + c->buffer_size, &header, header_size); + c->buffer_size += header_size; + + // Copy message to end of client buffer + memcpy(c->buffer + c->buffer_size, msg, msg_size); + c->buffer_size += msg_size; + + // Wake up when client is ready to receive messages + c->event.events |= EPOLLOUT; + epoll_ctl(epoll_fd, EPOLL_CTL_MOD, c->fd, &c->event); +} + +void +ipc_prepare_reply_failure(IPCClient *c, IPCMessageType msg_type, + const char *format, ...) +{ + yajl_gen gen; + va_list args; + + // Get output size + va_start(args, format); + size_t len = vsnprintf(NULL, 0, format, args); + va_end(args); + char *buffer = (char *)malloc((len + 1) * sizeof(char)); + + ipc_reply_init_message(&gen); + + va_start(args, format); + vsnprintf(buffer, len + 1, format, args); + va_end(args); + dump_error_message(gen, buffer); + + ipc_reply_prepare_send_message(gen, c, msg_type); + fprintf(stderr, "[fd %d] Error: %s\n", c->fd, buffer); + + free(buffer); +} + +void +ipc_prepare_reply_success(IPCClient *c, IPCMessageType msg_type) +{ + const char *success_msg = "{\"result\":\"success\"}"; + const size_t msg_len = strlen(success_msg) + 1; // +1 for null char + + ipc_prepare_send_message(c, msg_type, msg_len, success_msg); +} + +void +ipc_tag_change_event(int mon_num, TagState old_state, TagState new_state) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_tag_event(gen, mon_num, old_state, new_state); + ipc_event_prepare_send_message(gen, IPC_EVENT_TAG_CHANGE); +} + +void +ipc_client_focus_change_event(int mon_num, Client *old_client, + Client *new_client) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_client_focus_change_event(gen, old_client, new_client, mon_num); + ipc_event_prepare_send_message(gen, IPC_EVENT_CLIENT_FOCUS_CHANGE); +} + +void +ipc_layout_change_event(const int mon_num, const char *old_symbol, + const Layout *old_layout, const char *new_symbol, + const Layout *new_layout) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_layout_change_event(gen, mon_num, old_symbol, old_layout, new_symbol, + new_layout); + ipc_event_prepare_send_message(gen, IPC_EVENT_LAYOUT_CHANGE); +} + +void +ipc_monitor_focus_change_event(const int last_mon_num, const int new_mon_num) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_monitor_focus_change_event(gen, last_mon_num, new_mon_num); + ipc_event_prepare_send_message(gen, IPC_EVENT_MONITOR_FOCUS_CHANGE); +} + +void +ipc_focused_title_change_event(const int mon_num, const Window client_id, + const char *old_name, const char *new_name) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_focused_title_change_event(gen, mon_num, client_id, old_name, new_name); + ipc_event_prepare_send_message(gen, IPC_EVENT_FOCUSED_TITLE_CHANGE); +} + +void +ipc_focused_state_change_event(const int mon_num, const Window client_id, + const ClientState *old_state, + const ClientState *new_state) +{ + yajl_gen gen; + ipc_event_init_message(&gen); + dump_focused_state_change_event(gen, mon_num, client_id, old_state, + new_state); + ipc_event_prepare_send_message(gen, IPC_EVENT_FOCUSED_STATE_CHANGE); +} + +void +ipc_send_events(Monitor *mons, Monitor **lastselmon, Monitor *selmon) +{ + for (Monitor *m = mons; m; m = m->next) { + unsigned int urg = 0, occ = 0, tagset = 0; + + for (Client *c = m->clients; c; c = c->next) { + occ |= c->tags; + + if (c->isurgent) urg |= c->tags; + } + tagset = m->tagset[m->seltags]; + + TagState new_state = {.selected = tagset, .occupied = occ, .urgent = urg}; + + if (memcmp(&m->tagstate, &new_state, sizeof(TagState)) != 0) { + ipc_tag_change_event(m->num, m->tagstate, new_state); + m->tagstate = new_state; + } + + if (m->lastsel != m->sel) { + ipc_client_focus_change_event(m->num, m->lastsel, m->sel); + m->lastsel = m->sel; + } + + if (strcmp(m->ltsymbol, m->lastltsymbol) != 0 || + m->lastlt != m->lt[m->sellt]) { + ipc_layout_change_event(m->num, m->lastltsymbol, m->lastlt, m->ltsymbol, + m->lt[m->sellt]); + strcpy(m->lastltsymbol, m->ltsymbol); + m->lastlt = m->lt[m->sellt]; + } + + if (*lastselmon != selmon) { + if (*lastselmon != NULL) + ipc_monitor_focus_change_event((*lastselmon)->num, selmon->num); + *lastselmon = selmon; + } + + Client *sel = m->sel; + if (!sel) continue; + ClientState *o = &m->sel->prevstate; + ClientState n = {.oldstate = sel->oldstate, + .isfixed = sel->isfixed, + .isfloating = sel->isfloating, + .isfullscreen = sel->isfullscreen, + .isurgent = sel->isurgent, + .neverfocus = sel->neverfocus}; + if (memcmp(o, &n, sizeof(ClientState)) != 0) { + ipc_focused_state_change_event(m->num, m->sel->win, o, &n); + *o = n; + } + } +} + +int +ipc_handle_client_epoll_event(struct epoll_event *ev, Monitor *mons, + Monitor **lastselmon, Monitor *selmon, const int tags_len, + const Layout *layouts, const int layouts_len) +{ + int fd = ev->data.fd; + IPCClient *c = ipc_get_client(fd); + + if (ev->events & EPOLLHUP) { + DEBUG("EPOLLHUP received from client at fd %d\n", fd); + ipc_drop_client(c); + } else if (ev->events & EPOLLOUT) { + DEBUG("Sending message to client at fd %d...\n", fd); + if (c->buffer_size) ipc_write_client(c); + } else if (ev->events & EPOLLIN) { + IPCMessageType msg_type = 0; + uint32_t msg_size = 0; + char *msg = NULL; + + DEBUG("Received message from fd %d\n", fd); + if (ipc_read_client(c, &msg_type, &msg_size, &msg) < 0) return -1; + + if (msg_type == IPC_TYPE_GET_MONITORS) + ipc_get_monitors(c, mons, selmon); + else if (msg_type == IPC_TYPE_GET_TAGS) + ipc_get_tags(c, tags_len); + else if (msg_type == IPC_TYPE_GET_LAYOUTS) + ipc_get_layouts(c, layouts, layouts_len); + else if (msg_type == IPC_TYPE_RUN_COMMAND) { + if (ipc_run_command(c, msg) < 0) return -1; + ipc_send_events(mons, lastselmon, selmon); + } else if (msg_type == IPC_TYPE_GET_DWM_CLIENT) { + if (ipc_get_dwm_client(c, msg, mons) < 0) return -1; + } else if (msg_type == IPC_TYPE_SUBSCRIBE) { + if (ipc_subscribe(c, msg) < 0) return -1; + } else { + fprintf(stderr, "Invalid message type received from fd %d", fd); + ipc_prepare_reply_failure(c, msg_type, "Invalid message type: %d", + msg_type); + } + free(msg); + } else { + fprintf(stderr, "Epoll event returned %d from fd %d\n", ev->events, fd); + return -1; + } + + return 0; +} + +int +ipc_handle_socket_epoll_event(struct epoll_event *ev) +{ + if (!(ev->events & EPOLLIN)) return -1; + + // EPOLLIN means incoming client connection request + fputs("Received EPOLLIN event on socket\n", stderr); + int new_fd = ipc_accept_client(); + + return new_fd; +} diff --git a/.local/src/dwm/patch/ipc/ipc.h b/.local/src/dwm/patch/ipc/ipc.h new file mode 100644 index 00000000..29ec036a --- /dev/null +++ b/.local/src/dwm/patch/ipc/ipc.h @@ -0,0 +1,319 @@ +#ifndef IPC_H_ +#define IPC_H_ + +#include +#include +#include + +#include "IPCClient.h" + +// clang-format off +#define IPC_MAGIC "DWM-IPC" +#define IPC_MAGIC_ARR { 'D', 'W', 'M', '-', 'I', 'P', 'C'} +#define IPC_MAGIC_LEN 7 // Not including null char + +#define IPCCOMMAND(FUNC, ARGC, TYPES) \ + { #FUNC, {FUNC }, ARGC, (ArgType[ARGC])TYPES } +// clang-format on + +typedef enum IPCMessageType { + IPC_TYPE_RUN_COMMAND = 0, + IPC_TYPE_GET_MONITORS = 1, + IPC_TYPE_GET_TAGS = 2, + IPC_TYPE_GET_LAYOUTS = 3, + IPC_TYPE_GET_DWM_CLIENT = 4, + IPC_TYPE_SUBSCRIBE = 5, + IPC_TYPE_EVENT = 6 +} IPCMessageType; + +typedef enum IPCEvent { + IPC_EVENT_TAG_CHANGE = 1 << 0, + IPC_EVENT_CLIENT_FOCUS_CHANGE = 1 << 1, + IPC_EVENT_LAYOUT_CHANGE = 1 << 2, + IPC_EVENT_MONITOR_FOCUS_CHANGE = 1 << 3, + IPC_EVENT_FOCUSED_TITLE_CHANGE = 1 << 4, + IPC_EVENT_FOCUSED_STATE_CHANGE = 1 << 5 +} IPCEvent; + +typedef enum IPCSubscriptionAction { + IPC_ACTION_UNSUBSCRIBE = 0, + IPC_ACTION_SUBSCRIBE = 1 +} IPCSubscriptionAction; + +/** + * Every IPC packet starts with this structure + */ +typedef struct dwm_ipc_header { + uint8_t magic[IPC_MAGIC_LEN]; + uint32_t size; + uint8_t type; +} __attribute((packed)) dwm_ipc_header_t; + +typedef enum ArgType { + ARG_TYPE_NONE = 0, + ARG_TYPE_UINT = 1, + ARG_TYPE_SINT = 2, + ARG_TYPE_FLOAT = 3, + ARG_TYPE_PTR = 4, + ARG_TYPE_STR = 5 +} ArgType; + +/** + * An IPCCommand function can have either of these function signatures + */ +typedef union ArgFunction { + void (*single_param)(const Arg *); + void (*array_param)(const Arg *, int); +} ArgFunction; + +typedef struct IPCCommand { + char *name; + ArgFunction func; + unsigned int argc; + ArgType *arg_types; +} IPCCommand; + +typedef struct IPCParsedCommand { + char *name; + Arg *args; + ArgType *arg_types; + unsigned int argc; +} IPCParsedCommand; + +/** + * Initialize the IPC socket and the IPC module + * + * @param socket_path Path to create the socket at + * @param epoll_fd File descriptor for epoll + * @param commands Address of IPCCommands array defined in config.h + * @param commands_len Length of commands[] array + * + * @return int The file descriptor of the socket if it was successfully created, + * -1 otherwise + */ +int ipc_init(const char *socket_path, const int p_epoll_fd, + IPCCommand commands[], const int commands_len); + +/** + * Uninitialize the socket and module. Free allocated memory and restore static + * variables to their state before ipc_init + */ +void ipc_cleanup(); + +/** + * Get the file descriptor of the IPC socket + * + * @return int File descriptor of IPC socket, -1 if socket not created. + */ +int ipc_get_sock_fd(); + +/** + * Get address to IPCClient with specified file descriptor + * + * @param fd File descriptor of IPC Client + * + * @return Address to IPCClient with specified file descriptor, -1 otherwise + */ +IPCClient *ipc_get_client(int fd); + +/** + * Check if an IPC client exists with the specified file descriptor + * + * @param fd File descriptor + * + * @return int 1 if client exists, 0 otherwise + */ +int ipc_is_client_registered(int fd); + +/** + * Disconnect an IPCClient from the socket and remove the client from the list + * of known connected clients + * + * @param c Address of IPCClient + * + * @return 0 if the client's file descriptor was closed successfully, the + * result of executing close() on the file descriptor otherwise. + */ +int ipc_drop_client(IPCClient *c); + +/** + * Accept an IPC Client requesting to connect to the socket and add it to the + * list of clients + * + * @return File descriptor of new client, -1 on error + */ +int ipc_accept_client(); + +/** + * Read an incoming message from an accepted IPC client + * + * @param c Address of IPCClient + * @param msg_type Address to IPCMessageType variable which will be assigned + * the message type of the received message + * @param msg_size Address to uint32_t variable which will be assigned the size + * of the received message + * @param msg Address to char* variable which will be assigned the address of + * the received message. This must be freed using free(). + * + * @return 0 on success, -1 on error reading message, -2 if reading the message + * resulted in EAGAIN, EINTR, or EWOULDBLOCK. + */ +int ipc_read_client(IPCClient *c, IPCMessageType *msg_type, uint32_t *msg_size, + char **msg); + +/** + * Write any pending buffer of the client to the client's socket + * + * @param c Client whose buffer to write + * + * @return Number of bytes written >= 0, -1 otherwise. errno will still be set + * from the write operation. + */ +ssize_t ipc_write_client(IPCClient *c); + +/** + * Prepare a message in the specified client's buffer. + * + * @param c Client to prepare message for + * @param msg_type Type of message to prepare + * @param msg_size Size of the message in bytes. Should not exceed + * MAX_MESSAGE_SIZE + * @param msg Message to prepare (not including header). This pointer can be + * freed after the function invocation. + */ +void ipc_prepare_send_message(IPCClient *c, const IPCMessageType msg_type, + const uint32_t msg_size, const char *msg); + +/** + * Prepare an error message in the specified client's buffer + * + * @param c Client to prepare message for + * @param msg_type Type of message + * @param format Format string following vsprintf + * @param ... Arguments for format string + */ +void ipc_prepare_reply_failure(IPCClient *c, IPCMessageType msg_type, + const char *format, ...); + +/** + * Prepare a success message in the specified client's buffer + * + * @param c Client to prepare message for + * @param msg_type Type of message + */ +void ipc_prepare_reply_success(IPCClient *c, IPCMessageType msg_type); + +/** + * Send a tag_change_event to all subscribers. Should be called only when there + * has been a tag state change. + * + * @param mon_num The index of the monitor (Monitor.num property) + * @param old_state The old tag state + * @param new_state The new (now current) tag state + */ +void ipc_tag_change_event(const int mon_num, TagState old_state, + TagState new_state); + +/** + * Send a client_focus_change_event to all subscribers. Should be called only + * when the client focus changes. + * + * @param mon_num The index of the monitor (Monitor.num property) + * @param old_client The old DWM client selection (Monitor.oldsel) + * @param new_client The new (now current) DWM client selection + */ +void ipc_client_focus_change_event(const int mon_num, Client *old_client, + Client *new_client); + +/** + * Send a layout_change_event to all subscribers. Should be called only + * when there has been a layout change. + * + * @param mon_num The index of the monitor (Monitor.num property) + * @param old_symbol The old layout symbol + * @param old_layout Address to the old Layout + * @param new_symbol The new (now current) layout symbol + * @param new_layout Address to the new Layout + */ +void ipc_layout_change_event(const int mon_num, const char *old_symbol, + const Layout *old_layout, const char *new_symbol, + const Layout *new_layout); + +/** + * Send a monitor_focus_change_event to all subscribers. Should be called only + * when the monitor focus changes. + * + * @param last_mon_num The index of the previously selected monitor + * @param new_mon_num The index of the newly selected monitor + */ +void ipc_monitor_focus_change_event(const int last_mon_num, + const int new_mon_num); + +/** + * Send a focused_title_change_event to all subscribers. Should only be called + * if a selected client has a title change. + * + * @param mon_num Index of the client's monitor + * @param client_id Window XID of client + * @param old_name Old name of the client window + * @param new_name New name of the client window + */ +void ipc_focused_title_change_event(const int mon_num, const Window client_id, + const char *old_name, const char *new_name); + +/** + * Send a focused_state_change_event to all subscribers. Should only be called + * if a selected client has a state change. + * + * @param mon_num Index of the client's monitor + * @param client_id Window XID of client + * @param old_state Old state of the client + * @param new_state New state of the client + */ +void ipc_focused_state_change_event(const int mon_num, const Window client_id, + const ClientState *old_state, + const ClientState *new_state); +/** + * Check to see if an event has occured and call the *_change_event functions + * accordingly + * + * @param mons Address of Monitor pointing to start of linked list + * @param lastselmon Address of pointer to previously selected monitor + * @param selmon Address of selected Monitor + */ +void ipc_send_events(Monitor *mons, Monitor **lastselmon, Monitor *selmon); + +/** + * Handle an epoll event caused by a registered IPC client. Read, process, and + * handle any received messages from clients. Write pending buffer to client if + * the client is ready to receive messages. Drop clients that have sent an + * EPOLLHUP. + * + * @param ev Associated epoll event returned by epoll_wait + * @param mons Address of Monitor pointing to start of linked list + * @param selmon Address of selected Monitor + * @param lastselmon Address of pointer to previously selected monitor + * @param tags Array of tag names + * @param tags_len Length of tags array + * @param layouts Array of available layouts + * @param layouts_len Length of layouts array + * + * @return 0 if event was successfully handled, -1 on any error receiving + * or handling incoming messages or unhandled epoll event. + */ +int ipc_handle_client_epoll_event(struct epoll_event *ev, Monitor *mons, + Monitor **lastselmon, Monitor *selmon, const int tags_len, + const Layout *layouts, const int layouts_len); + +/** + * Handle an epoll event caused by the IPC socket. This function only handles an + * EPOLLIN event indicating a new client requesting to connect to the socket. + * + * @param ev Associated epoll event returned by epoll_wait + * + * @return 0, if the event was successfully handled, -1 if not an EPOLLIN event + * or if a new IPC client connection request could not be accepted. + */ +int ipc_handle_socket_epoll_event(struct epoll_event *ev); + +#endif /* IPC_H_ */ diff --git a/.local/src/dwm/patch/ipc/util.c b/.local/src/dwm/patch/ipc/util.c new file mode 100644 index 00000000..fedfc93c --- /dev/null +++ b/.local/src/dwm/patch/ipc/util.c @@ -0,0 +1,135 @@ +#include +#include + +int +normalizepath(const char *path, char **normal) +{ + size_t len = strlen(path); + *normal = (char *)malloc((len + 1) * sizeof(char)); + const char *walk = path; + const char *match; + size_t newlen = 0; + + while ((match = strchr(walk, '/'))) { + // Copy everything between match and walk + strncpy(*normal + newlen, walk, match - walk); + newlen += match - walk; + walk += match - walk; + + // Skip all repeating slashes + while (*walk == '/') + walk++; + + // If not last character in path + if (walk != path + len) + (*normal)[newlen++] = '/'; + } + + (*normal)[newlen++] = '\0'; + + // Copy remaining path + strcat(*normal, walk); + newlen += strlen(walk); + + *normal = (char *)realloc(*normal, newlen * sizeof(char)); + + return 0; +} + +int +parentdir(const char *path, char **parent) +{ + char *normal; + char *walk; + + normalizepath(path, &normal); + + // Pointer to last '/' + if (!(walk = strrchr(normal, '/'))) { + free(normal); + return -1; + } + + // Get path up to last '/' + size_t len = walk - normal; + *parent = (char *)malloc((len + 1) * sizeof(char)); + + // Copy path up to last '/' + strncpy(*parent, normal, len); + // Add null char + (*parent)[len] = '\0'; + + free(normal); + + return 0; +} + +int +mkdirp(const char *path) +{ + char *normal; + char *walk; + size_t normallen; + + normalizepath(path, &normal); + normallen = strlen(normal); + walk = normal; + + while (walk < normal + normallen + 1) { + // Get length from walk to next / + size_t n = strcspn(walk, "/"); + + // Skip path / + if (n == 0) { + walk++; + continue; + } + + // Length of current path segment + size_t curpathlen = walk - normal + n; + char curpath[curpathlen + 1]; + struct stat s; + + // Copy path segment to stat + strncpy(curpath, normal, curpathlen); + strcpy(curpath + curpathlen, ""); + int res = stat(curpath, &s); + + if (res < 0) { + if (errno == ENOENT) { + DEBUG("Making directory %s\n", curpath); + if (mkdir(curpath, 0700) < 0) { + fprintf(stderr, "Failed to make directory %s\n", curpath); + perror(""); + free(normal); + return -1; + } + } else { + fprintf(stderr, "Error statting directory %s\n", curpath); + perror(""); + free(normal); + return -1; + } + } + + // Continue to next path segment + walk += n; + } + + free(normal); + + return 0; +} + +int +nullterminate(char **str, size_t *len) +{ + if ((*str)[*len - 1] == '\0') + return 0; + + (*len)++; + *str = (char*)realloc(*str, *len * sizeof(char)); + (*str)[*len - 1] = '\0'; + + return 0; +} diff --git a/.local/src/dwm/patch/ipc/util.h b/.local/src/dwm/patch/ipc/util.h new file mode 100644 index 00000000..8f8d35fd --- /dev/null +++ b/.local/src/dwm/patch/ipc/util.h @@ -0,0 +1,4 @@ +int normalizepath(const char *path, char **normal); +int mkdirp(const char *path); +int parentdir(const char *path, char **parent); +int nullterminate(char **str, size_t *len); \ No newline at end of file diff --git a/.local/src/dwm/patch/ipc/yajl_dumps.c b/.local/src/dwm/patch/ipc/yajl_dumps.c new file mode 100644 index 00000000..d5d2a61d --- /dev/null +++ b/.local/src/dwm/patch/ipc/yajl_dumps.c @@ -0,0 +1,351 @@ +#include "yajl_dumps.h" + +#include + +int +dump_tag(yajl_gen gen, const char *name, const int tag_mask) +{ + // clang-format off + YMAP( + YSTR("bit_mask"); YINT(tag_mask); + YSTR("name"); YSTR(name); + ) + // clang-format on + + return 0; +} + +int +dump_tags(yajl_gen gen, int tags_len) +{ + // clang-format off + YARR( + for (int i = 0; i < tags_len; i++) + dump_tag(gen, tagicon(mons, i), 1 << i); + ) + // clang-format on + + return 0; +} + +int +dump_client(yajl_gen gen, Client *c) +{ + // clang-format off + YMAP( + YSTR("name"); YSTR(c->name); + YSTR("tags"); YINT(c->tags); + YSTR("window_id"); YINT(c->win); + YSTR("monitor_number"); YINT(c->mon->num); + + YSTR("geometry"); YMAP( + YSTR("current"); YMAP ( + YSTR("x"); YINT(c->x); + YSTR("y"); YINT(c->y); + YSTR("width"); YINT(c->w); + YSTR("height"); YINT(c->h); + ) + YSTR("old"); YMAP( + YSTR("x"); YINT(c->oldx); + YSTR("y"); YINT(c->oldy); + YSTR("width"); YINT(c->oldw); + YSTR("height"); YINT(c->oldh); + ) + ) + + YSTR("size_hints"); YMAP( + YSTR("base"); YMAP( + YSTR("width"); YINT(c->basew); + YSTR("height"); YINT(c->baseh); + ) + YSTR("step"); YMAP( + YSTR("width"); YINT(c->incw); + YSTR("height"); YINT(c->inch); + ) + YSTR("max"); YMAP( + YSTR("width"); YINT(c->maxw); + YSTR("height"); YINT(c->maxh); + ) + YSTR("min"); YMAP( + YSTR("width"); YINT(c->minw); + YSTR("height"); YINT(c->minh); + ) + YSTR("aspect_ratio"); YMAP( + YSTR("min"); YDOUBLE(c->mina); + YSTR("max"); YDOUBLE(c->maxa); + ) + ) + + YSTR("border_width"); YMAP( + YSTR("current"); YINT(c->bw); + YSTR("old"); YINT(c->oldbw); + ) + + YSTR("states"); YMAP( + YSTR("is_fixed"); YBOOL(c->isfixed); + YSTR("is_floating"); YBOOL(c->isfloating); + YSTR("is_urgent"); YBOOL(c->isurgent); + YSTR("never_focus"); YBOOL(c->neverfocus); + YSTR("old_state"); YBOOL(c->oldstate); + YSTR("is_fullscreen"); YBOOL(c->isfullscreen); + ) + ) + // clang-format on + + return 0; +} + +int +dump_monitor(yajl_gen gen, Monitor *mon, int is_selected) +{ + // clang-format off + YMAP( + YSTR("master_factor"); YDOUBLE(mon->mfact); + YSTR("num_master"); YINT(mon->nmaster); + YSTR("num"); YINT(mon->num); + YSTR("is_selected"); YBOOL(is_selected); + + YSTR("monitor_geometry"); YMAP( + YSTR("x"); YINT(mon->mx); + YSTR("y"); YINT(mon->my); + YSTR("width"); YINT(mon->mw); + YSTR("height"); YINT(mon->mh); + ) + + YSTR("window_geometry"); YMAP( + YSTR("x"); YINT(mon->wx); + YSTR("y"); YINT(mon->wy); + YSTR("width"); YINT(mon->ww); + YSTR("height"); YINT(mon->wh); + ) + + YSTR("tagset"); YMAP( + YSTR("current"); YINT(mon->tagset[mon->seltags]); + YSTR("old"); YINT(mon->tagset[mon->seltags ^ 1]); + ) + + YSTR("tag_state"); dump_tag_state(gen, mon->tagstate); + + YSTR("clients"); YMAP( + YSTR("selected"); YINT(mon->sel ? mon->sel->win : 0); + YSTR("stack"); YARR( + for (Client* c = mon->stack; c; c = c->snext) + YINT(c->win); + ) + YSTR("all"); YARR( + for (Client* c = mon->clients; c; c = c->next) + YINT(c->win); + ) + ) + + YSTR("layout"); YMAP( + YSTR("symbol"); YMAP( + YSTR("current"); YSTR(mon->ltsymbol); + YSTR("old"); YSTR(mon->lastltsymbol); + ) + YSTR("address"); YMAP( + YSTR("current"); YINT((uintptr_t)mon->lt[mon->sellt]); + YSTR("old"); YINT((uintptr_t)mon->lt[mon->sellt ^ 1]); + ) + ) + + YSTR("bar"); YMAP( + YSTR("y"); YINT(mon->bar->by); + YSTR("is_shown"); YBOOL(mon->showbar); + YSTR("is_top"); YBOOL(mon->bar->topbar); + YSTR("window_id"); YINT(mon->bar->win); + ) + ) + // clang-format on + + return 0; +} + +int +dump_monitors(yajl_gen gen, Monitor *mons, Monitor *selmon) +{ + // clang-format off + YARR( + for (Monitor *mon = mons; mon; mon = mon->next) { + if (mon == selmon) + dump_monitor(gen, mon, 1); + else + dump_monitor(gen, mon, 0); + } + ) + // clang-format on + + return 0; +} + +int +dump_layouts(yajl_gen gen, const Layout layouts[], const int layouts_len) +{ + // clang-format off + YARR( + for (int i = 0; i < layouts_len; i++) { + YMAP( + // Check for a NULL pointer. The cycle layouts patch adds an entry at + // the end of the layouts array with a NULL pointer for the symbol + YSTR("symbol"); YSTR((layouts[i].symbol ? layouts[i].symbol : "")); + YSTR("address"); YINT((uintptr_t)(layouts + i)); + ) + } + ) + // clang-format on + + return 0; +} + +int +dump_tag_state(yajl_gen gen, TagState state) +{ + // clang-format off + YMAP( + YSTR("selected"); YINT(state.selected); + YSTR("occupied"); YINT(state.occupied); + YSTR("urgent"); YINT(state.urgent); + ) + // clang-format on + + return 0; +} + +int +dump_tag_event(yajl_gen gen, int mon_num, TagState old_state, + TagState new_state) +{ + // clang-format off + YMAP( + YSTR("tag_change_event"); YMAP( + YSTR("monitor_number"); YINT(mon_num); + YSTR("old_state"); dump_tag_state(gen, old_state); + YSTR("new_state"); dump_tag_state(gen, new_state); + ) + ) + // clang-format on + + return 0; +} + +int +dump_client_focus_change_event(yajl_gen gen, Client *old_client, + Client *new_client, int mon_num) +{ + // clang-format off + YMAP( + YSTR("client_focus_change_event"); YMAP( + YSTR("monitor_number"); YINT(mon_num); + YSTR("old_win_id"); old_client == NULL ? YNULL() : YINT(old_client->win); + YSTR("new_win_id"); new_client == NULL ? YNULL() : YINT(new_client->win); + ) + ) + // clang-format on + + return 0; +} + +int +dump_layout_change_event(yajl_gen gen, const int mon_num, + const char *old_symbol, const Layout *old_layout, + const char *new_symbol, const Layout *new_layout) +{ + // clang-format off + YMAP( + YSTR("layout_change_event"); YMAP( + YSTR("monitor_number"); YINT(mon_num); + YSTR("old_symbol"); YSTR(old_symbol); + YSTR("old_address"); YINT((uintptr_t)old_layout); + YSTR("new_symbol"); YSTR(new_symbol); + YSTR("new_address"); YINT((uintptr_t)new_layout); + ) + ) + // clang-format on + + return 0; +} + +int +dump_monitor_focus_change_event(yajl_gen gen, const int last_mon_num, + const int new_mon_num) +{ + // clang-format off + YMAP( + YSTR("monitor_focus_change_event"); YMAP( + YSTR("old_monitor_number"); YINT(last_mon_num); + YSTR("new_monitor_number"); YINT(new_mon_num); + ) + ) + // clang-format on + + return 0; +} + +int +dump_focused_title_change_event(yajl_gen gen, const int mon_num, + const Window client_id, const char *old_name, + const char *new_name) +{ + // clang-format off + YMAP( + YSTR("focused_title_change_event"); YMAP( + YSTR("monitor_number"); YINT(mon_num); + YSTR("client_window_id"); YINT(client_id); + YSTR("old_name"); YSTR(old_name); + YSTR("new_name"); YSTR(new_name); + ) + ) + // clang-format on + + return 0; +} + +int +dump_client_state(yajl_gen gen, const ClientState *state) +{ + // clang-format off + YMAP( + YSTR("old_state"); YBOOL(state->oldstate); + YSTR("is_fixed"); YBOOL(state->isfixed); + YSTR("is_floating"); YBOOL(state->isfloating); + YSTR("is_fullscreen"); YBOOL(state->isfullscreen); + YSTR("is_urgent"); YBOOL(state->isurgent); + YSTR("never_focus"); YBOOL(state->neverfocus); + ) + // clang-format on + + return 0; +} + +int +dump_focused_state_change_event(yajl_gen gen, const int mon_num, + const Window client_id, + const ClientState *old_state, + const ClientState *new_state) +{ + // clang-format off + YMAP( + YSTR("focused_state_change_event"); YMAP( + YSTR("monitor_number"); YINT(mon_num); + YSTR("client_window_id"); YINT(client_id); + YSTR("old_state"); dump_client_state(gen, old_state); + YSTR("new_state"); dump_client_state(gen, new_state); + ) + ) + // clang-format on + + return 0; +} + +int +dump_error_message(yajl_gen gen, const char *reason) +{ + // clang-format off + YMAP( + YSTR("result"); YSTR("error"); + YSTR("reason"); YSTR(reason); + ) + // clang-format on + + return 0; +} diff --git a/.local/src/dwm/patch/keymodes.c b/.local/src/dwm/patch/keymodes.c new file mode 100644 index 00000000..45af3c5e --- /dev/null +++ b/.local/src/dwm/patch/keymodes.c @@ -0,0 +1,143 @@ +/* function implementations */ +void +clearcmd(const Arg *arg) +{ + unsigned int i; + + for (i = 0; i < LENGTH(cmdkeysym); i++) { + cmdkeysym[i] = 0; + cmdmod[i] = 0; + } +} + +void +grabkeys(void) +{ + if (keymode == INSERTMODE) { + grabdefkeys(); + } else if (keymode == COMMANDMODE) { + XUngrabKey(dpy, AnyKey, AnyModifier, root); + XGrabKey(dpy, AnyKey, AnyModifier, root, + True, GrabModeAsync, GrabModeAsync); + } +} + +int +isprotodel(Client *c) +{ + int n; + Atom *protocols; + int ret = 0; + + if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { + while (!ret && n--) + ret = protocols[n] == wmatom[WMDelete]; + XFree(protocols); + } + return ret; +} + + +void +keypress(XEvent *e) +{ + unsigned int i, j; + Arg a = {0}; + Bool ismatch = False, maybematch = False; + KeySym keysym; + XKeyEvent *ev; + + if (keymode == INSERTMODE) + keydefpress(e); + else if (keymode == COMMANDMODE) { + ev = &e->xkey; + keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); + if (keysym < XK_Shift_L || keysym > XK_Hyper_R) { + for (i = 0; i < LENGTH(cmdkeys); i++) + if (keysym == cmdkeys[i].keysym + && CLEANMASK(cmdkeys[i].mod) == CLEANMASK(ev->state) + && cmdkeys[i].func) { + cmdkeys[i].func(&(cmdkeys[i].arg)); + ismatch = True; + break; + } + if (!ismatch) { + for (j = 0; j < LENGTH(cmdkeysym); j++) + if (cmdkeysym[j] == 0) { + cmdkeysym[j] = keysym; + cmdmod[j] = ev->state; + break; + } + for (i = 0; i < LENGTH(commands); i++) { + for (j = 0; j < LENGTH(cmdkeysym); j++) { + if (cmdkeysym[j] == commands[i].keysym[j] + && CLEANMASK(cmdmod[j]) == CLEANMASK(commands[i].mod[j])) + ismatch = True; + else if (cmdkeysym[j] == 0 + && cmdmod[j] == 0) { + ismatch = False; + maybematch = True; + break; + } else { + ismatch = False; + break; + } + } + if (ismatch) { + if (commands[i].func) + commands[i].func(&(commands[i].arg)); + clearcmd(&a); + break; + } + + } + if (!maybematch) + clearcmd(&a); + } + } + } +} + +void +onlyclient(const Arg *arg) +{ + Client *c; + XEvent ev; + + if (!selmon->sel) + return; + for (c = selmon->clients; c; c = c->next) { + if (c != selmon->sel && ISVISIBLE(c)) { + if (isprotodel(c)) { + ev.type = ClientMessage; + ev.xclient.window = c->win; + ev.xclient.message_type = wmatom[WMProtocols]; + ev.xclient.format = 32; + ev.xclient.data.l[0] = wmatom[WMDelete]; + ev.xclient.data.l[1] = CurrentTime; + XSendEvent(dpy, c->win, False, NoEventMask, &ev); + } + else { + XGrabServer(dpy); + XSetErrorHandler(xerrordummy); + XSetCloseDownMode(dpy, DestroyAll); + XKillClient(dpy, c->win); + XSync(dpy, False); + XSetErrorHandler(xerror); + XUngrabServer(dpy); + } + } + } +} + +void +setkeymode(const Arg *arg) +{ + Arg a = {0}; + + if (!arg) + return; + keymode = arg->ui; + clearcmd(&a); + grabkeys(); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/keymodes.h b/.local/src/dwm/patch/keymodes.h new file mode 100644 index 00000000..3a131637 --- /dev/null +++ b/.local/src/dwm/patch/keymodes.h @@ -0,0 +1,21 @@ +#define COMMANDMODE 1 +#define INSERTMODE 2 + +typedef struct { + unsigned int mod[4]; + KeySym keysym[4]; + void (*func)(const Arg *); + const Arg arg; +} Command; + +static void clearcmd(const Arg *arg); +static void grabkeys(void); +static int isprotodel(Client *c); +static void keypress(XEvent *e); +static void onlyclient(const Arg *arg); +static void setkeymode(const Arg *arg); + +/* variables */ +static unsigned int cmdmod[4]; +static unsigned int keymode = INSERTMODE; +static KeySym cmdkeysym[4]; \ No newline at end of file diff --git a/.local/src/dwm/patch/killunsel.c b/.local/src/dwm/patch/killunsel.c new file mode 100644 index 00000000..774847b8 --- /dev/null +++ b/.local/src/dwm/patch/killunsel.c @@ -0,0 +1,27 @@ +void +killunsel(const Arg *arg) +{ + Client *i = NULL; + + if (!selmon->sel) + return; + + for (i = selmon->clients; i; i = i->next) { + if (ISVISIBLE(i) && i != selmon->sel) { + #if BAR_SYSTRAY_PATCH + if (!sendevent(i->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) + #else + if (!sendevent(i, wmatom[WMDelete])) + #endif // BAR_SYSTRAY_PATCH + { + XGrabServer(dpy); + XSetErrorHandler(xerrordummy); + XSetCloseDownMode(dpy, DestroyAll); + XKillClient(dpy, i->win); + XSync(dpy, False); + XSetErrorHandler(xerror); + XUngrabServer(dpy); + } + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/killunsel.h b/.local/src/dwm/patch/killunsel.h new file mode 100644 index 00000000..4f38a6e4 --- /dev/null +++ b/.local/src/dwm/patch/killunsel.h @@ -0,0 +1 @@ +static void killunsel(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_bstack.c b/.local/src/dwm/patch/layout_bstack.c new file mode 100644 index 00000000..be066476 --- /dev/null +++ b/.local/src/dwm/patch/layout_bstack.c @@ -0,0 +1,74 @@ +static void +bstack(Monitor *m) +{ + unsigned int i, n; + int mx = 0, my = 0, mh = 0, mw = 0; + int sx = 0, sy = 0, sh = 0, sw = 0; + float mfacts, sfacts; + int mrest, srest; + Client *c; + + #if VANITYGAPS_PATCH + int oh, ov, ih, iv; + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + + if (n == 0) + return; + + #if VANITYGAPS_PATCH + sx = mx = m->wx + ov; + sy = my = m->wy + oh; + sh = mh = m->wh - 2*oh; + mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); + sw = m->ww - 2*ov - iv * (n - m->nmaster - 1); + + if (m->nmaster && n > m->nmaster) { + sh = (mh - ih) * (1 - m->mfact); + mh = (mh - ih) * m->mfact; + sx = mx; + sy = my + mh + ih; + } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + sh = mh * (1 - m->mfact); + mh = mh * m->mfact; + sy = my + mh; + } + #endif // VANITYGAPS_PATCH + + getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i < m->nmaster) { + #if CFACTS_PATCH + resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #else + resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + mx += WIDTH(c) + iv; + #else + mx += WIDTH(c); + #endif + } else { + #if CFACTS_PATCH + resize(c, sx, sy, (sw / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #else + resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + sx += WIDTH(c) + iv; + #else + sx += WIDTH(c); + #endif + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_bstack.h b/.local/src/dwm/patch/layout_bstack.h new file mode 100644 index 00000000..56c99ffe --- /dev/null +++ b/.local/src/dwm/patch/layout_bstack.h @@ -0,0 +1 @@ +static void bstack(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_bstackhoriz.c b/.local/src/dwm/patch/layout_bstackhoriz.c new file mode 100644 index 00000000..0f9042f1 --- /dev/null +++ b/.local/src/dwm/patch/layout_bstackhoriz.c @@ -0,0 +1,76 @@ +static void +bstackhoriz(Monitor *m) +{ + unsigned int i, n; + int mx = 0, my = 0, mh = 0, mw = 0; + int sx = 0, sy = 0, sh = 0, sw = 0; + float mfacts, sfacts; + int mrest, srest; + Client *c; + + #if VANITYGAPS_PATCH + int oh, ov, ih, iv; + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + + if (n == 0) + return; + + #if VANITYGAPS_PATCH + sx = mx = m->wx + ov; + sy = my = m->wy + oh; + mh = m->wh - 2*oh; + sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); + mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); + sw = m->ww - 2*ov; + + if (m->nmaster && n > m->nmaster) { + sh = (mh - ih) * (1 - m->mfact); + mh = (mh - ih) * m->mfact; + sy = my + mh + ih; + sh = m->wh - mh - 2*oh - ih * (n - m->nmaster); + } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + sh = mh * (1 - m->mfact); + mh = mh * m->mfact; + sy = my + mh; + sh = m->wh - mh; + } + #endif // VANITYGAPS_PATCH + + getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest); + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i < m->nmaster) { + #if CFACTS_PATCH + resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #else + resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + mx += WIDTH(c) + iv; + #else + mx += WIDTH(c); + #endif + } else { + #if CFACTS_PATCH + resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #else + resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + sy += HEIGHT(c) + ih; + #else + sy += HEIGHT(c); + #endif + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_bstackhoriz.h b/.local/src/dwm/patch/layout_bstackhoriz.h new file mode 100644 index 00000000..8dd0ebd2 --- /dev/null +++ b/.local/src/dwm/patch/layout_bstackhoriz.h @@ -0,0 +1 @@ +static void bstackhoriz(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_centeredfloatingmaster.c b/.local/src/dwm/patch/layout_centeredfloatingmaster.c index 8b708c2d..756b41f4 100644 --- a/.local/src/dwm/patch/layout_centeredfloatingmaster.c +++ b/.local/src/dwm/patch/layout_centeredfloatingmaster.c @@ -8,13 +8,18 @@ centeredfloatingmaster(Monitor *m) int sx = 0, sy = 0, sh = 0, sw = 0; Client *c; + #if VANITYGAPS_PATCH float mivf = 1.0; // master inner vertical gap factor int oh, ov, ih, iv; getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH if (n == 0) return; + #if VANITYGAPS_PATCH sx = mx = m->wx + ov; sy = my = m->wy + oh; sh = mh = m->wh - 2*oh; @@ -38,17 +43,52 @@ centeredfloatingmaster(Monitor *m) sy = m->wy + oh; sh = m->wh - 2*oh; } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + /* go mfact box in the center if more than nmaster clients */ + if (m->ww > m->wh) { + mw = m->ww * m->mfact; + mh = m->wh * 0.9; + } else { + mw = m->ww * 0.9; + mh = m->wh * m->mfact; + } + mx = m->wx + (m->ww - mw) / 2; + my = m->wy + (m->wh - mh) / 2; + } + #endif // VANITYGAPS_PATCH getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { /* nmaster clients are stacked horizontally, in the center of the screen */ + #if CFACTS_PATCH + resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #else resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH mx += WIDTH(c) + iv*mivf; + #else + mx += WIDTH(c); + #endif } else { /* stack clients are stacked horizontally */ + #if CFACTS_PATCH + resize(c, sx, sy, (sw / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #else resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH sx += WIDTH(c) + iv; + #else + sx += WIDTH(c); + #endif } } diff --git a/.local/src/dwm/patch/layout_centeredfloatingmaster.h b/.local/src/dwm/patch/layout_centeredfloatingmaster.h index a9253e9f..e4147b3b 100644 --- a/.local/src/dwm/patch/layout_centeredfloatingmaster.h +++ b/.local/src/dwm/patch/layout_centeredfloatingmaster.h @@ -1 +1 @@ -static void centeredfloatingmaster(Monitor *m); +static void centeredfloatingmaster(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_centeredmaster.c b/.local/src/dwm/patch/layout_centeredmaster.c index 3060b878..a72eb070 100644 --- a/.local/src/dwm/patch/layout_centeredmaster.c +++ b/.local/src/dwm/patch/layout_centeredmaster.c @@ -10,13 +10,18 @@ centeredmaster(Monitor *m) int mrest = 0, lrest = 0, rrest = 0; Client *c; + #if VANITYGAPS_PATCH int oh, ov, ih, iv; getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH if (n == 0) return; /* initialize areas */ + #if VANITYGAPS_PATCH mx = m->wx + ov; my = m->wy + oh; mh = m->wh - 2*oh - ih * ((!m->nmaster ? n : MIN(n, m->nmaster)) - 1); @@ -42,8 +47,53 @@ centeredmaster(Monitor *m) rx = mx + mw + iv; ry = m->wy + oh; } + #else + mx = m->wx; + my = m->wy; + mh = m->wh; + mw = m->ww; + lh = m->wh; + rh = m->wh; + + if (m->nmaster && n > m->nmaster) { + /* go mfact box in the center if more than nmaster clients */ + if (n - m->nmaster > 1) { + /* ||<-S->|<---M--->|<-S->|| */ + mw = m->ww * m->mfact; + lw = (m->ww - mw) / 2; + mx += lw; + } else { + /* ||<---M--->|<-S->|| */ + mw = mw * m->mfact; + lw = m->ww - mw; + } + rw = lw; + lx = m->wx; + ly = m->wy; + rx = mx + mw; + ry = m->wy; + } + #endif // VANITYGAPS_PATCH /* calculate facts */ + #if CFACTS_PATCH + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { + if (!m->nmaster || n < m->nmaster) + mfacts += c->cfact; // total factor of master area + else if ((n - m->nmaster) % 2) + lfacts += c->cfact; // total factor of left hand stack area + else + rfacts += c->cfact; // total factor of right hand stack area + } + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) + if (!m->nmaster || n < m->nmaster) + mtotal += mh / mfacts; + else if ((n - m->nmaster) % 2) + ltotal += lh * (c->cfact / lfacts); + else + rtotal += rh * (c->cfact / rfacts); + #else for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { if (!m->nmaster || n < m->nmaster) mfacts += 1; @@ -60,6 +110,7 @@ centeredmaster(Monitor *m) ltotal += lh / lfacts; else rtotal += rh / rfacts; + #endif // CFACTS_PATCH mrest = mh - mtotal; lrest = lh - ltotal; @@ -68,17 +119,41 @@ centeredmaster(Monitor *m) for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { if (!m->nmaster || i < m->nmaster) { /* nmaster clients are stacked vertically, in the center of the screen */ + #if CFACTS_PATCH + resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH my += HEIGHT(c) + ih; + #else + my += HEIGHT(c); + #endif } else { /* stack clients are stacked vertically */ if ((i - m->nmaster) % 2 ) { + #if CFACTS_PATCH + resize(c, lx, ly, lw - (2*c->bw), (lh / lfacts) * c->cfact + ((i - 2*m->nmaster) < 2*lrest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, lx, ly, lw - (2*c->bw), (lh / lfacts) + ((i - 2*m->nmaster) < 2*lrest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH ly += HEIGHT(c) + ih; + #else + ly += HEIGHT(c); + #endif } else { + #if CFACTS_PATCH + resize(c, rx, ry, rw - (2*c->bw), (rh / rfacts) * c->cfact + ((i - 2*m->nmaster) < 2*rrest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, rx, ry, rw - (2*c->bw), (rh / rfacts) + ((i - 2*m->nmaster) < 2*rrest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH ry += HEIGHT(c) + ih; + #else + ry += HEIGHT(c); + #endif } } } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_centeredmaster.h b/.local/src/dwm/patch/layout_centeredmaster.h index 1c0ec2a5..b0472127 100644 --- a/.local/src/dwm/patch/layout_centeredmaster.h +++ b/.local/src/dwm/patch/layout_centeredmaster.h @@ -1 +1 @@ -static void centeredmaster(Monitor *m); +static void centeredmaster(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_columns.c b/.local/src/dwm/patch/layout_columns.c new file mode 100644 index 00000000..bcdaa110 --- /dev/null +++ b/.local/src/dwm/patch/layout_columns.c @@ -0,0 +1,73 @@ +static void +col(Monitor *m) +{ + unsigned int i, n; + int mx = 0, my = 0, mh = 0, mw = 0; + int sx = 0, sy = 0, sh = 0, sw = 0; + float mfacts, sfacts; + int mrest, srest; + Client *c; + + #if VANITYGAPS_PATCH + int oh, ov, ih, iv; + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + + if (n == 0) + return; + + #if VANITYGAPS_PATCH + sx = mx = m->wx + ov; + sy = my = m->wy + oh; + mh = m->wh - 2*oh; + sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); + mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); + sw = m->ww - 2*ov; + + if (m->nmaster && n > m->nmaster) { + sw = (mw - iv) * (1 - m->mfact); + mw = (mw - iv) * m->mfact; + sx = mx + mw + iv * m->nmaster; + } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + sw = mw * (1 - m->mfact); + mw = mw * m->mfact; + sx = mx + mw; + } + #endif // VANITYGAPS_PATCH + + getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest); + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < m->nmaster) { + #if CFACTS_PATCH + resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #else + resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + mx += WIDTH(c) + iv; + #else + mx += WIDTH(c); + #endif + } else { + #if CFACTS_PATCH + resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #else + resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + sy += HEIGHT(c) + ih; + #else + sy += HEIGHT(c); + #endif + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_columns.h b/.local/src/dwm/patch/layout_columns.h new file mode 100644 index 00000000..8f64a094 --- /dev/null +++ b/.local/src/dwm/patch/layout_columns.h @@ -0,0 +1 @@ +static void col(Monitor *); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_deck.c b/.local/src/dwm/patch/layout_deck.c index 8b3f91fd..6f2027d1 100644 --- a/.local/src/dwm/patch/layout_deck.c +++ b/.local/src/dwm/patch/layout_deck.c @@ -8,12 +8,17 @@ deck(Monitor *m) int mrest, srest; Client *c; + #if VANITYGAPS_PATCH int oh, ov, ih, iv; getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH if (n == 0) return; + #if VANITYGAPS_PATCH sx = mx = m->wx + ov; sy = my = m->wy + oh; sh = mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); @@ -25,6 +30,18 @@ deck(Monitor *m) sx = mx + mw + iv; sh = m->wh - 2*oh; } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + sw = mw * (1 - m->mfact); + mw = mw * m->mfact; + sx = mx + mw; + } + #endif // VANITYGAPS_PATCH getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); @@ -33,9 +50,17 @@ deck(Monitor *m) for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { + #if CFACTS_PATCH + resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH my += HEIGHT(c) + ih; + #else + my += HEIGHT(c); + #endif } else { resize(c, sx, sy, sw - (2*c->bw), sh - (2*c->bw), 0); } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_deck.h b/.local/src/dwm/patch/layout_deck.h index 9c09ed97..abedeb2a 100644 --- a/.local/src/dwm/patch/layout_deck.h +++ b/.local/src/dwm/patch/layout_deck.h @@ -1 +1 @@ -static void deck(Monitor *m); +static void deck(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_facts.c b/.local/src/dwm/patch/layout_facts.c index aa45f1a6..e5beb4b6 100644 --- a/.local/src/dwm/patch/layout_facts.c +++ b/.local/src/dwm/patch/layout_facts.c @@ -1,3 +1,30 @@ +#if CFACTS_PATCH +void +getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) +{ + unsigned int n; + float mfacts = 0, sfacts = 0; + int mtotal = 0, stotal = 0; + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) + if (n < m->nmaster) + mfacts += c->cfact; + else + sfacts += c->cfact; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) + if (n < m->nmaster) + mtotal += msize * (c->cfact / mfacts); + else + stotal += ssize * (c->cfact / sfacts); + + *mf = mfacts; // total factor of master area + *sf = sfacts; // total factor of stack area + *mr = msize - mtotal; // the remainder (rest) of pixels after a cfacts master split + *sr = ssize - stotal; // the remainder (rest) of pixels after a cfacts stack split +} +#else void getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) { @@ -21,3 +48,4 @@ getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *s *mr = msize - mtotal; // the remainder (rest) of pixels after an even master split *sr = ssize - stotal; // the remainder (rest) of pixels after an even stack split } +#endif // CFACTS_PATCH diff --git a/.local/src/dwm/patch/layout_fibonacci.c b/.local/src/dwm/patch/layout_fibonacci.c index c43911da..87a1bdf3 100644 --- a/.local/src/dwm/patch/layout_fibonacci.c +++ b/.local/src/dwm/patch/layout_fibonacci.c @@ -1,3 +1,4 @@ +#if VANITYGAPS_PATCH void fibonacci(Monitor *m, int s) { @@ -84,15 +85,106 @@ fibonacci(Monitor *m, int s) resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); } } +#else +void +fibonacci(Monitor *m, int s) +{ + unsigned int i, n; + int nx, ny, nw, nh; + int nv, hrest = 0, wrest = 0, r = 1; + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + if (n == 0) + return; + + nx = m->wx; + ny = m->wy; + nw = m->ww; + nh = m->wh; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) { + if (r) { + if ((i % 2 && nh / 2 <= (bh + 2*c->bw)) + || (!(i % 2) && nw / 2 <= (bh + 2*c->bw))) { + r = 0; + } + if (r && i < n - 1) { + if (i % 2) { + nv = nh / 2; + hrest = nh - 2*nv; + nh = nv; + } else { + nv = nw / 2; + wrest = nw - 2*nv; + nw = nv; + } + + if ((i % 4) == 2 && !s) + nx += nw; + else if ((i % 4) == 3 && !s) + ny += nh; + } + + if ((i % 4) == 0) { + if (s) { + ny += nh; + nh += hrest; + } + else { + nh -= hrest; + ny -= nh; + } + } + else if ((i % 4) == 1) { + nx += nw; + nw += wrest; + } + else if ((i % 4) == 2) { + ny += nh; + nh += hrest; + if (i < n - 1) + nw += wrest; + } + else if ((i % 4) == 3) { + if (s) { + nx += nw; + nw -= wrest; + } else { + nw -= wrest; + nx -= nw; + nh += hrest; + } + } + if (i == 0) { + if (n != 1) { + nw = m->ww - m->ww * (1 - m->mfact); + wrest = 0; + } + ny = m->wy; + } + else if (i == 1) + nw = m->ww - nw; + i++; + } + + resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); + } +} +#endif +#if FIBONACCI_DWINDLE_LAYOUT static void dwindle(Monitor *m) { fibonacci(m, 1); } +#endif +#if FIBONACCI_SPIRAL_LAYOUT static void spiral(Monitor *m) { fibonacci(m, 0); } +#endif diff --git a/.local/src/dwm/patch/layout_fibonacci.h b/.local/src/dwm/patch/layout_fibonacci.h index 8a5ca96a..a15eb76c 100644 --- a/.local/src/dwm/patch/layout_fibonacci.h +++ b/.local/src/dwm/patch/layout_fibonacci.h @@ -1,3 +1,7 @@ +#if FIBONACCI_DWINDLE_LAYOUT static void dwindle(Monitor *m); +#endif // FIBONACCI_DWINDLE_LAYOUT static void fibonacci(Monitor *m, int s); +#if FIBONACCI_SPIRAL_LAYOUT static void spiral(Monitor *m); +#endif // FIBONACCI_SPIRAL_LAYOUT \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_flextile-deluxe.c b/.local/src/dwm/patch/layout_flextile-deluxe.c new file mode 100644 index 00000000..3f5cc27c --- /dev/null +++ b/.local/src/dwm/patch/layout_flextile-deluxe.c @@ -0,0 +1,890 @@ +typedef struct { + void (*arrange)(Monitor *, int, int, int, int, int, int, int); +} LayoutArranger; + +typedef struct { + void (*arrange)(Monitor *, int, int, int, int, int, int, int, int, int); +} TileArranger; + +static const LayoutArranger flexlayouts[] = { + { layout_no_split }, + { layout_split_vertical }, + { layout_split_horizontal }, + { layout_split_centered_vertical }, + { layout_split_centered_horizontal }, + { layout_split_vertical_dual_stack }, + { layout_split_horizontal_dual_stack }, + { layout_floating_master }, + { layout_split_vertical_fixed }, + { layout_split_horizontal_fixed }, + { layout_split_centered_vertical_fixed }, + { layout_split_centered_horizontal_fixed }, + { layout_split_vertical_dual_stack_fixed }, + { layout_split_horizontal_dual_stack_fixed }, + { layout_floating_master_fixed }, +}; + +static const TileArranger flextiles[] = { + { arrange_top_to_bottom }, + { arrange_left_to_right }, + { arrange_monocle }, + { arrange_gapplessgrid }, + { arrange_gapplessgrid_alt1 }, + { arrange_gapplessgrid_alt2 }, + { arrange_gridmode }, + { arrange_horizgrid }, + { arrange_dwindle }, + { arrange_spiral }, + { arrange_tatami }, +}; + +static void +getfactsforrange(Monitor *m, int an, int ai, int size, int *rest, float *fact) +{ + int i; + float facts; + Client *c; + int total = 0; + + facts = 0; + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i >= ai && i < (ai + an)) + #if CFACTS_PATCH + facts += c->cfact; + #else + facts += 1; + #endif // CFACTS_PATCH + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i >= ai && i < (ai + an)) + #if CFACTS_PATCH + total += size * (c->cfact / facts); + #else + total += size / facts; + #endif // CFACTS_PATCH + + *rest = size - total; + *fact = facts; +} + +#if IPC_PATCH || DWMC_PATCH +static void +setlayoutaxisex(const Arg *arg) +{ + int axis, arr; + + axis = arg->i & 0x3; // lower two bytes indicates layout, master or stack1-2 + arr = ((arg->i & 0xFC) >> 2); // remaining six upper bytes indicate arrangement + + if ((axis == 0 && abs(arr) > LAYOUT_LAST) + || (axis > 0 && (arr > AXIS_LAST || arr < 0))) + arr = 0; + + selmon->ltaxis[axis] = arr; + #if PERTAG_PATCH + selmon->pertag->ltaxis[selmon->pertag->curtag][axis] = selmon->ltaxis[axis]; + #endif // PERTAG_PATCH + arrange(selmon); +} +#endif // IPC_PATCH | DWMC_PATCH + +static void +layout_no_split(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + (&flextiles[m->ltaxis[m->nmaster >= n ? MASTER : STACK]])->arrange(m, x, y, h, w, ih, iv, n, n, 0); +} + +static void +layout_split_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (m->nmaster && n > m->nmaster) { + layout_split_vertical_fixed(m, x, y, h, w, ih, iv, n); + } else { + layout_no_split(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sw, sx; + + sw = (w - iv) * (1 - m->mfact); + w = (w - iv) * m->mfact; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sx = x; + x += sw + iv; + } else { + sx = x + w + iv; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, h, sw, ih, iv, n, n - m->nmaster, m->nmaster); +} + +static void +layout_split_vertical_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (!m->nmaster || n <= m->nmaster) { + layout_no_split(m, x, y, h, w, ih, iv, n); + } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { + layout_split_vertical(m, x, y, h, w, ih, iv, n); + } else { + layout_split_vertical_dual_stack_fixed(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_vertical_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sh, sw, sx, oy, sc; + + if (m->nstack) + sc = m->nstack; + else + sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); + + sw = (w - iv) * (1 - m->mfact); + sh = (h - ih) / 2; + w = (w - iv) * m->mfact; + oy = y + sh + ih; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sx = x; + x += sw + iv; + } else { + sx = x + w + iv; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, sh, sw, ih, iv, n, sc, m->nmaster); + (&flextiles[m->ltaxis[STACK2]])->arrange(m, sx, oy, sh, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); +} + +static void +layout_split_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (m->nmaster && n > m->nmaster) { + layout_split_horizontal_fixed(m, x, y, h, w, ih, iv, n); + } else { + layout_no_split(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sh, sy; + + sh = (h - ih) * (1 - m->mfact); + h = (h - ih) * m->mfact; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sy = y; + y += sh + ih; + } else { + sy = y + h + ih; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, w, ih, iv, n, n - m->nmaster, m->nmaster); +} + +static void +layout_split_horizontal_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (!m->nmaster || n <= m->nmaster) { + layout_no_split(m, x, y, h, w, ih, iv, n); + } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { + layout_split_horizontal(m, x, y, h, w, ih, iv, n); + } else { + layout_split_horizontal_dual_stack_fixed(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_horizontal_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sh, sy, ox, sc; + + if (m->nstack) + sc = m->nstack; + else + sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); + + sh = (h - ih) * (1 - m->mfact); + h = (h - ih) * m->mfact; + sw = (w - iv) / 2; + ox = x + sw + iv; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sy = y; + y += sh + ih; + } else { + sy = y + h + ih; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, sw, ih, iv, n, sc, m->nmaster); + (&flextiles[m->ltaxis[STACK2]])->arrange(m, ox, sy, sh, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); +} + +static void +layout_split_centered_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (!m->nmaster || n <= m->nmaster) { + layout_no_split(m, x, y, h, w, ih, iv, n); + } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { + layout_split_vertical(m, x, y, h, w, ih, iv, n); + } else { + layout_split_centered_vertical_fixed(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_centered_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sw, sx, ox, sc; + + if (m->nstack) + sc = m->nstack; + else + sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); + + sw = (w - 2*iv) * (1 - m->mfact) / 2; + w = (w - 2*iv) * m->mfact; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sx = x; + x += sw + iv; + ox = x + w + iv; + } else { + ox = x; + x += sw + iv; + sx = x + w + iv; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, h, sw, ih, iv, n, sc, m->nmaster); + (&flextiles[m->ltaxis[STACK2]])->arrange(m, ox, y, h, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); +} + +static void +layout_split_centered_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (!m->nmaster || n <= m->nmaster) { + layout_no_split(m, x, y, h, w, ih, iv, n); + } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { + layout_split_horizontal(m, x, y, h, w, ih, iv, n); + } else { + layout_split_centered_horizontal_fixed(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_split_centered_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int sh, sy, oy, sc; + + if (m->nstack) + sc = m->nstack; + else + sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); + + sh = (h - 2*ih) * (1 - m->mfact) / 2; + h = (h - 2*ih) * m->mfact; + if (m->ltaxis[LAYOUT] < 0) { // mirror + sy = y; + y += sh + ih; + oy = y + h + ih; + } else { + oy = y; + y += sh + ih; + sy = y + h + ih; + } + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); + (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, w, ih, iv, n, sc, m->nmaster); + (&flextiles[m->ltaxis[STACK2]])->arrange(m, x, oy, sh, w, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); +} + +static void +layout_floating_master(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + /* Split master into master + stack if we have enough clients */ + if (!m->nmaster || n <= m->nmaster) { + layout_no_split(m, x, y, h, w, ih, iv, n); + } else { + layout_floating_master_fixed(m, x, y, h, w, ih, iv, n); + } +} + +static void +layout_floating_master_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) +{ + int mh, mw; + + /* Draw stack area first */ + (&flextiles[m->ltaxis[STACK]])->arrange(m, x, y, h, w, ih, iv, n, n - m->nmaster, m->nmaster); + + if (w > h) { + mw = w * m->mfact; + mh = h * 0.9; + } else { + mw = w * 0.9; + mh = h * m->mfact; + } + x = x + (w - mw) / 2; + y = y + (h - mh) / 2; + + (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, mh, mw, ih, iv, n, m->nmaster, 0); +} + +static void +arrange_left_to_right(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, rest; + float facts, fact = 1; + Client *c; + + if (ai + an > n) + an = n - ai; + + w -= iv * (an - 1); + getfactsforrange(m, an, ai, w, &rest, &facts); + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i >= ai && i < (ai + an)) { + #if CFACTS_PATCH + fact = c->cfact; + #endif // CFACTS_PATCH + resize(c, x, y, w * (fact / facts) + ((i - ai) < rest ? 1 : 0) - (2*c->bw), h - (2*c->bw), 0); + x += WIDTH(c) + iv; + } + } +} + +static void +arrange_top_to_bottom(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, rest; + float facts, fact = 1; + Client *c; + + if (ai + an > n) + an = n - ai; + + h -= ih * (an - 1); + getfactsforrange(m, an, ai, h, &rest, &facts); + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i >= ai && i < (ai + an)) { + #if CFACTS_PATCH + fact = c->cfact; + #endif // CFACTS_PATCH + resize(c, x, y, w - (2*c->bw), h * (fact / facts) + ((i - ai) < rest ? 1 : 0) - (2*c->bw), 0); + y += HEIGHT(c) + ih; + } + } +} + +static void +arrange_monocle(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i; + Client *c; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i >= ai && i < (ai + an)) + resize(c, x, y, w - (2*c->bw), h - (2*c->bw), 0); +} + +static void +arrange_gridmode(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, cols, rows, ch, cw, cx, cy, cc, cr, chrest, cwrest; // counters + Client *c; + + /* grid dimensions */ + for (rows = 0; rows <= an/2; rows++) + if (rows*rows >= an) + break; + cols = (rows && (rows - 1) * rows >= an) ? rows - 1 : rows; + + /* window geoms (cell height/width) */ + ch = (h - ih * (rows - 1)) / (rows ? rows : 1); + cw = (w - iv * (cols - 1)) / (cols ? cols : 1); + chrest = h - ih * (rows - 1) - ch * rows; + cwrest = w - iv * (cols - 1) - cw * cols; + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i >= ai && i < (ai + an)) { + cc = ((i - ai) / rows); // client column number + cr = ((i - ai) % rows); // client row number + cx = x + cc * (cw + iv) + MIN(cc, cwrest); + cy = y + cr * (ch + ih) + MIN(cr, chrest); + resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); + } + } +} + +static void +arrange_horizgrid(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int ntop, nbottom, rh, rest; + + /* Exception when there is only one client; don't split into two rows */ + if (an == 1) { + arrange_monocle(m, x, y, h, w, ih, iv, n, an, ai); + return; + } + + ntop = an / 2; + nbottom = an - ntop; + rh = (h - ih) / 2; + rest = h - ih - rh * 2; + arrange_left_to_right(m, x, y, rh + rest, w, ih, iv, n, ntop, ai); + arrange_left_to_right(m, x, y + rh + ih + rest, rh, w, ih, iv, n, nbottom, ai + ntop); +} + +static void +arrange_gapplessgrid(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, cols, rows, ch, cw, cn, rn, cc, rrest, crest; // counters + Client *c; + + /* grid dimensions */ + for (cols = 1; cols <= an/2; cols++) + if (cols*cols >= an) + break; + if (an == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ + cols = 2; + rows = an/cols; + cn = rn = cc = 0; // reset column no, row no, client count + + ch = (h - ih * (rows - 1)) / rows; + rrest = (h - ih * (rows - 1)) - ch * rows; + cw = (w - iv * (cols - 1)) / cols; + crest = (w - iv * (cols - 1)) - cw * cols; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i >= ai && i < (ai + an)) { + if (cc/rows + 1 > cols - an%cols) { + rows = an/cols + 1; + ch = (h - ih * (rows - 1)) / rows; + rrest = (h - ih * (rows - 1)) - ch * rows; + } + resize(c, + x, + y + rn*(ch + ih) + MIN(rn, rrest), + cw + (cn < crest ? 1 : 0) - 2*c->bw, + ch + (rn < rrest ? 1 : 0) - 2*c->bw, + 0); + rn++; + cc++; + if (rn >= rows) { + rn = 0; + x += cw + ih + (cn < crest ? 1 : 0); + cn++; + } + } + } +} + +/* This version of gappless grid fills rows first */ +static void +arrange_gapplessgrid_alt1(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, cols, rows, rest, ch; + + /* grid dimensions */ + for (cols = 1; cols <= an/2; cols++) + if (cols*cols >= an) + break; + rows = (cols && (cols - 1) * cols >= an) ? cols - 1 : cols; + ch = (h - ih * (rows - 1)) / (rows ? rows : 1); + rest = (h - ih * (rows - 1)) - ch * rows; + + for (i = 0; i < rows; i++) { + arrange_left_to_right(m, x, y, ch + (i < rest ? 1 : 0), w, ih, iv, n, MIN(cols, an - i*cols), ai + i*cols); + y += ch + (i < rest ? 1 : 0) + ih; + } +} + +/* This version of gappless grid fills columns first */ +static void +arrange_gapplessgrid_alt2(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + int i, cols, rows, rest, cw; + + /* grid dimensions */ + for (rows = 0; rows <= an/2; rows++) + if (rows*rows >= an) + break; + cols = (rows && (rows - 1) * rows >= an) ? rows - 1 : rows; + cw = (w - iv * (cols - 1)) / (cols ? cols : 1); + rest = (w - iv * (cols - 1)) - cw * cols; + + for (i = 0; i < cols; i++) { + arrange_top_to_bottom(m, x, y, h, cw + (i < rest ? 1 : 0), ih, iv, n, MIN(rows, an - i*rows), ai + i*rows); + x += cw + (i < rest ? 1 : 0) + iv; + } +} + +static void +arrange_fibonacci(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai, int s) +{ + int i, j, nv, hrest = 0, wrest = 0, nx = x, ny = y, nw = w, nh = h, r = 1; + Client *c; + + for (i = 0, j = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), j++) { + if (j >= ai && j < (ai + an)) { + if (r) { + if ((i % 2 && ((nh - ih) / 2) <= (bh + 2*c->bw)) || (!(i % 2) && ((nw - iv) / 2) <= (bh + 2*c->bw))) { + r = 0; + } + if (r && i < an - 1) { + if (i % 2) { + nv = (nh - ih) / 2; + hrest = nh - 2*nv - ih; + nh = nv; + } else { + nv = (nw - iv) / 2; + wrest = nw - 2*nv - iv; + nw = nv; + } + + if ((i % 4) == 2 && !s) + nx += nw + iv; + else if ((i % 4) == 3 && !s) + ny += nh + ih; + } + if ((i % 4) == 0) { + if (s) { + ny += nh + ih; + nh += hrest; + } else { + nh -= hrest; + ny -= nh + ih; + } + } else if ((i % 4) == 1) { + nx += nw + iv; + nw += wrest; + } else if ((i % 4) == 2) { + ny += nh + ih; + nh += hrest; + if (i < n - 1) + nw += wrest; + } else if ((i % 4) == 3) { + if (s) { + nx += nw + iv; + nw -= wrest; + } else { + nw -= wrest; + nx -= nw + iv; + nh += hrest; + } + } + if (i == 0) { + if (an != 1) { + nw = (w - iv) - (w - iv) * (1 - m->mfact); + wrest = 0; + } + ny = y; + } else if (i == 1) + nw = w - nw - iv; + i++; + } + + resize(c, nx, ny, nw - 2 * c->bw, nh - 2*c->bw, False); + } + } +} + +static void +arrange_dwindle(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + arrange_fibonacci(m, x, y, h, w, ih, iv, n, an, ai, 1); +} + +static void +arrange_spiral(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + arrange_fibonacci(m, x, y, h, w, ih, iv, n, an, ai, 0); +} + +static void +arrange_tatami(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) +{ + unsigned int i, j, nx, ny, nw, nh, tnx, tny, tnw, tnh, nhrest, hrest, wrest, areas, mats, cats; + Client *c; + + nx = x; + ny = y; + nw = w; + nh = h; + + mats = an / 5; + cats = an % 5; + hrest = 0; + wrest = 0; + + areas = mats + (cats > 0); + nh = (h - ih * (areas - 1)) / areas; + nhrest = (h - ih * (areas - 1)) % areas; + + for (i = 0, j = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), j++) { + if (j >= ai && j < (ai + an)) { + + tnw = nw; + tnx = nx; + tnh = nh; + tny = ny; + + if (j < ai + cats) { + /* Arrange cats (all excess clients that can't be tiled as mats). Cats sleep on mats. */ + + switch (cats) { + case 1: // fill + break; + case 2: // up and down + if ((i % 5) == 0) //up + tnh = (nh - ih) / 2 + (nh - ih) % 2; + else if ((i % 5) == 1) { //down + tny += (nh - ih) / 2 + (nh - ih) % 2 + ih; + tnh = (nh - ih) / 2; + } + break; + case 3: //bottom, up-left and up-right + if ((i % 5) == 0) { // up-left + tnw = (nw - iv) / 2 + (nw - iv) % 2; + tnh = (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3; + } else if ((i % 5) == 1) { // up-right + tnx += (nw - iv) / 2 + (nw - iv) % 2 + iv; + tnw = (nw - iv) / 2; + tnh = (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3; + } else if ((i % 5) == 2) { //bottom + tnh = (nh - ih) / 3; + tny += (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3 + ih; + } + break; + case 4: // bottom, left, right and top + if ((i % 5) == 0) { //top + hrest = (nh - 2 * ih) % 4; + tnh = (nh - 2 * ih) / 4 + (hrest ? 1 : 0); + } else if ((i % 5) == 1) { // left + tnw = (nw - iv) / 2 + (nw - iv) % 2; + tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + ih; + tnh = (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0); + } else if ((i % 5) == 2) { // right + tnx += (nw - iv) / 2 + (nw - iv) % 2 + iv; + tnw = (nw - iv) / 2; + tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + ih; + tnh = (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0); + } else if ((i % 5) == 3) { // bottom + tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0) + 2 * ih; + tnh = (nh - 2 * ih) / 4 + (hrest > 2 ? 1 : 0); + } + break; + } + + } else { + /* Arrange mats. One mat is a collection of five clients arranged tatami style */ + + if (((i - cats) % 5) == 0) { + if ((cats > 0) || ((i - cats) >= 5)) { + tny = ny = ny + nh + (nhrest > 0 ? 1 : 0) + ih; + --nhrest; + } + } + + switch ((i - cats) % 5) { + case 0: // top-left-vert + wrest = (nw - 2 * iv) % 3; + hrest = (nh - 2 * ih) % 3; + tnw = (nw - 2 * iv) / 3 + (wrest ? 1 : 0); + tnh = (nh - 2 * ih) * 2 / 3 + hrest + iv; + break; + case 1: // top-right-hor + tnx += (nw - 2 * iv) / 3 + (wrest ? 1 : 0) + iv; + tnw = (nw - 2 * iv) * 2 / 3 + (wrest > 1 ? 1 : 0) + iv; + tnh = (nh - 2 * ih) / 3 + (hrest ? 1 : 0); + break; + case 2: // center + tnx += (nw - 2 * iv) / 3 + (wrest ? 1 : 0) + iv; + tnw = (nw - 2 * iv) / 3 + (wrest > 1 ? 1 : 0); + tny += (nh - 2 * ih) / 3 + (hrest ? 1 : 0) + ih; + tnh = (nh - 2 * ih) / 3 + (hrest > 1 ? 1 : 0); + break; + case 3: // bottom-right-vert + tnx += (nw - 2 * iv) * 2 / 3 + wrest + 2 * iv; + tnw = (nw - 2 * iv) / 3; + tny += (nh - 2 * ih) / 3 + (hrest ? 1 : 0) + ih; + tnh = (nh - 2 * ih) * 2 / 3 + hrest + iv; + break; + case 4: // (oldest) bottom-left-hor + tnw = (nw - 2 * iv) * 2 / 3 + wrest + iv; + tny += (nh - 2 * ih) * 2 / 3 + hrest + 2 * iv; + tnh = (nh - 2 * ih) / 3; + break; + } + + } + + resize(c, tnx, tny, tnw - 2 * c->bw, tnh - 2 * c->bw, False); + ++i; + } + } +} + +static void +flextile(Monitor *m) +{ + unsigned int n; + int oh = 0, ov = 0, ih = 0, iv = 0; // gaps outer/inner horizontal/vertical + + #if VANITYGAPS_PATCH + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + Client *c; + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + + if (m->lt[m->sellt]->preset.layout != m->ltaxis[LAYOUT] || + m->lt[m->sellt]->preset.masteraxis != m->ltaxis[MASTER] || + m->lt[m->sellt]->preset.stack1axis != m->ltaxis[STACK] || + m->lt[m->sellt]->preset.stack2axis != m->ltaxis[STACK2]) + setflexsymbols(m, n); + else if (m->lt[m->sellt]->preset.symbolfunc != NULL) + m->lt[m->sellt]->preset.symbolfunc(m, n); + + if (n == 0) + return; + + #if VANITYGAPS_PATCH && !VANITYGAPS_MONOCLE_PATCH + /* No outer gap if full screen monocle */ + if (abs(m->ltaxis[MASTER]) == MONOCLE && (abs(m->ltaxis[LAYOUT]) == NO_SPLIT || n <= m->nmaster)) { + oh = 0; + ov = 0; + } + #endif // VANITYGAPS_PATCH && !VANITYGAPS_MONOCLE_PATCH + + (&flexlayouts[abs(m->ltaxis[LAYOUT])])->arrange(m, m->wx + ov, m->wy + oh, m->wh - 2*oh, m->ww - 2*ov, ih, iv, n); + return; +} + +static void +setflexsymbols(Monitor *m, unsigned int n) +{ + int l; + char sym1, sym2, sym3; + Client *c; + + if (n == 0) + for (c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + + l = abs(m->ltaxis[LAYOUT]); + if (m->ltaxis[MASTER] == MONOCLE && (l == NO_SPLIT || !m->nmaster || n <= m->nmaster)) { + monoclesymbols(m, n); + return; + } + + if (m->ltaxis[STACK] == MONOCLE && (l == SPLIT_VERTICAL || l == SPLIT_HORIZONTAL_FIXED)) { + decksymbols(m, n); + return; + } + + /* Layout symbols */ + if (l == NO_SPLIT || !m->nmaster) { + sym1 = sym2 = sym3 = (int)tilesymb[m->ltaxis[MASTER]]; + } else { + sym2 = layoutsymb[l]; + if (m->ltaxis[LAYOUT] < 0) { + sym1 = tilesymb[m->ltaxis[STACK]]; + sym3 = tilesymb[m->ltaxis[MASTER]]; + } else { + sym1 = tilesymb[m->ltaxis[MASTER]]; + sym3 = tilesymb[m->ltaxis[STACK]]; + } + } + + snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%c", sym1, sym2, sym3); +} + +static void +monoclesymbols(Monitor *m, unsigned int n) +{ + if (n > 0) + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); + else + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[M]"); +} + +static void +decksymbols(Monitor *m, unsigned int n) +{ + if (n > m->nmaster) + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[]%d", n); + else + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[D]"); +} + +/* Mirror layout axis for flextile */ +void +mirrorlayout(const Arg *arg) +{ + if (!selmon->lt[selmon->sellt]->arrange) + return; + selmon->ltaxis[LAYOUT] *= -1; + #if PERTAG_PATCH + selmon->pertag->ltaxis[selmon->pertag->curtag][0] = selmon->ltaxis[LAYOUT]; + #endif // PERTAG_PATCH + arrange(selmon); +} + +/* Rotate layout axis for flextile */ +void +rotatelayoutaxis(const Arg *arg) +{ + int incr = (arg->i > 0 ? 1 : -1); + int axis = abs(arg->i) - 1; + + if (!selmon->lt[selmon->sellt]->arrange) + return; + if (axis == LAYOUT) { + if (selmon->ltaxis[LAYOUT] >= 0) { + selmon->ltaxis[LAYOUT] += incr; + if (selmon->ltaxis[LAYOUT] >= LAYOUT_LAST) + selmon->ltaxis[LAYOUT] = 0; + else if (selmon->ltaxis[LAYOUT] < 0) + selmon->ltaxis[LAYOUT] = LAYOUT_LAST - 1; + } else { + selmon->ltaxis[LAYOUT] -= incr; + if (selmon->ltaxis[LAYOUT] <= -LAYOUT_LAST) + selmon->ltaxis[LAYOUT] = 0; + else if (selmon->ltaxis[LAYOUT] > 0) + selmon->ltaxis[LAYOUT] = -LAYOUT_LAST + 1; + } + } else { + selmon->ltaxis[axis] += incr; + if (selmon->ltaxis[axis] >= AXIS_LAST) + selmon->ltaxis[axis] = 0; + else if (selmon->ltaxis[axis] < 0) + selmon->ltaxis[axis] = AXIS_LAST - 1; + } + #if PERTAG_PATCH + selmon->pertag->ltaxis[selmon->pertag->curtag][axis] = selmon->ltaxis[axis]; + #endif // PERTAG_PATCH + arrange(selmon); + setflexsymbols(selmon, 0); +} + +void +incnstack(const Arg *arg) +{ + #if PERTAG_PATCH + selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag] = MAX(selmon->nstack + arg->i, 0); + #else + selmon->nstack = MAX(selmon->nstack + arg->i, 0); + #endif // PERTAG_PATCH + arrange(selmon); +} diff --git a/.local/src/dwm/patch/layout_flextile-deluxe.h b/.local/src/dwm/patch/layout_flextile-deluxe.h new file mode 100644 index 00000000..9ec7324c --- /dev/null +++ b/.local/src/dwm/patch/layout_flextile-deluxe.h @@ -0,0 +1,120 @@ +static void flextile(Monitor *m); +static void getfactsforrange(Monitor *m, int an, int ai, int size, int *rest, float *fact); +static void mirrorlayout(const Arg *arg); +static void rotatelayoutaxis(const Arg *arg); +#if IPC_PATCH || DWMC_PATCH +static void setlayoutaxisex(const Arg *arg); +#endif // IPC_PATCH | DWMC_PATCH +static void incnstack(const Arg *arg); + +/* Symbol handlers */ +static void setflexsymbols(Monitor *m, unsigned int n); +static void monoclesymbols(Monitor *m, unsigned int n); +static void decksymbols(Monitor *m, unsigned int n); + +/* Layout split */ +static void layout_no_split(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_vertical_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_horizontal_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_centered_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_centered_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_floating_master(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_vertical_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_horizontal_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_centered_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_split_centered_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); +static void layout_floating_master_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); + +/* Layout tile arrangements */ +static void arrange_left_to_right(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_top_to_bottom(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_monocle(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_gapplessgrid(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_gapplessgrid_alt1(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_gapplessgrid_alt2(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_gridmode(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_horizgrid(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_dwindle(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_spiral(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); +static void arrange_tatami(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); + +/* Named flextile constants */ +enum { + LAYOUT, // controls overall layout arrangement / split + MASTER, // indicates the tile arrangement for the master area + STACK, // indicates the tile arrangement for the stack area + STACK2, // indicates the tile arrangement for the secondary stack area + LTAXIS_LAST, +}; + +/* Layout arrangements */ +enum { + NO_SPLIT, + SPLIT_VERTICAL, // master stack vertical split + SPLIT_HORIZONTAL, // master stack horizontal split + SPLIT_CENTERED_VERTICAL, // centered master vertical split + SPLIT_CENTERED_HORIZONTAL, // centered master horizontal split + SPLIT_VERTICAL_DUAL_STACK, // master stack vertical split with dual stack + SPLIT_HORIZONTAL_DUAL_STACK, // master stack vertical split with dual stack + FLOATING_MASTER, // (fake) floating master + SPLIT_VERTICAL_FIXED, // master stack vertical fixed split + SPLIT_HORIZONTAL_FIXED, // master stack horizontal fixed split + SPLIT_CENTERED_VERTICAL_FIXED, // centered master vertical fixed split + SPLIT_CENTERED_HORIZONTAL_FIXED, // centered master horizontal fixed split + SPLIT_VERTICAL_DUAL_STACK_FIXED, // master stack vertical split with fixed dual stack + SPLIT_HORIZONTAL_DUAL_STACK_FIXED, // master stack vertical split with fixed dual stack + FLOATING_MASTER_FIXED, // (fake) fixed floating master + LAYOUT_LAST, +}; + +static char layoutsymb[] = { + 32, // " ", + 124, // "|", + 61, // "=", + 94, // "^", + 126, // "~", + 58, // ":", + 59, // ";", + 43, // "+", + 124, // "¦", + 61, // "=", + 94, // "^", + 126, // "~", + 58, // ":", + 59, // ";", + 43, // "+", +}; + +/* Tile arrangements */ +enum { + TOP_TO_BOTTOM, // clients are arranged vertically + LEFT_TO_RIGHT, // clients are arranged horizontally + MONOCLE, // clients are arranged in deck / monocle mode + GAPPLESSGRID, // clients are arranged in a gappless grid (original formula) + GAPPLESSGRID_ALT1, // clients are arranged in a gappless grid (alt. 1, fills rows first) + GAPPLESSGRID_ALT2, // clients are arranged in a gappless grid (alt. 2, fills columns first) + GRIDMODE, // clients are arranged in a grid + HORIZGRID, // clients are arranged in a horizontal grid + DWINDLE, // clients are arranged in fibonacci dwindle mode + SPIRAL, // clients are arranged in fibonacci spiral mode + TATAMI, // clients are arranged as tatami mats + AXIS_LAST, +}; + +static char tilesymb[] = { + 61, // "=", + 124, // "|", + 68, // "D", + 71, // "G", + 49, // "1", + 50, // "2" + 35, // "#", + 126, // "~", + 92, // "\\", + 64, // "@", + 84, // "T", +}; diff --git a/.local/src/dwm/patch/layout_gapplessgrid.c b/.local/src/dwm/patch/layout_gapplessgrid.c new file mode 100644 index 00000000..0330181e --- /dev/null +++ b/.local/src/dwm/patch/layout_gapplessgrid.c @@ -0,0 +1,98 @@ +#if VANITYGAPS_PATCH +void +gaplessgrid(Monitor *m) +{ + unsigned int i, n; + int x, y, cols, rows, ch, cw, cn, rn, rrest, crest; // counters + int oh, ov, ih, iv; + Client *c; + + getgaps(m, &oh, &ov, &ih, &iv, &n); + if (n == 0) + return; + + /* grid dimensions */ + for (cols = 0; cols <= n/2; cols++) + if (cols*cols >= n) + break; + if (n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ + cols = 2; + rows = n/cols; + cn = rn = 0; // reset column no, row no, client count + + ch = (m->wh - 2*oh - ih * (rows - 1)) / rows; + cw = (m->ww - 2*ov - iv * (cols - 1)) / cols; + rrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows; + crest = (m->ww - 2*ov - iv * (cols - 1)) - cw * cols; + x = m->wx + ov; + y = m->wy + oh; + + for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { + if (i/rows + 1 > cols - n%cols) { + rows = n/cols + 1; + ch = (m->wh - 2*oh - ih * (rows - 1)) / rows; + rrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows; + } + resize(c, + x, + y + rn*(ch + ih) + MIN(rn, rrest), + cw + (cn < crest ? 1 : 0) - 2*c->bw, + ch + (rn < rrest ? 1 : 0) - 2*c->bw, + 0); + rn++; + if (rn >= rows) { + rn = 0; + x += cw + ih + (cn < crest ? 1 : 0); + cn++; + } + } +} +#else +void +gaplessgrid(Monitor *m) +{ + unsigned int i, n; + int x, y, cols, rows, ch, cw, cn, rn, rrest, crest; // counters + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + if (n == 0) + return; + + /* grid dimensions */ + for (cols = 0; cols <= n/2; cols++) + if (cols*cols >= n) + break; + if (n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ + cols = 2; + rows = n/cols; + cn = rn = 0; // reset column no, row no, client count + + ch = m->wh / rows; + cw = m->ww / cols; + rrest = m->wh - ch * rows; + crest = m->ww - cw * cols; + x = m->wx; + y = m->wy; + + for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { + if (i/rows + 1 > cols - n%cols) { + rows = n/cols + 1; + ch = m->wh / rows; + rrest = m->wh - ch * rows; + } + resize(c, + x, + y + rn*ch + MIN(rn, rrest), + cw + (cn < crest ? 1 : 0) - 2*c->bw, + ch + (rn < rrest ? 1 : 0) - 2*c->bw, + 0); + rn++; + if (rn >= rows) { + rn = 0; + x += cw + (cn < crest ? 1 : 0); + cn++; + } + } +} +#endif diff --git a/.local/src/dwm/patch/layout_gapplessgrid.h b/.local/src/dwm/patch/layout_gapplessgrid.h new file mode 100644 index 00000000..28a7b5d4 --- /dev/null +++ b/.local/src/dwm/patch/layout_gapplessgrid.h @@ -0,0 +1 @@ +static void gaplessgrid(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_grid.c b/.local/src/dwm/patch/layout_grid.c index 8e93e364..df198963 100644 --- a/.local/src/dwm/patch/layout_grid.c +++ b/.local/src/dwm/patch/layout_grid.c @@ -1,3 +1,4 @@ +#if VANITYGAPS_PATCH void grid(Monitor *m) { @@ -27,3 +28,33 @@ grid(Monitor *m) resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); } } +#else +void +grid(Monitor *m) +{ + unsigned int i, n; + int cx, cy, cw, ch, cc, cr, chrest, cwrest, cols, rows; + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + + /* grid dimensions */ + for (rows = 0; rows <= n/2; rows++) + if (rows*rows >= n) + break; + cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows; + + /* window geoms (cell height/width) */ + ch = m->wh / (rows ? rows : 1); + cw = m->ww / (cols ? cols : 1); + chrest = m->wh - ch * rows; + cwrest = m->ww - cw * cols; + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + cc = i / rows; + cr = i % rows; + cx = m->wx + cc * cw + MIN(cc, cwrest); + cy = m->wy + cr * ch + MIN(cr, chrest); + resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); + } +} +#endif \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_grid.h b/.local/src/dwm/patch/layout_grid.h index e3455d25..81149ce5 100644 --- a/.local/src/dwm/patch/layout_grid.h +++ b/.local/src/dwm/patch/layout_grid.h @@ -1 +1 @@ -static void grid(Monitor *m); +static void grid(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_horizgrid.c b/.local/src/dwm/patch/layout_horizgrid.c new file mode 100644 index 00000000..48f66abe --- /dev/null +++ b/.local/src/dwm/patch/layout_horizgrid.c @@ -0,0 +1,103 @@ +void +horizgrid(Monitor *m) { + Client *c; + unsigned int n, i; + int mx = 0, my = 0, mh = 0, mw = 0; + int sx = 0, sy = 0, sh = 0, sw = 0; + int ntop; + float mfacts = 0, sfacts = 0; + int mrest, srest, mtotal = 0, stotal = 0; + + #if VANITYGAPS_PATCH + int oh, ov, ih, iv; + getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH + if (n == 0) + return; + + if (n <= 2) + ntop = n; + else { + ntop = n / 2; + } + + #if VANITYGAPS_PATCH + sx = mx = m->wx + ov; + sy = my = m->wy + oh; + sh = mh = m->wh - 2*oh; + sw = mw = m->ww - 2*ov; + + if (n > ntop) { + sh = (mh - ih) / 2; + mh = mh - ih - sh; + sy = my + mh + ih; + mw = m->ww - 2*ov - iv * (ntop - 1); + sw = m->ww - 2*ov - iv * (n - ntop - 1); + } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (n > ntop) { + sh = mh / 2; + mh = mh - sh; + sy = my + mh; + } + #endif // VANITYGAPS_PATCH + + /* calculate facts */ + #if CFACTS_PATCH + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < ntop) + mfacts += c->cfact; + else + sfacts += c->cfact; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < ntop) + mtotal += mh * (c->cfact / mfacts); + else + stotal += sw * (c->cfact / sfacts); + #else + mfacts = ntop; + sfacts = n - ntop; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < ntop) + mtotal += mh / mfacts; + else + stotal += sw / sfacts; + #endif // CFACTS_PATCH + + mrest = mh - mtotal; + srest = sw - stotal; + + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < ntop) { + #if CFACTS_PATCH + resize(c, mx, my, mw * (c->cfact / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #else + resize(c, mx, my, mw / mfacts + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + mx += WIDTH(c) + iv; + #else + mx += WIDTH(c); + #endif // VANITYGAPS_PATCH + } else { + #if CFACTS_PATCH + resize(c, sx, sy, sw * (c->cfact / sfacts) + ((i - ntop) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #else + resize(c, sx, sy, sw / sfacts + ((i - ntop) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH + sx += WIDTH(c) + iv; + #else + sx += WIDTH(c); + #endif // VANITYGAPS_PATCH + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_horizgrid.h b/.local/src/dwm/patch/layout_horizgrid.h new file mode 100644 index 00000000..71a57fbb --- /dev/null +++ b/.local/src/dwm/patch/layout_horizgrid.h @@ -0,0 +1 @@ +static void horizgrid(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_monocle.c b/.local/src/dwm/patch/layout_monocle.c index 72421b3a..1533aa97 100644 --- a/.local/src/dwm/patch/layout_monocle.c +++ b/.local/src/dwm/patch/layout_monocle.c @@ -1,3 +1,4 @@ +#if VANITYGAPS_PATCH && VANITYGAPS_MONOCLE_PATCH void monocle(Monitor *m) { @@ -7,8 +8,30 @@ monocle(Monitor *m) getgaps(m, &oh, &ov, &ih, &iv, &n); + #if !MONOCLESYMBOL_PATCH if (n > 0) /* override layout symbol */ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); + #endif // MONOCLESYMBOL_PATCH for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) resize(c, m->wx + ov, m->wy + oh, m->ww - 2 * c->bw - 2 * ov, m->wh - 2 * c->bw - 2 * oh, 0); } +#else +void +monocle(Monitor *m) +{ + #if !MONOCLESYMBOL_PATCH + unsigned int n = 0; + #endif // MONOCLESYMBOL_PATCH + Client *c; + + #if !MONOCLESYMBOL_PATCH + for (c = m->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; + if (n > 0) /* override layout symbol */ + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); + #endif // MONOCLESYMBOL_PATCH + for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) + resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); +} +#endif // VANITYGAPS_PATCH \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_monocle.h b/.local/src/dwm/patch/layout_monocle.h index d835b5ff..d3df9604 100644 --- a/.local/src/dwm/patch/layout_monocle.h +++ b/.local/src/dwm/patch/layout_monocle.h @@ -1 +1 @@ -static void monocle(Monitor *m); +static void monocle(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_nrowgrid.c b/.local/src/dwm/patch/layout_nrowgrid.c new file mode 100644 index 00000000..5709d806 --- /dev/null +++ b/.local/src/dwm/patch/layout_nrowgrid.c @@ -0,0 +1,103 @@ +#if VANITYGAPS_PATCH +void +nrowgrid(Monitor *m) +{ + unsigned int n = 0, i = 0, ri = 0, ci = 0; /* counters */ + int oh, ov, ih, iv; /* vanitygap settings */ + unsigned int cx, cy, cw, ch; /* client geometry */ + unsigned int uw = 0, uh = 0, uc = 0; /* utilization trackers */ + unsigned int cols, rows = m->nmaster + 1; + Client *c; + + /* count clients */ + getgaps(m, &oh, &ov, &ih, &iv, &n); + + /* nothing to do here */ + if (n == 0) + return; + + /* force 2 clients to always split vertically */ + if (FORCE_VSPLIT && n == 2) + rows = 1; + + /* never allow empty rows */ + if (n < rows) + rows = n; + + /* define first row */ + cols = n / rows; + uc = cols; + cy = m->wy + oh; + ch = (m->wh - 2*oh - ih*(rows - 1)) / rows; + uh = ch; + + for (c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, ci++) { + if (ci == cols) { + uw = 0; + ci = 0; + ri++; + + /* next row */ + cols = (n - uc) / (rows - ri); + uc += cols; + cy = m->wy + oh + uh + ih; + uh += ch + ih; + } + + cx = m->wx + ov + uw; + cw = (m->ww - 2*ov - uw) / (cols - ci); + uw += cw + iv; + + resize(c, cx, cy, cw - (2*c->bw), ch - (2*c->bw), 0); + } +} +#else +void +nrowgrid(Monitor *m) +{ + unsigned int n = 0, i = 0, ri = 0, ci = 0; /* counters */ + unsigned int cx, cy, cw, ch; /* client geometry */ + unsigned int uw = 0, uh = 0, uc = 0; /* utilization trackers */ + unsigned int cols, rows = m->nmaster + 1; + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + if (n == 0) + return; + + /* force 2 clients to always split vertically */ + if (FORCE_VSPLIT && n == 2) + rows = 1; + + /* never allow empty rows */ + if (n < rows) + rows = n; + + /* define first row */ + cols = n / rows; + uc = cols; + cy = m->wy; + ch = m->wh / rows; + uh = ch; + + for (c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, ci++) { + if (ci == cols) { + uw = 0; + ci = 0; + ri++; + + /* next row */ + cols = (n - uc) / (rows - ri); + uc += cols; + cy = m->wy + uh; + uh += ch; + } + + cx = m->wx + uw; + cw = (m->ww - uw) / (cols - ci); + uw += cw; + + resize(c, cx, cy, cw - (2*c->bw), ch - (2*c->bw), 0); + } +} +#endif \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_nrowgrid.h b/.local/src/dwm/patch/layout_nrowgrid.h new file mode 100644 index 00000000..de71a504 --- /dev/null +++ b/.local/src/dwm/patch/layout_nrowgrid.h @@ -0,0 +1 @@ +static void nrowgrid(Monitor *m); \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_tile.c b/.local/src/dwm/patch/layout_tile.c index f02a7729..fa0b90a4 100644 --- a/.local/src/dwm/patch/layout_tile.c +++ b/.local/src/dwm/patch/layout_tile.c @@ -9,12 +9,17 @@ tile(Monitor *m) Client *c; + #if VANITYGAPS_PATCH int oh, ov, ih, iv; getgaps(m, &oh, &ov, &ih, &iv, &n); + #else + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + #endif // VANITYGAPS_PATCH if (n == 0) return; + #if VANITYGAPS_PATCH sx = mx = m->wx + ov; sy = my = m->wy + oh; mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); @@ -26,15 +31,43 @@ tile(Monitor *m) mw = (mw - iv) * m->mfact; sx = mx + mw + iv; } + #else + sx = mx = m->wx; + sy = my = m->wy; + sh = mh = m->wh; + sw = mw = m->ww; + + if (m->nmaster && n > m->nmaster) { + sw = mw * (1 - m->mfact); + mw = mw * m->mfact; + sx = mx + mw; + } + #endif // VANITYGAPS_PATCH getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { + #if CFACTS_PATCH + resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH my += HEIGHT(c) + ih; + #else + my += HEIGHT(c); + #endif } else { + #if CFACTS_PATCH + resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #else resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); + #endif // CFACTS_PATCH + #if VANITYGAPS_PATCH sy += HEIGHT(c) + ih; + #else + sy += HEIGHT(c); + #endif } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/layout_tile.h b/.local/src/dwm/patch/layout_tile.h index d24397ed..8730e132 100644 --- a/.local/src/dwm/patch/layout_tile.h +++ b/.local/src/dwm/patch/layout_tile.h @@ -1 +1 @@ -static void tile(Monitor *); +static void tile(Monitor *); \ No newline at end of file diff --git a/.local/src/dwm/patch/maximize.c b/.local/src/dwm/patch/maximize.c new file mode 100644 index 00000000..53336eba --- /dev/null +++ b/.local/src/dwm/patch/maximize.c @@ -0,0 +1,69 @@ +void +maximize(int x, int y, int w, int h) +{ + XEvent ev; + + if (!selmon->sel || selmon->sel->isfixed) + return; + XRaiseWindow(dpy, selmon->sel->win); + if (!selmon->sel->ismax) { + if (!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) + selmon->sel->wasfloating = True; + else { + togglefloating(NULL); + selmon->sel->wasfloating = False; + } + selmon->sel->oldx = selmon->sel->x; + selmon->sel->oldy = selmon->sel->y; + selmon->sel->oldw = selmon->sel->w; + selmon->sel->oldh = selmon->sel->h; + resize(selmon->sel, x, y, w, h, True); + selmon->sel->ismax = True; + } + else { + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); + if (!selmon->sel->wasfloating) + togglefloating(NULL); + selmon->sel->ismax = False; + } + drawbar(selmon); + while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} + +#if SETBORDERPX_PATCH +void +togglemax(const Arg *arg) +{ + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * selmon->borderpx, selmon->wh - 2 * selmon->borderpx); +} + +void +toggleverticalmax(const Arg *arg) +{ + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * selmon->borderpx); +} + +void +togglehorizontalmax(const Arg *arg) +{ + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * selmon->borderpx, selmon->sel->h); +} +#else +void +togglemax(const Arg *arg) +{ + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); +} + +void +toggleverticalmax(const Arg *arg) +{ + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); +} + +void +togglehorizontalmax(const Arg *arg) +{ + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); +} +#endif // SETBORDERPX_PATCH \ No newline at end of file diff --git a/.local/src/dwm/patch/maximize.h b/.local/src/dwm/patch/maximize.h new file mode 100644 index 00000000..e06a3ffe --- /dev/null +++ b/.local/src/dwm/patch/maximize.h @@ -0,0 +1,4 @@ +static void maximize(int x, int y, int w, int h); +static void togglemax(const Arg *arg); +static void toggleverticalmax(const Arg *arg); +static void togglehorizontalmax(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/moveplace.c b/.local/src/dwm/patch/moveplace.c new file mode 100644 index 00000000..cfd17a47 --- /dev/null +++ b/.local/src/dwm/patch/moveplace.c @@ -0,0 +1,29 @@ +void +moveplace(const Arg *arg) +{ + Client *c; + int nh, nw, nx, ny; + c = selmon->sel; + if (!c || (arg->ui >= 9)) + return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + togglefloating(NULL); + nh = (selmon->wh / 3) - (c->bw * 2); + nw = (selmon->ww / 3) - (c->bw * 2); + nx = (arg->ui % 3) -1; + ny = (arg->ui / 3) -1; + if (nx < 0) + nx = selmon->wx; + else if (nx > 0) + nx = selmon->wx + selmon->ww - nw - c->bw*2; + else + nx = selmon->wx + selmon->ww/2 - nw/2 - c->bw; + if (ny <0) + ny = selmon->wy; + else if (ny > 0) + ny = selmon->wy + selmon->wh - nh - c->bw*2; + else + ny = selmon->wy + selmon->wh/2 - nh/2 - c->bw; + resize(c, nx, ny, nw, nh, True); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, nw/2, nh/2); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/moveplace.h b/.local/src/dwm/patch/moveplace.h new file mode 100644 index 00000000..f921b8e3 --- /dev/null +++ b/.local/src/dwm/patch/moveplace.h @@ -0,0 +1,3 @@ +enum { WIN_NW, WIN_N, WIN_NE, WIN_W, WIN_C, WIN_E, WIN_SW, WIN_S, WIN_SE }; + +static void moveplace(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/moveresize.c b/.local/src/dwm/patch/moveresize.c new file mode 100644 index 00000000..35f0a2f0 --- /dev/null +++ b/.local/src/dwm/patch/moveresize.c @@ -0,0 +1,64 @@ +void +moveresize(const Arg *arg) { + /* only floating windows can be moved */ + Client *c; + c = selmon->sel; + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; + char xAbs, yAbs, wAbs, hAbs; + int msx, msy, dx, dy, nmx, nmy; + unsigned int dui; + Window dummy; + + if (!c || !arg) + return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + return; + if (sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) + return; + + /* compute new window position; prevent window from be positioned outside the current monitor */ + nw = c->w + w; + if (wAbs == 'W') + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; + + nh = c->h + h; + if (hAbs == 'H') + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; + + nx = c->x + x; + if (xAbs == 'X') { + if (x < selmon->mx) + nx = selmon->mx; + else if (x > selmon->mx + selmon->mw) + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; + else + nx = x; + } + + ny = c->y + y; + if (yAbs == 'Y') { + if (y < selmon->my) + ny = selmon->my; + else if (y > selmon->my + selmon->mh) + ny = selmon->my + selmon->mh - nh - 2 * c->bw; + else + ny = y; + } + + ox = c->x; + oy = c->y; + ow = c->w; + oh = c->h; + + XRaiseWindow(dpy, c->win); + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); + resize(c, nx, ny, nw, nh, True); + + /* move cursor along with the window to avoid problems caused by the sloppy focus */ + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) + { + nmx = c->x - ox + c->w - ow; + nmy = c->y - oy + c->h - oh; + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/moveresize.h b/.local/src/dwm/patch/moveresize.h new file mode 100644 index 00000000..5d963ff8 --- /dev/null +++ b/.local/src/dwm/patch/moveresize.h @@ -0,0 +1 @@ +static void moveresize(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/movestack.c b/.local/src/dwm/patch/movestack.c index 243c19c4..ab97b18c 100644 --- a/.local/src/dwm/patch/movestack.c +++ b/.local/src/dwm/patch/movestack.c @@ -47,4 +47,4 @@ movestack(const Arg *arg) arrange(selmon); } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/movestack.h b/.local/src/dwm/patch/movestack.h index 4797f31a..19ac5d8a 100644 --- a/.local/src/dwm/patch/movestack.h +++ b/.local/src/dwm/patch/movestack.h @@ -1 +1 @@ -static void movestack(const Arg *arg); +static void movestack(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/mpdcontrol.c b/.local/src/dwm/patch/mpdcontrol.c new file mode 100644 index 00000000..c7ff7862 --- /dev/null +++ b/.local/src/dwm/patch/mpdcontrol.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include + +#include + +#define MPDHOST "localhost" +#define MPDPORT 6600 + +struct mpd_connection *get_conn() +{ + struct mpd_connection *conn; + + conn = mpd_connection_new(MPDHOST, MPDPORT, 1000); + + if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { + fprintf(stderr, "Could not connect to mpd: %s\n", mpd_connection_get_error_message(conn)); + + mpd_connection_free(conn); + return NULL; + } + + return conn; +} + +void mpdchange(const Arg *direction) +{ + struct mpd_connection *conn; + + conn = get_conn(); + + if (conn == NULL) { + return; + } + + if (direction->i > 0) { + mpd_run_next(conn); + } + else { + mpd_run_previous(conn); + } + + mpd_connection_free(conn); +} + +char *get_regerror(int errcode, regex_t *compiled) +{ + size_t length = regerror(errcode, compiled, NULL, 0); + char *buffer = malloc(length); + (void) regerror(errcode, compiled, buffer, length); + + return buffer; +} + +void mpdcontrol() +{ + struct mpd_connection *conn; + struct mpd_status *status; + struct mpd_song *song; + enum mpd_state state; + + const char *filename; + + regex_t expr; + + conn = get_conn(); + + if (conn == NULL) { + return; + } + + status = mpd_run_status(conn); + + if (status == NULL) { + fprintf(stderr, "Could not get mpd status: %s\n", mpd_status_get_error(status)); + + mpd_status_free(status); + mpd_connection_free(conn); + return; + } + + state = mpd_status_get_state(status); + + if (state == MPD_STATE_STOP || state == MPD_STATE_PAUSE) { + mpd_run_play(conn); + mpd_status_free(status); + mpd_connection_free(conn); + } + else if (state != MPD_STATE_UNKNOWN) { //playing some music + song = mpd_run_current_song(conn); + + if (song == NULL){ + fprintf(stderr, "Error fetching current song!\n"); + + mpd_song_free(song); + mpd_status_free(status); + mpd_connection_free(conn); + return; + } + + filename = mpd_song_get_uri(song); + + int errcode = regcomp(&expr, "^[[:alnum:]]+://", REG_EXTENDED|REG_NOSUB); + if (errcode != 0) { + char *err = get_regerror(errcode, &expr); + fprintf(stderr, "Could not compile regexp: %s\n", err); + + mpd_song_free(song); + mpd_status_free(status); + mpd_connection_free(conn); + free(err); + regfree(&expr); + return; + } + + int matchcode = regexec(&expr, filename, 0, NULL, 0); + + if (matchcode == 0) { + if (strstr(filename, "file://") == filename) { //match just at the start of the filename + //this means that mpd is playing a file outside the music_dir, + //but on disk, so we can safely pause + mpd_run_toggle_pause(conn); + } + else { + mpd_run_stop(conn); + } + } + else if (matchcode == REG_NOMATCH) { + mpd_run_toggle_pause(conn); + } + else { + char *err = get_regerror(matchcode, &expr); + fprintf(stderr, "Error while matching regexp: %s\n", err); + + free(err); + } + + regfree(&expr); + mpd_song_free(song); + mpd_status_free(status); + mpd_connection_free(conn); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/mpdcontrol.h b/.local/src/dwm/patch/mpdcontrol.h new file mode 100644 index 00000000..b8825d4f --- /dev/null +++ b/.local/src/dwm/patch/mpdcontrol.h @@ -0,0 +1,2 @@ +static void mpdchange(const Arg *direction); +static void mpdcontrol(); \ No newline at end of file diff --git a/.local/src/dwm/patch/nomodbuttons.c b/.local/src/dwm/patch/nomodbuttons.c new file mode 100644 index 00000000..c4e082ec --- /dev/null +++ b/.local/src/dwm/patch/nomodbuttons.c @@ -0,0 +1,7 @@ +void +togglenomodbuttons(const Arg *arg) +{ + nomodbuttons = !nomodbuttons; + if (selmon->sel) + grabbuttons(selmon->sel, 1); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/nomodbuttons.h b/.local/src/dwm/patch/nomodbuttons.h new file mode 100644 index 00000000..4e6c572b --- /dev/null +++ b/.local/src/dwm/patch/nomodbuttons.h @@ -0,0 +1 @@ +static void togglenomodbuttons(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/pertag.c b/.local/src/dwm/patch/pertag.c index 9c98cdc3..3ca7ab2a 100644 --- a/.local/src/dwm/patch/pertag.c +++ b/.local/src/dwm/patch/pertag.c @@ -1,10 +1,27 @@ struct Pertag { unsigned int curtag, prevtag; /* current and previous tag */ int nmasters[NUMTAGS + 1]; /* number of windows in master area */ + #if FLEXTILE_DELUXE_LAYOUT + int nstacks[NUMTAGS + 1]; /* number of windows in primary stack area */ + int ltaxis[NUMTAGS + 1][LTAXIS_LAST]; + const Layout *ltidxs[NUMTAGS + 1][3]; /* matrix of tags and layouts indexes */ + #else const Layout *ltidxs[NUMTAGS + 1][2]; /* matrix of tags and layouts indexes */ + #endif // FLEXTILE_DELUXE_LAYOUT float mfacts[NUMTAGS + 1]; /* mfacts per tag */ unsigned int sellts[NUMTAGS + 1]; /* selected layouts */ + #if PERTAGBAR_PATCH + int showbars[NUMTAGS + 1]; /* display bar for the current tag */ + #endif // PERTAGBAR_PATCH + #if SWAPFOCUS_PATCH + Client *prevclient[NUMTAGS + 1]; + #endif // SWAPFOCUS_PATCH + #if ZOOMSWAP_PATCH + Client *prevzooms[NUMTAGS + 1]; /* store zoom information */ + #endif // ZOOMSWAP_PATCH + #if VANITYGAPS_PATCH int enablegaps[NUMTAGS + 1]; + #endif // VANITYGAPS_PATCH }; void @@ -15,7 +32,11 @@ pertagview(const Arg *arg) if (arg->ui & TAGMASK) { selmon->pertag->prevtag = selmon->pertag->curtag; selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; + #if SCRATCHPADS_PATCH if (arg->ui == ~SPTAGMASK) + #else + if (arg->ui == ~0) + #endif // SCRATCHPADS_PATCH selmon->pertag->curtag = 0; else { for (i = 0; !(arg->ui & 1 << i); i++) ; @@ -27,9 +48,22 @@ pertagview(const Arg *arg) selmon->pertag->curtag = tmptag; } selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; + #if FLEXTILE_DELUXE_LAYOUT + selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag]; + #endif // FLEXTILE_DELUXE_LAYOUT selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; -} + #if FLEXTILE_DELUXE_LAYOUT + selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT]; + selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER]; + selmon->ltaxis[STACK] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK]; + selmon->ltaxis[STACK2] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2]; + #endif // FLEXTILE_DELUXE_LAYOUT + #if PERTAGBAR_PATCH + if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) + togglebar(NULL); + #endif // PERTAGBAR_PATCH +} \ No newline at end of file diff --git a/.local/src/dwm/patch/pertag.h b/.local/src/dwm/patch/pertag.h index 73b53618..ac5288d3 100644 --- a/.local/src/dwm/patch/pertag.h +++ b/.local/src/dwm/patch/pertag.h @@ -1 +1 @@ -static void pertagview(const Arg *arg); +static void pertagview(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/placemouse.c b/.local/src/dwm/patch/placemouse.c new file mode 100644 index 00000000..4f8fcc3f --- /dev/null +++ b/.local/src/dwm/patch/placemouse.c @@ -0,0 +1,151 @@ +void +moveorplace(const Arg *arg) { + if ((!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)) + movemouse(arg); + else + placemouse(arg); +} + +void +placemouse(const Arg *arg) +{ + int x, y, px, py, ocx, ocy, nx = -9999, ny = -9999, freemove = 0; + Client *c, *r = NULL, *at, *prevr; + Monitor *m; + XEvent ev; + XWindowAttributes wa; + Time lasttime = 0; + int attachmode, prevattachmode; + attachmode = prevattachmode = -1; + + if (!(c = selmon->sel) || !c->mon->lt[c->mon->sellt]->arrange) /* no support for placemouse when floating layout is used */ + return; + if (c->isfullscreen) /* no support placing fullscreen windows by mouse */ + return; + restack(selmon); + prevr = c; + if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, + None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) + return; + + c->isfloating = 0; + c->beingmoved = 1; + + XGetWindowAttributes(dpy, c->win, &wa); + ocx = wa.x; + ocy = wa.y; + + if (arg->i == 2) // warp cursor to client center + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, WIDTH(c) / 2, HEIGHT(c) / 2); + + if (!getrootptr(&x, &y)) + return; + + do { + XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); + switch (ev.type) { + case ConfigureRequest: + case Expose: + case MapRequest: + handler[ev.type](&ev); + break; + case MotionNotify: + if ((ev.xmotion.time - lasttime) <= (1000 / 60)) + continue; + lasttime = ev.xmotion.time; + + nx = ocx + (ev.xmotion.x - x); + ny = ocy + (ev.xmotion.y - y); + + if (!freemove && (abs(nx - ocx) > snap || abs(ny - ocy) > snap)) + freemove = 1; + + if (freemove) + XMoveWindow(dpy, c->win, nx, ny); + + if ((m = recttomon(ev.xmotion.x, ev.xmotion.y, 1, 1)) && m != selmon) + selmon = m; + + if (arg->i == 1) { // tiled position is relative to the client window center point + px = nx + wa.width / 2; + py = ny + wa.height / 2; + } else { // tiled position is relative to the mouse cursor + px = ev.xmotion.x; + py = ev.xmotion.y; + } + + r = recttoclient(px, py, 1, 1); + + if (!r || r == c) + break; + + if ((((float)(r->y + r->h - py) / r->h) > ((float)(r->x + r->w - px) / r->w) + && (abs(r->y - py) < r->h / 2)) || (abs(r->x - px) < r->w / 2)) + attachmode = 1; // above + else + attachmode = 0; // below + + if ((r && r != prevr) || (attachmode != prevattachmode)) { + detachstack(c); + detach(c); + if (c->mon != r->mon) + arrangemon(c->mon); + + c->mon = r->mon; + r->mon->sel = r; + + if (attachmode) { + if (r == r->mon->clients) + attach(c); + else { + for (at = r->mon->clients; at->next != r; at = at->next); + c->next = at->next; + at->next = c; + } + } else { + c->next = r->next; + r->next = c; + } + + attachstack(c); + arrangemon(r->mon); + prevr = r; + prevattachmode = attachmode; + } + break; + } + } while (ev.type != ButtonRelease); + XUngrabPointer(dpy, CurrentTime); + + if ((m = recttomon(ev.xmotion.x, ev.xmotion.y, 1, 1)) && m != c->mon) { + detach(c); + detachstack(c); + arrangemon(c->mon); + c->mon = m; + attach(c); + attachstack(c); + selmon = m; + } + + focus(c); + c->beingmoved = 0; + + if (nx != -9999) + resize(c, nx, ny, c->w, c->h, 0); + arrangemon(c->mon); +} + +Client * +recttoclient(int x, int y, int w, int h) +{ + Client *c, *r = NULL; + int a, area = 0; + + for (c = nexttiled(selmon->clients); c; c = nexttiled(c->next)) { + if ((a = INTERSECTC(x, y, w, h, c)) > area) { + area = a; + r = c; + } + } + return r; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/placemouse.h b/.local/src/dwm/patch/placemouse.h new file mode 100644 index 00000000..8687ae37 --- /dev/null +++ b/.local/src/dwm/patch/placemouse.h @@ -0,0 +1,6 @@ +#define INTERSECTC(x,y,w,h,z) (MAX(0, MIN((x)+(w),(z)->x+(z)->w) - MAX((x),(z)->x)) \ + * MAX(0, MIN((y)+(h),(z)->y+(z)->h) - MAX((y),(z)->y))) + +static void moveorplace(const Arg *arg); +static void placemouse(const Arg *arg); +static Client *recttoclient(int x, int y, int w, int h); diff --git a/.local/src/dwm/patch/push.c b/.local/src/dwm/patch/push.c new file mode 100644 index 00000000..ae359289 --- /dev/null +++ b/.local/src/dwm/patch/push.c @@ -0,0 +1,71 @@ +static Client * +nextc(Client *c, float f) +{ + if (!f) + return nexttiled(c); + + for (; c && !ISVISIBLE(c); c = c->next); + return c; +} + +static Client * +prevc(Client *c, float f) +{ + Client *p, *r; + + for (p = selmon->clients, r = NULL; c && p && p != c; p = p->next) + if ((f || !p->isfloating) && ISVISIBLE(p)) + r = p; + return r; +} + +static void +pushup(const Arg *arg) +{ + Client *sel = selmon->sel; + Client *c; + + if (!sel || (sel->isfloating && !arg->f)) + return; + if ((c = prevc(sel, arg->f))) { + /* attach before c */ + detach(sel); + sel->next = c; + if (selmon->clients == c) + selmon->clients = sel; + else { + for (c = selmon->clients; c->next != sel->next; c = c->next); + c->next = sel; + } + } else { + /* move to the end */ + for (c = sel; c->next; c = c->next); + detach(sel); + sel->next = NULL; + c->next = sel; + } + focus(sel); + arrange(selmon); +} + +static void +pushdown(const Arg *arg) +{ + Client *sel = selmon->sel; + Client *c; + + if (!sel || (sel->isfloating && !arg->f)) + return; + if ((c = nextc(sel->next, arg->f))) { + /* attach after c */ + detach(sel); + sel->next = c->next; + c->next = sel; + } else { + /* move to the front */ + detach(sel); + attach(sel); + } + focus(sel); + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/push.h b/.local/src/dwm/patch/push.h new file mode 100644 index 00000000..9cad8b38 --- /dev/null +++ b/.local/src/dwm/patch/push.h @@ -0,0 +1,4 @@ +static Client * nextc(Client *c, float f); +static Client * prevc(Client *c, float f); +static void pushup(const Arg *arg); +static void pushdown(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/push_no_master.c b/.local/src/dwm/patch/push_no_master.c new file mode 100644 index 00000000..5ff9326b --- /dev/null +++ b/.local/src/dwm/patch/push_no_master.c @@ -0,0 +1,43 @@ +Client * +prevt(Client *c) +{ + Client *p, *r; + + for (p = selmon->clients, r = NULL; p && p != c; p = p->next) + if (!p->isfloating && ISVISIBLE(p)) + r = p; + return r; +} + +void +pushup(const Arg *arg) +{ + Client *sel = selmon->sel, *c; + + if (!sel || sel->isfloating) + return; + if ((c = prevt(sel)) && c != nexttiled(selmon->clients)) { + detach(sel); + sel->next = c; + for (c = selmon->clients; c->next != sel->next; c = c->next); + c->next = sel; + } + focus(sel); + arrange(selmon); +} + +void +pushdown(const Arg *arg) +{ + Client *sel = selmon->sel, *c; + + if (!sel || sel->isfloating || sel == nexttiled(selmon->clients)) + return; + if ((c = nexttiled(sel->next))) { + detach(sel); + sel->next = c->next; + c->next = sel; + } + focus(sel); + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/push_no_master.h b/.local/src/dwm/patch/push_no_master.h new file mode 100644 index 00000000..7ea061dc --- /dev/null +++ b/.local/src/dwm/patch/push_no_master.h @@ -0,0 +1,3 @@ +Client * prevt(Client *c); +static void pushup(const Arg *arg); +static void pushdown(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/reorganizetags.c b/.local/src/dwm/patch/reorganizetags.c new file mode 100644 index 00000000..da27ecd8 --- /dev/null +++ b/.local/src/dwm/patch/reorganizetags.c @@ -0,0 +1,27 @@ +void +reorganizetags(const Arg *arg) +{ + Client *c; + unsigned int occ, unocc, i; + unsigned int tagdest[NUMTAGS]; + + occ = 0; + for (c = selmon->clients; c; c = c->next) + occ |= (1 << (ffs(c->tags)-1)); + unocc = 0; + for (i = 0; i < NUMTAGS; ++i) { + while (unocc < i && (occ & (1 << unocc))) + unocc++; + if (occ & (1 << i)) { + tagdest[i] = unocc; + occ &= ~(1 << i); + occ |= 1 << unocc; + } + } + + for (c = selmon->clients; c; c = c->next) + c->tags = 1 << tagdest[ffs(c->tags)-1]; + if (selmon->sel) + selmon->tagset[selmon->seltags] = selmon->sel->tags; + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/reorganizetags.h b/.local/src/dwm/patch/reorganizetags.h new file mode 100644 index 00000000..27c0cea3 --- /dev/null +++ b/.local/src/dwm/patch/reorganizetags.h @@ -0,0 +1 @@ +static void reorganizetags(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/restartsig.c b/.local/src/dwm/patch/restartsig.c new file mode 100644 index 00000000..0bef576a --- /dev/null +++ b/.local/src/dwm/patch/restartsig.c @@ -0,0 +1,15 @@ +static int restart = 0; + +void +sighup(int unused) +{ + Arg a = {.i = 1}; + quit(&a); +} + +void +sigterm(int unused) +{ + Arg a = {.i = 0}; + quit(&a); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/restartsig.h b/.local/src/dwm/patch/restartsig.h new file mode 100644 index 00000000..5a08c393 --- /dev/null +++ b/.local/src/dwm/patch/restartsig.h @@ -0,0 +1,2 @@ +static void sighup(int unused); +static void sigterm(int unused); \ No newline at end of file diff --git a/.local/src/dwm/patch/riodraw.c b/.local/src/dwm/patch/riodraw.c new file mode 100644 index 00000000..b80328fd --- /dev/null +++ b/.local/src/dwm/patch/riodraw.c @@ -0,0 +1,103 @@ +/* drag out an area using slop and resize the selected window to it. */ +int +riodraw(Client *c, const char slopstyle[]) +{ + int i; + char str[100]; + char strout[100]; + char tmpstring[30] = {0}; + char slopcmd[100] = "slop -f x%xx%yx%wx%hx "; + int firstchar = 0; + int counter = 0; + + strcat(slopcmd, slopstyle); + FILE *fp = popen(slopcmd, "r"); + + while (fgets(str, 100, fp) != NULL) + strcat(strout, str); + + pclose(fp); + + if (strlen(strout) < 6) + return 0; + + for (i = 0; i < strlen(strout); i++){ + if (!firstchar) { + if (strout[i] == 'x') + firstchar = 1; + continue; + } + + if (strout[i] != 'x') + tmpstring[strlen(tmpstring)] = strout[i]; + else { + riodimensions[counter] = atoi(tmpstring); + counter++; + memset(tmpstring,0,strlen(tmpstring)); + } + } + + if (riodimensions[0] <= -40 || riodimensions[1] <= -40 || riodimensions[2] <= 50 || riodimensions[3] <= 50) { + riodimensions[3] = -1; + return 0; + } + + if (c) { + rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); + return 0; + } + + return 1; +} + +void +rioposition(Client *c, int x, int y, int w, int h) +{ + Monitor *m; + if ((m = recttomon(x, y, w, h)) && m != c->mon) { + detach(c); + detachstack(c); + c->mon = m; + c->tags = m->tagset[m->seltags]; + attach(c); + attachstack(c); + selmon = m; + focus(c); + } + + c->isfloating = 1; + if (riodraw_borders) + resizeclient(c, x, y, w - (c->bw * 2), h - (c->bw * 2)); + else + resizeclient(c, x - c->bw, y - c->bw, w, h); + drawbar(c->mon); + arrange(c->mon); + + riodimensions[3] = -1; + riopid = 0; +} + +/* drag out an area using slop and resize the selected window to it */ +void +rioresize(const Arg *arg) +{ + Client *c = (arg && arg->v ? (Client*)arg->v : selmon->sel); + if (c) + riodraw(c, slopresizestyle); +} + +/* Spawn a new window and drag out an area using slop to position it while the window is + * initialising in the background. */ +void +riospawn(const Arg *arg) +{ + riopid = spawncmd(arg); + riodraw(NULL, slopspawnstyle); +} + +void +riospawnsync(const Arg *arg) +{ + if (riodraw(NULL, slopspawnstyle)) + riopid = spawncmd(arg); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/riodraw.h b/.local/src/dwm/patch/riodraw.h new file mode 100644 index 00000000..91788049 --- /dev/null +++ b/.local/src/dwm/patch/riodraw.h @@ -0,0 +1,5 @@ +static int riodraw(Client *c, const char slopstyle[]); +static void rioposition(Client *c, int x, int y, int w, int h); +static void rioresize(const Arg *arg); +static void riospawn(const Arg *arg); +static void riospawnsync(const Arg *arg); diff --git a/.local/src/dwm/patch/rotatestack.c b/.local/src/dwm/patch/rotatestack.c new file mode 100644 index 00000000..d2f7d508 --- /dev/null +++ b/.local/src/dwm/patch/rotatestack.c @@ -0,0 +1,52 @@ +void +enqueue(Client *c) +{ + Client *l; + for (l = c->mon->clients; l && l->next; l = l->next); + if (l) { + l->next = c; + c->next = NULL; + } +} + +void +enqueuestack(Client *c) +{ + Client *l; + for (l = c->mon->stack; l && l->snext; l = l->snext); + if (l) { + l->snext = c; + c->snext = NULL; + } +} + +void +rotatestack(const Arg *arg) +{ + Client *c = NULL, *f; + + if (!selmon->sel) + return; + f = selmon->sel; + if (arg->i > 0) { + for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next)); + if (c){ + detach(c); + attach(c); + detachstack(c); + attachstack(c); + } + } else { + if ((c = nexttiled(selmon->clients))){ + detach(c); + enqueue(c); + detachstack(c); + enqueuestack(c); + } + } + if (c){ + arrange(selmon); + focus(f); + restack(selmon); + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/rotatestack.h b/.local/src/dwm/patch/rotatestack.h new file mode 100644 index 00000000..c0661fa0 --- /dev/null +++ b/.local/src/dwm/patch/rotatestack.h @@ -0,0 +1,3 @@ +static void enqueue(Client *c); +static void enqueuestack(Client *c); +static void rotatestack(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/roundedcorners.c b/.local/src/dwm/patch/roundedcorners.c new file mode 100644 index 00000000..56c54c84 --- /dev/null +++ b/.local/src/dwm/patch/roundedcorners.c @@ -0,0 +1,50 @@ +#include + +void drawroundedcorners(Client *c) +{ + if (corner_radius <= 0 || !c || c->isfullscreen) + return; + + Window win; + win = c->win; + if (!win) + return; + + XWindowAttributes win_attr; + if (!XGetWindowAttributes(dpy, win, &win_attr)) + return; + + int dia = 2 * corner_radius; + int w = c->w; + int h = c->h; + if (w < dia || h < dia) + return; + + Pixmap mask; + mask = XCreatePixmap(dpy, win, w, h, 1); + if (!mask) + return; + + XGCValues xgcv; + GC shape_gc; + shape_gc = XCreateGC(dpy, mask, 0, &xgcv); + + if (!shape_gc) { + XFreePixmap(dpy, mask); + free(shape_gc); + return; + } + + XSetForeground(dpy, shape_gc, 0); + XFillRectangle(dpy, mask, shape_gc, 0, 0, w, h); + XSetForeground(dpy, shape_gc, 1); + XFillArc(dpy, mask, shape_gc, 0, 0, dia, dia, 0, 23040); + XFillArc(dpy, mask, shape_gc, w-dia-1, 0, dia, dia, 0, 23040); + XFillArc(dpy, mask, shape_gc, 0, h-dia-1, dia, dia, 0, 23040); + XFillArc(dpy, mask, shape_gc, w-dia-1, h-dia-1, dia, dia, 0, 23040); + XFillRectangle(dpy, mask, shape_gc, corner_radius, 0, w-dia, h); + XFillRectangle(dpy, mask, shape_gc, 0, corner_radius, w, h-dia); + XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, mask, ShapeSet); + XFreePixmap(dpy, mask); + XFreeGC(dpy, shape_gc); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/roundedcorners.h b/.local/src/dwm/patch/roundedcorners.h new file mode 100644 index 00000000..40f7549e --- /dev/null +++ b/.local/src/dwm/patch/roundedcorners.h @@ -0,0 +1 @@ +static void drawroundedcorners(Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patch/scratchpad.c b/.local/src/dwm/patch/scratchpad.c index 17f2bc3f..2034d0d4 100644 --- a/.local/src/dwm/patch/scratchpad.c +++ b/.local/src/dwm/patch/scratchpad.c @@ -73,4 +73,4 @@ togglescratch(const Arg *arg) selmon->tagset[selmon->seltags] |= scratchtag; spawn(&sparg); } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/scratchpad.h b/.local/src/dwm/patch/scratchpad.h index 10516c81..42e592b3 100644 --- a/.local/src/dwm/patch/scratchpad.h +++ b/.local/src/dwm/patch/scratchpad.h @@ -5,4 +5,4 @@ typedef struct { static void removescratch(const Arg *arg); static void setscratch(const Arg *arg); -static void togglescratch(const Arg *arg); +static void togglescratch(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/scratchpad_alt_1.c b/.local/src/dwm/patch/scratchpad_alt_1.c new file mode 100644 index 00000000..c1301c91 --- /dev/null +++ b/.local/src/dwm/patch/scratchpad_alt_1.c @@ -0,0 +1,92 @@ +static Client * scratchpad_last_showed = NULL; + +static void scratchpad_hide () +{ + if (selmon->sel) + { + selmon->sel->tags = SCRATCHPAD_MASK; + focus(NULL); + arrange(selmon); + } +} + +static _Bool scratchpad_last_showed_is_killed (void) +{ + _Bool killed = 1; + for (Client * c = selmon->clients; c != NULL; c = c->next) + { + if (c == scratchpad_last_showed) + { + killed = 0; + break; + } + } + return killed; +} + +static void scratchpad_remove () +{ + if (selmon->sel && scratchpad_last_showed != NULL && selmon->sel == scratchpad_last_showed) + scratchpad_last_showed = NULL; +} + +static void scratchpad_show () +{ + if (scratchpad_last_showed == NULL || scratchpad_last_showed_is_killed ()) + scratchpad_show_first (); + else + { + if (scratchpad_last_showed->tags != SCRATCHPAD_MASK) + { + scratchpad_last_showed->tags = SCRATCHPAD_MASK; + focus(NULL); + arrange(selmon); + } + else + { + _Bool found_current = 0; + _Bool found_next = 0; + for (Client * c = selmon->clients; c != NULL; c = c->next) + { + if (found_current == 0) + { + if (c == scratchpad_last_showed) + { + found_current = 1; + continue; + } + } + else + { + if (c->tags == SCRATCHPAD_MASK) + { + found_next = 1; + scratchpad_show_client (c); + break; + } + } + } + if (found_next == 0) scratchpad_show_first (); + } + } +} + +static void scratchpad_show_client (Client * c) +{ + scratchpad_last_showed = c; + c->tags = selmon->tagset[selmon->seltags]; + focus(c); + arrange(selmon); +} + +static void scratchpad_show_first (void) +{ + for (Client * c = selmon->clients; c != NULL; c = c->next) + { + if (c->tags == SCRATCHPAD_MASK) + { + scratchpad_show_client (c); + break; + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/scratchpad_alt_1.h b/.local/src/dwm/patch/scratchpad_alt_1.h new file mode 100644 index 00000000..5cc2e2f8 --- /dev/null +++ b/.local/src/dwm/patch/scratchpad_alt_1.h @@ -0,0 +1,8 @@ +#define SCRATCHPAD_MASK (1u << NUMTAGS) + +static void scratchpad_hide (); +static _Bool scratchpad_last_showed_is_killed (void); +static void scratchpad_remove (); +static void scratchpad_show (); +static void scratchpad_show_client (Client * c); +static void scratchpad_show_first (void); \ No newline at end of file diff --git a/.local/src/dwm/patch/selfrestart.c b/.local/src/dwm/patch/selfrestart.c new file mode 100644 index 00000000..c3b88c1a --- /dev/null +++ b/.local/src/dwm/patch/selfrestart.c @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include + +/** + * Magically finds the current's executable path + * + * I'm doing the do{}while(); trick because Linux (what I'm running) is not + * POSIX compilant and so lstat() cannot be trusted on /proc entries + * + * @return char* the path of the current executable + */ +char *get_dwm_path() +{ + struct stat s; + int r, length, rate = 42; + char *path = NULL; + + if (lstat("/proc/self/exe", &s) == -1) { + perror("lstat:"); + return NULL; + } + + length = s.st_size + 1 - rate; + + do + { + length+=rate; + + free(path); + path = malloc(sizeof(char) * length); + + if (path == NULL){ + perror("malloc:"); + return NULL; + } + + r = readlink("/proc/self/exe", path, length); + + if (r == -1){ + perror("readlink:"); + return NULL; + } + } while (r >= length); + + path[r] = '\0'; + + return path; +} + +/** + * self-restart + * + * Initially inspired by: Yu-Jie Lin + * https://sites.google.com/site/yjlnotes/notes/dwm + */ +void self_restart(const Arg *arg) +{ + char *const argv[] = {get_dwm_path(), NULL}; + + if (argv[0] == NULL) { + return; + } + + execv(argv[0], argv); +} diff --git a/.local/src/dwm/patch/selfrestart.h b/.local/src/dwm/patch/selfrestart.h new file mode 100644 index 00000000..4af2436e --- /dev/null +++ b/.local/src/dwm/patch/selfrestart.h @@ -0,0 +1,2 @@ +char *get_dwm_path(); +void self_restart(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/setborderpx.c b/.local/src/dwm/patch/setborderpx.c new file mode 100644 index 00000000..320aaa43 --- /dev/null +++ b/.local/src/dwm/patch/setborderpx.c @@ -0,0 +1,44 @@ +void +setborderpx(const Arg *arg) +{ + Client *c; + int prev_borderpx = selmon->borderpx; + + if (arg->i == 0) + selmon->borderpx = borderpx; + else if (selmon->borderpx + arg->i < 0) + selmon->borderpx = 0; + else + selmon->borderpx += arg->i; + + #if BAR_BORDER_PATCH + for (bar = selmon->bar; bar; bar = bar->next) { + bar->bh = bar->bh - 2 * bar->borderpx + 2 * selmon->borderpx; + bar->borderpx = selmon->borderpx; + } + updatebarpos(selmon); + for (bar = selmon->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + #endif // BAR_BORDER_PATCH + + for (c = selmon->clients; c; c = c->next) + { + if (c->bw + arg->i < 0) + c->bw = 0; + else + c->bw = selmon->borderpx; + + if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) + { + if (arg->i != 0 && prev_borderpx + arg->i >= 0) + resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0); + else if (arg->i != 0) + resizeclient(c, c->x, c->y, c->w, c->h); + else if (prev_borderpx > borderpx) + resize(c, c->x, c->y, c->w + 2*(prev_borderpx - borderpx), c->h + 2*(prev_borderpx - borderpx), 0); + else if (prev_borderpx < borderpx) + resize(c, c->x, c->y, c->w - 2*(borderpx - prev_borderpx), c->h - 2*(borderpx - prev_borderpx), 0); + } + } + arrange(selmon); +} diff --git a/.local/src/dwm/patch/setborderpx.h b/.local/src/dwm/patch/setborderpx.h new file mode 100644 index 00000000..c598066b --- /dev/null +++ b/.local/src/dwm/patch/setborderpx.h @@ -0,0 +1 @@ +static void setborderpx(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/shiftview.c b/.local/src/dwm/patch/shiftview.c index 0f10c847..72d5b364 100644 --- a/.local/src/dwm/patch/shiftview.c +++ b/.local/src/dwm/patch/shiftview.c @@ -2,7 +2,11 @@ void shiftview(const Arg *arg) { Arg shifted; + #if SCRATCHPADS_PATCH unsigned int seltagset = selmon->tagset[selmon->seltags] & ~SPTAGMASK; + #else + unsigned int seltagset = selmon->tagset[selmon->seltags]; + #endif // SCRATCHPADS_PATCH if (arg->i > 0) // left circular shift shifted.ui = (seltagset << arg->i) | (seltagset >> (NUMTAGS - arg->i)); diff --git a/.local/src/dwm/patch/shiftview.h b/.local/src/dwm/patch/shiftview.h index 7bf3a148..cace70eb 100644 --- a/.local/src/dwm/patch/shiftview.h +++ b/.local/src/dwm/patch/shiftview.h @@ -1 +1 @@ -static void shiftview(const Arg *arg); +static void shiftview(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/shiftviewclients.c b/.local/src/dwm/patch/shiftviewclients.c new file mode 100644 index 00000000..04378eff --- /dev/null +++ b/.local/src/dwm/patch/shiftviewclients.c @@ -0,0 +1,42 @@ +void +shiftviewclients(const Arg *arg) +{ + Arg shifted; + Client *c; + unsigned int tagmask = 0; + + for (c = selmon->clients; c; c = c->next) + #if SCRATCHPADS_PATCH + if (!(c->tags & SPTAGMASK)) + tagmask = tagmask | c->tags; + #elif SCRATCHPAD_ALT_1_PATCH + if (!(c->tags & SCRATCHPAD_MASK)) + tagmask = tagmask | c->tags; + #else + tagmask = tagmask | c->tags; + #endif // SCRATCHPADS_PATCH + + #if SCRATCHPADS_PATCH + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; + #else + shifted.ui = selmon->tagset[selmon->seltags]; + #endif // SCRATCHPADS_PATCH + if (arg->i > 0) // left circular shift + do { + shifted.ui = (shifted.ui << arg->i) + | (shifted.ui >> (NUMTAGS - arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH + } while (tagmask && !(shifted.ui & tagmask)); + else // right circular shift + do { + shifted.ui = (shifted.ui >> (- arg->i) + | shifted.ui << (NUMTAGS + arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH + } while (tagmask && !(shifted.ui & tagmask)); + + view(&shifted); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/shiftviewclients.h b/.local/src/dwm/patch/shiftviewclients.h new file mode 100644 index 00000000..ddff8265 --- /dev/null +++ b/.local/src/dwm/patch/shiftviewclients.h @@ -0,0 +1 @@ +static void shiftviewclients(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/sizehints_ruled.c b/.local/src/dwm/patch/sizehints_ruled.c new file mode 100644 index 00000000..885707ff --- /dev/null +++ b/.local/src/dwm/patch/sizehints_ruled.c @@ -0,0 +1,24 @@ +void +checkfloatingrules(Client *c) +{ + const char *class, *instance; + unsigned int i; + const Rule *r; + XClassHint ch = { NULL, NULL }; + + XGetClassHint(dpy, c->win, &ch); + class = ch.res_class ? ch.res_class : broken; + instance = ch.res_name ? ch.res_name : broken; + + for (i = 0; i < LENGTH(rules); i++) { + r = &rules[i]; + if ((!r->title || strstr(c->name, r->title)) + && (!r->class || strstr(class, r->class)) + && (!r->instance || strstr(instance, r->instance))) + c->isfloating = r->isfloating; + } + if (ch.res_class) + XFree(ch.res_class); + if (ch.res_name) + XFree(ch.res_name); +} diff --git a/.local/src/dwm/patch/sizehints_ruled.h b/.local/src/dwm/patch/sizehints_ruled.h new file mode 100644 index 00000000..d21b2e49 --- /dev/null +++ b/.local/src/dwm/patch/sizehints_ruled.h @@ -0,0 +1 @@ +static void checkfloatingrules(Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patch/sortscreens.c b/.local/src/dwm/patch/sortscreens.c new file mode 100644 index 00000000..62508481 --- /dev/null +++ b/.local/src/dwm/patch/sortscreens.c @@ -0,0 +1,15 @@ +void +sortscreens(XineramaScreenInfo *screens, int n) +{ + int i, j; + XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo)); + + for (i = 0; i < n; i++) + for (j = i + 1; j < n; j++) + if (RIGHTOF(screens[i], screens[j])) { + memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo)); + memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo)); + memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo)); + } + XFree(screen); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/sortscreens.h b/.local/src/dwm/patch/sortscreens.h new file mode 100644 index 00000000..d829cdf2 --- /dev/null +++ b/.local/src/dwm/patch/sortscreens.h @@ -0,0 +1,3 @@ +#define RIGHTOF(a,b) (a.y_org > b.y_org) || ((a.y_org == b.y_org) && (a.x_org > b.x_org)) + +static void sortscreens(XineramaScreenInfo *screens, int n); \ No newline at end of file diff --git a/.local/src/dwm/patch/stacker.c b/.local/src/dwm/patch/stacker.c new file mode 100644 index 00000000..1582cf66 --- /dev/null +++ b/.local/src/dwm/patch/stacker.c @@ -0,0 +1,106 @@ +void +focusstack(const Arg *arg) +{ + int i = stackpos(arg); + Client *c, *p; + + if (i < 0) + return; + + #if ALWAYSFULLSCREEN_PATCH + if (!selmon->sel || selmon->sel->isfullscreen) + return; + #endif // ALWAYSFULLSCREEN_PATCH + + #if BAR_WINTITLEACTIONS_PATCH + for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c) || HIDDEN(c)); + i -= (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), p = c, c = c->next); + #else + for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c)); + i -= (ISVISIBLE(c) ? 1 : 0), p = c, c = c->next); + #endif // BAR_WINTITLEACTIONS_PATCH + focus(c ? c : p); + restack(selmon); +} + +void +pushstack(const Arg *arg) +{ + int i = stackpos(arg); + Client *sel = selmon->sel, *c, *p; + + if (i < 0) + return; + else if (i == 0) { + detach(sel); + attach(sel); + } + else { + for (p = NULL, c = selmon->clients; c; p = c, c = c->next) + #if BAR_WINTITLEACTIONS_PATCH + if (!(i -= (ISVISIBLE(c) && !HIDDEN(c) && c != sel))) + #else + if (!(i -= (ISVISIBLE(c) && c != sel))) + #endif // BAR_WINTITLEACTIONS_PATCH + break; + c = c ? c : p; + detach(sel); + sel->next = c->next; + c->next = sel; + } + arrange(selmon); +} + +int +stackpos(const Arg *arg) +{ + int n, i; + Client *c, *l; + + if (!selmon->clients) + return -1; + + #if BAR_WINTITLEACTIONS_PATCH + if (arg->i == PREVSEL) { + for (l = selmon->stack; l && (!ISVISIBLE(l) || HIDDEN(l) || l == selmon->sel); l = l->snext); + if (!l) + return -1; + for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); + return i; + } + else if (ISINC(arg->i)) { + if (!selmon->sel) + return -1; + for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); + for (n = i; c; n += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); + return MOD(i + GETINC(arg->i), n); + } + else if (arg->i < 0) { + for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); + return MAX(i + arg->i, 0); + } + else + return arg->i; + #else // !BAR_WINTITLEACTIONS_PATCH + if (arg->i == PREVSEL) { + for (l = selmon->stack; l && (!ISVISIBLE(l) || l == selmon->sel); l = l->snext); + if (!l) + return -1; + for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); + return i; + } + else if (ISINC(arg->i)) { + if (!selmon->sel) + return -1; + for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); + for (n = i; c; n += (ISVISIBLE(c) ? 1 : 0), c = c->next); + return MOD(i + GETINC(arg->i), n); + } + else if (arg->i < 0) { + for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); + return MAX(i + arg->i, 0); + } + else + return arg->i; + #endif // BAR_WINTITLEACTIONS_PATCH +} diff --git a/.local/src/dwm/patch/stacker.h b/.local/src/dwm/patch/stacker.h new file mode 100644 index 00000000..0a064613 --- /dev/null +++ b/.local/src/dwm/patch/stacker.h @@ -0,0 +1,10 @@ +#define GETINC(X) ((X) - 2000) +#define INC(X) ((X) + 2000) +#define ISINC(X) ((X) > 1000 && (X) < 3000) +#define PREVSEL 3000 +#define MOD(N,M) ((N)%(M) < 0 ? (N)%(M) + (M) : (N)%(M)) +#define TRUNC(X,A,B) (MAX((A), MIN((X), (B)))) + +static void focusstack(const Arg *arg); +static void pushstack(const Arg *arg); +static int stackpos(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/sticky.c b/.local/src/dwm/patch/sticky.c new file mode 100644 index 00000000..54bd4031 --- /dev/null +++ b/.local/src/dwm/patch/sticky.c @@ -0,0 +1,8 @@ +void +togglesticky(const Arg *arg) +{ + if (!selmon->sel) + return; + selmon->sel->issticky = !selmon->sel->issticky; + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/sticky.h b/.local/src/dwm/patch/sticky.h new file mode 100644 index 00000000..a7c35ab9 --- /dev/null +++ b/.local/src/dwm/patch/sticky.h @@ -0,0 +1 @@ +static void togglesticky(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/swallow.c b/.local/src/dwm/patch/swallow.c new file mode 100644 index 00000000..84dda8c4 --- /dev/null +++ b/.local/src/dwm/patch/swallow.c @@ -0,0 +1,205 @@ +#include +#include +#ifdef __OpenBSD__ +#include +#include +#endif /* __OpenBSD__ */ + +static int scanner; +static xcb_connection_t *xcon; + +int +swallow(Client *p, Client *c) +{ + Client *s; + + if (c->noswallow > 0 || c->isterminal) + return 0; + if (c->noswallow < 0 && !swallowfloating && c->isfloating) + return 0; + + XMapWindow(dpy, c->win); + + detach(c); + detachstack(c); + + setclientstate(c, WithdrawnState); + XUnmapWindow(dpy, p->win); + + p->swallowing = c; + c->mon = p->mon; + + Window w = p->win; + p->win = c->win; + c->win = w; + + XChangeProperty(dpy, c->win, netatom[NetClientList], XA_WINDOW, 32, PropModeReplace, + (unsigned char *) &(p->win), 1); + + updatetitle(p); + s = scanner ? c : p; + #if BAR_EWMHTAGS_PATCH + setfloatinghint(s); + #endif // BAR_EWMHTAGS_PATCH + XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h); + arrange(p->mon); + configure(p); + updateclientlist(); + + return 1; +} + +void +unswallow(Client *c) +{ + c->win = c->swallowing->win; + + free(c->swallowing); + c->swallowing = NULL; + + XDeleteProperty(dpy, c->win, netatom[NetClientList]); + + /* unfullscreen the client */ + setfullscreen(c, 0); + updatetitle(c); + arrange(c->mon); + XMapWindow(dpy, c->win); + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); + #if BAR_EWMHTAGS_PATCH + setfloatinghint(c); + #endif // BAR_EWMHTAGS_PATCH + setclientstate(c, NormalState); + focus(NULL); + arrange(c->mon); +} + +pid_t +winpid(Window w) +{ + pid_t result = 0; + + #ifdef __linux__ + xcb_res_client_id_spec_t spec = {0}; + spec.client = w; + spec.mask = XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID; + + xcb_generic_error_t *e = NULL; + xcb_res_query_client_ids_cookie_t c = xcb_res_query_client_ids(xcon, 1, &spec); + xcb_res_query_client_ids_reply_t *r = xcb_res_query_client_ids_reply(xcon, c, &e); + + if (!r) + return (pid_t)0; + + xcb_res_client_id_value_iterator_t i = xcb_res_query_client_ids_ids_iterator(r); + for (; i.rem; xcb_res_client_id_value_next(&i)) { + spec = i.data->spec; + if (spec.mask & XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID) { + uint32_t *t = xcb_res_client_id_value_value(i.data); + result = *t; + break; + } + } + + free(r); + + if (result == (pid_t)-1) + result = 0; + + #endif /* __linux__ */ + #ifdef __OpenBSD__ + Atom type; + int format; + unsigned long len, bytes; + unsigned char *prop; + pid_t ret; + + if (XGetWindowProperty(dpy, w, XInternAtom(dpy, "_NET_WM_PID", 1), 0, 1, False, AnyPropertyType, &type, &format, &len, &bytes, &prop) != Success || !prop) + return 0; + + ret = *(pid_t*)prop; + XFree(prop); + result = ret; + #endif /* __OpenBSD__ */ + + return result; +} + +pid_t +getparentprocess(pid_t p) +{ + unsigned int v = 0; + +#ifdef __linux__ + FILE *f; + char buf[256]; + snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)p); + + if (!(f = fopen(buf, "r"))) + return (pid_t)0; + + if (fscanf(f, "%*u %*s %*c %u", (unsigned *)&v) != 1) + v = (pid_t)0; + fclose(f); +#endif /* __linux__ */ +#ifdef __OpenBSD__ + int n; + kvm_t *kd; + struct kinfo_proc *kp; + + kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, NULL); + if (!kd) + return 0; + + kp = kvm_getprocs(kd, KERN_PROC_PID, p, sizeof(*kp), &n); + v = kp->p_ppid; +#endif /* __OpenBSD__ */ + return (pid_t)v; +} + +int +isdescprocess(pid_t p, pid_t c) +{ + while (p != c && c != 0) + c = getparentprocess(c); + + return (int)c; +} + +Client * +termforwin(const Client *w) +{ + Client *c; + Monitor *m; + + if (!w->pid || w->isterminal) + return NULL; + + c = selmon->sel; + if (c && c->isterminal && !c->swallowing && c->pid && isdescprocess(c->pid, w->pid)) + return c; + + for (m = mons; m; m = m->next) { + for (c = m->clients; c; c = c->next) { + if (c->isterminal && !c->swallowing && c->pid && isdescprocess(c->pid, w->pid)) + return c; + } + } + + return NULL; +} + +Client * +swallowingclient(Window w) +{ + Client *c; + Monitor *m; + + for (m = mons; m; m = m->next) { + for (c = m->clients; c; c = c->next) { + if (c->swallowing && c->swallowing->win == w) + return c; + } + } + + return NULL; +} diff --git a/.local/src/dwm/patch/swallow.h b/.local/src/dwm/patch/swallow.h new file mode 100644 index 00000000..d44a7eac --- /dev/null +++ b/.local/src/dwm/patch/swallow.h @@ -0,0 +1,7 @@ +static pid_t getparentprocess(pid_t p); +static int isdescprocess(pid_t p, pid_t c); +static int swallow(Client *p, Client *c); +static Client *swallowingclient(Window w); +static Client *termforwin(const Client *c); +static void unswallow(Client *c); +static pid_t winpid(Window w); \ No newline at end of file diff --git a/.local/src/dwm/patch/swapfocus.c b/.local/src/dwm/patch/swapfocus.c new file mode 100644 index 00000000..7693925a --- /dev/null +++ b/.local/src/dwm/patch/swapfocus.c @@ -0,0 +1,21 @@ +void +swapfocus(const Arg *arg) +{ + if (!selmon->sel) + return; + if (selmon->pertag->prevclient[selmon->pertag->curtag] != NULL + && ISVISIBLE(selmon->pertag->prevclient[selmon->pertag->curtag])) { + focus(selmon->pertag->prevclient[selmon->pertag->curtag]); + restack(selmon->pertag->prevclient[selmon->pertag->curtag]->mon); + } + else { + Client *c = NULL; + for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); + if (!c) + for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); + if (c) { + focus(c); + restack(selmon); + } + } +} \ No newline at end of file diff --git a/.local/src/dwm/patch/swapfocus.h b/.local/src/dwm/patch/swapfocus.h new file mode 100644 index 00000000..f5739886 --- /dev/null +++ b/.local/src/dwm/patch/swapfocus.h @@ -0,0 +1 @@ +static void swapfocus(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/swaptags.c b/.local/src/dwm/patch/swaptags.c new file mode 100644 index 00000000..c43a83f9 --- /dev/null +++ b/.local/src/dwm/patch/swaptags.c @@ -0,0 +1,22 @@ +void +swaptags(const Arg *arg) +{ + unsigned int newtag = arg->ui & TAGMASK; + unsigned int curtag = selmon->tagset[selmon->seltags]; + + if (newtag == curtag || !curtag || (curtag & (curtag-1))) + return; + + for (Client *c = selmon->clients; c != NULL; c = c->next) { + if ((c->tags & newtag) || (c->tags & curtag)) + c->tags ^= curtag ^ newtag; + + if (!c->tags) + c->tags = newtag; + } + + selmon->tagset[selmon->seltags] = newtag; + + focus(NULL); + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/swaptags.h b/.local/src/dwm/patch/swaptags.h new file mode 100644 index 00000000..150fcce7 --- /dev/null +++ b/.local/src/dwm/patch/swaptags.h @@ -0,0 +1 @@ +static void swaptags(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/switchcol.c b/.local/src/dwm/patch/switchcol.c index 30808cbb..b2fe595b 100644 --- a/.local/src/dwm/patch/switchcol.c +++ b/.local/src/dwm/patch/switchcol.c @@ -25,4 +25,4 @@ switchcol(const Arg *arg) break; } } -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/switchcol.h b/.local/src/dwm/patch/switchcol.h index 68072e00..f7f5f962 100644 --- a/.local/src/dwm/patch/switchcol.h +++ b/.local/src/dwm/patch/switchcol.h @@ -1 +1 @@ -static void switchcol(const Arg *arg); +static void switchcol(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/tagall.c b/.local/src/dwm/patch/tagall.c new file mode 100644 index 00000000..81f44e0c --- /dev/null +++ b/.local/src/dwm/patch/tagall.c @@ -0,0 +1,25 @@ +void +tagall(const Arg *arg) +{ + if (!selmon->clients) + return; + /* if parameter starts with F, just move floating windows */ + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; + int j; + Client* c; + if (tag >= 0 && tag < NUMTAGS) + for (c = selmon->clients; c; c = c->next) + { + if (!floating_only || c->isfloating) + for (j = 0; j < NUMTAGS; j++) + { + if (c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) + { + c->tags = c->tags ^ (1 << j & TAGMASK); + c->tags = c->tags | 1 << (tag-1); + } + } + } + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/tagall.h b/.local/src/dwm/patch/tagall.h new file mode 100644 index 00000000..09fe4d1e --- /dev/null +++ b/.local/src/dwm/patch/tagall.h @@ -0,0 +1 @@ +static void tagall(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/tagallmon.c b/.local/src/dwm/patch/tagallmon.c new file mode 100644 index 00000000..f863b6d3 --- /dev/null +++ b/.local/src/dwm/patch/tagallmon.c @@ -0,0 +1,48 @@ +void +tagallmon(const Arg *arg) +{ + Monitor *m; + Client *c, *last, *slast, *next; + + if (!mons->next) + return; + + m = dirtomon(arg->i); + for (last = m->clients; last && last->next; last = last->next); + for (slast = m->stack; slast && slast->snext; slast = slast->snext); + + for (c = selmon->clients; c; c = next) { + next = c->next; + if (!ISVISIBLE(c)) + continue; + unfocus(c, 1, NULL); + detach(c); + detachstack(c); + c->mon = m; + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ + c->next = NULL; + c->snext = NULL; + if (last) + last = last->next = c; + else + m->clients = last = c; + if (slast) + slast = slast->snext = c; + else + m->stack = slast = c; + if (c->isfullscreen) { + #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen != 1) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + #elif !FAKEFULLSCREEN_PATCH + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + #endif // FAKEFULLSCREEN_CLIENT_PATCH + } + } + + focus(NULL); + arrange(NULL); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/tagallmon.h b/.local/src/dwm/patch/tagallmon.h new file mode 100644 index 00000000..e4090242 --- /dev/null +++ b/.local/src/dwm/patch/tagallmon.h @@ -0,0 +1 @@ +static void tagallmon(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/tagothermonitor.c b/.local/src/dwm/patch/tagothermonitor.c new file mode 100644 index 00000000..ddeaff87 --- /dev/null +++ b/.local/src/dwm/patch/tagothermonitor.c @@ -0,0 +1,43 @@ +#if IPC_PATCH || DWMC_PATCH +void +tagnextmonex(const Arg *arg) +{ + tagnextmon(&((Arg) { .ui = 1 << arg->ui })); +} + +void +tagprevmonex(const Arg *arg) +{ + tagprevmon(&((Arg) { .ui = 1 << arg->ui })); +} +#endif // IPC_PATCH | DWMC_PATCH + +void +tagnextmon(const Arg *arg) +{ + tagothermon(arg, 1); +} + +void +tagprevmon(const Arg *arg) +{ + tagothermon(arg, -1); +} + +void +tagothermon(const Arg *arg, int dir) +{ + Client *sel; + Monitor *newmon; + + if (!selmon->sel || !mons->next) + return; + sel = selmon->sel; + newmon = dirtomon(dir); + sendmon(sel, newmon); + if (arg->ui & TAGMASK) { + sel->tags = arg->ui & TAGMASK; + focus(NULL); + arrange(newmon); + } +} diff --git a/.local/src/dwm/patch/tagothermonitor.h b/.local/src/dwm/patch/tagothermonitor.h new file mode 100644 index 00000000..e2aa24f9 --- /dev/null +++ b/.local/src/dwm/patch/tagothermonitor.h @@ -0,0 +1,8 @@ +#if IPC_PATCH || DWMC_PATCH +static void tagnextmonex(const Arg *arg); +static void tagprevmonex(const Arg *arg); +#endif // IPC_PATCH | DWMC_PATCH + +static void tagnextmon(const Arg *arg); +static void tagprevmon(const Arg *arg); +static void tagothermon(const Arg *arg, int dir); diff --git a/.local/src/dwm/patch/tagswapmon.c b/.local/src/dwm/patch/tagswapmon.c new file mode 100644 index 00000000..a6f8a32a --- /dev/null +++ b/.local/src/dwm/patch/tagswapmon.c @@ -0,0 +1,74 @@ +void +tagswapmon(const Arg *arg) +{ + Monitor *m; + Client *c, *sc = NULL, *mc = NULL, *next; + + if (!mons->next) + return; + + m = dirtomon(arg->i); + + for (c = selmon->clients; c; c = next) { + next = c->next; + if (!ISVISIBLE(c)) + continue; + unfocus(c, 1, NULL); + detach(c); + detachstack(c); + c->next = sc; + sc = c; + } + + for (c = m->clients; c; c = next) { + next = c->next; + if (!ISVISIBLE(c)) + continue; + unfocus(c, 1, NULL); + detach(c); + detachstack(c); + c->next = mc; + mc = c; + } + + for (c = sc; c; c = next) { + next = c->next; + c->mon = m; + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ + attach(c); + attachstack(c); + if (c->isfullscreen) { + #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen != 1) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + #elif !FAKEFULLSCREEN_PATCH + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + #endif // FAKEFULLSCREEN_CLIENT_PATCH + } + } + + for (c = mc; c; c = next) { + next = c->next; + c->mon = selmon; + c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */ + attach(c); + attachstack(c); + if (c->isfullscreen) { + #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen != 1) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + #elif !FAKEFULLSCREEN_PATCH + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + #endif // FAKEFULLSCREEN_CLIENT_PATCH + } + } + + focus(NULL); + arrange(NULL); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/tagswapmon.h b/.local/src/dwm/patch/tagswapmon.h new file mode 100644 index 00000000..433f4b16 --- /dev/null +++ b/.local/src/dwm/patch/tagswapmon.h @@ -0,0 +1 @@ +static void tagswapmon(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/togglefullscreen.c b/.local/src/dwm/patch/togglefullscreen.c index 8b4240ca..bc1c705b 100644 --- a/.local/src/dwm/patch/togglefullscreen.c +++ b/.local/src/dwm/patch/togglefullscreen.c @@ -5,5 +5,13 @@ togglefullscreen(const Arg *arg) if (!c) return; + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->fakefullscreen == 1) { // fake fullscreen --> fullscreen + c->fakefullscreen = 2; + setfullscreen(c, 1); + } else + setfullscreen(c, !c->isfullscreen); + #else setfullscreen(c, !c->isfullscreen); + #endif // FAKEFULLSCREEN_CLIENT_PATCH } diff --git a/.local/src/dwm/patch/togglefullscreen.h b/.local/src/dwm/patch/togglefullscreen.h index 1ea65784..7e1126af 100644 --- a/.local/src/dwm/patch/togglefullscreen.h +++ b/.local/src/dwm/patch/togglefullscreen.h @@ -1 +1 @@ -static void togglefullscreen(const Arg *arg); +static void togglefullscreen(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/transfer.c b/.local/src/dwm/patch/transfer.c new file mode 100644 index 00000000..0a99f310 --- /dev/null +++ b/.local/src/dwm/patch/transfer.c @@ -0,0 +1,33 @@ +void +transfer(const Arg *arg) +{ + Client *c, *mtail = selmon->clients, *stail = NULL, *insertafter; + int transfertostack = 0, i, nmasterclients; + + for (i = 0, c = selmon->clients; c; c = c->next) { + if (!ISVISIBLE(c) || c->isfloating) continue; + if (selmon->sel == c) { transfertostack = i < selmon->nmaster && selmon->nmaster != 0; } + if (i < selmon->nmaster) { nmasterclients++; mtail = c; } + stail = c; + i++; + } + if (!selmon->sel || selmon->sel->isfloating || i == 0) { + return; + } else if (transfertostack) { + selmon->nmaster = MIN(i, selmon->nmaster) - 1; + insertafter = stail; + } else { + selmon->nmaster = selmon->nmaster + 1; + insertafter = mtail; + } + if (insertafter != selmon->sel) { + detach(selmon->sel); + if (selmon->nmaster == 1 && !transfertostack) { + attach(selmon->sel); // Head prepend case + } else { + selmon->sel->next = insertafter->next; + insertafter->next = selmon->sel; + } + } + arrange(selmon); +} diff --git a/.local/src/dwm/patch/transfer.h b/.local/src/dwm/patch/transfer.h new file mode 100644 index 00000000..a8436dda --- /dev/null +++ b/.local/src/dwm/patch/transfer.h @@ -0,0 +1 @@ +static void transfer(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/transferall.c b/.local/src/dwm/patch/transferall.c new file mode 100644 index 00000000..fe126997 --- /dev/null +++ b/.local/src/dwm/patch/transferall.c @@ -0,0 +1,25 @@ +void +transferall(const Arg *arg) +{ + Client *c, *n = selmon->clients, *attachfrom = NULL; + int i = 0, nstackclients = 0; + while (n) { + c = n; + n = c->next; + if (!ISVISIBLE(c) || c->isfloating) continue; + if (i >= selmon->nmaster) { + detach(c); + if (!attachfrom) { + attach(c); + } else { + c->next = attachfrom->next; + attachfrom->next = c; + } + attachfrom = c; + nstackclients++; + } + i++; + } + selmon->nmaster = nstackclients; + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/transferall.h b/.local/src/dwm/patch/transferall.h new file mode 100644 index 00000000..55564688 --- /dev/null +++ b/.local/src/dwm/patch/transferall.h @@ -0,0 +1 @@ +static void transferall(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/unfloatvisible.c b/.local/src/dwm/patch/unfloatvisible.c new file mode 100644 index 00000000..8f0360de --- /dev/null +++ b/.local/src/dwm/patch/unfloatvisible.c @@ -0,0 +1,14 @@ +void +unfloatvisible(const Arg *arg) +{ + Client *c; + + for (c = selmon->clients; c; c = c->next) + if (ISVISIBLE(c) && c->isfloating) + c->isfloating = c->isfixed; + + if (arg && arg->v) + setlayout(arg); + else + arrange(selmon); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/unfloatvisible.h b/.local/src/dwm/patch/unfloatvisible.h new file mode 100644 index 00000000..690b6eff --- /dev/null +++ b/.local/src/dwm/patch/unfloatvisible.h @@ -0,0 +1 @@ +static void unfloatvisible(const Arg *arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/vanitygaps.c b/.local/src/dwm/patch/vanitygaps.c index 573f4ff3..dd579dec 100644 --- a/.local/src/dwm/patch/vanitygaps.c +++ b/.local/src/dwm/patch/vanitygaps.c @@ -1,4 +1,7 @@ /* Settings */ +#if !PERTAG_PATCH +static int enablegaps = 1; +#endif // PERTAG_PATCH static void setgaps(int oh, int ov, int ih, int iv) @@ -15,11 +18,68 @@ setgaps(int oh, int ov, int ih, int iv) arrange(selmon); } +#if IPC_PATCH || DWMC_PATCH +/* External function that takes one integer and splits it + * into four gap values: + * - outer horizontal (oh) + * - outer vertical (ov) + * - inner horizontal (ih) + * - inner vertical (iv) + * + * Each value is represented as one byte with the uppermost + * bit of each byte indicating whether or not to keep the + * current value. + * + * Example: + * + * 10000000 10000000 00001111 00001111 + * | | | | + * + keep oh + keep ov + ih 15px + iv 15px + * + * This gives an int of: + * 10000000100000000000111100001111 = 2155876111 + * + * Thus this command should set inner gaps to 15: + * xsetroot -name "fsignal:setgaps i 2155876111" + */ +static void +setgapsex(const Arg *arg) +{ + int oh = selmon->gappoh; + int ov = selmon->gappov; + int ih = selmon->gappih; + int iv = selmon->gappiv; + + if (!(arg->i & (1 << 31))) + oh = (arg->i & 0x7f000000) >> 24; + if (!(arg->i & (1 << 23))) + ov = (arg->i & 0x7f0000) >> 16; + if (!(arg->i & (1 << 15))) + ih = (arg->i & 0x7f00) >> 8; + if (!(arg->i & (1 << 7))) + iv = (arg->i & 0x7f); + + /* Auto enable gaps if disabled */ + #if PERTAG_PATCH + if (!selmon->pertag->enablegaps[selmon->pertag->curtag]) + selmon->pertag->enablegaps[selmon->pertag->curtag] = 1; + #else + if (!enablegaps) + enablegaps = 1; + #endif // PERTAG_PATCH + + setgaps(oh, ov, ih, iv); +} +#endif // IPC_PATCH | DWMC_PATCH static void togglegaps(const Arg *arg) { + #if PERTAG_PATCH selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag]; + #else + enablegaps = !enablegaps; + #endif // PERTAG_PATCH arrange(NULL); } @@ -106,11 +166,16 @@ incrivgaps(const Arg *arg) ); } +#if DRAGMFACT_PATCH || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT || GAPPLESSGRID_LAYOUT || NROWGRID_LAYOUT || HORIZGRID_LAYOUT || BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || GRIDMODE_LAYOUT || FLEXTILE_DELUXE_LAYOUT || TILE_LAYOUT || (VANITYGAPS_MONOCLE_PATCH && MONOCLE_LAYOUT) static void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) { unsigned int n, oe, ie; + #if PERTAG_PATCH oe = ie = selmon->pertag->enablegaps[selmon->pertag->curtag]; + #else + oe = ie = enablegaps; + #endif // PERTAG_PATCH Client *c; for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); @@ -124,3 +189,4 @@ getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) *iv = m->gappiv*ie; // inner vertical gap *nc = n; // number of clients } +#endif diff --git a/.local/src/dwm/patch/vanitygaps.h b/.local/src/dwm/patch/vanitygaps.h index e9390c88..c3eb6222 100644 --- a/.local/src/dwm/patch/vanitygaps.h +++ b/.local/src/dwm/patch/vanitygaps.h @@ -10,5 +10,10 @@ static void incrivgaps(const Arg *arg); static void togglegaps(const Arg *arg); /* Internals */ +#if DRAGMFACT_PATCH || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT || GAPPLESSGRID_LAYOUT || NROWGRID_LAYOUT || HORIZGRID_LAYOUT || BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || GRIDMODE_LAYOUT || FLEXTILE_DELUXE_LAYOUT || TILE_LAYOUT || (VANITYGAPS_MONOCLE_PATCH && MONOCLE_LAYOUT) static void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc); +#endif static void setgaps(int oh, int ov, int ih, int iv); +#if IPC_PATCH || DWMC_PATCH +static void setgapsex(const Arg *arg); +#endif // IPC_PATCH | DWMC_PATCH \ No newline at end of file diff --git a/.local/src/dwm/patch/warp.c b/.local/src/dwm/patch/warp.c new file mode 100644 index 00000000..41838187 --- /dev/null +++ b/.local/src/dwm/patch/warp.c @@ -0,0 +1,37 @@ +void +warp(const Client *c) +{ + Monitor *m; + Bar *bar; + int x, y; + + if (ignore_warp) + return; + + if (!c) { + XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww / 2, selmon->wy + selmon->wh / 2); + return; + } + + if (!getrootptr(&x, &y)) + return; + + if (!force_warp && + (x > c->x - c->bw && + y > c->y - c->bw && + x < c->x + c->w + c->bw*2 && + y < c->y + c->h + c->bw*2)) + return; + + force_warp = 0; + + for (m = mons; m; m = m->next) + for (bar = m->bar; bar; bar = bar->next) + if (x > bar->bx && + x < bar->bx + bar->bw && + y > bar->by && + y < bar->by + bar->bh) + return; + + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); +} diff --git a/.local/src/dwm/patch/warp.h b/.local/src/dwm/patch/warp.h new file mode 100644 index 00000000..6657dc11 --- /dev/null +++ b/.local/src/dwm/patch/warp.h @@ -0,0 +1 @@ +static void warp(const Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patch/winview.c b/.local/src/dwm/patch/winview.c index 3f6f8501..a73ee660 100644 --- a/.local/src/dwm/patch/winview.c +++ b/.local/src/dwm/patch/winview.c @@ -17,4 +17,4 @@ winview(const Arg* arg) a.ui = c->tags; view(&a); -} +} \ No newline at end of file diff --git a/.local/src/dwm/patch/winview.h b/.local/src/dwm/patch/winview.h index 620a3edf..a2405330 100644 --- a/.local/src/dwm/patch/winview.h +++ b/.local/src/dwm/patch/winview.h @@ -1 +1 @@ -static void winview(const Arg* arg); +static void winview(const Arg* arg); \ No newline at end of file diff --git a/.local/src/dwm/patch/xrdb.c b/.local/src/dwm/patch/xrdb.c new file mode 100644 index 00000000..e8633cd7 --- /dev/null +++ b/.local/src/dwm/patch/xrdb.c @@ -0,0 +1,125 @@ +void +loadxrdb() +{ + Display *display; + char * resm; + XrmDatabase xrdb; + char *type; + XrmValue value; + + display = XOpenDisplay(NULL); + + if (display != NULL) { + resm = XResourceManagerString(display); + + if (resm != NULL) { + xrdb = XrmGetStringDatabase(resm); + + if (xrdb != NULL) { + XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor); + XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor); + XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor); + XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor); + XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor); + XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor); + XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor); + XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor); + XRDB_LOAD_COLOR("dwm.titlenormfgcolor", titlenormfgcolor); + XRDB_LOAD_COLOR("dwm.titlenormbgcolor", titlenormbgcolor); + XRDB_LOAD_COLOR("dwm.titlenormbordercolor", titlenormbordercolor); + XRDB_LOAD_COLOR("dwm.titlenormfloatcolor", titlenormfloatcolor); + XRDB_LOAD_COLOR("dwm.titleselfgcolor", titleselfgcolor); + XRDB_LOAD_COLOR("dwm.titleselbgcolor", titleselbgcolor); + XRDB_LOAD_COLOR("dwm.titleselbordercolor", titleselbordercolor); + XRDB_LOAD_COLOR("dwm.titleselfloatcolor", titleselfloatcolor); + XRDB_LOAD_COLOR("dwm.tagsnormfgcolor", tagsnormfgcolor); + XRDB_LOAD_COLOR("dwm.tagsnormbgcolor", tagsnormbgcolor); + XRDB_LOAD_COLOR("dwm.tagsnormbordercolor", tagsnormbordercolor); + XRDB_LOAD_COLOR("dwm.tagsnormfloatcolor", tagsnormfloatcolor); + XRDB_LOAD_COLOR("dwm.tagsselfgcolor", tagsselfgcolor); + XRDB_LOAD_COLOR("dwm.tagsselbgcolor", tagsselbgcolor); + XRDB_LOAD_COLOR("dwm.tagsselbordercolor", tagsselbordercolor); + XRDB_LOAD_COLOR("dwm.tagsselfloatcolor", tagsselfloatcolor); + XRDB_LOAD_COLOR("dwm.hidfgcolor", hidfgcolor); + XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor); + XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor); + XRDB_LOAD_COLOR("dwm.hidfloatcolor", hidfloatcolor); + XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor); + XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor); + XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor); + XRDB_LOAD_COLOR("dwm.urgfloatcolor", urgfloatcolor); + #if BAR_FLEXWINTITLE_PATCH + XRDB_LOAD_COLOR("dwm.normTTBbgcolor", normTTBbgcolor); + XRDB_LOAD_COLOR("dwm.normLTRbgcolor", normLTRbgcolor); + XRDB_LOAD_COLOR("dwm.normMONObgcolor", normMONObgcolor); + XRDB_LOAD_COLOR("dwm.normGRIDbgcolor", normGRIDbgcolor); + XRDB_LOAD_COLOR("dwm.normGRD1bgcolor", normGRD1bgcolor); + XRDB_LOAD_COLOR("dwm.normGRD2bgcolor", normGRD2bgcolor); + XRDB_LOAD_COLOR("dwm.normGRDMbgcolor", normGRDMbgcolor); + XRDB_LOAD_COLOR("dwm.normHGRDbgcolor", normHGRDbgcolor); + XRDB_LOAD_COLOR("dwm.normDWDLbgcolor", normDWDLbgcolor); + XRDB_LOAD_COLOR("dwm.normSPRLbgcolor", normSPRLbgcolor); + XRDB_LOAD_COLOR("dwm.normfloatbgcolor", normfloatbgcolor); + XRDB_LOAD_COLOR("dwm.actTTBbgcolor", actTTBbgcolor); + XRDB_LOAD_COLOR("dwm.actLTRbgcolor", actLTRbgcolor); + XRDB_LOAD_COLOR("dwm.actMONObgcolor", actMONObgcolor); + XRDB_LOAD_COLOR("dwm.actGRIDbgcolor", actGRIDbgcolor); + XRDB_LOAD_COLOR("dwm.actGRD1bgcolor", actGRD1bgcolor); + XRDB_LOAD_COLOR("dwm.actGRD2bgcolor", actGRD2bgcolor); + XRDB_LOAD_COLOR("dwm.actGRDMbgcolor", actGRDMbgcolor); + XRDB_LOAD_COLOR("dwm.actHGRDbgcolor", actHGRDbgcolor); + XRDB_LOAD_COLOR("dwm.actDWDLbgcolor", actDWDLbgcolor); + XRDB_LOAD_COLOR("dwm.actSPRLbgcolor", actSPRLbgcolor); + XRDB_LOAD_COLOR("dwm.actfloatbgcolor", actfloatbgcolor); + XRDB_LOAD_COLOR("dwm.selTTBbgcolor", selTTBbgcolor); + XRDB_LOAD_COLOR("dwm.selLTRbgcolor", selLTRbgcolor); + XRDB_LOAD_COLOR("dwm.selMONObgcolor", selMONObgcolor); + XRDB_LOAD_COLOR("dwm.selGRIDbgcolor", selGRIDbgcolor); + XRDB_LOAD_COLOR("dwm.selGRD1bgcolor", selGRD1bgcolor); + XRDB_LOAD_COLOR("dwm.selGRD2bgcolor", selGRD2bgcolor); + XRDB_LOAD_COLOR("dwm.selGRDMbgcolor", selGRDMbgcolor); + XRDB_LOAD_COLOR("dwm.selHGRDbgcolor", selHGRDbgcolor); + XRDB_LOAD_COLOR("dwm.selDWDLbgcolor", selDWDLbgcolor); + XRDB_LOAD_COLOR("dwm.selSPRLbgcolor", selSPRLbgcolor); + XRDB_LOAD_COLOR("dwm.selfloatbgcolor", selfloatbgcolor); + #endif // BAR_FLEXWINTITLE_PATCH + #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH && BAR_STATUS2D_PATCH + XRDB_LOAD_COLOR("color0", termcol0); + XRDB_LOAD_COLOR("color1", termcol1); + XRDB_LOAD_COLOR("color2", termcol2); + XRDB_LOAD_COLOR("color3", termcol3); + XRDB_LOAD_COLOR("color4", termcol4); + XRDB_LOAD_COLOR("color5", termcol5); + XRDB_LOAD_COLOR("color6", termcol6); + XRDB_LOAD_COLOR("color7", termcol7); + XRDB_LOAD_COLOR("color8", termcol8); + XRDB_LOAD_COLOR("color9", termcol9); + XRDB_LOAD_COLOR("color10", termcol10); + XRDB_LOAD_COLOR("color11", termcol11); + XRDB_LOAD_COLOR("color12", termcol12); + XRDB_LOAD_COLOR("color13", termcol13); + XRDB_LOAD_COLOR("color14", termcol14); + XRDB_LOAD_COLOR("color15", termcol15); + #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH + } + } + } + + XCloseDisplay(display); +} + +void +xrdb(const Arg *arg) +{ + loadxrdb(); + int i; + for (i = 0; i < LENGTH(colors); i++) + scheme[i] = drw_scm_create(drw, colors[i], + #if BAR_ALPHA_PATCH + alphas[i], + #endif // BAR_ALPHA_PATCH + ColCount + ); + focus(NULL); + arrange(NULL); +} \ No newline at end of file diff --git a/.local/src/dwm/patch/xrdb.h b/.local/src/dwm/patch/xrdb.h new file mode 100644 index 00000000..304f2e22 --- /dev/null +++ b/.local/src/dwm/patch/xrdb.h @@ -0,0 +1,21 @@ +#include + +#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \ + if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \ + int i = 1; \ + for (; i <= 6; i++) { \ + if (value.addr[i] < 48) break; \ + if (value.addr[i] > 57 && value.addr[i] < 65) break; \ + if (value.addr[i] > 70 && value.addr[i] < 97) break; \ + if (value.addr[i] > 102) break; \ + } \ + if (i == 7) { \ + strncpy(V, value.addr, 7); \ + V[7] = '\0'; \ + } \ + } \ + } + +static void loadxrdb(void); +static void xrdb(const Arg *arg); + diff --git a/.local/src/dwm/patch/zoomswap.c b/.local/src/dwm/patch/zoomswap.c new file mode 100644 index 00000000..d7f57c4f --- /dev/null +++ b/.local/src/dwm/patch/zoomswap.c @@ -0,0 +1,13 @@ + +#if !PERTAG_PATCH +static Client *prevzoom = NULL; +#endif // PERTAG_PATCH + +Client * +findbefore(Client *c) { + Client *p; + if (!c || c == c->mon->clients) + return NULL; + for (p = c->mon->clients; p && p->next != c; p = p->next); + return p; +} \ No newline at end of file diff --git a/.local/src/dwm/patch/zoomswap.h b/.local/src/dwm/patch/zoomswap.h new file mode 100644 index 00000000..21cc8487 --- /dev/null +++ b/.local/src/dwm/patch/zoomswap.h @@ -0,0 +1 @@ +static Client *findbefore(Client *c); \ No newline at end of file diff --git a/.local/src/dwm/patches.def.h b/.local/src/dwm/patches.def.h new file mode 100644 index 00000000..0a27b1cc --- /dev/null +++ b/.local/src/dwm/patches.def.h @@ -0,0 +1,1178 @@ +/* + * This file contains patch control flags. + * + * In principle you should be able to mix and match any patches + * you may want. In cases where patches are logically incompatible + * one patch may take precedence over the other as noted in the + * relevant descriptions. + * + * Although layouts typically come as patches they are differentiated + * here for grouping purposes. + */ + +/** + * Bar modules + */ + +/* Enhanced taskbar that shows the titles of all visible windows in the status bar + * and allows focus / hiding / unhiding of windows by clicking on the status bar. + * Awesomebar takes precedence over fancybar. + * https://dwm.suckless.org/patches/awesomebar/ + */ +#define BAR_AWESOMEBAR_PATCH 0 + +/* This patch depends on statuscmd patch and adds integration with a (patched) dwmblocks + * instance to give a clickable status bar. + * Patch: https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea + * dwmblocks: https://github.com/torrinfail/dwmblocks + */ +#define BAR_DWMBLOCKS_PATCH 0 + +/* This patch shows the titles of all visible windows in the status bar + * (as opposed to showing only the selected one). + * Awesomebar takes precedence over fancybar. Fancybar takes precedence over + * the centeredwindowname patch. + * https://dwm.suckless.org/patches/fancybar/ + */ +#define BAR_FANCYBAR_PATCH 0 + +/* Being an evolution of the bartabgroups patch the flexwintitle patch specifically + * taps into the many layout options that flextile-deluxe offers to produce a window + * title section in the bar that is representative of what is shown on screen. + */ +#define BAR_FLEXWINTITLE_PATCH 0 + +/* This patch adds a context menu for layout switching. + * - xmenu needs to be installed. + * - Edit layoutmenu.sh with the installed layouts and with correct indexes. + * - Place layoutmenu.sh in PATH. + * - The text of the menu items is for display only. Name them however you want. + * https://dwm.suckless.org/patches/layoutmenu/ + */ +#define BAR_LAYOUTMENU_PATCH 0 + +/* Show layout symbol in bar */ +#define BAR_LTSYMBOL_PATCH 1 + +/* Adds powerline arrows for the status. + * This uses statuscolors logic for choosing colors for the powerline. As these markers + * are also control characters there is no explicit statuscmd support for this patch. + * + * Powerline separators are defined as: + * |\xXX (creates a hard edge) + * <\xXX (creates a less than arrow) + * /\xXX (creates a diagonal line) + * + * Examples: + * xsetroot -name "$(echo -e '<\x01a<\x02b<\x03c')" + * xsetroot -name "$(echo -e '/\x01d/\x02d/\x03f')" + * + * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 + * https://dwm.suckless.org/patches/statuscolors/ + */ +#define BAR_POWERLINE_STATUS_PATCH 0 + +/* Adds powerline arrows for the tags. + * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 + */ +#define BAR_POWERLINE_TAGS_PATCH 0 + +/* Alters the tags powerline to use forward slash instead of arrows */ +#define BAR_POWERLINE_TAGS_SLASH_PATCH 0 + +/* This patch turns the titlebar area into a mfact-respecting tabbar showing each client's title. + * https://dwm.suckless.org/patches/bartabgroups/ + */ +#define BAR_TABGROUPS_PATCH 0 + +/* This patch adds an option to place tags in rows like in many other window managers. + * https://dwm.suckless.org/patches/taggrid/ + */ +#define BAR_TAGGRID_PATCH 0 + +/* Show status in bar */ +#define BAR_STATUS_PATCH 1 + +/* This patch adds a clickable button to the left hand side of the statusbar. + * https://dwm.suckless.org/patches/statusbutton/ + */ +#define BAR_STATUSBUTTON_PATCH 0 + +/* This patch adds the ability to execute shell commands based on the mouse button and position + * when clicking the status bar. Refer to the website for usage. + * https://dwm.suckless.org/patches/statuscmd/ + */ +#define BAR_STATUSCMD_PATCH 0 + +/* Status2d allows colors and rectangle drawing in your dwm status bar. + * This patch is incompatible with the statuscolors patch which takes precedence. + * This patch is incompatible with the extrabar patch. + * https://dwm.suckless.org/patches/status2d/ + */ +#define BAR_STATUS2D_PATCH 0 + +/* Supplementary patch should you want to disable alpha for the status2d section */ +#define BAR_STATUS2D_NO_ALPHA_PATCH 0 + +/* Addition to the status2d patch that allows the use of terminal colors (color0 through color15) + * from xrdb in the status, allowing programs like pywal to change statusbar colors. + * This adds the C and B codes to use terminal foreground and background colors respectively. + * E.g. ^B5^ would use color5 as the background color. + * https://dwm.suckless.org/patches/status2d/ + */ +#define BAR_STATUS2D_XRDB_TERMCOLORS_PATCH 0 + +/* The systray patch adds systray for the status bar. + * https://dwm.suckless.org/patches/systray/ + */ +#define BAR_SYSTRAY_PATCH 0 + +/* Show tag symbols in bar */ +#define BAR_TAGS_PATCH 1 + +/* Show window title in bar */ +#define BAR_WINTITLE_PATCH 1 + +/* Shows window titles in the bar, but only for floating clients. + * This depends on code from the flexwintitle patch. + * Note that the configuration in config.def.h for this is merely an example. If combined + * with the corresponding hidden patch then these two will overlap unless the width of the + * modules are controlled. + */ +#define BAR_WINTITLE_FLOATING_PATCH 0 + +/* Shows window titles in the bar, but only for floating clients. + * This depends on code from the flexwintitle patch. + * Note that the configuration in config.def.h for this is merely an example. If combined + * with the corresponding floating patch then these two will overlap unless the width of the + * modules are controlled. + */ +#define BAR_WINTITLE_HIDDEN_PATCH 0 + +/* Title bar modules such as wintitle (default), fancybar and awesomebar + * do not by default add left and/or right padding as they take up the + * remaining space. These options allow you explicitly add padding should + * you need it. + */ +#define BAR_TITLE_RIGHT_PAD_PATCH 0 +#define BAR_TITLE_LEFT_PAD_PATCH 1 + +/** + * Bar options + */ + +/* This patch changes the rectangle indicating if a tag is used by a client into a bar + * above the tag name for better visibility. + * Set the tagindicatortype variable in config.h to INDICATOR_TOP_BAR to enable this. + * https://dwm.suckless.org/patches/activetagindicatorbar/ + */ +#define BAR_ACTIVETAGINDICATORBAR_PATCH N/A + +/* Alternative patch to the activetagindicatorbar patch, adds the bar below the tag + * icon rather than above. + * Set the tagindicatortype variable in config.h to INDICATOR_BOTTOM_BAR to enable this. + */ +#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH N/A + +/* The alpha patch adds transparency for the status bar. + * You need to uncomment the corresponding line in config.mk to use the -lXrender library + * when including this patch. + * https://dwm.suckless.org/patches/alpha/ + */ +#define BAR_ALPHA_PATCH 0 + +/* This patch introduces alternative tags which can be switched on the fly for the + * sole purpose of providing visual aid. + * https://dwm.suckless.org/patches/alternativetags/ + */ +#define BAR_ALTERNATIVE_TAGS_PATCH 0 + +/* This patches provides the ability to use alternative text for tags which contain at + * least one window. + * https://dwm.suckless.org/patches/alttagsdecoration/ + */ +#define BAR_ALTTAGSDECORATION_PATCH 0 + +/* This patch enables dwm to manage external status bars such as lemonbar and polybar. + * dwm treats the external bar as it would its own, so all regular dwm commands such as + * togglebar affect the external bar in the same way. + * + * NB: Unless you want both anybar + dwm bar(s) then the recommendation is to disable all + * bar modules and have { 0 } in the barrules. + * + * https://dwm.suckless.org/patches/anybar/ + */ +#define BAR_ANYBAR_PATCH 0 + +/* This patch adds a border around the status bar(s) just like the border of client windows. + * https://codemadness.org/paste/dwm-border-bar.patch + */ +#define BAR_BORDER_PATCH 0 + +/* This patch centers the WM_NAME of the currently selected window on the status bar. + * This is compatible with the wintitle, bartabgroups, flexwintitle and awesomebar bar + * modules. + * https://dwm.suckless.org/patches/centeredwindowname/ + */ +#define BAR_CENTEREDWINDOWNAME_PATCH 0 + +/* Draws a dot indicator overlayed on each tag icon for each client. The selected client + * is drawn as a larger horizontal line. + * Set the tagindicatortype variable in config.h to INDICATOR_CLIENT_DOTS to enable this. + * https://dwm.suckless.org/patches/clientindicators/ + */ +#define BAR_CLIENTINDICATOR_PATCH N/A + +/* This patch enables color emoji in dwm by removing a workaround for a BadLength error + * in the Xft library when color glyphs are used. + * To enable this you will need an updated Xft library that can handle color glyphs otherwise + * dwm will crash on encountering such characters. Note that you will also need a font that + * provides color emojis for this to work. + */ +#define BAR_COLOR_EMOJI_PATCH 0 + +/* Updates the position of dmenu to match that of the bar. I.e. if topbar is 0 then dmenu + * will appear at the bottom and if 1 then dmenu will appear at the top. + * https://dwm.suckless.org/patches/dmenumatchtop + */ +#define BAR_DMENUMATCHTOP_PATCH 0 + +/* Originally this was the extrabar patch, but as the handling of extra bars is now built-in + * only the splitting of the status by a designated separator remains. As such this has been + * renamed to more accurately reflect what it does - creating an extra status. + * https://dwm.suckless.org/patches/extrabar/ + */ +#define BAR_EXTRASTATUS_PATCH 0 + +/* Adds EWMH support for _NET_NUMBER_OF_DESKTOPS, _NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES + * and _NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs + * that request workspace information. For example polybar's xworkspaces module. + * + * This patch also includes support for adding the _IS_FLOATING property for floating windows + * allowing for compositors to treat floating windows differently to tiled windows. + * + * E.g. this setting makes picom only render shadows for floating windows: + * + * shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ]; + * + * https://github.com/bakkeby/dwm-flexipatch/issues/50 (_IS_FLOATING patch) + * https://dwm.suckless.org/patches/ewmhtags/ + */ +#define BAR_EWMHTAGS_PATCH 0 + +/* 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 + +/* This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the bar. + * https://dwm.suckless.org/patches/hide_vacant_tags/ + */ +#define BAR_HIDEVACANTTAGS_PATCH 0 + +/* With this patch dwm's built-in status bar is only shown when HOLDKEY is pressed + * and the bar will now overlay the display. + * http://dwm.suckless.org/patches/holdbar/ + */ +#define BAR_HOLDBAR_PATCH 0 + +/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji). + * This patch is essentially a hack to ignore any errors when drawing text on the status bar. + * https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww + * https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0 + */ +#define BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0 + +/* This patch adds vertical and horizontal space between the statusbar and the edge of the screen. + * https://dwm.suckless.org/patches/barpadding/ + */ +#define BAR_PADDING_PATCH 0 + +/* This patch adds simple markup for status messages using pango markup. + * This depends on the pango library v1.44 or greater. + * You need to uncomment the corresponding lines in config.mk to use the pango libraries + * when including this patch. + * + * Note that the pango patch does not protect against the BadLength error from Xft + * when color glyphs are used, which means that dwm will crash if color emoji is used. + * + * If you need color emoji then you may want to install this patched library from the AUR: + * https://aur.archlinux.org/packages/libxft-bgra/ + * + * A long term fix for the libXft library is pending approval of this pull request: + * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1 + * + * Also see: + * https://developer.gnome.org/pygtk/stable/pango-markup-language.html + * https://lists.suckless.org/hackers/2004/17285.html + * https://dwm.suckless.org/patches/pango/ + */ +#define BAR_PANGO_PATCH 0 + +/* 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. + * This patch is incompatible with and takes precedence over the status2d patch. + * https://dwm.suckless.org/patches/statuscolors/ + */ +#define BAR_STATUSCOLORS_PATCH 0 + +/* This patch adds configuration options for horizontal and vertical padding in the status bar. + * https://dwm.suckless.org/patches/statuspadding/ + */ +#define BAR_STATUSPADDING_PATCH 0 + +/* This patch adds the ability for dwm to read colors from the linux virtual console. + * /sys/module/vt/parameters/default_{red,grn,blu} + * Essentially this way the colors you use in your regular tty is "mirrored" to dwm. + * https://dwm.suckless.org/patches/vtcolors/ + */ +#define BAR_VTCOLORS_PATCH 0 + +/* This patch allows client windows to be hidden. This code was originally part of awesomebar, + * but has been separated out so that other bar modules can take advantage of it. + * Both awesomebar and bartabgroups patches depend on this patch and it will be auto-enabled + * during compile time if it is needed. Note that if using flexipatch-finalizer this must be + * explicitly enabled. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-barmodules-wintitleactions-6.2.diff + */ +#define BAR_WINTITLEACTIONS_PATCH BAR_AWESOMEBAR_PATCH || BAR_TABGROUPS_PATCH || BAR_FLEXWINTITLE_PATCH + +/*** + * Other patches + */ + +/* This patch allows windows to be resized with its aspect ratio remaining constant. + * https://dwm.suckless.org/patches/aspectresize/ + */ +#define ASPECTRESIZE_PATCH 0 + +/* This patch prevents the focus to drift from the active fullscreen client when + * using focusstack(). + * https://dwm.suckless.org/patches/alwaysfullscreen/ + */ +#define ALWAYSFULLSCREEN_PATCH 0 + +/* This patch adds new clients above the selected client, instead of always + * becoming the new master. This behaviour is known from Xmonad. + * This patch takes precedence over ATTACHASIDE_PATCH. + * https://dwm.suckless.org/patches/attachabove/ + */ +#define ATTACHABOVE_PATCH 0 + +/* This patch adds new clients on top of the stack. + * This patch takes precedence over ATTACHBELOW_PATCH. + * https://dwm.suckless.org/patches/attachaside/ + */ +#define ATTACHASIDE_PATCH 0 + +/* 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 + +/* This patch adds new clients at the bottom of the stack. + * https://dwm.suckless.org/patches/attachbottom/ + */ +#define ATTACHBOTTOM_PATCH 0 + +/* This patch will make dwm run "~/.local/share/dwm/autostart_blocking.sh" and + * "~/.local/share/dwm/autostart.sh &" before entering the handler loop. One or + * both of these files can be ommited. Note the path inside .local/share rather + * than the original ~/.dwm folder. + * https://dwm.suckless.org/patches/autostart/ + */ +#define AUTOSTART_PATCH 0 + +/* By default, windows that are not visible when requesting a resize/move will not + * get resized/moved. With this patch, they will. + * https://dwm.suckless.org/patches/autoresize/ + */ +#define AUTORESIZE_PATCH 0 + +/* This patch adds an iscentered rule to automatically center clients on the current monitor. + * This patch takes precedence over centeredwindowname and fancybar patches. + * https://dwm.suckless.org/patches/center/ + */ +#define CENTER_PATCH 0 + +/* 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. + * It should be noted that in dwm transient windows are not subject to normal client rules + * and they are always floating by default. + * This patch centers transient windows on the screen like the center patch does. Note that + * the 6.2 center patch piggy-backed on the updatewindowtype function to ensure that all + * dialog boxes were centered, transient or not. This function was removed in relation to + * adding wintype as a client rule filter, hence this no longer works out of the box. This + * patch restores previous behaviour with the center patch. + */ +#define CENTER_TRANSIENT_WINDOWS_PATCH 0 + +/* As above, except that the transient window is centered within the position of the parent + * window, rather than at the center of the screen. This takes precedence over the above patch. + */ +#define CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH 0 + +/* This patch provides the ability to assign different weights to clients in their + * respective stack in tiled layout. + * https://dwm.suckless.org/patches/cfacts/ + */ +#define CFACTS_PATCH 0 + +/* This patch allows color attributes to be set through the command line. + * https://dwm.suckless.org/patches/cmdcustomize/ + */ +#define CMDCUSTOMIZE_PATCH 0 + +/* This patch tweaks the tagging interface so that you can select multiple tags for tag + * or view by pressing all the right keys as a combo. For example to view tags 1 and 3, + * hold MOD and then press and hold 1 and 3 together. + * https://dwm.suckless.org/patches/combo/ + */ +#define COMBO_PATCH 0 + +/* Allow dwm to execute commands from autostart array in your config.h file. When dwm exits + * then all processes from autostart array will be killed. + * https://dwm.suckless.org/patches/cool_autostart/ + */ +#define COOL_AUTOSTART_PATCH 0 + +/* The cyclelayouts patch lets you cycle through all your layouts. + * https://dwm.suckless.org/patches/cyclelayouts/ + */ +#define CYCLELAYOUTS_PATCH 0 + +/* 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 + * decorations. + * Not respecting this property leads to issues with applications that draw their own borders, + * 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 + +/* Similarly to the dragmfact patch this allows you to click and drag clients to change the + * cfact to adjust the client's size in the stack. This patch depends on the cfacts patch. + */ +#define DRAGCFACT_PATCH 0 + +/* This patch lets you resize the split in the tile layout (i.e. modify mfact) by holding + * the modkey and dragging the mouse. + * This patch can be a bit wonky with other layouts, but generally works. + * https://dwm.suckless.org/patches/dragmfact/ + */ +#define DRAGMFACT_PATCH 0 + +/* Simple dwmc client using a fork of fsignal to communicate with dwm. + * To use this either copy the patch/dwmc shell script to somewhere in your path or + * uncomment the following line in Makefile: + * #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin + * http://dwm.suckless.org/patches/dwmc/ + */ +#define DWMC_PATCH 0 + +/* 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 + * it will be opened on the first tag. + * https://dwm.suckless.org/patches/emptyview/ + */ +#define EMPTYVIEW_PATCH 0 + +/* This patch allows the user to change size and placement of floating windows using only the + * keyboard. It also allows for temporary vertical and horizontal extension of windows similar + * to other WMs fill command. + * https://dwm.suckless.org/patches/exresize/ + */ +#define EXRESIZE_PATCH 0 + +/* Only allow clients to "fullscreen" into the space currently given to them. + * As an example, this will allow you to view a fullscreen video in your browser on + * one half of the screen, while having the other half available for other tasks. + * This patch takes precedence over the fakefullscreen client patch below. + * https://dwm.suckless.org/patches/fakefullscreen/ + */ +#define FAKEFULLSCREEN_PATCH 0 + +/* Similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into + * the space currently given to them. + * The "twist" with this patch is that fake fullscreen can be toggled on a per client basis + * rather than applying to all clients globally. + * Also see the selectivefakefullscreen option that adds a rule option to enabled this on client + * startup. + */ +#define FAKEFULLSCREEN_CLIENT_PATCH 0 + +/* 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 + * exresize, moveresize, and moveplace patches. + * The size and position can be specified using absolute, relative or fixed co-ordinates and + * https://github.com/bakkeby/patches/wiki/floatpos/ + */ +#define FLOATPOS_PATCH 0 + +/* Add-on functionality for the above: make the float positions respect outer (vanity)gaps. */ +#define FLOATPOS_RESPECT_GAPS_PATCH 0 + +/* This patch provides the ability to focus the tag on the immediate left or right of the + * currently focused tag. It also allows to send the focused window either on the left or + * the right tag. + * http://dwm.suckless.org/patches/focusadjacenttag/ + */ +#define FOCUSADJACENTTAG_PATCH 0 + +/* Allows focusing on clients based on direction (up, down, left, right) instead of client order. + * https://github.com/bakkeby/patches/wiki/focusdir/ + */ +#define FOCUSDIR_PATCH 0 + +/* A simple patch that just puts focus back to the master client. + * https://dwm.suckless.org/patches/focusmaster/ + */ +#define FOCUSMASTER_PATCH 0 + +/* Switch focus only by mouse click and not sloppy (focus follows mouse pointer). + * https://dwm.suckless.org/patches/focusonclick/ + */ +#define FOCUSONCLICK_PATCH 0 + +/* Selects the next window having the urgent flag regardless of the tag it is on. + * The urgent flag can be artificially set with the following xdotool command on any window: + * xdotool selectwindow -- set_window --urgency 1 + * https://dwm.suckless.org/patches/focusurgent/ + */ +#define FOCUSURGENT_PATCH 0 + +/* By default, dwm responds to _NET_ACTIVE_WINDOW client messages by setting + * the urgency bit on the named window. This patch activates the window instead. + * https://dwm.suckless.org/patches/focusonnetactive/ + */ +#define FOCUSONNETACTIVE_PATCH 0 + +/* Send "fake signals" to dwm for handling, using xsetroot. This will not conflict with the + * status bar, which also is managed using xsetroot. + * Also see the dwmc patch, which takes precedence over this patch. + * https://dwm.suckless.org/patches/fsignal/ + */ +#define FSIGNAL_PATCH 0 + +/* Applies the monocle layout with the focused client on top and hides the bar. When pressed + * 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 + +/* This patch provides a keybinding to rotate all clients in the currently selected + * area (master or stack) without affecting the other area. + * https://dwm.suckless.org/patches/inplacerotate/ + */ +#define INPLACEROTATE_PATCH 0 + +/* This patch lets you define custom insets from each edge of the screen. One use case would be + * to arrange space for an external bar. + * https://dwm.suckless.org/patches/insets/ + */ +#define INSETS_PATCH 0 + +/* This patch (v1.5.7) implements inter-process communication through a UNIX socket for dwm. This + * allows for the window manager to be queried for information, e.g. listen for events such as tag + * or layout changes, as well as send commands to control the window manager via other programs. + * + * You need to uncomment the corresponding lines in config.mk to use the -lyajl library + * when including this patch. + * This patch depends on the following additional library: + * - yajl + * + * https://github.com/mihirlad55/dwm-ipc + * https://dwm.suckless.org/patches/ipc/ + */ +#define IPC_PATCH 0 + +/* Adds rule option for clients to avoid accidental termination by killclient for sticky windows. + * https://dwm.suckless.org/patches/ispermanent/ + */ +#define ISPERMANENT_PATCH 0 + +/* This patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts + * can be performed. + * https://dwm.suckless.org/patches/keymodes/ + */ +#define KEYMODES_PATCH 0 + +/* This patch adds a keybinding to kills all visible clients that are not selected. + * https://dwm.suckless.org/patches/killunsel/ + */ +#define KILLUNSEL_PATCH 0 + +/* By default in dwm it is possible to make an application fullscreen, then use + * the focusstack keybindings to focus on other windows beneath the current window. + * It is also possible to spawn new windows (e.g. a terminal) that end up getting + * focus while the previous window remains in fullscreen. This patch ensures that + * 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 + +/* This patch adds helper functions for maximizing, horizontally and vertically, floating + * windows using keybindings. + * https://dwm.suckless.org/patches/maximize/ + */ +#define MAXIMIZE_PATCH 0 + +/* Control Music Player Daemon via keybinds. + * You need to uncomment the corresponding line in config.mk to use the -lmpdclient library + * when including this patch. + * This patch depends on the following additional library: + * - libmpdclient + * https://dwm.suckless.org/patches/mpdcontrol/ + */ +#define MPDCONTROL_PATCH 0 + +/* Adds rules per monitor, e.g. have default layouts per monitor. + * The use case for this is if the second monitor is vertical (i.e. rotated) then + * you may want to use a different default layout for this monitor than what is + * used for the main monitor. E.g. normal vertical split for main monitor and + * horizontal split for the second. + */ +#define MONITOR_RULES_PATCH 0 + +/* Always display the the monocle-symbol as defined in config.h if the monocle-layout + * is activated. Do not display the number of open clients in the current tag. + * https://dwm.suckless.org/patches/monoclesymbol/ + */ +#define MONOCLESYMBOL_PATCH 0 + +/* Makes a window floating and 1/3rd the height and 1/3rd the width of the screen and is + * positioned in either the center or one of the 8 cardinal directions depending on which + * key is pressed. + * https://dwm.suckless.org/patches/moveplace/ + */ +#define MOVEPLACE_PATCH 0 + +/* This patch allows you to move and resize dwm's clients using keyboard bindings. + * https://dwm.suckless.org/patches/moveresize/ + */ +#define MOVERESIZE_PATCH 0 + +/* This patch allows you to move clients around in the stack and swap them with the master. + * https://dwm.suckless.org/patches/movestack/ + */ +#define MOVESTACK_PATCH 0 + +/* Adds support for the _NET_CLIENT_LIST_STACKING atom, needed by certain applications like the + * Zoom video conferencing application. + * https://github.com/bakkeby/patches/wiki/netclientliststacking/ + */ +#define NET_CLIENT_LIST_STACKING_PATCH 0 + +/* Removes the border when there is only one window visible. + * https://dwm.suckless.org/patches/noborder/ + */ +#define NOBORDER_PATCH 0 + +/* 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. + * https://dwm.suckless.org/patches/nodmenu/ + */ +#define NODMENU_PATCH 0 + +/* This patch allows for toggleable client button bindings that have no modifiers. + * This can, for example, allow you to move or resize using the mouse alone without holding + * down a modifier key. This can be practical if you have extra buttons on your mouse. + * While you can use button bindings with no modifiers without this patch in a bare dwm, + * those buttons are then unavailable for use within the application itself so being able to + * toggle these on and off can be necessary in certain situations (e.g. being able to use + * back and forward buttons in a browser). + + * Example bindings: + * { ClkClientWin, 0, Button8, movemouse, {0} }, + * { ClkClientWin, 0, Button9, resizemouse, {0} }, + */ +#define NO_MOD_BUTTONS_PATCH 0 + +/* When terminals have transparency then their borders also become transparent. + * This patch ensures that borders have no transparency. Note that this patch is + * only relevant if you are not using the alpha patch. + * https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8 + * https://dwm.suckless.org/patches/alpha/dwm-fixborders-6.2.diff + */ +#define NO_TRANSPARENT_BORDERS_PATCH 0 + +/* Port of InstantVM's on_empty_keys functionality allowing keybindings that apply only when + * a tag is empty. An example use case is being able to launch applications with first hand + * keys like "f" to launch firefox. + * + * https://github.com/instantOS/instantWM/ + * https://github.com/bakkeby/dwm-flexipatch/issues/51 + */ +#define ON_EMPTY_KEYS_PATCH 0 + +/* Minor patch that prevents more than one rule being matched for a given client. */ +#define ONLY_ONE_RULE_MATCH_PATCH 0 + +/* This patch makes it so dwm will only exit via quit() if no windows are open. + * This is to prevent you accidentally losing all your work. + * https://dwm.suckless.org/patches/onlyquitonempty/ + */ +#define ONLYQUITONEMPTY_PATCH 0 + +/* The pertag patch adds nmaster, mfacts and layouts per tag rather than per + * monitor (default). + * https://dwm.suckless.org/patches/pertag/ + */ +#define PERTAG_PATCH 0 + +/* This controls whether or not to also store bar position on a per + * tag basis, or leave it as one bar per monitor. + */ +#define PERTAGBAR_PATCH 0 + +/* This patch lets you change the position of a client in the stack using the mouse. + * https://github.com/bakkeby/patches/wiki/placemouse + */ +#define PLACEMOUSE_PATCH 0 + +/* This patch provides a way to move clients up and down inside the client list. + * https://dwm.suckless.org/patches/push/ + */ +#define PUSH_PATCH 0 + +/* This patch provides a way to move clients up and down inside the client list, + * but does not push up or down into the master area (except that it does not take + * nmaster into account). + * This takes precedence over the push patch above. + * https://dwm.suckless.org/patches/push/ + */ +#define PUSH_NO_MASTER_PATCH 0 + +/* Shifts all clients per tag to leftmost unoccupied tags. + * + * For example, if clients A, B, C are tagged on tags 1, 5, 9 respectively, when + * this function is called, they will now be on 1, 2, and 3. The focused client + * will also remain focused. + * + * Clients on multiple tags will be treated as if they only were only on their + * leftmost tag, and will be reduced to one tag after the operation is complete. + * https://dwm.suckless.org/patches/reorganizetags/ + */ +#define REORGANIZETAGS_PATCH 0 + +/* By default, windows only resize from the bottom right corner. With this + * patch the mouse is warped to the nearest corner and you resize from there. + * https://dwm.suckless.org/patches/resizecorners/ + */ +#define RESIZECORNERS_PATCH 0 + +/* Practically the same as resizecorners, but the cursor does not warp to corners. + * This takes precedence over the resizecorners patch. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-resizepoint-6.2.diff + */ +#define RESIZEPOINT_PATCH 0 + +/* Adds a keyboard shortcut to restart dwm or alternatively by using kill -HUP dwmpid. + * Additionally dwm can quit cleanly by using kill -TERM dwmpid. + * https://dwm.suckless.org/patches/restartsig/ + */ +#define RESTARTSIG_PATCH 0 + +/* Adds rio-like drawing to resize the selected client. + * This depends on an external tool slop being installed. + * This patch was backported from instantWM. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-riodraw-6.2.diff + */ +#define RIODRAW_PATCH 0 + +/* This patch let's you rotate through the stack using keyboard shortcuts. + * https://dwm.suckless.org/patches/rotatestack/ + */ +#define ROTATESTACK_PATCH 0 + +/* This patch adds rounded corners to client windows in dwm. + * You need to uncomment the corresponding line in config.mk to use the -lXext library + * when including this patch. You will also want to set "borderpx = 0;" in your config.h. + * https://github.com/mitchweaver/suckless/blob/master/dwm/patches_mitch/mitch-06-rounded_corners-db6093f6ec1bb884f7540f2512935b5254750b30.patch + */ +#define ROUNDED_CORNERS_PATCH 0 + +/* This patch saves size and position of every floating window before it is forced + * into tiled mode. If the window is made floating again then the old dimensions + * will be restored. + * https://dwm.suckless.org/patches/save_floats/ + */ +#define SAVEFLOATS_PATCH 0 + +/* The scratchpad patch allows you to spawn or restore floating terminal windows. + * It is typically useful when one need to do some short typing. + * + * Note that this patch changes TAGMASK to make room for special scratchpad tags, + * so ~0 does more than select all tags with this patch. Code that relies on ~0 to + * represent all tags should use ~SPTAGMASK instead. + * + * Upgraded to Christian Tenllado's multiple scratchpad version. + * https://lists.suckless.org/hackers/2004/17205.html + * https://dwm.suckless.org/patches/scratchpads/ + */ +#define SCRATCHPADS_PATCH 0 + +/* Minor alteration of the above allowing clients to keep their size and position when shown */ +#define SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH 0 + +/* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad + * feature in i3wm. + * https://github.com/GasparVardanyan/dwm-scratchpad + */ +#define SCRATCHPAD_ALT_1_PATCH 0 + +/* 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 + * with the fakefullscreenclient patch and offers no practical functionality without it. + * https://dwm.suckless.org/patches/selectivefakefullscreen/ + */ +#define SELECTIVEFAKEFULLSCREEN_PATCH 0 + +/* Allows restarting dwm without the dependency of an external script. + * https://dwm.suckless.org/patches/selfrestart/ + */ +#define SELFRESTART_PATCH 0 + +/* This patch allow clients to keep focus when being sent to another monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-sendmon_keepfocus-6.2.diff + */ +#define SENDMON_KEEPFOCUS_PATCH 0 + +/* This patch allows border pixels to be changed during runtime. + * https://dwm.suckless.org/patches/setborderpx/ + */ +#define SETBORDERPX_PATCH 0 + +/* This patch adds keybindings for left and right circular shift through tags. + * https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff + */ +#define SHIFTVIEW_PATCH 0 + +/* This variant of the shiftview patch adds left and right circular shift through tags, + * but skips tags where there are no clients. + */ +#define SHIFTVIEW_CLIENTS_PATCH 0 + +/* This patch makes dwm obey even "soft" sizehints for new clients. Any window + * that requests a specific initial size will be floated and set to that size. + * Unlike with "fixed size" windows, you are able to resize and/or unfloat these + * windows freely - only the initial state is affected. + * This version of the patch is honestly of limited utility since there are many + * clients that will abuse it. + * https://dwm.suckless.org/patches/sizehints/ + */ +#define SIZEHINTS_PATCH 0 + +/* This patch makes dwm obey even "soft" sizehints for new clients. This ruled + * version is essentially the same patch except it obeys the "isfloating" rule + * if it is available in config.h for the given client. + * https://dwm.suckless.org/patches/sizehints/ + */ +#define SIZEHINTS_RULED_PATCH 0 + +/* In a multi-head setup monitor 0 is by default the primary screen, with the left and right + * screen being monitor 1 and 2 respectively. This patch sorts screens left to right (or + * top to bottom in a vertical layout) which aims to address some inconsistencies when it + * comes to focusmon, tagmon and similar functionality. + * https://www.mail-archive.com/hackers@suckless.org/msg09400.html + */ +#define SORTSCREENS_PATCH 0 + +/* Spawns programs from currently focused client's working directory. + * https://dwm.suckless.org/patches/spawn_cwd/ + */ +#define SPAWNCMD_PATCH 0 + +/* This patch provides comprehensive utilities for managing the client stack, providing + * keyboard shortcuts for focusing or placing a client at specific positions in the stack. + * Note that the default keybindings for this patch have been changed in dwm-flexipatch + * due to the many conflicts with other patches. As it provides similar functionality to the + * swapfocus patch it also uses the MOD+s shortcut to focus the previously selected client, + * thus note a conflict between these two patches. + * https://dwm.suckless.org/patches/stacker/ + */ +#define STACKER_PATCH 0 + +/* Steam, and steam windows (games), trigger a ConfigureNotify request every time the window + * gets focus. More so, the configure event passed along from Steam tends to have the wrong + * x and y co-ordinates which can make the window, if floating, jump around the screen. + * + * This patch works around this age-old issue by ignoring the x and y co-ordinates for + * ConfigureNotify requests relating to Steam windows. + * + * https://github.com/bakkeby/patches/wiki/steam + */ +#define STEAM_PATCH 0 + +/* Adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags. + * https://dwm.suckless.org/patches/sticky/ + */ +#define STICKY_PATCH 0 + +/* This patch adds "window swallowing" to dwm as known from Plan 9's windowing system rio. + * Clients marked with isterminal in config.h swallow a window opened by any child process, + * e.g. running xclock in a terminal. Closing the xclock window restores the terminal window + * in the current position. + * + * This patch depends on the following additional libraries: + * - libxcb + * - Xlib-libxcb + * - xcb-res + * + * You need to uncomment the corresponding line in config.mk to use the above libraries when + * including this patch. + * + * https://dwm.suckless.org/patches/swallow/ + */ +#define SWALLOW_PATCH 0 + +/* This patch depends on the pertag patch and makes it possible to switch focus with a single + * shortcut (MOD+s) instead of having to think if you should use mod-j or mod-k for reaching + * the previously used window. + * https://dwm.suckless.org/patches/swapfocus/ + */ +#define SWAPFOCUS_PATCH 0 + +/* This patch allows swapping the contents of the currently selected tag with another tag using + * keyboard shortcuts. + * https://dwm.suckless.org/patches/swaptags/ + */ +#define SWAPTAGS_PATCH 0 + +/* Switch focus between the master and stack columns using a single keybinding. + * https://dwm.suckless.org/patches/switchcol/ + */ +#define SWITCHCOL_PATCH 0 + +/* By default dwm allow you to set application specific rules so that you can have your browser, + * for example, start up on tag 9 optionally on a given monitor when you open your browser it is + * then automatically moved to the configured tag, but you have to manually enable the tag to see + * the newly opened application. + * This patch adds an extra configuration option for individual rules where: + * 0 is default behaviour + * 1 automatically moves you to the tag of the newly opened application and + * 2 enables the tag of the newly opened application in addition to your existing enabled tags + * 3 as 1, but closing that window reverts the view back to what it was previously (*) + * 4 as 2, but closing that window reverts the view back to what it was previously (*) + * + * (*) except if the client has been moved between tags or to another monitor + * + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-switchtag-6.2.diff + * Also see https://dwm.suckless.org/patches/switchtotag + */ +#define SWITCHTAG_PATCH 0 + +/* Adds keyboard shortcuts to move all (or only floating) windows from one tag to another. + * https://dwm.suckless.org/patches/tagall/ + */ +#define TAGALL_PATCH 0 + +/* This patch allows you to move all visible windows on a monitor to an adjacent monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagallmon-6.2.diff + */ +#define TAGALLMON_PATCH 0 + +/* This patch makes new clients attach into the stack area when you toggle a new tag into + * view. This means your master area will remain unchanged when toggling views. + * The allmaster patch will cause all clients in the master area to be left alone. This patch + * takes precedence over the onemaster tagintostack patch. + * https://dwm.suckless.org/patches/tagintostack/ + */ +#define TAGINTOSTACK_ALLMASTER_PATCH 0 + +/* This patch makes new clients attach into the stack area when you toggle a new tag into + * view. This means your master area will remain unchanged when toggling views. + * The onemaster patch will cause the first client in the master area to be left alone. + * https://dwm.suckless.org/patches/tagintostack/ + */ +#define TAGINTOSTACK_ONEMASTER_PATCH 0 + +/* If you try to send a fullscreen window to an adjacent monitor using tagmon then + * the window is moved behind the scenes, but it remains in fullscreen on the original + * monitor until you exit fullscreen view (at which point it will appear on the adjacent + * monitor). This patch allows a fullscreen window to be moved to an adjacent monitor + * while remaining in fullscreen. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagmonfixfs-6.2.diff + */ +#define TAGMONFIXFS_PATCH 0 + +/* Add functions and keybindings to tag a window to a desired tag on the next (right) + * or previous (left) monitor from the currently selected monitor. + * https://dwm.suckless.org/patches/tagothermonitor/ + */ +#define TAGOTHERMONITOR_PATCH 0 + +/* This patch allows you to swap all visible windows on one monitor with those of an + * adjacent monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagswapmon-6.2.diff + */ +#define TAGSWAPMON_PATCH 0 + +/* This patch allows you to toggle fullscreen on and off using a single shortcut key. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-togglefullscreen-6.2.diff + */ +#define TOGGLEFULLSCREEN_PATCH 0 + +/* Lets you transfer the currently focused client between the master and stack area + * while increasing or decreasing the master area (nmaster) accordingly. + * https://dwm.suckless.org/patches/transfer/ + */ +#define TRANSFER_PATCH 0 + +/* Lets you transfer all clients between the master and stack area + * while increasing or decreasing the master area (nmaster) accordingly. + * https://dwm.suckless.org/patches/transfer/ + */ +#define TRANSFER_ALL_PATCH 0 + +/* This patch resets isfloating on any visible windows that have it set. + * Optionally also applies a layout. + * https://dwm.suckless.org/patches/unfloatvisible/ + */ +#define UNFLOATVISIBLE_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 + +/* 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 + * fullscreen mode, hence this is enabled separately from the main vanitygaps patch. + */ +#define VANITYGAPS_MONOCLE_PATCH 0 + +/* Follow a window to the tag it is being moved to. + * https://dwm.suckless.org/patches/viewontag/ + */ +#define VIEWONTAG_PATCH 0 + +/* By default tags can be changed using MOD+ while MOD+Tab toggles between the current and + * the previous tag. This patch changes this so that if you hit MOD+ for the tag you are + * currently on, then it works the same as MOD+Tab and switches back to the previous tag. + * Idea ref. + * https://www.reddit.com/r/suckless/comments/ik27vd/key_toggle_between_next_and_previous_tag_dwm/ + */ +#define VIEW_SAME_TAG_GIVES_PREVIOUS_TAG_PATCH 0 + +/* This patch warps the mouse cursor to the center of the currently focused window or screen + * when the mouse cursor is (a) on a different screen or (b) on top of a different window. + * https://dwm.suckless.org/patches/warp/ + */ +#define WARP_PATCH 0 + +/* Sometimes a single application opens different windows depending on the task + * at hand and this is often reflected in the WM_WINDOW_ROLE(STRING) x property. + * This patch adds the role field to the rule configuration so that one can + * differentiate between, say, Firefox "browser" vs "Preferences" vs "Manager" + * or Google-chrome "browser" vs "pop-up". + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-windowrolerule-6.2.diff + */ +#define WINDOWROLERULE_PATCH 0 + +/* The winview patch allows switching the view to that of a given client from the all-window + * view (Mod-0) using a keyboard shortcut. + * http://dwm.suckless.org/patches/winview/ + */ +#define WINVIEW_PATCH 0 + +/* Allows dwm to read colors from xrdb (.Xresources) during runtime. Compatible with + * the float border color, awesomebar, urgentborder and titlecolor patches. + * https://dwm.suckless.org/patches/xrdb/ + */ +#define XRDB_PATCH 0 + +/* 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/ + */ +#define ZOOMFLOATING_PATCH 0 + +/* The zoomswap patch allows a master and a stack window to swap places + * rather than every window on the screen changing position. + * https://dwm.suckless.org/patches/zoomswap/ + */ +#define ZOOMSWAP_PATCH 0 + +/** + * Layouts + */ + +/* Bottomstack layout. + * https://dwm.suckless.org/patches/bottomstack/ + */ +#define BSTACK_LAYOUT 0 + +/* Bottomstack horizontal layout. + * https://dwm.suckless.org/patches/bottomstack/ + */ +#define BSTACKHORIZ_LAYOUT 0 + +/* Centered master layout. + * https://dwm.suckless.org/patches/centeredmaster/ + */ +#define CENTEREDMASTER_LAYOUT 0 + +/* Centered floating master layout. + * https://dwm.suckless.org/patches/centeredmaster/ + */ +#define CENTEREDFLOATINGMASTER_LAYOUT 0 + +/* Same as the default tile layout except clients in the master area are arranged in + * columns (i.e. left to right). + * https://dwm.suckless.org/patches/columns/ + */ +#define COLUMNS_LAYOUT 0 + +/* Deck layout. + * https://dwm.suckless.org/patches/deck/ + */ +#define DECK_LAYOUT 0 + +/* Fibonacci dwindle layout. + * https://dwm.suckless.org/patches/fibonacci/ + */ +#define FIBONACCI_DWINDLE_LAYOUT 0 + +/* Fibonacci spiral layout. + * https://dwm.suckless.org/patches/fibonacci/ + */ +#define FIBONACCI_SPIRAL_LAYOUT 0 + +/* Flextile deluxe layout. + * A revamped, more flexible, and over-the-top version of the original flextile layout. + * https://dwm.suckless.org/patches/flextile/ (original) + */ +#define FLEXTILE_DELUXE_LAYOUT 0 + +/* Gappless grid layout. + * https://dwm.suckless.org/patches/gaplessgrid/ + */ +#define GAPPLESSGRID_LAYOUT 0 + +/* Gridmode (grid) layout. + * https://dwm.suckless.org/patches/gridmode/ + */ +#define GRIDMODE_LAYOUT 0 + +/* Horizontal grid (horizgrid) layout. + * https://dwm.suckless.org/patches/horizgrid/ + */ +#define HORIZGRID_LAYOUT 0 + +/* Grid layout where nmaster controls the number of rows. + * https://dwm.suckless.org/patches/nrowgrid/ + */ +#define NROWGRID_LAYOUT 0 + +/* The default tile layout. + * This can be optionally disabled in favour of other layouts. + */ +#define TILE_LAYOUT 1 + +/* Monocle layout (default). + * This can be optionally disabled in favour of other layouts. + */ +#define MONOCLE_LAYOUT 1 diff --git a/.local/src/dwm/patches.h b/.local/src/dwm/patches.h new file mode 100644 index 00000000..ca329bb5 --- /dev/null +++ b/.local/src/dwm/patches.h @@ -0,0 +1,1178 @@ +/* + * This file contains patch control flags. + * + * In principle you should be able to mix and match any patches + * you may want. In cases where patches are logically incompatible + * one patch may take precedence over the other as noted in the + * relevant descriptions. + * + * Although layouts typically come as patches they are differentiated + * here for grouping purposes. + */ + +/** + * Bar modules + */ + +/* Enhanced taskbar that shows the titles of all visible windows in the status bar + * and allows focus / hiding / unhiding of windows by clicking on the status bar. + * Awesomebar takes precedence over fancybar. + * https://dwm.suckless.org/patches/awesomebar/ + */ +#define BAR_AWESOMEBAR_PATCH 0 + +/* This patch depends on statuscmd patch and adds integration with a (patched) dwmblocks + * instance to give a clickable status bar. + * Patch: https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea + * dwmblocks: https://github.com/torrinfail/dwmblocks + */ +#define BAR_DWMBLOCKS_PATCH 1 + +/* This patch shows the titles of all visible windows in the status bar + * (as opposed to showing only the selected one). + * Awesomebar takes precedence over fancybar. Fancybar takes precedence over + * the centeredwindowname patch. + * https://dwm.suckless.org/patches/fancybar/ + */ +#define BAR_FANCYBAR_PATCH 0 + +/* Being an evolution of the bartabgroups patch the flexwintitle patch specifically + * taps into the many layout options that flextile-deluxe offers to produce a window + * title section in the bar that is representative of what is shown on screen. + */ +#define BAR_FLEXWINTITLE_PATCH 0 + +/* This patch adds a context menu for layout switching. + * - xmenu needs to be installed. + * - Edit layoutmenu.sh with the installed layouts and with correct indexes. + * - Place layoutmenu.sh in PATH. + * - The text of the menu items is for display only. Name them however you want. + * https://dwm.suckless.org/patches/layoutmenu/ + */ +#define BAR_LAYOUTMENU_PATCH 1 + +/* Show layout symbol in bar */ +#define BAR_LTSYMBOL_PATCH 1 + +/* Adds powerline arrows for the status. + * This uses statuscolors logic for choosing colors for the powerline. As these markers + * are also control characters there is no explicit statuscmd support for this patch. + * + * Powerline separators are defined as: + * |\xXX (creates a hard edge) + * <\xXX (creates a less than arrow) + * /\xXX (creates a diagonal line) + * + * Examples: + * xsetroot -name "$(echo -e '<\x01a<\x02b<\x03c')" + * xsetroot -name "$(echo -e '/\x01d/\x02d/\x03f')" + * + * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 + * https://dwm.suckless.org/patches/statuscolors/ + */ +#define BAR_POWERLINE_STATUS_PATCH 0 + +/* Adds powerline arrows for the tags. + * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 + */ +#define BAR_POWERLINE_TAGS_PATCH 0 + +/* Alters the tags powerline to use forward slash instead of arrows */ +#define BAR_POWERLINE_TAGS_SLASH_PATCH 0 + +/* This patch turns the titlebar area into a mfact-respecting tabbar showing each client's title. + * https://dwm.suckless.org/patches/bartabgroups/ + */ +#define BAR_TABGROUPS_PATCH 0 + +/* This patch adds an option to place tags in rows like in many other window managers. + * https://dwm.suckless.org/patches/taggrid/ + */ +#define BAR_TAGGRID_PATCH 0 + +/* Show status in bar */ +#define BAR_STATUS_PATCH 1 + +/* This patch adds a clickable button to the left hand side of the statusbar. + * https://dwm.suckless.org/patches/statusbutton/ + */ +#define BAR_STATUSBUTTON_PATCH 0 + +/* This patch adds the ability to execute shell commands based on the mouse button and position + * when clicking the status bar. Refer to the website for usage. + * https://dwm.suckless.org/patches/statuscmd/ + */ +#define BAR_STATUSCMD_PATCH 1 + +/* Status2d allows colors and rectangle drawing in your dwm status bar. + * This patch is incompatible with the statuscolors patch which takes precedence. + * This patch is incompatible with the extrabar patch. + * https://dwm.suckless.org/patches/status2d/ + */ +#define BAR_STATUS2D_PATCH 1 + +/* Supplementary patch should you want to disable alpha for the status2d section */ +#define BAR_STATUS2D_NO_ALPHA_PATCH 0 + +/* Addition to the status2d patch that allows the use of terminal colors (color0 through color15) + * from xrdb in the status, allowing programs like pywal to change statusbar colors. + * This adds the C and B codes to use terminal foreground and background colors respectively. + * E.g. ^B5^ would use color5 as the background color. + * https://dwm.suckless.org/patches/status2d/ + */ +#define BAR_STATUS2D_XRDB_TERMCOLORS_PATCH 0 + +/* The systray patch adds systray for the status bar. + * https://dwm.suckless.org/patches/systray/ + */ +#define BAR_SYSTRAY_PATCH 1 + +/* Show tag symbols in bar */ +#define BAR_TAGS_PATCH 1 + +/* Show window title in bar */ +#define BAR_WINTITLE_PATCH 0 + +/* Shows window titles in the bar, but only for floating clients. + * This depends on code from the flexwintitle patch. + * Note that the configuration in config.def.h for this is merely an example. If combined + * with the corresponding hidden patch then these two will overlap unless the width of the + * modules are controlled. + */ +#define BAR_WINTITLE_FLOATING_PATCH 0 + +/* Shows window titles in the bar, but only for floating clients. + * This depends on code from the flexwintitle patch. + * Note that the configuration in config.def.h for this is merely an example. If combined + * with the corresponding floating patch then these two will overlap unless the width of the + * modules are controlled. + */ +#define BAR_WINTITLE_HIDDEN_PATCH 0 + +/* Title bar modules such as wintitle (default), fancybar and awesomebar + * do not by default add left and/or right padding as they take up the + * remaining space. These options allow you explicitly add padding should + * you need it. + */ +#define BAR_TITLE_RIGHT_PAD_PATCH 0 +#define BAR_TITLE_LEFT_PAD_PATCH 1 + +/** + * Bar options + */ + +/* This patch changes the rectangle indicating if a tag is used by a client into a bar + * above the tag name for better visibility. + * Set the tagindicatortype variable in config.h to INDICATOR_TOP_BAR to enable this. + * https://dwm.suckless.org/patches/activetagindicatorbar/ + */ +#define BAR_ACTIVETAGINDICATORBAR_PATCH N/A + +/* Alternative patch to the activetagindicatorbar patch, adds the bar below the tag + * icon rather than above. + * Set the tagindicatortype variable in config.h to INDICATOR_BOTTOM_BAR to enable this. + */ +#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH N/A + +/* The alpha patch adds transparency for the status bar. + * You need to uncomment the corresponding line in config.mk to use the -lXrender library + * when including this patch. + * https://dwm.suckless.org/patches/alpha/ + */ +#define BAR_ALPHA_PATCH 0 + +/* This patch introduces alternative tags which can be switched on the fly for the + * sole purpose of providing visual aid. + * https://dwm.suckless.org/patches/alternativetags/ + */ +#define BAR_ALTERNATIVE_TAGS_PATCH 0 + +/* This patches provides the ability to use alternative text for tags which contain at + * least one window. + * https://dwm.suckless.org/patches/alttagsdecoration/ + */ +#define BAR_ALTTAGSDECORATION_PATCH 0 + +/* This patch enables dwm to manage external status bars such as lemonbar and polybar. + * dwm treats the external bar as it would its own, so all regular dwm commands such as + * togglebar affect the external bar in the same way. + * + * NB: Unless you want both anybar + dwm bar(s) then the recommendation is to disable all + * bar modules and have { 0 } in the barrules. + * + * https://dwm.suckless.org/patches/anybar/ + */ +#define BAR_ANYBAR_PATCH 0 + +/* This patch adds a border around the status bar(s) just like the border of client windows. + * https://codemadness.org/paste/dwm-border-bar.patch + */ +#define BAR_BORDER_PATCH 0 + +/* This patch centers the WM_NAME of the currently selected window on the status bar. + * This is compatible with the wintitle, bartabgroups, flexwintitle and awesomebar bar + * modules. + * https://dwm.suckless.org/patches/centeredwindowname/ + */ +#define BAR_CENTEREDWINDOWNAME_PATCH 0 + +/* Draws a dot indicator overlayed on each tag icon for each client. The selected client + * is drawn as a larger horizontal line. + * Set the tagindicatortype variable in config.h to INDICATOR_CLIENT_DOTS to enable this. + * https://dwm.suckless.org/patches/clientindicators/ + */ +#define BAR_CLIENTINDICATOR_PATCH N/A + +/* This patch enables color emoji in dwm by removing a workaround for a BadLength error + * in the Xft library when color glyphs are used. + * To enable this you will need an updated Xft library that can handle color glyphs otherwise + * dwm will crash on encountering such characters. Note that you will also need a font that + * provides color emojis for this to work. + */ +#define BAR_COLOR_EMOJI_PATCH 0 + +/* Updates the position of dmenu to match that of the bar. I.e. if topbar is 0 then dmenu + * will appear at the bottom and if 1 then dmenu will appear at the top. + * https://dwm.suckless.org/patches/dmenumatchtop + */ +#define BAR_DMENUMATCHTOP_PATCH 0 + +/* Originally this was the extrabar patch, but as the handling of extra bars is now built-in + * only the splitting of the status by a designated separator remains. As such this has been + * renamed to more accurately reflect what it does - creating an extra status. + * https://dwm.suckless.org/patches/extrabar/ + */ +#define BAR_EXTRASTATUS_PATCH 0 + +/* Adds EWMH support for _NET_NUMBER_OF_DESKTOPS, _NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES + * and _NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs + * that request workspace information. For example polybar's xworkspaces module. + * + * This patch also includes support for adding the _IS_FLOATING property for floating windows + * allowing for compositors to treat floating windows differently to tiled windows. + * + * E.g. this setting makes picom only render shadows for floating windows: + * + * shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ]; + * + * https://github.com/bakkeby/dwm-flexipatch/issues/50 (_IS_FLOATING patch) + * https://dwm.suckless.org/patches/ewmhtags/ + */ +#define BAR_EWMHTAGS_PATCH 0 + +/* 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 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/ + */ +#define BAR_HIDEVACANTTAGS_PATCH 0 + +/* With this patch dwm's built-in status bar is only shown when HOLDKEY is pressed + * and the bar will now overlay the display. + * http://dwm.suckless.org/patches/holdbar/ + */ +#define BAR_HOLDBAR_PATCH 0 + +/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji). + * This patch is essentially a hack to ignore any errors when drawing text on the status bar. + * https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww + * https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0 + */ +#define BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0 + +/* This patch adds vertical and horizontal space between the statusbar and the edge of the screen. + * https://dwm.suckless.org/patches/barpadding/ + */ +#define BAR_PADDING_PATCH 1 + +/* This patch adds simple markup for status messages using pango markup. + * This depends on the pango library v1.44 or greater. + * You need to uncomment the corresponding lines in config.mk to use the pango libraries + * when including this patch. + * + * Note that the pango patch does not protect against the BadLength error from Xft + * when color glyphs are used, which means that dwm will crash if color emoji is used. + * + * If you need color emoji then you may want to install this patched library from the AUR: + * https://aur.archlinux.org/packages/libxft-bgra/ + * + * A long term fix for the libXft library is pending approval of this pull request: + * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1 + * + * Also see: + * https://developer.gnome.org/pygtk/stable/pango-markup-language.html + * https://lists.suckless.org/hackers/2004/17285.html + * https://dwm.suckless.org/patches/pango/ + */ +#define BAR_PANGO_PATCH 0 + +/* 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. + * This patch is incompatible with and takes precedence over the status2d patch. + * https://dwm.suckless.org/patches/statuscolors/ + */ +#define BAR_STATUSCOLORS_PATCH 0 + +/* This patch adds configuration options for horizontal and vertical padding in the status bar. + * https://dwm.suckless.org/patches/statuspadding/ + */ +#define BAR_STATUSPADDING_PATCH 0 + +/* This patch adds the ability for dwm to read colors from the linux virtual console. + * /sys/module/vt/parameters/default_{red,grn,blu} + * Essentially this way the colors you use in your regular tty is "mirrored" to dwm. + * https://dwm.suckless.org/patches/vtcolors/ + */ +#define BAR_VTCOLORS_PATCH 0 + +/* This patch allows client windows to be hidden. This code was originally part of awesomebar, + * but has been separated out so that other bar modules can take advantage of it. + * Both awesomebar and bartabgroups patches depend on this patch and it will be auto-enabled + * during compile time if it is needed. Note that if using flexipatch-finalizer this must be + * explicitly enabled. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-barmodules-wintitleactions-6.2.diff + */ +#define BAR_WINTITLEACTIONS_PATCH BAR_AWESOMEBAR_PATCH || BAR_TABGROUPS_PATCH || BAR_FLEXWINTITLE_PATCH + +/*** + * Other patches + */ + +/* This patch allows windows to be resized with its aspect ratio remaining constant. + * https://dwm.suckless.org/patches/aspectresize/ + */ +#define ASPECTRESIZE_PATCH 0 + +/* This patch prevents the focus to drift from the active fullscreen client when + * using focusstack(). + * https://dwm.suckless.org/patches/alwaysfullscreen/ + */ +#define ALWAYSFULLSCREEN_PATCH 1 + +/* This patch adds new clients above the selected client, instead of always + * becoming the new master. This behaviour is known from Xmonad. + * This patch takes precedence over ATTACHASIDE_PATCH. + * https://dwm.suckless.org/patches/attachabove/ + */ +#define ATTACHABOVE_PATCH 0 + +/* This patch adds new clients on top of the stack. + * This patch takes precedence over ATTACHBELOW_PATCH. + * https://dwm.suckless.org/patches/attachaside/ + */ +#define ATTACHASIDE_PATCH 0 + +/* 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 + +/* This patch adds new clients at the bottom of the stack. + * https://dwm.suckless.org/patches/attachbottom/ + */ +#define ATTACHBOTTOM_PATCH 0 + +/* This patch will make dwm run "~/.local/share/dwm/autostart_blocking.sh" and + * "~/.local/share/dwm/autostart.sh &" before entering the handler loop. One or + * both of these files can be ommited. Note the path inside .local/share rather + * than the original ~/.dwm folder. + * https://dwm.suckless.org/patches/autostart/ + */ +#define AUTOSTART_PATCH 1 + +/* By default, windows that are not visible when requesting a resize/move will not + * get resized/moved. With this patch, they will. + * https://dwm.suckless.org/patches/autoresize/ + */ +#define AUTORESIZE_PATCH 0 + +/* This patch adds an iscentered rule to automatically center clients on the current monitor. + * This patch takes precedence over centeredwindowname and fancybar patches. + * https://dwm.suckless.org/patches/center/ + */ +#define CENTER_PATCH 0 + +/* 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. + * It should be noted that in dwm transient windows are not subject to normal client rules + * and they are always floating by default. + * This patch centers transient windows on the screen like the center patch does. Note that + * the 6.2 center patch piggy-backed on the updatewindowtype function to ensure that all + * dialog boxes were centered, transient or not. This function was removed in relation to + * adding wintype as a client rule filter, hence this no longer works out of the box. This + * patch restores previous behaviour with the center patch. + */ +#define CENTER_TRANSIENT_WINDOWS_PATCH 0 + +/* As above, except that the transient window is centered within the position of the parent + * window, rather than at the center of the screen. This takes precedence over the above patch. + */ +#define CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH 0 + +/* This patch provides the ability to assign different weights to clients in their + * respective stack in tiled layout. + * https://dwm.suckless.org/patches/cfacts/ + */ +#define CFACTS_PATCH 0 + +/* This patch allows color attributes to be set through the command line. + * https://dwm.suckless.org/patches/cmdcustomize/ + */ +#define CMDCUSTOMIZE_PATCH 0 + +/* This patch tweaks the tagging interface so that you can select multiple tags for tag + * or view by pressing all the right keys as a combo. For example to view tags 1 and 3, + * hold MOD and then press and hold 1 and 3 together. + * https://dwm.suckless.org/patches/combo/ + */ +#define COMBO_PATCH 1 + +/* Allow dwm to execute commands from autostart array in your config.h file. When dwm exits + * then all processes from autostart array will be killed. + * https://dwm.suckless.org/patches/cool_autostart/ + */ +#define COOL_AUTOSTART_PATCH 0 + +/* The cyclelayouts patch lets you cycle through all your layouts. + * https://dwm.suckless.org/patches/cyclelayouts/ + */ +#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 + * decorations. + * Not respecting this property leads to issues with applications that draw their own borders, + * 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 + +/* Similarly to the dragmfact patch this allows you to click and drag clients to change the + * cfact to adjust the client's size in the stack. This patch depends on the cfacts patch. + */ +#define DRAGCFACT_PATCH 0 + +/* This patch lets you resize the split in the tile layout (i.e. modify mfact) by holding + * the modkey and dragging the mouse. + * This patch can be a bit wonky with other layouts, but generally works. + * https://dwm.suckless.org/patches/dragmfact/ + */ +#define DRAGMFACT_PATCH 0 + +/* Simple dwmc client using a fork of fsignal to communicate with dwm. + * To use this either copy the patch/dwmc shell script to somewhere in your path or + * uncomment the following line in Makefile: + * #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin + * http://dwm.suckless.org/patches/dwmc/ + */ +#define DWMC_PATCH 0 + +/* 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 + * it will be opened on the first tag. + * https://dwm.suckless.org/patches/emptyview/ + */ +#define EMPTYVIEW_PATCH 0 + +/* This patch allows the user to change size and placement of floating windows using only the + * keyboard. It also allows for temporary vertical and horizontal extension of windows similar + * to other WMs fill command. + * https://dwm.suckless.org/patches/exresize/ + */ +#define EXRESIZE_PATCH 0 + +/* Only allow clients to "fullscreen" into the space currently given to them. + * As an example, this will allow you to view a fullscreen video in your browser on + * one half of the screen, while having the other half available for other tasks. + * This patch takes precedence over the fakefullscreen client patch below. + * https://dwm.suckless.org/patches/fakefullscreen/ + */ +#define FAKEFULLSCREEN_PATCH 0 + +/* Similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into + * the space currently given to them. + * The "twist" with this patch is that fake fullscreen can be toggled on a per client basis + * rather than applying to all clients globally. + * Also see the selectivefakefullscreen option that adds a rule option to enabled this on client + * startup. + */ +#define FAKEFULLSCREEN_CLIENT_PATCH 0 + +/* 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 + * exresize, moveresize, and moveplace patches. + * The size and position can be specified using absolute, relative or fixed co-ordinates and + * https://github.com/bakkeby/patches/wiki/floatpos/ + */ +#define FLOATPOS_PATCH 1 + +/* Add-on functionality for the above: make the float positions respect outer (vanity)gaps. */ +#define FLOATPOS_RESPECT_GAPS_PATCH 1 + +/* This patch provides the ability to focus the tag on the immediate left or right of the + * currently focused tag. It also allows to send the focused window either on the left or + * the right tag. + * http://dwm.suckless.org/patches/focusadjacenttag/ + */ +#define FOCUSADJACENTTAG_PATCH 0 + +/* Allows focusing on clients based on direction (up, down, left, right) instead of client order. + * https://github.com/bakkeby/patches/wiki/focusdir/ + */ +#define FOCUSDIR_PATCH 0 + +/* A simple patch that just puts focus back to the master client. + * https://dwm.suckless.org/patches/focusmaster/ + */ +#define FOCUSMASTER_PATCH 0 + +/* Switch focus only by mouse click and not sloppy (focus follows mouse pointer). + * https://dwm.suckless.org/patches/focusonclick/ + */ +#define FOCUSONCLICK_PATCH 0 + +/* Selects the next window having the urgent flag regardless of the tag it is on. + * The urgent flag can be artificially set with the following xdotool command on any window: + * xdotool selectwindow -- set_window --urgency 1 + * https://dwm.suckless.org/patches/focusurgent/ + */ +#define FOCUSURGENT_PATCH 0 + +/* By default, dwm responds to _NET_ACTIVE_WINDOW client messages by setting + * the urgency bit on the named window. This patch activates the window instead. + * https://dwm.suckless.org/patches/focusonnetactive/ + */ +#define FOCUSONNETACTIVE_PATCH 0 + +/* Send "fake signals" to dwm for handling, using xsetroot. This will not conflict with the + * status bar, which also is managed using xsetroot. + * Also see the dwmc patch, which takes precedence over this patch. + * https://dwm.suckless.org/patches/fsignal/ + */ +#define FSIGNAL_PATCH 0 + +/* Applies the monocle layout with the focused client on top and hides the bar. When pressed + * again it shows the bar and restores the layout that was active before going fullscreen. + * https://dwm.suckless.org/patches/fullscreen/ + */ +#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. + * https://dwm.suckless.org/patches/inplacerotate/ + */ +#define INPLACEROTATE_PATCH 0 + +/* This patch lets you define custom insets from each edge of the screen. One use case would be + * to arrange space for an external bar. + * https://dwm.suckless.org/patches/insets/ + */ +#define INSETS_PATCH 0 + +/* This patch (v1.5.7) implements inter-process communication through a UNIX socket for dwm. This + * allows for the window manager to be queried for information, e.g. listen for events such as tag + * or layout changes, as well as send commands to control the window manager via other programs. + * + * You need to uncomment the corresponding lines in config.mk to use the -lyajl library + * when including this patch. + * This patch depends on the following additional library: + * - yajl + * + * https://github.com/mihirlad55/dwm-ipc + * https://dwm.suckless.org/patches/ipc/ + */ +#define IPC_PATCH 0 + +/* Adds rule option for clients to avoid accidental termination by killclient for sticky windows. + * https://dwm.suckless.org/patches/ispermanent/ + */ +#define ISPERMANENT_PATCH 0 + +/* This patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts + * can be performed. + * https://dwm.suckless.org/patches/keymodes/ + */ +#define KEYMODES_PATCH 0 + +/* This patch adds a keybinding to kills all visible clients that are not selected. + * https://dwm.suckless.org/patches/killunsel/ + */ +#define KILLUNSEL_PATCH 0 + +/* By default in dwm it is possible to make an application fullscreen, then use + * the focusstack keybindings to focus on other windows beneath the current window. + * It is also possible to spawn new windows (e.g. a terminal) that end up getting + * focus while the previous window remains in fullscreen. This patch ensures that + * in such scenarios the previous window loses fullscreen. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-losefullscreen-6.2.diff + */ +#define LOSEFULLSCREEN_PATCH 1 + +/* This patch adds helper functions for maximizing, horizontally and vertically, floating + * windows using keybindings. + * https://dwm.suckless.org/patches/maximize/ + */ +#define MAXIMIZE_PATCH 0 + +/* Control Music Player Daemon via keybinds. + * You need to uncomment the corresponding line in config.mk to use the -lmpdclient library + * when including this patch. + * This patch depends on the following additional library: + * - libmpdclient + * https://dwm.suckless.org/patches/mpdcontrol/ + */ +#define MPDCONTROL_PATCH 0 + +/* Adds rules per monitor, e.g. have default layouts per monitor. + * The use case for this is if the second monitor is vertical (i.e. rotated) then + * you may want to use a different default layout for this monitor than what is + * used for the main monitor. E.g. normal vertical split for main monitor and + * horizontal split for the second. + */ +#define MONITOR_RULES_PATCH 0 + +/* Always display the the monocle-symbol as defined in config.h if the monocle-layout + * is activated. Do not display the number of open clients in the current tag. + * https://dwm.suckless.org/patches/monoclesymbol/ + */ +#define MONOCLESYMBOL_PATCH 0 + +/* Makes a window floating and 1/3rd the height and 1/3rd the width of the screen and is + * positioned in either the center or one of the 8 cardinal directions depending on which + * key is pressed. + * https://dwm.suckless.org/patches/moveplace/ + */ +#define MOVEPLACE_PATCH 0 + +/* This patch allows you to move and resize dwm's clients using keyboard bindings. + * https://dwm.suckless.org/patches/moveresize/ + */ +#define MOVERESIZE_PATCH 0 + +/* This patch allows you to move clients around in the stack and swap them with the master. + * https://dwm.suckless.org/patches/movestack/ + */ +#define MOVESTACK_PATCH 1 + +/* Adds support for the _NET_CLIENT_LIST_STACKING atom, needed by certain applications like the + * Zoom video conferencing application. + * https://github.com/bakkeby/patches/wiki/netclientliststacking/ + */ +#define NET_CLIENT_LIST_STACKING_PATCH 0 + +/* Removes the border when there is only one window visible. + * https://dwm.suckless.org/patches/noborder/ + */ +#define NOBORDER_PATCH 0 + +/* 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. + * https://dwm.suckless.org/patches/nodmenu/ + */ +#define NODMENU_PATCH 0 + +/* This patch allows for toggleable client button bindings that have no modifiers. + * This can, for example, allow you to move or resize using the mouse alone without holding + * down a modifier key. This can be practical if you have extra buttons on your mouse. + * While you can use button bindings with no modifiers without this patch in a bare dwm, + * those buttons are then unavailable for use within the application itself so being able to + * toggle these on and off can be necessary in certain situations (e.g. being able to use + * back and forward buttons in a browser). + + * Example bindings: + * { ClkClientWin, 0, Button8, movemouse, {0} }, + * { ClkClientWin, 0, Button9, resizemouse, {0} }, + */ +#define NO_MOD_BUTTONS_PATCH 0 + +/* When terminals have transparency then their borders also become transparent. + * This patch ensures that borders have no transparency. Note that this patch is + * only relevant if you are not using the alpha patch. + * https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8 + * https://dwm.suckless.org/patches/alpha/dwm-fixborders-6.2.diff + */ +#define NO_TRANSPARENT_BORDERS_PATCH 1 + +/* Port of InstantVM's on_empty_keys functionality allowing keybindings that apply only when + * a tag is empty. An example use case is being able to launch applications with first hand + * keys like "f" to launch firefox. + * + * https://github.com/instantOS/instantWM/ + * https://github.com/bakkeby/dwm-flexipatch/issues/51 + */ +#define ON_EMPTY_KEYS_PATCH 0 + +/* Minor patch that prevents more than one rule being matched for a given client. */ +#define ONLY_ONE_RULE_MATCH_PATCH 0 + +/* This patch makes it so dwm will only exit via quit() if no windows are open. + * This is to prevent you accidentally losing all your work. + * https://dwm.suckless.org/patches/onlyquitonempty/ + */ +#define ONLYQUITONEMPTY_PATCH 0 + +/* The pertag patch adds nmaster, mfacts and layouts per tag rather than per + * monitor (default). + * https://dwm.suckless.org/patches/pertag/ + */ +#define PERTAG_PATCH 1 + +/* This controls whether or not to also store bar position on a per + * tag basis, or leave it as one bar per monitor. + */ +#define PERTAGBAR_PATCH 0 + +/* This patch lets you change the position of a client in the stack using the mouse. + * https://github.com/bakkeby/patches/wiki/placemouse + */ +#define PLACEMOUSE_PATCH 0 + +/* This patch provides a way to move clients up and down inside the client list. + * https://dwm.suckless.org/patches/push/ + */ +#define PUSH_PATCH 0 + +/* This patch provides a way to move clients up and down inside the client list, + * but does not push up or down into the master area (except that it does not take + * nmaster into account). + * This takes precedence over the push patch above. + * https://dwm.suckless.org/patches/push/ + */ +#define PUSH_NO_MASTER_PATCH 0 + +/* Shifts all clients per tag to leftmost unoccupied tags. + * + * For example, if clients A, B, C are tagged on tags 1, 5, 9 respectively, when + * this function is called, they will now be on 1, 2, and 3. The focused client + * will also remain focused. + * + * Clients on multiple tags will be treated as if they only were only on their + * leftmost tag, and will be reduced to one tag after the operation is complete. + * https://dwm.suckless.org/patches/reorganizetags/ + */ +#define REORGANIZETAGS_PATCH 0 + +/* By default, windows only resize from the bottom right corner. With this + * patch the mouse is warped to the nearest corner and you resize from there. + * https://dwm.suckless.org/patches/resizecorners/ + */ +#define RESIZECORNERS_PATCH 0 + +/* Practically the same as resizecorners, but the cursor does not warp to corners. + * This takes precedence over the resizecorners patch. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-resizepoint-6.2.diff + */ +#define RESIZEPOINT_PATCH 0 + +/* Adds a keyboard shortcut to restart dwm or alternatively by using kill -HUP dwmpid. + * Additionally dwm can quit cleanly by using kill -TERM dwmpid. + * https://dwm.suckless.org/patches/restartsig/ + */ +#define RESTARTSIG_PATCH 0 + +/* Adds rio-like drawing to resize the selected client. + * This depends on an external tool slop being installed. + * This patch was backported from instantWM. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-riodraw-6.2.diff + */ +#define RIODRAW_PATCH 0 + +/* This patch let's you rotate through the stack using keyboard shortcuts. + * https://dwm.suckless.org/patches/rotatestack/ + */ +#define ROTATESTACK_PATCH 0 + +/* This patch adds rounded corners to client windows in dwm. + * You need to uncomment the corresponding line in config.mk to use the -lXext library + * when including this patch. You will also want to set "borderpx = 0;" in your config.h. + * https://github.com/mitchweaver/suckless/blob/master/dwm/patches_mitch/mitch-06-rounded_corners-db6093f6ec1bb884f7540f2512935b5254750b30.patch + */ +#define ROUNDED_CORNERS_PATCH 0 + +/* This patch saves size and position of every floating window before it is forced + * into tiled mode. If the window is made floating again then the old dimensions + * will be restored. + * https://dwm.suckless.org/patches/save_floats/ + */ +#define SAVEFLOATS_PATCH 1 + +/* The scratchpad patch allows you to spawn or restore floating terminal windows. + * It is typically useful when one need to do some short typing. + * + * Note that this patch changes TAGMASK to make room for special scratchpad tags, + * so ~0 does more than select all tags with this patch. Code that relies on ~0 to + * represent all tags should use ~SPTAGMASK instead. + * + * Upgraded to Christian Tenllado's multiple scratchpad version. + * https://lists.suckless.org/hackers/2004/17205.html + * https://dwm.suckless.org/patches/scratchpads/ + */ +#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 + +/* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad + * feature in i3wm. + * https://github.com/GasparVardanyan/dwm-scratchpad + */ +#define SCRATCHPAD_ALT_1_PATCH 0 + +/* 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 + * with the fakefullscreenclient patch and offers no practical functionality without it. + * https://dwm.suckless.org/patches/selectivefakefullscreen/ + */ +#define SELECTIVEFAKEFULLSCREEN_PATCH 0 + +/* Allows restarting dwm without the dependency of an external script. + * https://dwm.suckless.org/patches/selfrestart/ + */ +#define SELFRESTART_PATCH 0 + +/* This patch allow clients to keep focus when being sent to another monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-sendmon_keepfocus-6.2.diff + */ +#define SENDMON_KEEPFOCUS_PATCH 0 + +/* This patch allows border pixels to be changed during runtime. + * https://dwm.suckless.org/patches/setborderpx/ + */ +#define SETBORDERPX_PATCH 0 + +/* This patch adds keybindings for left and right circular shift through tags. + * https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff + */ +#define SHIFTVIEW_PATCH 1 + +/* This variant of the shiftview patch adds left and right circular shift through tags, + * but skips tags where there are no clients. + */ +#define SHIFTVIEW_CLIENTS_PATCH 0 + +/* This patch makes dwm obey even "soft" sizehints for new clients. Any window + * that requests a specific initial size will be floated and set to that size. + * Unlike with "fixed size" windows, you are able to resize and/or unfloat these + * windows freely - only the initial state is affected. + * This version of the patch is honestly of limited utility since there are many + * clients that will abuse it. + * https://dwm.suckless.org/patches/sizehints/ + */ +#define SIZEHINTS_PATCH 0 + +/* This patch makes dwm obey even "soft" sizehints for new clients. This ruled + * version is essentially the same patch except it obeys the "isfloating" rule + * if it is available in config.h for the given client. + * https://dwm.suckless.org/patches/sizehints/ + */ +#define SIZEHINTS_RULED_PATCH 0 + +/* In a multi-head setup monitor 0 is by default the primary screen, with the left and right + * screen being monitor 1 and 2 respectively. This patch sorts screens left to right (or + * top to bottom in a vertical layout) which aims to address some inconsistencies when it + * comes to focusmon, tagmon and similar functionality. + * https://www.mail-archive.com/hackers@suckless.org/msg09400.html + */ +#define SORTSCREENS_PATCH 0 + +/* Spawns programs from currently focused client's working directory. + * https://dwm.suckless.org/patches/spawn_cwd/ + */ +#define SPAWNCMD_PATCH 0 + +/* This patch provides comprehensive utilities for managing the client stack, providing + * keyboard shortcuts for focusing or placing a client at specific positions in the stack. + * Note that the default keybindings for this patch have been changed in dwm-flexipatch + * due to the many conflicts with other patches. As it provides similar functionality to the + * swapfocus patch it also uses the MOD+s shortcut to focus the previously selected client, + * thus note a conflict between these two patches. + * https://dwm.suckless.org/patches/stacker/ + */ +#define STACKER_PATCH 0 + +/* Steam, and steam windows (games), trigger a ConfigureNotify request every time the window + * gets focus. More so, the configure event passed along from Steam tends to have the wrong + * x and y co-ordinates which can make the window, if floating, jump around the screen. + * + * This patch works around this age-old issue by ignoring the x and y co-ordinates for + * ConfigureNotify requests relating to Steam windows. + * + * https://github.com/bakkeby/patches/wiki/steam + */ +#define STEAM_PATCH 0 + +/* Adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags. + * https://dwm.suckless.org/patches/sticky/ + */ +#define STICKY_PATCH 0 + +/* This patch adds "window swallowing" to dwm as known from Plan 9's windowing system rio. + * Clients marked with isterminal in config.h swallow a window opened by any child process, + * e.g. running xclock in a terminal. Closing the xclock window restores the terminal window + * in the current position. + * + * This patch depends on the following additional libraries: + * - libxcb + * - Xlib-libxcb + * - xcb-res + * + * You need to uncomment the corresponding line in config.mk to use the above libraries when + * including this patch. + * + * https://dwm.suckless.org/patches/swallow/ + */ +#define SWALLOW_PATCH 0 + +/* This patch depends on the pertag patch and makes it possible to switch focus with a single + * shortcut (MOD+s) instead of having to think if you should use mod-j or mod-k for reaching + * the previously used window. + * https://dwm.suckless.org/patches/swapfocus/ + */ +#define SWAPFOCUS_PATCH 0 + +/* This patch allows swapping the contents of the currently selected tag with another tag using + * keyboard shortcuts. + * https://dwm.suckless.org/patches/swaptags/ + */ +#define SWAPTAGS_PATCH 0 + +/* Switch focus between the master and stack columns using a single keybinding. + * https://dwm.suckless.org/patches/switchcol/ + */ +#define SWITCHCOL_PATCH 1 + +/* By default dwm allow you to set application specific rules so that you can have your browser, + * for example, start up on tag 9 optionally on a given monitor when you open your browser it is + * then automatically moved to the configured tag, but you have to manually enable the tag to see + * the newly opened application. + * This patch adds an extra configuration option for individual rules where: + * 0 is default behaviour + * 1 automatically moves you to the tag of the newly opened application and + * 2 enables the tag of the newly opened application in addition to your existing enabled tags + * 3 as 1, but closing that window reverts the view back to what it was previously (*) + * 4 as 2, but closing that window reverts the view back to what it was previously (*) + * + * (*) except if the client has been moved between tags or to another monitor + * + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-switchtag-6.2.diff + * Also see https://dwm.suckless.org/patches/switchtotag + */ +#define SWITCHTAG_PATCH 0 + +/* Adds keyboard shortcuts to move all (or only floating) windows from one tag to another. + * https://dwm.suckless.org/patches/tagall/ + */ +#define TAGALL_PATCH 0 + +/* This patch allows you to move all visible windows on a monitor to an adjacent monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagallmon-6.2.diff + */ +#define TAGALLMON_PATCH 0 + +/* This patch makes new clients attach into the stack area when you toggle a new tag into + * view. This means your master area will remain unchanged when toggling views. + * The allmaster patch will cause all clients in the master area to be left alone. This patch + * takes precedence over the onemaster tagintostack patch. + * https://dwm.suckless.org/patches/tagintostack/ + */ +#define TAGINTOSTACK_ALLMASTER_PATCH 0 + +/* This patch makes new clients attach into the stack area when you toggle a new tag into + * view. This means your master area will remain unchanged when toggling views. + * The onemaster patch will cause the first client in the master area to be left alone. + * https://dwm.suckless.org/patches/tagintostack/ + */ +#define TAGINTOSTACK_ONEMASTER_PATCH 0 + +/* If you try to send a fullscreen window to an adjacent monitor using tagmon then + * the window is moved behind the scenes, but it remains in fullscreen on the original + * monitor until you exit fullscreen view (at which point it will appear on the adjacent + * monitor). This patch allows a fullscreen window to be moved to an adjacent monitor + * while remaining in fullscreen. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagmonfixfs-6.2.diff + */ +#define TAGMONFIXFS_PATCH 0 + +/* Add functions and keybindings to tag a window to a desired tag on the next (right) + * or previous (left) monitor from the currently selected monitor. + * https://dwm.suckless.org/patches/tagothermonitor/ + */ +#define TAGOTHERMONITOR_PATCH 0 + +/* This patch allows you to swap all visible windows on one monitor with those of an + * adjacent monitor. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagswapmon-6.2.diff + */ +#define TAGSWAPMON_PATCH 0 + +/* This patch allows you to toggle fullscreen on and off using a single shortcut key. + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-togglefullscreen-6.2.diff + */ +#define TOGGLEFULLSCREEN_PATCH 1 + +/* Lets you transfer the currently focused client between the master and stack area + * while increasing or decreasing the master area (nmaster) accordingly. + * https://dwm.suckless.org/patches/transfer/ + */ +#define TRANSFER_PATCH 0 + +/* Lets you transfer all clients between the master and stack area + * while increasing or decreasing the master area (nmaster) accordingly. + * https://dwm.suckless.org/patches/transfer/ + */ +#define TRANSFER_ALL_PATCH 0 + +/* This patch resets isfloating on any visible windows that have it set. + * Optionally also applies a layout. + * https://dwm.suckless.org/patches/unfloatvisible/ + */ +#define UNFLOATVISIBLE_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 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 + * fullscreen mode, hence this is enabled separately from the main vanitygaps patch. + */ +#define VANITYGAPS_MONOCLE_PATCH 1 + +/* Follow a window to the tag it is being moved to. + * https://dwm.suckless.org/patches/viewontag/ + */ +#define VIEWONTAG_PATCH 0 + +/* By default tags can be changed using MOD+ while MOD+Tab toggles between the current and + * the previous tag. This patch changes this so that if you hit MOD+ for the tag you are + * currently on, then it works the same as MOD+Tab and switches back to the previous tag. + * Idea ref. + * https://www.reddit.com/r/suckless/comments/ik27vd/key_toggle_between_next_and_previous_tag_dwm/ + */ +#define VIEW_SAME_TAG_GIVES_PREVIOUS_TAG_PATCH 0 + +/* This patch warps the mouse cursor to the center of the currently focused window or screen + * when the mouse cursor is (a) on a different screen or (b) on top of a different window. + * https://dwm.suckless.org/patches/warp/ + */ +#define WARP_PATCH 0 + +/* Sometimes a single application opens different windows depending on the task + * at hand and this is often reflected in the WM_WINDOW_ROLE(STRING) x property. + * This patch adds the role field to the rule configuration so that one can + * differentiate between, say, Firefox "browser" vs "Preferences" vs "Manager" + * or Google-chrome "browser" vs "pop-up". + * https://github.com/bakkeby/patches/blob/master/dwm/dwm-windowrolerule-6.2.diff + */ +#define WINDOWROLERULE_PATCH 0 + +/* The winview patch allows switching the view to that of a given client from the all-window + * view (Mod-0) using a keyboard shortcut. + * http://dwm.suckless.org/patches/winview/ + */ +#define WINVIEW_PATCH 1 + +/* Allows dwm to read colors from xrdb (.Xresources) during runtime. Compatible with + * the float border color, awesomebar, urgentborder and titlecolor patches. + * https://dwm.suckless.org/patches/xrdb/ + */ +#define XRDB_PATCH 0 + +/* 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/ + */ +#define ZOOMFLOATING_PATCH 0 + +/* The zoomswap patch allows a master and a stack window to swap places + * rather than every window on the screen changing position. + * https://dwm.suckless.org/patches/zoomswap/ + */ +#define ZOOMSWAP_PATCH 0 + +/** + * Layouts + */ + +/* Bottomstack layout. + * https://dwm.suckless.org/patches/bottomstack/ + */ +#define BSTACK_LAYOUT 0 + +/* Bottomstack horizontal layout. + * https://dwm.suckless.org/patches/bottomstack/ + */ +#define BSTACKHORIZ_LAYOUT 0 + +/* Centered master layout. + * https://dwm.suckless.org/patches/centeredmaster/ + */ +#define CENTEREDMASTER_LAYOUT 1 + +/* Centered floating master layout. + * https://dwm.suckless.org/patches/centeredmaster/ + */ +#define CENTEREDFLOATINGMASTER_LAYOUT 1 + +/* Same as the default tile layout except clients in the master area are arranged in + * columns (i.e. left to right). + * https://dwm.suckless.org/patches/columns/ + */ +#define COLUMNS_LAYOUT 0 + +/* Deck layout. + * https://dwm.suckless.org/patches/deck/ + */ +#define DECK_LAYOUT 1 + +/* Fibonacci dwindle layout. + * https://dwm.suckless.org/patches/fibonacci/ + */ +#define FIBONACCI_DWINDLE_LAYOUT 1 + +/* Fibonacci spiral layout. + * https://dwm.suckless.org/patches/fibonacci/ + */ +#define FIBONACCI_SPIRAL_LAYOUT 1 + +/* Flextile deluxe layout. + * A revamped, more flexible, and over-the-top version of the original flextile layout. + * https://dwm.suckless.org/patches/flextile/ (original) + */ +#define FLEXTILE_DELUXE_LAYOUT 0 + +/* Gappless grid layout. + * https://dwm.suckless.org/patches/gaplessgrid/ + */ +#define GAPPLESSGRID_LAYOUT 0 + +/* Gridmode (grid) layout. + * https://dwm.suckless.org/patches/gridmode/ + */ +#define GRIDMODE_LAYOUT 1 + +/* Horizontal grid (horizgrid) layout. + * https://dwm.suckless.org/patches/horizgrid/ + */ +#define HORIZGRID_LAYOUT 0 + +/* Grid layout where nmaster controls the number of rows. + * https://dwm.suckless.org/patches/nrowgrid/ + */ +#define NROWGRID_LAYOUT 0 + +/* The default tile layout. + * This can be optionally disabled in favour of other layouts. + */ +#define TILE_LAYOUT 1 + +/* Monocle layout (default). + * This can be optionally disabled in favour of other layouts. + */ +#define MONOCLE_LAYOUT 1 diff --git a/.local/src/dwm/theme.h b/.local/src/dwm/theme.h new file mode 100644 index 00000000..f0a40013 --- /dev/null +++ b/.local/src/dwm/theme.h @@ -0,0 +1,39 @@ +/* appearance */ +static const unsigned int gappx = 6; +static const unsigned int borderpx = 3; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int user_bh = 27; +static const int bar_height = 27; +static const int topbar = 1; /* 0 means bottom bar */ +static const char *fonts[] = { "CaskaydiaCove Nerd Font:size=10" }; +static const char dmenufont[] = "CaskaydiaCove Nerd Font:size=10"; + +static const int vertpad = 10; /* vertical padding of bar */ +static const int sidepad = 10; /* horizontal padding of bar */ + +static const char fore[] = "#e5e9f0"; +static const char back[] = "#0f111a"; +static const char border[] = "#3a575c"; +static const char col0[] = "#3b4252"; +static const char col1[] = "#bf616a"; /* red */ +static const char col2[] = "#a3be8c"; /* green */ +static const char col3[] = "#ebcb8b"; /* yellow */ +static const char col4[] = "#81a1c1"; /* light_blue */ +static const char col5[] = "#a48ead"; /* puple */ +static const char col6[] = "#88c0d0"; /* blue */ +static const char col7[] = "#e5e9f0"; /* white */ +static const char col8[] = "#4c566a"; /* gray */ + +static char *colors[][ColCount] = { + /* fg bg border float */ + [SchemeNorm] = { fore, back, border, border}, + [SchemeSel] = { fore, back, col1, col1}, + [SchemeTitleNorm] = { fore, back, border }, + [SchemeTitleSel] = { fore, back, border, border}, + [SchemeTagsNorm] = { fore, back, border, border}, + [SchemeTagsSel] = { back, col1, border, border}, + [SchemeHid] = { back, col4, border, border}, + [SchemeUrg] = { back, col5, border, border}, +}; + diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h new file mode 100644 index 00000000..6438a8b3 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h @@ -0,0 +1,79 @@ +/* Macros and inline functions to swap the order of bytes in integer values. + Copyright (C) 1997-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H +# error "Never use directly; include instead." +#endif + +#ifndef _BITS_BYTESWAP_H +#define _BITS_BYTESWAP_H 1 + +#include +#include + +/* Swap bytes in 16-bit value. */ +#define __bswap_constant_16(x) \ + ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) + +static __inline __uint16_t +__bswap_16 (__uint16_t __bsx) +{ +#if __GNUC_PREREQ (4, 8) + return __builtin_bswap16 (__bsx); +#else + return __bswap_constant_16 (__bsx); +#endif +} + +/* Swap bytes in 32-bit value. */ +#define __bswap_constant_32(x) \ + ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ + | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) + +static __inline __uint32_t +__bswap_32 (__uint32_t __bsx) +{ +#if __GNUC_PREREQ (4, 3) + return __builtin_bswap32 (__bsx); +#else + return __bswap_constant_32 (__bsx); +#endif +} + +/* Swap bytes in 64-bit value. */ +#define __bswap_constant_64(x) \ + ((((x) & 0xff00000000000000ull) >> 56) \ + | (((x) & 0x00ff000000000000ull) >> 40) \ + | (((x) & 0x0000ff0000000000ull) >> 24) \ + | (((x) & 0x000000ff00000000ull) >> 8) \ + | (((x) & 0x00000000ff000000ull) << 8) \ + | (((x) & 0x0000000000ff0000ull) << 24) \ + | (((x) & 0x000000000000ff00ull) << 40) \ + | (((x) & 0x00000000000000ffull) << 56)) + +__extension__ static __inline __uint64_t +__bswap_64 (__uint64_t __bsx) +{ +#if __GNUC_PREREQ (4, 3) + return __builtin_bswap64 (__bsx); +#else + return __bswap_constant_64 (__bsx); +#endif +} + +#endif /* _BITS_BYTESWAP_H */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@byteswap.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..9a5cd0d6a206e08ffc628a670bbde89f569973cd GIT binary patch literal 2992 zcmah~-D@LN6u*-VON~)ODQ$&qomdP_)A>l6X2WiF?bgQbmMv7axG3suGIP`1b~-6D zciKb?{sroj!oG_5@dqdhio1(1f+9r_@l6rghkX&B6xZ?G`A9QqG9ALrWX{L${C?-0 z$sGDm{B+|E;y5JPmMIZK)ol$+bwVwv-l5n!sO^bOBsE*RSn7~1LM2gesWn})OjWWd ze83!6^_sDTgm$aGja5qav7qL1LKD|CY@QY@9JI_GVr&T-F(J5Rb}kKvLzz&W*w9GL zfC^k1A(KnNq8c%%V8apNMLT=g0w$)dQiYOTZ0%uncv9b;Y*`rGLw-7`ORg4DJ}>4) zxhp6XqTvSf{p{D5?}Q3%;2O0}Y=shq8sPydiZuu_@U%KW0qdaP@I(h{vt|xAyVS|+ zc(_Ld0K<0+9UkrRP+@*{`g99OxJ~PEBU+TB-`(iudLv?BD@tJKd8s(OaCd$LqG5v) z+8O8vwWz|LiTy6KtqOJ7t94+gKdJ8Y?b;N#hkHfLJJVkU^eCF{oU<;QQL@55YF6YJ z(54BiEm$y3SQAd^y1!TE0qc8+TGX~cQk z!RT!nHoOAtx+O$Sf}0MsiBNgZQ|A;_dcB02sWt}|b-WL!m?hTLsHW;I_J(cQb$#%9 zcj*T}u|jBmd)`vTkReoJd=!l(XV5c=0xBj}(Y3@G=PNzFdTagh^Ux^g~Dx}{mUq&;%wj3b`}*1V_X$g$70;dx$7~65a-;!_`=)i`M17ANe+G^XaDD4 zHox6Y9S#CmDD(g<6nud0Qy)M^G5|>EyaynEpFL70)_({9KJ2`g|6@nu2La?uJplQV z572$;1Ef(J0C+U(0etbzT|ysBkNW^;cNmY}tB2%v?{jv~Iohrb%e-Q@OKxL*YlbCTub8}-snt$0%OyZ?toRcTz`8el1`^Kez-u?UYPflcEGt<*4 zG(X>$W~H*S5$CFtRY*eugy5TVx;!0vbN!;tC#xqQtY*s$N@c1cQ4C|md7g(-)01hy z$c$#L#<}T{>2phHq&o=xQ-j9G6QEO7td<|f-15ph50k)pt+Mufl4Iu*>Z*7wlRJrR zKUx-LHySi5Z@bZpl|_hVCqxI-yy)Y8`_XAJ?M6e{W#UF>DjA4oCq&==@zw`VzIN|H zF#2lCfZ;MI>;R~jnSowF*}d#6fB7. */ + +#ifndef _BITS_ENDIAN_H +#define _BITS_ENDIAN_H 1 + +/* Definitions for byte order, according to significance of bytes, + from low addresses to high addresses. The value is what you get by + putting '4' in the most significant byte, '3' in the second most + significant byte, '2' in the second least significant byte, and '1' + in the least significant byte, and then writing down one digit for + each byte, starting with the byte at the lowest address at the left, + and proceeding to the byte with the highest address at the right. */ + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __PDP_ENDIAN 3412 + +/* This file defines `__BYTE_ORDER' for the particular machine. */ +#include + +/* Some machines may need to use a different endianness for floating point + values. */ +#ifndef __FLOAT_WORD_ORDER +# define __FLOAT_WORD_ORDER __BYTE_ORDER +#endif + +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) LO, HI +#elif __BYTE_ORDER == __BIG_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) HI, LO +#endif + +#endif /* bits/endian.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endian.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endian.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..d23d913c3c46f6a0a39ca643ceabd880de544f42 GIT binary patch literal 2069 zcmah}J#W)c6tyD+L@-3{00V6!L1{?hI7y?51w>KOCQ{TyB@zM&8OMH29(C>LJ-cZ- zRF#m}7%MUGBUtzt`xlUyV4*B5m0;-HaGyWoxWrBr-@*61^Ul5ZT&KD7+{flI$8%!W z*g@g|cd#kuG((X!krG9uCj4_RNH#5kXn@Eo(5}L{ zP?G4RD?KC~KnX~L4u%u;m99*})9rzYXkYGyBkbnjeH4y}kiZn$rG%e$DpkN?+ZQ_P zl{wZB8-~>=pgaHQ@jE8c5sexFxMHOgF5GsQfK{ZM*c?p6ffhyR5#;)SZC1bsj@F4s zT`$}I+_6lwHxb49s{ngc8Mf2e6iHOuU?Wu;IcBpzkRWr0S6WL`yx|v`q)SiRg0A>CTj{ zjH3jZDBX#oe7{dgi)^Y*2%ll8_uc(TcAjpO*tOr{uPvB?d2I66E# zc=O?uZyA!bR&T7fq^FI|vII|s5#RBNFJ|Gc$In_756UmiEUm;?^oYNGf0jQu`g#sD zqaUBXnod6Ahd)ve7uTzoe@arb+>|OC<=W~7fNuKN`S0V)r9u&uFC-RHF&2xi@}s|r z*Dr7UxduhoTCIA;=b86;0;zbRxLg9Nxx`#9#^QaOichD~YoKZ|Up+Mr7v4f;wRN9u zOqKsWURo{|fNDN552_$~sy directly; include instead." +#endif + +/* i386/x86_64 are little-endian. */ +#define __BYTE_ORDER __LITTLE_ENDIAN + +#endif /* bits/endianness.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endianness.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@endianness.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..60dc0a09a264608df31d4b658d5a9478a079e1bc GIT binary patch literal 1726 zcmah}!EVz)5M8$*MS??aaEt^(sMTg0sX|rIRTbtc;`}|CC*{xgtmk6J8ZCpMTBxapKQ* z%Sol~p~8bu3!SXRVI5AV67m_FttrenYvwZu9=x?)lh@TysuI02J2UM z+5Vysu{O!w`-E)Hul_VYynXQd9$EQVjjcxSr8WQY^LXdt>idmt?;nr4_N$|V?h(Qs zK0+so5L&DMAUx^a{ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h new file mode 100644 index 00000000..296e1cef --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h @@ -0,0 +1,86 @@ +/* Handle feature test macros at the start of a header. + Copyright (C) 2016-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* This header is internal to glibc and should not be included outside + of glibc headers. Headers including it must define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header + cannot have multiple include guards because ISO C feature test + macros depend on the definition of the macro when an affected + header is included, not when the first system header is + included. */ + +#ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +# error "Never include directly." +#endif + +#undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION + +#include + +/* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ + macro. */ +#undef __GLIBC_USE_LIB_EXT2 +#if (defined __USE_GNU \ + || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) +# define __GLIBC_USE_LIB_EXT2 1 +#else +# define __GLIBC_USE_LIB_EXT2 0 +#endif + +/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ + macro. Most but not all symbols enabled by that macro in TS + 18661-1 are enabled unconditionally in C2X; the symbols in Annex F + still require that macro in C2X. */ +#undef __GLIBC_USE_IEC_60559_BFP_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ +# define __GLIBC_USE_IEC_60559_BFP_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_BFP_EXT 0 +#endif +#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X +#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X) +# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1 +#else +# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 +#endif + +/* ISO/IEC TS 18661-4:2015 defines the + __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction + functions, the symbols from this TS are enabled unconditionally in + C2X. */ +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 +#endif +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X) +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 +#endif + +/* ISO/IEC TS 18661-3:2015 defines the + __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ +#undef __GLIBC_USE_IEC_60559_TYPES_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__ +# define __GLIBC_USE_IEC_60559_TYPES_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_TYPES_EXT 0 +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@libc-header-start.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..d5296f43b40d3957a5ca827d39b2deee2a7dab13 GIT binary patch literal 2266 zcma)6&rcIU7@ciUIW%bML1PS(kO+ZnmsX*G0UK&dOOQ0sn))NzYmvy>VS zMo*aVr+CD~g9c6b2S_j;B_8|>yl4V`JKdJ8?oMf%$tLsWd+&YUn;AnV(Y^dW5|C7_ zZDOfODuhZ=y{0OUVF?==Q4CPPgm!I}3AI3-Mhq(2uy9bcS;v4S6$?|@ z@pD#9CuND5lVY)GEIQF)hRPaVcd+k|pX_%ruVaPUCbqf?wG}g2EkarLrEDXuCTPMs zv?RDtL#--i@OHULvDHxO!3at=u|;0sU<5~kqmWq%KHYMvLS#1n>1^Akry&eRG#=0$ zD1V-@jtVGG}JPnR}Nt-hG0hI@tg2 zlP4i=VV2rDR=Z031j+;7QgmN*#jxR(u*;UnO9S%@*M!sQdaFY{I^#u&im6t8MV&eB zu`M~B;0;!H>m~l-Mw4{*j&%$?hHCs&zr#nZxi9d(;uW^+@o!N7#Vv6FC z_;N^qHSa2ter-H_^YQwkmjhztc#cEqQNPmdeO7TKGBO(yV4Zg>{#-g7cs+OYxnmGM Lgu#J9Jt_PJVVxY> literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h new file mode 100644 index 00000000..5b3c8412 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h @@ -0,0 +1,21 @@ +/* Properties of long double type. ldbl-96 version. + Copyright (C) 2016-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* long double is distinct from double, so there is nothing to + define here. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@long-double.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..cfe6e413cc9f9b787732d61cea9490551d4a1a84 GIT binary patch literal 1647 zcma)6L2lGA6wM$G08$q$E09=FIqo2Y*sy5nRH`)6pfa%NCUTtLiD|}(Y^T$31Wv$3 zVBI|%uE0eYzMZ5@VC*4^vhn-h@4x?Eo<+anuWxUoQAG1{3A7OlVQ5^GoE20nPPM@| z&ZGOhU~&a6|`3sW2MZWkMQK<0pVJO$8RKYHkuEmY^%({-zyVEHof|fGb2wofdRFj>qxg z9Z@8b!KKB1`+0FYAbJVR)C%;VQ9q!YqP;Ll^tLN|q;7BoC{RIvqZQAY@*k&-0li|C zAK}CipTLg@P_PW$DE{hpQjQM0`b*h<%nd;tOk^QoxBu|^TN6ppp%tJjUcT@XcMc;W z18Ib5w&IWrCzXQE2R2y)AGBPzmUdot{#@1uZv3b~BCP%#Zx4;>l3=&2Lb76FGaa;n z$rXm5X!ILoWXIOK5<;WJu)dHj9-`NyM& zNisc|y+58#lJm*Q+4;RdRHEhWOJb=q({(|3BdShuDAb!QO{^ L_InYnN7&#u$TD`| literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h new file mode 100644 index 00000000..4ebc4f97 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h @@ -0,0 +1,55 @@ +/* Copyright (C) 2002-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_PTHREADTYPES_ARCH_H +#define _BITS_PTHREADTYPES_ARCH_H 1 + +#include + +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# else +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# endif +#else +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +#endif +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + +#define __LOCK_ALIGNMENT +#define __ONCE_ALIGNMENT + +#ifndef __x86_64__ +/* Extra attributes for the cleanup functions. */ +# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) +#endif + +#endif /* bits/pthreadtypes.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes-arch.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..f0e73f571233a3f8da6faff58fb5952c3900100b GIT binary patch literal 2688 zcmah}O>Em_82%gvXk#1JRB3-`@`g0JbdHlPlnD()+N2~~nnr1+K`);i`)l$s$BF#e zOM?Ug4wbm<1QHj7P&x8*0&(C_O78?V%<-l314Dv=y zb;8#D$($bF`^ac<_XLh}Z0MeZS@5Fae_2%K>Q2m2gs%U#ZjFctqSv%N_(*sSrp6^f z(1ABGE_Vm+OmszLS0rn!p50TJ@L1yujoYWy;UCtH*RaN4_Hgo`ku*ILU7=)8D4uu@ zojrOEy>K{#vWF2mvUBI&%IEhUq%UJ!UYfs-bLG7kLPl=TB%UW)$29PS+DN0#vzp~LefR~ zVmZNU)$g+T>Bd(10Qs9b>_GxE%}1g{mp$HuuwUq9Y@FCFSJ zzf{Q&JIqFQ*oBE1l5%n(Awj+7^SAAve)&wfe}62$uqYMFjq6I53%?*=cs0Rm-X}h? z_|o?J(|7+05&J6;+}TL(AxgP?3FuExoh~ML4Se|`z5U}S>j(Z0(GM&Y?3W_h1Ca9K zERdg?It8XcE&JMkOMbZZ?xA8x8)%SaA t|NQ*ybv#$9F9%m!f3sRx#<|*j5f?$z?pmWj2Q$EZOg;wYLtPk{_CJk~nt1>K literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h new file mode 100644 index 00000000..4d4a2553 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h @@ -0,0 +1,121 @@ +/* Declaration of common pthread types for all architectures. + Copyright (C) 2017-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_PTHREADTYPES_COMMON_H +# define _BITS_PTHREADTYPES_COMMON_H 1 + +/* For internal mutex and condition variable definitions. */ +#include + +/* Thread identifiers. The structure of the attribute type is not + exposed on purpose. */ +typedef unsigned long int pthread_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is not exposed on purpose. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for condition variable handling. The structure of + the attribute type is not exposed on purpose. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int __ONCE_ALIGNMENT pthread_once_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +typedef union +{ + struct __pthread_mutex_s __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + + +typedef union +{ + struct __pthread_cond_s __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for reader-writer lock variable handling. The + structure of the attribute type is deliberately not exposed. */ +typedef union +{ + struct __pthread_rwlock_arch_t __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@pthreadtypes.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..aee600d062cb2859de588087ddb115393e31db74 GIT binary patch literal 6668 zcmcgwe{2)i9e-yI1|hXfKmny5T%0HkP8>VTB*aUiEI0|IwiAUwOcr7s`<&cjpTpfb zAt1I1X-r6ziH&XTR$4lkrj2&2L+e<75wWcu?K;+OqMKCOwVOJowx|MD=qTL2@7+Dy zm)Oq!SuH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v$|dCCI=zeC?M4Q>7cO2vIZz$W2w+6 zUwQqHb??75d;_UhF8sDL9*a3C7`ejry1s~&MEzwgVU_Q5%PTcfmd6qf!=CMtwwL-ecR zd+a-KWatOX^&8)qxl$^GGGyzWF?%{0=cl2I+wEoOetudjcska@^RW;UB4k8CjLYuw zniv;yc`*}oI1#@4^6jsmZSYbb*`||X1SVFrYLylBz<(V{5ymTiHy=r1xgf^vaYMbj zk(<;jwMfg>c+%^#1dSIL+EJGc2cUl7IKQW#>3UGt@J!$G#0y*gyg#>Py~Hzv6TJYoxm>FL)JC2` zcCZpg9yC}NOF__g%Tk*K-q3-2l2OCx-jhvR64OB zHT3S4y|zI7eBXd2P=_udqqU?@|WfE+n z4=r8@Uev?h*t1KQTq1`RO^cDOa8;+7FU|VtgYBa%-UF6nWUMe zlVSd-);G|og61IE9%O^PdQ|kh$iLl9cbA*X$?kHte4D=er0ec)9z4LlNAtn|GC^xF z06EcC^*>m)o9)E1owfJtmT7yN50RSU8nU&9t)Ym#Za;Y8%SHPhHw4vWZR&=gV*3Xc zmb-e78t#=_%lqLTZG7{&REibiQehS9a`TC;zSD_CP^Fm<(_!uKfmu3wkvTFqxkXi& z+)!z#5^E;JhAL%^Tspwz$8ZB>XV^SUq8et0gF1$0&RccXa?6;kdzE_wL`5Y(XBf~5 zMV=!={1lAV1+cii4c>MfsF(G&tMm~;SEJqp=S{Y=w38&;$#&9Y6XG9Udz5?Sl?;U7 z%Ww5#-sreKuU)ZJBz8qsq;_d5Hw^OHL4Ye)tFIzErodC`A-g@Shwi2aV}1(K1tObe zLV?W6gE|E>$4*@Eef!3{hMb12!`mRI6Sk{Ay>{WNF2g;$)!qm9-stI}16-h6(TJueC4q%L. */ + +#ifndef _SYS_SELECT_H +# error "Never use directly; include instead." +#endif + + +/* We don't use `memset' because this would require a prototype and + the array isn't too big. */ +#define __FD_ZERO(s) \ + do { \ + unsigned int __i; \ + fd_set *__arr = (s); \ + for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ + __FDS_BITS (__arr)[__i] = 0; \ + } while (0) +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@select.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@select.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..09937e7ec73005b4107d868c01029a63c6fe386f GIT binary patch literal 1969 zcmb7EJ#P~+7*w|JJnzTdK!0iiLe6)KMC~S_e&2-wWD^?1!zFoNCeIgf1_W4)++Blafh4l)EBm6DA}ihjLKQ zr$b9lq@*JP>PL(_JYd2LK!FvSx@rlnKphi-CJ`J3C_U(MgOw50t`>V-bvey{G=Yn@ z;s8(Ke9>}jEu7WW+G=g(L?{She8*rvecw7v3EknIjwDy9heigiirO9Px^0B8&nnHS_kA6ABZwd!}+D8)spH6#aIqpzL!g3P@^TZjM(Dh`qWZ(2XWvysmps5D?&%RiGNTkXC zg(&UGf}u~=b-dj@&rgXMjb1y5;3p8Z6e*en`yAA!pvqlst23c0r%}X{w38`nyblwu z9n;mKruw1z$A(eM&tBgX`y(P$x`eJ=L}+?=bbkBzOYip^*M0cFU2itmHW5Ns7hu*z z!0|X*VK=d=;ujY%u2f98>E2u4Y~qTlKDVf~jZIu()or{KXFa*wd~5<$JXgmnRfI|l z<%Pv5I2QvnECI`K>7Y?MYWx`5{QDaXh?P^!5KHm)Lcyvyk3MFvto|1;@R>n5YLuzHzEGUKL7e~aI7rx)>`8! Wc)pzS90yA?<(c^@IImxeGyej91I*h1 literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h new file mode 100644 index 00000000..8a1cf5db --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h @@ -0,0 +1,29 @@ +/* Define intN_t types. + Copyright (C) 2017-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_STDINT_INTN_H +#define _BITS_STDINT_INTN_H 1 + +#include + +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; + +#endif /* bits/stdint-intn.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-intn.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..0a5e9c00f1522333b99b0a93f0658c97889b2396 GIT binary patch literal 2146 zcmah}J#W)c6tzQ#f)E5c#ECjYA*!mjwn-@ws>A{e?LdXph=C5qv0sx%9Xq`D+%$X$ zRA6C3Vu1k_HiTF~9lIl7=mH~upb{HH)o|al9qJN0QJbprIrpA>?zx_l4zy19i0+Orwo3yrZi$XrrVIz4X=I&Sq!fu)ta7Go5-{g8Aet+9$CX~ zL$xshvPZg?liNuXx=)FYUCZ%pq$AhHrV9#$(Ac9oW)#%f*k!5@UnwZoZ6l5)zQqiN zTZp!im0UE0;|4_lkKr6#*M%2)rJ_}|^L?Qp#73(e`}xhHD5eM+ z8U`KIGD6ZWjDQ?)Fu732YMLbZalOkB?U?OkgfIu+L&=B~30$EVC7B&eYC*!*jyM~Q zdB_j}!*&`l$cKw)n!B*@>RhrW5grxW$Yq#y2jXD6mf9vLTroeI*ouP~4y1-L713+? z3~eN%Qo_!ywV-?2m?GqSfh5f_I7XYMZkRO*+_g#}O2}4+EHpeS(%~zOjh1#QaIPHt z->C?*fM|uU7L_uSq~tw_)1kv&H=US>C{+#Dhx_;IR832QCW)$#c2)${Al;LGigA2pJvV)>0Jk)+X{GP?3K|Gs>Y&k3x{XQlA7&;QDWY@swF_cFCd?)>++TM@0#C`Qb3`4oqj3$q!yAQfggyWeeJ z7XR*@xc>3MuCpCg0dCOy!YuSwlq0?K**x$4Y;*JO47n)+%O%sMM?zku3cT_0BRnOm zaNe2StF4u7`Yq}vG;;>mESQ02rL2HvMN$IIQM*v{!*@>>j@|!qI;sM%au?Y}{yq-0 zUjhk}lUY6>{{*(>vbiEi(7wLBy|wq^O+*$F_^@1p7&?%UFXur*Udjg&BA-GD2R~jv zHgnHk#i~GCUW9iql}>{7xl&Hc$T=yeaT&cxcThv_*}oS*{Q23MF|I7umW}1wwZ)~H i0l!Pe0>CHEfwR~}#Q~3xSD^Y>cC4D=-}6$BFY_;2_XKkQ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h new file mode 100644 index 00000000..a4fca46f --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h @@ -0,0 +1,29 @@ +/* Define uintN_t types. + Copyright (C) 2017-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_STDINT_UINTN_H +#define _BITS_STDINT_UINTN_H 1 + +#include + +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; + +#endif /* bits/stdint-uintn.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@stdint-uintn.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..0ce206ec9eb2ab65d1d6077c40796a7940b95457 GIT binary patch literal 2188 zcmah~O=}ZT6n#^=P^=oPkPiieh9GGsV`2#vTa=<;7Z#xrMUY`K^O`(6nF;T`X_~t7 z7r4j#2P8ygsu|6`K z)EI{FP@GAsimOs777N9~i7o}k4FfNW*cV@}ZGyF za5!EY9u+a`!hapAN6B)`=P8hqis){Ws zPpdo~JfLhghLDuXrpjYd3Z=>juFjd8bARsse)(uya(_N?Do39EdjC0$bF$>)hzB1h znN0#t5+yyHuls*ofBj+4l#j!&Ts-ZhC(Z{rjs*v*g^e_;+m!qCie*466b_2Y;@TEB zDG^I##-%Q?J_O-ik3N*o?*K@}QUYLW^UuV`JBPjn0G=hHrfZ2?+_NN+O@NdHN_bKN z?!J^jS%A}(0tWj$Tw8Lv9Xyh;q~Njl;m-$aoA*+E`Qi`42bcjP^7#WozqmXj;<5Nq z$bU1Rdv$8|?BgKc(*YT-43U}1>;vE8nRsbTilcZ*Ky=G`Dx}WStxxU4>-TS|^9z+F rb*XZ0VX>lKhTEcg0pgDzgRvnNP7iv&y9oG`vB{Y+ai2vUF)aT8Va^. */ + +#ifndef _THREAD_MUTEX_INTERNAL_H +#define _THREAD_MUTEX_INTERNAL_H 1 + +struct __pthread_mutex_s +{ + int __lock; + unsigned int __count; + int __owner; +#ifdef __x86_64__ + unsigned int __nusers; +#endif + /* KIND must stay at this position in the structure to maintain + binary compatibility with static initializers. */ + int __kind; +#ifdef __x86_64__ + short __spins; + short __elision; + __pthread_list_t __list; +# define __PTHREAD_MUTEX_HAVE_PREV 1 +#else + unsigned int __nusers; + __extension__ union + { + struct + { + short __espins; + short __eelision; +# define __spins __elision_data.__espins +# define __elision __elision_data.__eelision + } __elision_data; + __pthread_slist_t __list; + }; +# define __PTHREAD_MUTEX_HAVE_PREV 0 +#endif +}; + +#ifdef __x86_64__ +# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ + 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } +#else +# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ + 0, 0, 0, __kind, 0, { { 0, 0 } } +#endif + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_mutex.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_mutex.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..d95a7d1fd9b8b66fce95a1a7372a5888d8f06cec GIT binary patch literal 2936 zcmai0O>7%Q7#+J7N{fk1s>n_vB^x`mlw|EBL@liVB_c)+v{qt;s;VlM_3qT3biM2D z%+@s}C?IhmP>x)Hh~p`GlP%UjV1%2kaT&NWGeuv}I%6j{qrQ^`>V-)t4d6iwDENW5y4*RaCK6)Y-~ zlVTOiDmHs<78{0niRcwkB_?b(%;s~!$Dt!Ri<&v2E1IR^9M)AL>%hP!+Obq7i~>8A z=uEWW5>myQb~#Crl(N))`^V zu64jg5$h&)bHFF7BL@!G?pwh*1@?sy>@^9Fv%G(1m|-xBDh+KgtC}#@B84PjRqWAE zcc#n+?`Vg#ut|Y-@!EZpV)q_4D(;g-q)awL;_hf}o9ipG)@Zh%}BXe)jf!5!w6#Xah+h*(5U-$1EeB<8j*3IvKz47?^t8S zFE4@WjfM_CfBLfAy`lKfFvl5+4Gp`TykuB9yx4WDf{Xwg6~odQ8lLAssnOIF2TH|K zQ)>. */ + +#ifndef _RWLOCK_INTERNAL_H +#define _RWLOCK_INTERNAL_H + +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; +#ifdef __x86_64__ + int __cur_writer; + int __shared; + signed char __rwelision; +# ifdef __ILP32__ + unsigned char __pad1[3]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } +# else + unsigned char __pad1[7]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } +# endif + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; +#else /* __x86_64__ */ + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + unsigned char __shared; + signed char __rwelision; + unsigned char __pad2; + int __cur_writer; +#endif +}; + +#ifdef __x86_64__ +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags +#else +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 +#endif + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_rwlock.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@struct_rwlock.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..b231ba0fddf70cd145bae79806aa99a91ec9fe2d GIT binary patch literal 3348 zcma)7T}&KR6uz?^TWmI13Bm%)GFXHHJG+30LQz>2EoDQI5=&a^I6HgUy|B!zGj~c? zQiHZOjj@S+X?*ZO6BA=hd@#W$6EXfgG}Rcz2NPp#YD|3a!3SeBS;uo{X9gB_2R5_w zF!$W=e&;*iIkyM>7h9WN4{#`+)s}F)Kr)2JV>wNcb8$mg;s%8$mPNdhlhq6o&ugg# ztWa_ei%M^=n8k7$>$`0hmoyjhdSe?p~s1;L}=6&Tn= z%a&4v8o(}1R4SVA@`<8_Jcd}3F))=_KAUJcl8W2O#rykX{jompWI#^ic^3Qet<&pe zC(mP!!Iy5Ic;d{Q{kW`q#7M3KbiEC4j_-2CEadEhCaNRw3(V2)@D`K{bYp}O#9n_ zW_9Rh(Ez{Uw79eCevJavV)^Z8lr5z7P^W-3>? z&As&9gV4Tv(S1P?JrF#K9tom5G_>uz+r8+Yvcy?Ty2Kna{m`6`+6v?qch`4AZ8Z8ERF3Lxv3pI^E(aUldVx{4MYDNx$=t58k zGZ=vv!g>kDE&N^+UDgT3x*^T82?_~E0JbI4GRk0E_?A(Jool1L!sg}l{eTt(v~VQc z!_dNfxW_?ro$u6wUBG_D(3f$J7@#!@9d7`{_Hg?ELu}{U2eeY!zuf#{qxOIdOV?22_6NFpPSlVmPgO+!3ez-NLg61)(om`PqRm zo}4&2abijupPQXY*qdA%A#S*C_;>)`BUg~c9O?DPUiD-b2b2jUtpfo`q(&vA^{oDTG8ylPT znH`^*N+hLYAWMf=9wnkcQQ?~N0t|{Hw=b^Eg z?`KPZ8$jVH=JD<$-Gi(k-F)}pV#$%*AJ=ckYJSi7`vj66^^)H1$udVV7p_#YqHqBS zbk%oF2iW_vqm6rk>@rRiQ. */ + +#ifndef _THREAD_SHARED_TYPES_H +#define _THREAD_SHARED_TYPES_H 1 + +/* Arch-specific definitions. Each architecture must define the following + macros to define the expected sizes of pthread data types: + + __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t. + __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t. + __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t. + __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t. + __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t. + __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t. + __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t. + __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. + __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. + + The additional macro defines any constraint for the lock alignment + inside the thread structures: + + __LOCK_ALIGNMENT - for internal lock/futex usage. + + Same idea but for the once locking primitive: + + __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. */ + +#include + + +/* Common definition of pthread_mutex_t. */ + +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; + +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; + +/* Arch-specific mutex definitions. A generic implementation is provided + by sysdeps/nptl/bits/struct_mutex.h. If required, an architecture + can override it by defining: + + 1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t + definition). It should contains at least the internal members + defined in the generic version. + + 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with + atomic operations. + + 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization. + It should initialize the mutex internal flag. */ + +#include + +/* Arch-sepecific read-write lock definitions. A generic implementation is + provided by struct_rwlock.h. If required, an architecture can override it + by defining: + + 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition). + It should contain at least the internal members defined in the + generic version. + + 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization. + It should initialize the rwlock internal type. */ + +#include + + +/* Common definition of pthread_cond_t. */ + +struct __pthread_cond_s +{ + __extension__ union + { + __extension__ unsigned long long int __wseq; + struct + { + unsigned int __low; + unsigned int __high; + } __wseq32; + }; + __extension__ union + { + __extension__ unsigned long long int __g1_start; + struct + { + unsigned int __low; + unsigned int __high; + } __g1_start32; + }; + unsigned int __g_refs[2] __LOCK_ALIGNMENT; + unsigned int __g_size[2]; + unsigned int __g1_orig_size; + unsigned int __wrefs; + unsigned int __g_signals[2]; +}; + +typedef unsigned int __tss_t; +typedef unsigned long int __thrd_t; + +typedef struct +{ + int __data __ONCE_ALIGNMENT; +} __once_flag; + +#define __ONCE_FLAG_INIT { 0 } + +#endif /* _THREAD_SHARED_TYPES_H */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@thread-shared-types.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@thread-shared-types.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..0c9c9003ec819db2cb5d679b38d07de59e2f7783 GIT binary patch literal 4800 zcmb_feQX=$8Gr9~K>t-1sAoi4xO7nx>^i5Ymt#Xn?o&`D|ZvzH{!* zcHM+3NPtAq20|6$Lx2zxAh8Y!RH&v2TG%wH%Kn%r66&OFMSwscO=uhCqv3eo_wGGA z@kbDy6%<2;9=d95Htt8z{@qY*_DQ%cm(#i(JzUnGwN zQAw#e6yC3;_er8Dm!+_{X;U~ar81Jf*5YtQ(`RKh7tY8!EY|eume$*$V6su?c9rA?GsElLn8=M2fjL{AM(k<(EsE;=v}8HmK( zodG!`Wl8LtXZ9Rlv2#{RnI&B^Rsb=^l$O0A#!a_mkwz6bNeZN-HBd#&r}Wmh(^XS4 zDyd@Y2vaUdhI~M39nppYVMwL4UTrHC!7{U}GRtJvC4`2_nRbCrLEG2Uc7-Y#?MeW` zhZ3!cQ_F`K}JCkOC8nGyet;2zi=!}%GVW#vp zZP9>SPAN@+b7~1@L@8~A+j)V)L6fw}bJ5J}Fzsk$)17Ey>Z8IbUCg%*T?5HhNRrmB ztcpg)s#Z!X%^Td6&v^Xejuj4WN&4}|FvG4RbMx<7M!2>>=u#c6dU2NTo|Er&Jb3sM zWIeXL?ulcUKi8j9H8o(v2Qb!DQNmdzm4lTLgt)4=+QY+jfrl^ZmZS9?!L}B6pY`s3 z3yb2bt6qbshTx%e!2ml(coBbR_d8O+~@y1HVZWyn7? z!E;025nI_8dyc&O%EnjIh$`bO_L&>*9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git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h new file mode 100644 index 00000000..af3e7316 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h @@ -0,0 +1,36 @@ +/* bits/time64.h -- underlying types for __time64_t. Generic version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TIME64_H +#define _BITS_TIME64_H 1 + +/* Define __TIME64_T_TYPE so that it is always a 64-bit type. */ + +#if __TIMESIZE == 64 +/* If we already have 64-bit time type then use it. */ +# define __TIME64_T_TYPE __TIME_T_TYPE +#else +/* Define a 64-bit time type alongsize the 32-bit one. */ +# define __TIME64_T_TYPE __SQUAD_TYPE +#endif + +#endif /* bits/time64.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@time64.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..e2be9d7bb2be2f3a6e3cdf94e681a57d07c61f2d GIT binary patch literal 1731 zcmah}&ubGw6rQaf4D=vH=pk)UgdU8ONucB=h)^&GOTk?9;IcdWnjO2@4KuSz*MFp5 zyb1ja)NB6+@!(Mr{|)1t{SmV@I|*S3dEcA&zVCZ)9+5xYPp8+!AuLQLz%nrwnsuXu zdl6HTGo|s{4asdDdGVOgi^P8mT#Fe{-s#W~ya42;WI9jexroO!5E7FUnLTMPM-Ex4 zBoi@@(f}C5f$(DNAaAr5@`YB|T_9pjQ#>pvolU`DWy-ay#RSw8c=M$tT#OYUyoQT} z&vGqTzu)b5d&@?#kpRvN_Vdrz*R@8^z|*M&RlBGnn6oGfx~^JRvO=m1DL{k@HeWR7 zp(mTeex^aqy=gNd7e~BV+x7%L~Q4Gpr zK|VoL1Q2VXv$X`U7N=7QrO#$_YCadetW7OvHJ`sps^Ov;Wtn)RFURT@8il^bMQM`_ zH!@IGn{_C0xv9c=f`D#twcIQ@H@?=W+4coZGuZ$3B^L`5dHKFjr9EjG`hxSycF(-1 z)(_Tl zzbZtwcF4W$1M*;-kXwrnZ@v#ZSC=1McQkx)JUDVk?&#I&F(KsOAr760;r@+Kt5y85 zL^}IB`@Jo5o{)uunTsE@Z-e$_`W}BTKTi8jd+({U_|^M*_50+@q5Et&dRY~Hj. */ + +#if defined __x86_64__ && defined __ILP32__ +/* For x32, time is 64-bit even though word size is 32-bit. */ +# define __TIMESIZE 64 +#else +/* For others, time size is word size. */ +# define __TIMESIZE __WORDSIZE +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@timesize.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@timesize.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..568bf7d00edea615cbf591d4920db5bd92f480dd GIT binary patch literal 1641 zcmah}F>cgA6dgx2P)49FXpoR1L^K{&LaBm8L5dU+2#}D{SoX}1J;ZBUGvnQu18@bn z1SQlt1T<7|0SXSl@@H%(Yp`cmD;M_r^WT5({dq|Kgr8qrl7O(RTmWliDh&(slE*pI ziZgBSA7Rc8n6;fewshTI#?Z_UhwPLd1 zc`blJA!J-214nf5DUn7aJ0S~0YkYW6rm4VURn1LgjH%AK-GCFsB8Z z&%=56=!z&35pZU)Uw)om4v3yXY-$C1a8N&>o1$$PMS84dkJJs0068i+eb9<$v6}vz zGzRo4uBH*52DZN=I$hn)!7)GQ|LE2au`#ZLN#O%_?)uGbBT|6&35=c}Jf0@*@a literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h new file mode 100644 index 00000000..2dc63de5 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h @@ -0,0 +1,228 @@ +/* bits/types.h -- definitions of __*_t types underlying *_t types. + Copyright (C) 2002-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + +#include +#include +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + +/* Fixed-size types, underlying types depend on word size and compiler. */ +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#if __WORDSIZE == 64 +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; +#else +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; +#endif + +/* Smallest types with at least a given width. */ +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + +/* quad_t is also 64 bits. */ +#if __WORDSIZE == 64 +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; +#else +__extension__ typedef long long int __quad_t; +__extension__ typedef unsigned long long int __u_quad_t; +#endif + +/* Largest integral types. */ +#if __WORDSIZE == 64 +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +#else +__extension__ typedef long long int __intmax_t; +__extension__ typedef unsigned long long int __uintmax_t; +#endif + + +/* The machine-dependent file defines __*_T_TYPE + macros for each of the OS types we define below. The definitions + of those macros must use the following macros for underlying types. + We define __S_TYPE and __U_TYPE for the signed and unsigned + variants of each of the following integer types on this machine. + + 16 -- "natural" 16-bit type (always short) + 32 -- "natural" 32-bit type (always int) + 64 -- "natural" 64-bit type (long or long long) + LONG32 -- 32-bit type, traditionally long + QUAD -- 64-bit type, traditionally long long + WORD -- natural type of __WORDSIZE bits (int or long) + LONGWORD -- type of __WORDSIZE bits, traditionally long + + We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the + conventional uses of `long' or `long long' type modifiers match the + types we define, even when a less-adorned type would be the same size. + This matters for (somewhat) portably writing printf/scanf formats for + these types, where using the appropriate l or ll format modifiers can + make the typedefs and the formats match up across all GNU platforms. If + we used `long' when it's 64 bits where `long long' is expected, then the + compiler would warn about the formats not matching the argument types, + and the programmer changing them to shut up the compiler would break the + program's portability. + + Here we assume what is presently the case in all the GCC configurations + we support: long long is always 64 bits, long is always word/address size, + and int is always 32 bits. */ + +#define __S16_TYPE short int +#define __U16_TYPE unsigned short int +#define __S32_TYPE int +#define __U32_TYPE unsigned int +#define __SLONGWORD_TYPE long int +#define __ULONGWORD_TYPE unsigned long int +#if __WORDSIZE == 32 +# define __SQUAD_TYPE __int64_t +# define __UQUAD_TYPE __uint64_t +# define __SWORD_TYPE int +# define __UWORD_TYPE unsigned int +# define __SLONG32_TYPE long int +# define __ULONG32_TYPE unsigned long int +# define __S64_TYPE __int64_t +# define __U64_TYPE __uint64_t +/* We want __extension__ before typedef's that use nonstandard base types + such as `long long' in C89 mode. */ +# define __STD_TYPE __extension__ typedef +#elif __WORDSIZE == 64 +# define __SQUAD_TYPE long int +# define __UQUAD_TYPE unsigned long int +# define __SWORD_TYPE long int +# define __UWORD_TYPE unsigned long int +# define __SLONG32_TYPE int +# define __ULONG32_TYPE unsigned int +# define __S64_TYPE long int +# define __U64_TYPE unsigned long int +/* No need to mark the typedef with __extension__. */ +# define __STD_TYPE typedef +#else +# error +#endif +#include /* Defines __*_T_TYPE macros. */ +#include /* Defines __TIME*_T_TYPE macros. */ + + +__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ +__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ +__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ +__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ +__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ +__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ +__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ +__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ +__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ +__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ +__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ +__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ +__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ +__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ +__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ +__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ +__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ +__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ +__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; + +__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ +__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ + +/* Clock ID used in clock and timer functions. */ +__STD_TYPE __CLOCKID_T_TYPE __clockid_t; + +/* Timer ID returned by `timer_create'. */ +__STD_TYPE __TIMER_T_TYPE __timer_t; + +/* Type to represent block size. */ +__STD_TYPE __BLKSIZE_T_TYPE __blksize_t; + +/* Types from the Large File Support interface. */ + +/* Type to count number of disk blocks. */ +__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; +__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; + +/* Type to count file system blocks. */ +__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; +__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; + +/* Type to count file system nodes. */ +__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; +__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; + +/* Type of miscellaneous file system fields. */ +__STD_TYPE __FSWORD_T_TYPE __fsword_t; + +__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ + +/* Signed long type used in system calls. */ +__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; +/* Unsigned long type used in system calls. */ +__STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; + +/* These few don't really vary by system, they always correspond + to one of the other defined types. */ +typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ +typedef char *__caddr_t; + +/* Duplicates info from stdint.h but this is used in unistd.h. */ +__STD_TYPE __SWORD_TYPE __intptr_t; + +/* Duplicate info from sys/socket.h. */ +__STD_TYPE __U32_TYPE __socklen_t; + +/* C99: An integer type that can be accessed as an atomic entity, + even in the presence of asynchronous interrupts. + It is not currently necessary for this to be machine-specific. */ +typedef int __sig_atomic_t; + +/* Seconds since the Epoch, visible to user code when time_t is too + narrow only for consistency with the old way of widening too-narrow + types. User code should never use __time64_t. */ +#if __TIMESIZE == 64 && defined __LIBC +# define __time64_t __time_t +#elif __TIMESIZE != 64 +__STD_TYPE __TIME64_T_TYPE __time64_t; +#endif + +#undef __STD_TYPE + +#endif /* bits/types.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..59e82acac49f118f64c996ed55a5f70522fbac8e GIT binary patch literal 9013 zcmai33s_Xwwccl<29(Ar>PQK}BS8cl-s6ZPBK3)>52{9+*fkCQawb~?2^o#BFYOF>R(;Du-&pCTIhnIf&R^aTj z{=L?}9((OWJoz#4?VMvejw4Ba(VOIS+g<)VAt~4C6O();g@WjOK@bxiB+20^5Ryuq zOPs!>M3={Ib0vvhdy?qGe^~BgciG%aNWwBt?r#LU&siiS*hh^@a0s?M!TT`fgkq0( zsnfkAAoOjkoiU!K$LOYlRuVT|Nb*S92hV6NA1_gQ_;0zoVk><@k2 zxkME3y5>EXGdD?cI4LD1F(olMKpPCn6Y}Z1?|k{}F^viNg3agmN?i78pVcaMwul(El0wRG+Nq; zS&bj6*PMC1y{N>$_wWnuJg3d=7DSrPJ%s>SVK()=E@fDPGf!~)oW7E7--9joghH>N zWNO&-X$cB?7{Psz^$zfV}!^INhr-L6yq?by9HH)&xf(I|U+qZMVDN9(`aZR8H& z@S?&KMC6;0m++9NE1r3aY1}oKz10(fO5g2LPtyKSv@1;}LG;@|d*Uh@>uz3*P-3zQX`z4U%kSsDOWICA< z;w3A|tK_wi%jAm?lGXl<`K-V8eNef$?|};pLGeKJi-O(b&J!gQ!owp0P?uG= zNXONYx$K8`|>Y8GzO5$5p3HLyqQK`1#eAN}J<`XckX^14 zzR2b+;d4uPbP=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PzLYo6I}u(?pPcEoUm7W3J9Z&@6AOYtz5G2HEkhmGi;-4-UY9w)z1EG8;I!Ee)cptSZ%gT?}FKo7RBtG zFU}-qG*6Aum{w{irL|oX5`1IMPJDY-{p0Ekbu{Tp9gBnAzpI%I`e+=~NzQjfLc7*& z$vv-s9^(<@JjJ3*p9;5cu76{uYE#lTJ}5pSiyI#_9&&2XR7h`-7xJZ$mv~rHyMFmU z9}GNoPOZaL7%C`Hlk2K~`n&6It+P&?K5woR=($#UEe;Qusa^<9K_Lv)4@K5NCMq_0 zXJ$?K#h@^4*Qqho&;Wi=d?M?ojbQwYTEaWp9gzJOFrg@idjRz4O=BxS;d&)}Et#>0AAsNfphyDAud0g2Y z^%h*Yp`7O8wNTINMc$KV0X{F#lGNbJ)8Js`#6}o5gl>QjkaEqBz?c2OS@bUikeGcT z@n;oC{CNfvcN|E3q=Lkq0}{6`NR0fD`0fOWkAjdGydm-N2oh5yB*s`sd|`&fmvcz` zy#*5U86@sskeC@EF?B&=e1gQy9}-`;Au$O-VvK>r5CMsy8WNxEATjGg;tBM}h_TxJj|Lf4L z_utX1H5r;Ru*PmHXnK6C>XH*@u~@D6+vvj7=SWaYe~?WtI1hAv|nQMt=Z5_i#V>VzTw!2N3?4@4Lhk`)Vk*upIvcfghsE@P)WHP SSui6v`|;`8#z3ja;{G2A(G_F> literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h new file mode 100644 index 00000000..e2f18acf --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h @@ -0,0 +1,10 @@ +#ifndef ____sigset_t_defined +#define ____sigset_t_defined + +#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) +typedef struct +{ + unsigned long int __val[_SIGSET_NWORDS]; +} __sigset_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@__sigset_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..945f130276294729fa09ee6d76dead584e0f3b51 GIT binary patch literal 1948 zcmah}&ubGw6rSCNL_BB_p#e)>EK1UJvrQ?b6a?`HB7&Ay5ENN9v(sekb~en+HjO9$ z0xw=Y3!e0%c(WHp1TS9o;!$s2JgM=`Y!b6}cN4-K_I>l-_rCYNSwMg4FE^AXy!Y5s}yCL79tY!O@ z!{w0o&S#fH=bT7zhcX;QK5+>1smFkUCYlH}sT9D@r%c)r962c2>kx(I5tgo`yF_#d z&Q3aj)0Q9rPv8RDbhH*uqfu|vmqtW^h)=c^_SM%r2MMCv#FG&xB9Um=py&ZH5`ZqL zVcldGw>_R6ZuTS*U9Xdk&@IykBpZ=KK{3>dWZ#Yj!{D2p|MVKRsrwj%Q9lnjm}>q| zV{0%X(uIvH!mL+UvWaWo*wiOXQrSzz0T*m{I2lY=?Mq_1G1t_q1BYtY?M9O9XQOg_ zuJp%HJ+DpeZ#89}CoAlsFLG@l+ZT}2Ue+*b2I=cPYJXS=A!PP1{XBE}W9`LbkA=*NMYLR344yoIEFxqSrVFzs zoFx-J82z*FkH5WG^EpB@27EyM6Z796y?OTSwNeBOdN|K`%DK6dkfc;7l_4c6m34+8 zjbA$9)Tl(nfC?kNrMj~!V=Sxd>#hrp7rl%H7bv{IW;B6FFiW?VFu|50xvU%BgX~m^Ri-ed?^} EFa3?r7XSbN literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h new file mode 100644 index 00000000..ce97248f --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h @@ -0,0 +1,9 @@ +#ifndef __clock_t_defined +#define __clock_t_defined 1 + +#include + +/* Returned by `clock'. */ +typedef __clock_t clock_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clock_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..f485c255d8f822ec5186dfca72556a0a891db4c3 GIT binary patch literal 1781 zcmah}J&)5s5M7^6t`M9kudpQzi=YVuI*e5@g|C#Nb_dq&Ad0hPyU2opIj1;u&kT`tHo4k7Um_7bEYI` zO5-=o$S%+0VoKKD+#Jss2k8u(KL)AwW(!?R5gwOIc{*c(1K^N91bV7 z2DOOi!w9<^@e+m+4hn{$9c4JXnUtf$PDT39Zo5I(g>~!NxT65&+AYd`^l+GwwGI_2 z6k6zdBM!CYbS|M4*qlsH;Kqa-Q`=dr@n)5V^I??3>SnPVySv7;7B})q*IMxuQ{~iG zXA-ZPDl`(Lbc>wrNy&u~v^SdTP*7BZ{qIohvM`aiFBYnFEFErd%(QmaXK~&m(K%{b zRCxVWqNvLWwjA!pvE_NQoh@5gN6}dFY$K`b%ij`aMpc)nd1+p*WtHTc?{+nQ*U0mG z{_Qa#WM}#K`-kI?k8XW7bE546(;$ca4*CXBmZ#6^ND|GDy|q@dA7mw;@#UfpI*IRu1ZG8 eOJEfYAKYpFUo-52!34>9dmdKC=Mh<&YJUM6{-aL- literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h new file mode 100644 index 00000000..b17c7da8 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h @@ -0,0 +1,9 @@ +#ifndef __clockid_t_defined +#define __clockid_t_defined 1 + +#include + +/* Clock ID used in clock and timer functions. */ +typedef __clockid_t clockid_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@clockid_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..74942452c82ede83359af957c66e418034a940af GIT binary patch literal 1811 zcmah~F^kkd6rLPM>f;JIun7pu;xUN}dc}g3Hg;APf`nvdb~9dfvdm0wFa8Jr!1dM^ z$7x}+f5J`#LH~l);reEh>?OLH4I#TQ-+S+S@B3cz5d8^nUapacqO4f3sN!?3qcAT> zl1ECCNNKpk3>}g@5p#qui}WocnqM$XPET>h63XPhV7w~iITv$GxrE?CR!@h^p;1&S z8F4}KlCp>i$`b($EYaRk%C!P^lnaeZcsNkHS~7!`CDF0w3#OKg3@2^ie6AS4d$^pZ zk)1^}nS_(@(UvF>p=@TbpMJbv_lV9|qD#qCFHzf|?V>Ii$7)x}7O5&|f#op4;Y2Hv zC35&Utu#}sWI2qm!{P7PFv3B>Ftn`2iUMpDXL^`})TdA|u7fIeD z(K>1_O4$7}RoLYOn+|5Mpc)nd0}3yMVaQiw|3ip zTgdZ!{_QbA=wS2v`rFOt?^jo*Pq1A8f(3DGcb3ywqmz?+sJU*~1|%z?ut20Wf+{|L-=?9tRWP?j3n&2j)3N8 + +/* A set of signals to be blocked, unblocked, or waited for. */ +typedef __sigset_t sigset_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@sigset_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@sigset_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..5f9a6ab6c62989245805b5a11a547b7fbf234e33 GIT binary patch literal 1881 zcmah}J&)5s5M3Xq)DfaSth-YR!rDZfA{rzR1uZ3_iR|5pvz%i`yX)k_kD#HYrJw^L zJ|qfGqUI0KAWEna)rl~>c0R0&H&J9+p0_h^X5QNy4b%n zp~zTTa0nseBFd0~C0Yx`LMvp)MW$(i4+l!mCt$F$V0xg%7}NwFR^EzKbEF0-PG)P^CYrHPB%8zW zT!WfLlV*f%T0DbhgoA=%Xj^GMU3SV)Ij0S6ZVbf21a|?ey}H+0iX#K%S^;jmf6`3c zDu)UVnHGA!6^C3Hok*y3U>sA^LCJON(MqFMcjH3CSu@I^bTfa3)m?2`g_|u)*I3bs zTsdW+M-oj<73vK*-Ldt`QF3PXUTe+eCtRw*Uh9omxA1_ir$7&+UqEz`h_hay5BS7Fc z{UTev=F*= uses. */ +#ifndef _STRUCT_TIMESPEC +#define _STRUCT_TIMESPEC 1 + +#include +#include + +/* POSIX.1b structure for a time value. This is like a `struct timeval' but + has nanoseconds instead of microseconds. */ +struct timespec +{ + __time_t tv_sec; /* Seconds. */ +#if __WORDSIZE == 64 \ + || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ + || __TIMESIZE == 32 + __syscall_slong_t tv_nsec; /* Nanoseconds. */ +#else +# if __BYTE_ORDER == __BIG_ENDIAN + int: 32; /* Padding. */ + long int tv_nsec; /* Nanoseconds. */ +# else + long int tv_nsec; /* Nanoseconds. */ + int: 32; /* Padding. */ +# endif +#endif +}; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timespec.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timespec.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..81b78e06f951a46aa2603affa5b9f28eb2ece60f GIT binary patch literal 2233 zcmah~O=#3W6rO}d`sZ#H@gEtgRIy~^LM_NN;>iQ_=1W?M?b(~Yc)n%I*_Z9(m{;1V`xj9EVPAD4Fy^3 z?v){N$-fQNv)YWLEvL+~XoVGYvSlD#2HUK0&>L~I4W`aT)EQflb5FIFwNEfq>AP;9 zBC;URZXGBZ7beSCidb_k46^mQ>7_s<(yRC(oDiYKwJaq>>0m`NSgytFY{1HDFU@4O z+Y!{tK5SstWoubO^#XaQ2BGD3Uhj7MNg=f-rQZ~izV)WIGL=EJa{%R5w;|B(-9xB#{gH2_kSh%5l&1Oi!ne7P-#@GgkK2T(!E{uA zu76uj;mOD3tu|j=e^kEz^5~`JucasVK38A4sQKW;!>iW4*D!4}DjB#O#8xQ!T$5wp^aD=p zz<0pi=K}Ty2W4EPHcP%2kZ@pnBAeRO{<4nBb|c4+i@M=M zQFP!~9-UbM0EG&N3S)oOoMd^7_w0a-ZH5dZCO4f&rrA0?fM((zAVvT7{vnwHC?9I2 z_)>p2w&zZGS0YRjOBdUCkqNe2RKN&nO AHvj+t literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h new file mode 100644 index 00000000..70394ce8 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h @@ -0,0 +1,13 @@ +#ifndef __timeval_defined +#define __timeval_defined 1 + +#include + +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval +{ + __time_t tv_sec; /* Seconds. */ + __suseconds_t tv_usec; /* Microseconds. */ +}; +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@struct_timeval.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..10bc6c167292d8cfb3939486ecc3771f9610956e GIT binary patch literal 2083 zcmah~zi-n(6h5aBB>_SOh)Pw3j#4pDY!ie!RAS%{Kp??F8QjbH8XtA+=+k*`e(hqzEv@h z?S&m?_j#Ku+wwz7d|L`?O9fxcLsjaNppDFpuyuz~#n+ih7Zyy95toT^!DcTMYdmP1 zE*B6SivH!|a_FobNn!JV`jN|Q7Py=Qz#t}?yVc@K0y~!n%8cMrf>Ql1(^wHv8< zsT#X)pW$ed{KA$LQRRGKrvGPV4>&A9LH* zK9$+zhx(}+MlFBz!VcwUg^UBaiQL&W03cKyY<|4`^2PBlN3>2DB&-WycrHbf(J*kO zqtMLE3_#=0AAL3I)%vNbF(4n7zpZ@!{%KEWA_1bNk{E=Ns9LplqH4(OF#D|xejnYw zh95qAGWhZM{rz{RU(KVzt%K#r+n25oxNMYj35PJjyuz)ul!{I9K16Eqdm~2eWR*Xq>r~>SE zh@l~~2WZ;R#3zQNo%rqIsEp&%l3I7596C0C7~M#E2$^dqYjb}qRRfwZCl5|Tieb)N zvvX;*2WZx6psPC?G|f7$TRIu|V5P~t^S_>&Z&z+6bf7a1n8^d?LZ!Jg$$zjlZDe*6 SH^EI~%D7n3*F`kY;{F47(F2|U literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h new file mode 100644 index 00000000..ab8287c6 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h @@ -0,0 +1,9 @@ +#ifndef __time_t_defined +#define __time_t_defined 1 + +#include + +/* Returned by `time'. */ +typedef __time_t time_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@time_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..4d7f836417f0e15b7a150c199ace93039e684498 GIT binary patch literal 1776 zcmah}!EVz)5M4)=PaJYYyikqCzigT4NKcGDwz0g0|8s9vJ3LEA-BFpkx(k{wdj*aGA@!Qn(JmL+odIIT6P zRk9dH*x`uxFpO|eFbr)g!_iHr3>9|y&t$tcw+3Qig1dn2{@v?uL{xxstpHW=^mLfG zRTvc<3N3WK6Ng+FT}WtkV4T&{LBn-tXsczb&v~WcY8d5kgqc6X>aI4e6U>&SYpm#4 zuADN^nMCtbg?a-{_iVj&o?Mx|_gZuL372ZH|M|%d3j2NlVDKDDo?3v0oiYAg}J4yZZ!|-uln%lLk(tNjZH;r{EJin*R zUJXJ<>*UkfkMl1-Z%qd%sK68mVtaMQnj9XEN&C4oZ_gk5!GX74{(Af1{`kp@E~*O% zjNUMAGPy@y1Kx!N@F1;&bMyb>5aTC)IP!erhbG;o`kiO9ub0n0zxnpz<<~A>jFbfC bz|-Ji^Ls + +/* Timer ID returned by `timer_create'. */ +typedef __timer_t timer_t; + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@timer_t.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@types@timer_t.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..07609e8b09f7040eb264e02483ceca0fe5583f55 GIT binary patch literal 1798 zcmah}v2N5r5M4)+=}<(S!U`vl60OYzNCyoxbQDlPfw6Zd=OsS-w7b5GX;SbHkr3Yj z9a1X(gOYy;9J6ctIFs|<>112lH#2W$-rGa+C;a;Iig+Z-$|*#(mAW?f%{CZ$wmpa;*SWaq?)G zxK$Vx911OTy%C387@bLIbzq#;(?P>^V`!^otIuhr;d~h7aD;PJBhhJUQdH>v zDpl0AVw(!OQW zMFge=6FC~)Ca=tQ@ZxzO0q?~Ec#zh?`v$>Kd>ZbDm~!MF?|44(k4=RYrEAX?TwdOK mcKH}ye_54?k*L6AczkfT`3`Oz24f`a?Rl6PpC@E#vi${;(x&+U literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h new file mode 100644 index 00000000..060af056 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h @@ -0,0 +1,106 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. + Copyright (C) 2012-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +/* X32 kernel interface is 64-bit. */ +#if defined __x86_64__ && defined __ILP32__ +# define __SYSCALL_SLONG_TYPE __SQUAD_TYPE +# define __SYSCALL_ULONG_TYPE __UQUAD_TYPE +#else +# define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +# define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#endif + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __SYSCALL_ULONG_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#ifdef __x86_64__ +# define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE +# define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE +#else +# define __NLINK_T_TYPE __UWORD_TYPE +# define __FSWORD_T_TYPE __SWORD_TYPE +#endif +#define __OFF_T_TYPE __SYSCALL_SLONG_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE +#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE + +#ifdef __x86_64__ +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* And for __rlim_t and __rlim64_t. */ +# define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ +# define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 +#else +# define __RLIM_T_MATCHES_RLIM64_T 0 + +# define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@typesizes.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..0d3cc8b00f296b42be04b105754b29765477a732 GIT binary patch literal 5543 zcma)94QyLi6@Jfa6ATf1xS=hh6elcyuK(gV&YzP!$3L+XC-!0|EM3}H|GdPnb?wN{ zZkwfJ>VQh?G=#LZs6u1iU|Q87C`j!JWg`fr3h2bD0qcr1Kt-D%Dl02x8i<8+pWpSn z&#@h>_9%YmymP<%o$s7`ZJ<6fUkI;IG-XL;5Av2JVL`}S%;{_*mbQqwghkB5KXZ!O zlt{-i3zX?dHol)vJ7m~b%&m@Id1`tROwe9>P^|X(4Wr zc4_JCGY=KV$H`Nmz zPNZVF>hAbbo)-_t7OO`{A$bh_&LY(xzp7 z9xUYfBh{m7XdUsNfYoblQ|bg%2zuj_rVXkt?<{v1)m^o< zTKxo!qu6!*B#{L#CgjOt67#WKjiy-F{fA;{6$mW7g-ij4L?JGkYAHdMoFs^fX(W7$ zMS?aUhKw@Ba*0&+gd1ckZW0x?R$bFsG+?uZc)D_jml(h}s7*SmvEg%+{^Mqz-Lx5)^ZdWkKMS`KpQ4D;P8MSI?u)F2t-?*S*n0FsK#Yxqh zQjil=pgLoZR(mKbB=rUW>SKIB0$8V<>yy`S{CMSr@jS=5gCX}g$pZmY?L$DjY#5%G z@d7-sJ~`!c$Cv;5-+QmTh7};!iBNB`?C7~vrAnK&F*Z;$*r=R!wNbnj{lo1+sCenK z$!@f>EbX?sp_@EL5B%-5d4149tDpbR`;LK=cQ|e`7?>QdND=8FaZHos8+Asrh6ant z5C8GkR_A43E5`*ULrBqBHU#;k2W6gqVA@sEVF%LzB>;r*m5WG+pa}P5 zluX;I$Yq_oJas?Q@6ga-!!l`4Hh%f*pN{U^ghs%u0+lF*@?4@oDXWL^KmowAa<028 zmnZ5P9gC8r%Rn|OAj@`uv_kH_m+7@>Xs|&!?GN_8{^-KFC$39;R)h#_%FnA-shw#D zuwb!ThTLzQz2MV4P?8G#K{q*@=0F>7{r0H+r>W(4C4G`q6BU%Fl~h}4RdNqqOczuT zY^j3Bg4U4M51N<=d5FdIs9aokieFhSOzNUd^78zBYYU>qdi!dwcfbt=n!I zegrgoXDW(VdA=@N3)2F`fW;*LkUg1ta_pr#l9up9`l%crxZ6eGXf0mDh~`nb^wk&`W5%F~z~aVy?>pL`FJ2Ylu!>AayzbDX2d<|$ z{r!Z1%e=$_stURomt8}H#h0?he2;Fd{#EGGNYoYeMM`(m;#cVoY$MjG9Hf`-y|cPm zkA?<|N5Hw$FT0L4ZQWHID*zndu<$qN{3z^8;2z(&bJG<2Gg+ z=ohR*R$2GlDeOrBI2QOS>5o#bVN8R^x~V5f?^`5$n4tXu#9 literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h new file mode 100644 index 00000000..6eb4964a --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h @@ -0,0 +1,50 @@ +/* Inline functions to return unsigned integer values unchanged. + Copyright (C) 2017-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#if !defined _NETINET_IN_H && !defined _ENDIAN_H +# error "Never use directly; include or instead." +#endif + +#ifndef _BITS_UINTN_IDENTITY_H +#define _BITS_UINTN_IDENTITY_H 1 + +#include + +/* These inline functions are to ensure the appropriate type + conversions and associated diagnostics from macros that convert to + a given endianness. */ + +static __inline __uint16_t +__uint16_identity (__uint16_t __x) +{ + return __x; +} + +static __inline __uint32_t +__uint32_identity (__uint32_t __x) +{ + return __x; +} + +static __inline __uint64_t +__uint64_identity (__uint64_t __x) +{ + return __x; +} + +#endif /* _BITS_UINTN_IDENTITY_H. */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@uintn-identity.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..e63d6ad760757297d40260cbae8f1aee55a31353 GIT binary patch literal 2558 zcmah~&ube;6rNR$A&H4aVC^jVuJ#|}c`1&$QNkqW+c2hEYd<85RehOJ#n6x*j3saCBH z^?WK$bG8mbvB!AZ@|ghVQ1q|OhC`+kN#QU~g2<;1{8wXKMVauw@R*`s83(A1o@B?a@GUBFsStc6pr+jaZ(AyFXW(;aR5{gaO#=7{c4 zPep>tT%at$IEw_(b>%e3%u@Ct1sZ^YvjZKFjwfbsxB8081FtvRA{K|;qq8jvC}@Up zDzm+lObK+@-h{GQnqz{*X3Q@#OzU4<{-lXGl|?0huGmq=)dN|vvpwqRk1kj7<#~rS#CyL~PN%Uo5c~wWiP+JoEi2Bwk)l4T!9O!!H zQY)GhD3-Q8F(3UA!SF{dY0aqcsOLbN0+oA- zI;W^IZe@9bbf%ITVV<(>=&BYKH3;?D8b+;P`q&QB&wz}zT>s{n7!`EB{LUWtSwxpgsM(>CW}@sw9B#yrOAI4}Rfs8t5(k1%`n2p?ezdxJJ`3|)FG|aJd40|>P4mq;V{rZcwf{c<_lKhsQFOPC zx<{c}Z6Zt+S0PNztU(x-A!Pq!c@ET__pU~`eB%U!?1Unts%waBdjew-F9HTOF<{IM zb5A-r>n*gfFb~R@n`Yy<6zA30JubtWmCDL%<&m2CzE8bso3+>r(rE0(UUtRSURjwE zudKsTFT9CkFCf-nvDZ>%NqdR=-;y5}{<-Bgwwkxy54N_O+wRueH@2Hw%@5soK%Cko aC{;Y7Q!Q{Ecwczs!e&YTzJ&&Q{{9EDNQgQB literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h new file mode 100644 index 00000000..36623e33 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h @@ -0,0 +1,49 @@ +/* wchar_t type related definitions. + Copyright (C) 2000-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_WCHAR_H +#define _BITS_WCHAR_H 1 + +/* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ + are not defined, give the right value and type as long as both int + and wchar_t are 32-bit types. Adding L'\0' to a constant value + ensures that the type is correct; it is necessary to use (L'\0' + + 0) rather than just L'\0' so that the type in C++ is the promoted + version of wchar_t rather than the distinct wchar_t type itself. + Because wchar_t in preprocessor #if expressions is treated as + intmax_t or uintmax_t, the expression (L'\0' - 1) would have the + wrong value for WCHAR_MAX in such expressions and so cannot be used + to define __WCHAR_MAX in the unsigned case. */ + +#ifdef __WCHAR_MAX__ +# define __WCHAR_MAX __WCHAR_MAX__ +#elif L'\0' - 1 > 0 +# define __WCHAR_MAX (0xffffffffu + L'\0') +#else +# define __WCHAR_MAX (0x7fffffff + L'\0') +#endif + +#ifdef __WCHAR_MIN__ +# define __WCHAR_MIN __WCHAR_MIN__ +#elif L'\0' - 1 > 0 +# define __WCHAR_MIN (L'\0' + 0) +#else +# define __WCHAR_MIN (-__WCHAR_MAX - 1) +#endif + +#endif /* bits/wchar.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wchar.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..58b0dded2906f0987c03c83631bc5f1a0dd777bb GIT binary patch literal 1774 zcmah}O^?$s5OvFkDB^&2B@PIoE=a4gi(?`oZXCLB*gde~OR(ZVlsIl1S; z0}w}k2}s=b2OusS5J!$&`2m!%la>S$SE?*Eelzpt%^Po_-_D1JC#Zu+luj7Q`Isx> z#3}V-A_XN<7~$hIc*UsVM-0>LZ5%N_WMWk?o~7cDCu1CP0l}%r@3xmi znL*Zqsmi!!sL|E_M|18k0k?m z4Hxr(7%hnFI<9kTNfd~LY^1Rtf4n%U5gjpKWrE3CqD6zIi=v?C$)=JEq|BiO7K4KA ziGo})IrFFO2-7`(&Ds%`8k&OP+8$lBLcv0Z|46s!qtdZ~@z4e=2W+2j;gW<&o5nEq zJGa}38w+6`vP5x}H{yT`#Z$q`LF?724Z7gk7+RXu7;us)cHEA#SYGQ-p}MV2V|6`c zVUrbBGL%*us7SzeV;T9-FkUhBa<#-v&%M@~ZDC-j8vEbE7_lIbmJbY;$`=;b7oMxE z_mLmhNGz;3PBM4}vOr>+6HGeL#-j4HP-lfIRTTCGjT%Y)-G>#|L{HT=)Hv0TY?=je z^Lj7aUlc;!YiRSr0Np%~(5d;CpI3IyKKlOE^Pb<^9X|FR?Cm3jE?o!1@r3m&pL+wm z{5L%4$*-Yh!H#a>04O%=P}< luV*i_&)>YAy{At~g1eCI@{(TlqUS=6^^5CUU41%5jz6PQmgN8d literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h new file mode 100644 index 00000000..70f652bc --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h @@ -0,0 +1,17 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __x86_64__ && !defined __ILP32__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 +#endif + +#ifdef __x86_64__ +# define __WORDSIZE_TIME64_COMPAT32 1 +/* Both x86-64 and x32 use the 64-bit system call interface. */ +# define __SYSCALL_WORDSIZE 64 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@bits@wordsize.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..af503fec98573ee5f373b12486b092e6b3e47142 GIT binary patch literal 1783 zcmah}O>fgc5Zxp_P_;oQ;s+psdZ27fAmmn1Rf<&9s8tgQ(TioTr}0w9j&|2gjl{Ko z1|d!$j{Or{xFG%j2X0&l{}LAl16GG|O_5&ta(GvK*z^h}eIIuj|@O zHX)v}(Alb7fvZg=rU@LnVy4+%iE%vDf^glo;K*X^!nPztQ@Xd<5`YHqhL zEUzFU57xjB@fQ%MJ>VHrJ`nOUvX{3Gt-UC3*tX)5Zd1I z<(;;lKSZi)0_UwpVSr#xo=pu68`n|nvy. */ + +#ifndef _ENDIAN_H +#define _ENDIAN_H 1 + +#include + +/* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */ +#include + +#ifdef __USE_MISC +# define LITTLE_ENDIAN __LITTLE_ENDIAN +# define BIG_ENDIAN __BIG_ENDIAN +# define PDP_ENDIAN __PDP_ENDIAN +# define BYTE_ORDER __BYTE_ORDER +#endif + +#if defined __USE_MISC && !defined __ASSEMBLER__ +/* Conversion interfaces. */ +# include +# include + +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define htobe16(x) __bswap_16 (x) +# define htole16(x) __uint16_identity (x) +# define be16toh(x) __bswap_16 (x) +# define le16toh(x) __uint16_identity (x) + +# define htobe32(x) __bswap_32 (x) +# define htole32(x) __uint32_identity (x) +# define be32toh(x) __bswap_32 (x) +# define le32toh(x) __uint32_identity (x) + +# define htobe64(x) __bswap_64 (x) +# define htole64(x) __uint64_identity (x) +# define be64toh(x) __bswap_64 (x) +# define le64toh(x) __uint64_identity (x) + +# else +# define htobe16(x) __uint16_identity (x) +# define htole16(x) __bswap_16 (x) +# define be16toh(x) __uint16_identity (x) +# define le16toh(x) __bswap_16 (x) + +# define htobe32(x) __uint32_identity (x) +# define htole32(x) __bswap_32 (x) +# define be32toh(x) __uint32_identity (x) +# define le32toh(x) __bswap_32 (x) + +# define htobe64(x) __uint64_identity (x) +# define htole64(x) __bswap_64 (x) +# define be64toh(x) __uint64_identity (x) +# define le64toh(x) __bswap_64 (x) +# endif +#endif + +#endif /* endian.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@endian.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@endian.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..ff41114ff583010d0a6714023555a7d6b530e1dd GIT binary patch literal 2991 zcmah}O>7%g5MD<`C?KNB*%n9}DJnQ|n(S`YPJIA@O0h$Oq7tg~P%g{{6c7h4HS^Z*d3Uq++OkI4 zc{AVpX6BoBkh?2>w%Ft{oK&+{kkr6c>`9_&>#8ZajxM<#{KXo#OE*=k$_eYX_7c)P zyov;UYD%af)j&?aWMR#APGPGm7}$Yi+i5(}`#Nr1@?A&5mTvk6k~HkOK*7M4C-`72 zAQNy-MtO}oBC(FIdy0owkXuK3-*8-Y5roI$Osq*k!ICVCvN+RW14In8OkywIc%d1i zu#8mCcaR$cidE6(rzmc>D_Nx5fD(`iZR!oQrq@)b_p#RSkh`YVdq)J#!KYF0h!hHh zVNgo%>~^I($mrCL&ayItu|~qMkrqhjpFVzM8CbO}K*xGG!;Nt+1Acn<@jZ z=D>yvF6a#zLZ7MA&2!es++)-J5#}tJilx7vSonzqTxQxup2L^~;;#wKVZT&d$w*BAe%}vPFl5oV;hSSI! zsg!0Z&I~^TIAG@}&e`9aSLH*u?ln=d;Muh(E$Rws6$?9QiM$AKU>U7%F5mg-`Bxum zYDqZiiqa|;C@p~(00%6ib^Yg)GiT0Sy9<0ezfA7F+=0WH)?c?qF1-6mWm2geE6+c5 zOgRb>S=P&rb5Mr1Wp`%*7wkAK_qB~C(%w07=E(drG!l||mK=Hq6(#%tpnchW;{(JV zra(`A@M!Mq?Z5Mj<;5;Qp%;L{4*=Sq-48%u8PL;P=kZtnzU~BrEEa%HR2QUaT{||# zPeEm1S;ualzg~LwVe!(DlS>ulx#Q)^@mOUYFR85a0fa`gqd*8OBeb!Nh1Kug8(WxP zT3V=t#f`8o#SQ>2_6>+5*^%i1Vi#zy{`o%p>CLw$)=ear5*iC!p~mFWPK{0SlTayG zrm@?9JaD79dG!slMhUpU6~ZMqsmK=r4lIK^cW3w67a#oderQ+cm&qN>9R;af92QUC zb7J(DU^sFK&f~+8OVQ!TB`W7}ejM%q%ZBsq{D)h=E`PM8B|AV}U2*b!9&o@ioW1(v zzkS^Le30z-j?$?siqqNp0$%_eungym&6kJXzaTsoygZ4z$eh9!CMPn%PXHWP*22BR dm;Fnx{IDIsB{WRlkq|EVh)na-00)-B{SR%o{}2EG literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h new file mode 100644 index 00000000..c6ff9713 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h @@ -0,0 +1,500 @@ +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _FEATURES_H +#define _FEATURES_H 1 + +/* These are defined by the user (or the compiler) + to specify the desired environment: + + __STRICT_ANSI__ ISO Standard C. + _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. + _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. + _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X. + __STDC_WANT_LIB_EXT2__ + Extensions to ISO C99 from TR 27431-2:2010. + __STDC_WANT_IEC_60559_BFP_EXT__ + Extensions to ISO C11 from TS 18661-1:2014. + __STDC_WANT_IEC_60559_FUNCS_EXT__ + Extensions to ISO C11 from TS 18661-4:2015. + __STDC_WANT_IEC_60559_TYPES_EXT__ + Extensions to ISO C11 from TS 18661-3:2015. + + _POSIX_SOURCE IEEE Std 1003.1. + _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; + if >=199309L, add IEEE Std 1003.1b-1993; + if >=199506L, add IEEE Std 1003.1c-1995; + if >=200112L, all of IEEE 1003.1-2004 + if >=200809L, all of IEEE 1003.1-2008 + _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if + Single Unix conformance is wanted, to 600 for the + sixth revision, to 700 for the seventh revision. + _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. + _LARGEFILE_SOURCE Some more functions for correct standard I/O. + _LARGEFILE64_SOURCE Additional functionality from LFS for large files. + _FILE_OFFSET_BITS=N Select default filesystem interface. + _ATFILE_SOURCE Additional *at interfaces. + _GNU_SOURCE All of the above, plus GNU extensions. + _DEFAULT_SOURCE The default set of features (taking precedence over + __STRICT_ANSI__). + + _FORTIFY_SOURCE Add security hardening to many library functions. + Set to 1 or 2; 2 performs stricter checks than 1. + + _REENTRANT, _THREAD_SAFE + Obsolete; equivalent to _POSIX_C_SOURCE=199506L. + + The `-ansi' switch to the GNU C compiler, and standards conformance + options such as `-std=c99', define __STRICT_ANSI__. If none of + these are defined, or if _DEFAULT_SOURCE is defined, the default is + to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to + 200809L, as well as enabling miscellaneous functions from BSD and + SVID. If more than one of these are defined, they accumulate. For + example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together + give you ISO C, 1003.1, and 1003.2, but nothing else. + + These are defined by this file and are used by the + header files to decide what to declare or define: + + __GLIBC_USE (F) Define things from feature set F. This is defined + to 1 or 0; the subsequent macros are either defined + or undefined, and those tests should be moved to + __GLIBC_USE. + __USE_ISOC11 Define ISO C11 things. + __USE_ISOC99 Define ISO C99 things. + __USE_ISOC95 Define ISO C90 AMD1 (C95) things. + __USE_ISOCXX11 Define ISO C++11 things. + __USE_POSIX Define IEEE Std 1003.1 things. + __USE_POSIX2 Define IEEE Std 1003.2 things. + __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. + __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. + __USE_XOPEN Define XPG things. + __USE_XOPEN_EXTENDED Define X/Open Unix things. + __USE_UNIX98 Define Single Unix V2 things. + __USE_XOPEN2K Define XPG6 things. + __USE_XOPEN2KXSI Define XPG6 XSI things. + __USE_XOPEN2K8 Define XPG7 things. + __USE_XOPEN2K8XSI Define XPG7 XSI things. + __USE_LARGEFILE Define correct standard I/O things. + __USE_LARGEFILE64 Define LFS things with separate names. + __USE_FILE_OFFSET64 Define 64bit interface as default. + __USE_MISC Define things from 4.3BSD or System V Unix. + __USE_ATFILE Define *at interfaces and AT_* constants for them. + __USE_GNU Define GNU extensions. + __USE_FORTIFY_LEVEL Additional security measures used, according to level. + + The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are + defined by this file unconditionally. `__GNU_LIBRARY__' is provided + only for compatibility. All new code should use the other symbols + to test for features. + + All macros listed above as possibly being defined by this file are + explicitly undefined if they are not explicitly defined. + Feature-test macros that are not defined by the user or compiler + but are implied by the other feature-test macros defined (or by the + lack of any definitions) are defined by the file. + + ISO C feature test macros depend on the definition of the macro + when an affected header is included, not when the first system + header is included, and so they are handled in + , which does not have a multiple include + guard. Feature test macros that can be handled from the first + system header included are handled here. */ + + +/* Undefine everything, so we get a clean slate. */ +#undef __USE_ISOC11 +#undef __USE_ISOC99 +#undef __USE_ISOC95 +#undef __USE_ISOCXX11 +#undef __USE_POSIX +#undef __USE_POSIX2 +#undef __USE_POSIX199309 +#undef __USE_POSIX199506 +#undef __USE_XOPEN +#undef __USE_XOPEN_EXTENDED +#undef __USE_UNIX98 +#undef __USE_XOPEN2K +#undef __USE_XOPEN2KXSI +#undef __USE_XOPEN2K8 +#undef __USE_XOPEN2K8XSI +#undef __USE_LARGEFILE +#undef __USE_LARGEFILE64 +#undef __USE_FILE_OFFSET64 +#undef __USE_MISC +#undef __USE_ATFILE +#undef __USE_GNU +#undef __USE_FORTIFY_LEVEL +#undef __KERNEL_STRICT_NAMES +#undef __GLIBC_USE_ISOC2X +#undef __GLIBC_USE_DEPRECATED_GETS +#undef __GLIBC_USE_DEPRECATED_SCANF + +/* Suppress kernel-name space pollution unless user expressedly asks + for it. */ +#ifndef _LOOSE_KERNEL_NAMES +# define __KERNEL_STRICT_NAMES +#endif + +/* Convenience macro to test the version of gcc. + Use like this: + #if __GNUC_PREREQ (2,8) + ... code requiring gcc 2.8 or later ... + #endif + Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was + added in 2.0. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __GNUC_PREREQ(maj, min) 0 +#endif + +/* Similarly for clang. Features added to GCC after version 4.2 may + or may not also be available in clang, and clang's definitions of + __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such + features can be queried via __has_extension/__has_feature. */ +#if defined __clang_major__ && defined __clang_minor__ +# define __glibc_clang_prereq(maj, min) \ + ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) +#else +# define __glibc_clang_prereq(maj, min) 0 +#endif + +/* Whether to use feature set F. */ +#define __GLIBC_USE(F) __GLIBC_USE_ ## F + +/* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for + _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not + issue a warning; the expectation is that the source is being + transitioned to use the new macro. */ +#if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ + && !defined _DEFAULT_SOURCE +# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +#endif + +/* If _GNU_SOURCE was defined by the user, turn on all the other features. */ +#ifdef _GNU_SOURCE +# undef _ISOC95_SOURCE +# define _ISOC95_SOURCE 1 +# undef _ISOC99_SOURCE +# define _ISOC99_SOURCE 1 +# undef _ISOC11_SOURCE +# define _ISOC11_SOURCE 1 +# undef _ISOC2X_SOURCE +# define _ISOC2X_SOURCE 1 +# undef _POSIX_SOURCE +# define _POSIX_SOURCE 1 +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200809L +# undef _XOPEN_SOURCE +# define _XOPEN_SOURCE 700 +# undef _XOPEN_SOURCE_EXTENDED +# define _XOPEN_SOURCE_EXTENDED 1 +# undef _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +# undef _ATFILE_SOURCE +# define _ATFILE_SOURCE 1 +#endif + +/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, + define _DEFAULT_SOURCE. */ +#if (defined _DEFAULT_SOURCE \ + || (!defined __STRICT_ANSI__ \ + && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE \ + && !defined _ISOC2X_SOURCE \ + && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ + && !defined _XOPEN_SOURCE)) +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +#endif + +/* This is to enable the ISO C2X extension. */ +#if (defined _ISOC2X_SOURCE \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) +# define __GLIBC_USE_ISOC2X 1 +#else +# define __GLIBC_USE_ISOC2X 0 +#endif + +/* This is to enable the ISO C11 extension. */ +#if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) +# define __USE_ISOC11 1 +#endif + +/* This is to enable the ISO C99 extension. */ +#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ + || defined _ISOC2X_SOURCE \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) +# define __USE_ISOC99 1 +#endif + +/* This is to enable the ISO C90 Amendment 1:1995 extension. */ +#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ + || defined _ISOC2X_SOURCE \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) +# define __USE_ISOC95 1 +#endif + +#ifdef __cplusplus +/* This is to enable compatibility for ISO C++17. */ +# if __cplusplus >= 201703L +# define __USE_ISOC11 1 +# endif +/* This is to enable compatibility for ISO C++11. + Check the temporary macro for now, too. */ +# if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__ +# define __USE_ISOCXX11 1 +# define __USE_ISOC99 1 +# endif +#endif + +/* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE + is defined, use POSIX.1-2008 (or another version depending on + _XOPEN_SOURCE). */ +#ifdef _DEFAULT_SOURCE +# if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE +# define __USE_POSIX_IMPLICITLY 1 +# endif +# undef _POSIX_SOURCE +# define _POSIX_SOURCE 1 +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200809L +#endif + +#if ((!defined __STRICT_ANSI__ \ + || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \ + && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) +# define _POSIX_SOURCE 1 +# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 +# define _POSIX_C_SOURCE 2 +# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 +# define _POSIX_C_SOURCE 199506L +# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 +# define _POSIX_C_SOURCE 200112L +# else +# define _POSIX_C_SOURCE 200809L +# endif +# define __USE_POSIX_IMPLICITLY 1 +#endif + +/* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be + defined in all multithreaded code. GNU libc has not required this + for many years. We now treat them as compatibility synonyms for + _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with + comprehensive support for multithreaded code. Using them never + lowers the selected level of POSIX conformance, only raises it. */ +#if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \ + && (defined _REENTRANT || defined _THREAD_SAFE)) +# define _POSIX_SOURCE 1 +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 199506L +#endif + +#if (defined _POSIX_SOURCE \ + || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \ + || defined _XOPEN_SOURCE) +# define __USE_POSIX 1 +#endif + +#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE +# define __USE_POSIX2 1 +#endif + +#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L +# define __USE_POSIX199309 1 +#endif + +#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L +# define __USE_POSIX199506 1 +#endif + +#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L +# define __USE_XOPEN2K 1 +# undef __USE_ISOC95 +# define __USE_ISOC95 1 +# undef __USE_ISOC99 +# define __USE_ISOC99 1 +#endif + +#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L +# define __USE_XOPEN2K8 1 +# undef _ATFILE_SOURCE +# define _ATFILE_SOURCE 1 +#endif + +#ifdef _XOPEN_SOURCE +# define __USE_XOPEN 1 +# if (_XOPEN_SOURCE - 0) >= 500 +# define __USE_XOPEN_EXTENDED 1 +# define __USE_UNIX98 1 +# undef _LARGEFILE_SOURCE +# define _LARGEFILE_SOURCE 1 +# if (_XOPEN_SOURCE - 0) >= 600 +# if (_XOPEN_SOURCE - 0) >= 700 +# define __USE_XOPEN2K8 1 +# define __USE_XOPEN2K8XSI 1 +# endif +# define __USE_XOPEN2K 1 +# define __USE_XOPEN2KXSI 1 +# undef __USE_ISOC95 +# define __USE_ISOC95 1 +# undef __USE_ISOC99 +# define __USE_ISOC99 1 +# endif +# else +# ifdef _XOPEN_SOURCE_EXTENDED +# define __USE_XOPEN_EXTENDED 1 +# endif +# endif +#endif + +#ifdef _LARGEFILE_SOURCE +# define __USE_LARGEFILE 1 +#endif + +#ifdef _LARGEFILE64_SOURCE +# define __USE_LARGEFILE64 1 +#endif + +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 +# define __USE_FILE_OFFSET64 1 +#endif + +#if defined _DEFAULT_SOURCE +# define __USE_MISC 1 +#endif + +#ifdef _ATFILE_SOURCE +# define __USE_ATFILE 1 +#endif + +#ifdef _GNU_SOURCE +# define __USE_GNU 1 +#endif + +#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 +# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 +# warning _FORTIFY_SOURCE requires compiling with optimization (-O) +# elif !__GNUC_PREREQ (4, 1) +# warning _FORTIFY_SOURCE requires GCC 4.1 or later +# elif _FORTIFY_SOURCE > 2 && __glibc_clang_prereq (9, 0) +# if _FORTIFY_SOURCE > 3 +# warning _FORTIFY_SOURCE > 3 is treated like 3 on this platform +# endif +# define __USE_FORTIFY_LEVEL 3 +# elif _FORTIFY_SOURCE > 1 +# if _FORTIFY_SOURCE > 2 +# warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform +# endif +# define __USE_FORTIFY_LEVEL 2 +# else +# define __USE_FORTIFY_LEVEL 1 +# endif +#endif +#ifndef __USE_FORTIFY_LEVEL +# define __USE_FORTIFY_LEVEL 0 +#endif + +/* The function 'gets' existed in C89, but is impossible to use + safely. It has been removed from ISO C11 and ISO C++14. Note: for + compatibility with various implementations of , this test + must consider only the value of __cplusplus when compiling C++. */ +#if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11 +# define __GLIBC_USE_DEPRECATED_GETS 0 +#else +# define __GLIBC_USE_DEPRECATED_GETS 1 +#endif + +/* GNU formerly extended the scanf functions with modified format + specifiers %as, %aS, and %a[...] that allocate a buffer for the + input using malloc. This extension conflicts with ISO C99, which + defines %a as a standalone format specifier that reads a floating- + point number; moreover, POSIX.1-2008 provides the same feature + using the modifier letter 'm' instead (%ms, %mS, %m[...]). + + We now follow C99 unless GNU extensions are active and the compiler + is specifically in C89 or C++98 mode (strict or not). For + instance, with GCC, -std=gnu11 will have C99-compliant scanf with + or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the + old extension. */ +#if (defined __USE_GNU \ + && (defined __cplusplus \ + ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \ + : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))) +# define __GLIBC_USE_DEPRECATED_SCANF 1 +#else +# define __GLIBC_USE_DEPRECATED_SCANF 0 +#endif + +/* Get definitions of __STDC_* predefined macros, if the compiler has + not preincluded this header automatically. */ +#include + +/* This macro indicates that the installed library is the GNU C Library. + For historic reasons the value now is 6 and this will stay from now + on. The use of this variable is deprecated. Use __GLIBC__ and + __GLIBC_MINOR__ now (see below) when you want to test for a specific + GNU C library version and use the values in to get + the sonames of the shared libraries. */ +#undef __GNU_LIBRARY__ +#define __GNU_LIBRARY__ 6 + +/* Major and minor version number of the GNU C library package. Use + these macros to test for features in specific releases. */ +#define __GLIBC__ 2 +#define __GLIBC_MINOR__ 33 + +#define __GLIBC_PREREQ(maj, min) \ + ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) + +/* This is here only because every header file already includes this one. */ +#ifndef __ASSEMBLER__ +# ifndef _SYS_CDEFS_H +# include +# endif + +/* If we don't have __REDIRECT, prototypes will be missing if + __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ +# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT +# define __USE_LARGEFILE 1 +# define __USE_LARGEFILE64 1 +# endif + +#endif /* !ASSEMBLER */ + +/* Decide whether we can define 'extern inline' functions in headers. */ +#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ + && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ + && defined __extern_inline +# define __USE_EXTERN_INLINES 1 +#endif + + +/* This is here only because every header file already includes this one. + Get the definitions of all the appropriate `__stub_FUNCTION' symbols. + contains `#define __stub_FUNCTION' when FUNCTION is a stub + that will always return failure (and set errno to ENOSYS). */ +#include + + +#endif /* features.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@features.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..b102c2a447a1defa846e8c71b9f20aa91dcf6e5f GIT binary patch literal 6002 zcma)94QvzF9rsH@gR_jLH=5FdI*+uG6Jp0U#v~L%5@QFG#K~-@4Ikrh>?1MctF}WL z#9(TxBDM;ID%v4cg{*_NBi#ZLqjb$mS=TW@kW$LJbt{C84aQX34XNA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-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h new file mode 100644 index 00000000..b7457215 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h @@ -0,0 +1,17 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ + +#ifdef _LIBC + #error Applications may not define the macro _LIBC +#endif + +#define __stub___compat_bdflush +#define __stub_chflags +#define __stub_fchflags +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs-64.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..8a8344feb35f0e8f0f1c02a63e284006ebf96298 GIT binary patch literal 2099 zcmah}O>5LZ7@jPO_S2ktkRk=4ht?#mh&THKM8un-;F3&clWAv@WoFWC3SNX>iZ`V< z!CQ|~MGy8;`Wq@~6BK`yTQ>?=#Q)xrF|?pB^0{3wd$cCSFb> zDm|B_*k_*L*b@?dZj3Hr<|h$yw$fmoU`aQLgO`_`nD`;#b*^%LMmmf>{<4k0c@W6HuUqmRtdq!jpN22++tgESr+HiRchK7EU8U0A9i|8hAQO zZ*|pObyxZlgbYK{QrOQwo*tDXw1_V=PDF{QC;fuHW>buMvWFBoq(B(drkbdWW1m;M zgIp5P^*hxFT^zbisu493ltNwV>gb{q7-nZXjlh?veQI5@ULlqF&+sK zbuECYxO=Bsc&46kXh;%CWj+!ITCmgM#LR)(nbI5-T1STJq|JP`GfB3pQ8lx!>W|^| zx-|7Bs4nxmvcfKgqIL{q%weq^0rN&eXH3^kX1uHVUP`TQpP=FjJG4)_SP+QKWpRY` zdCgJ`ZU3gvN+O0w4^powq8U0p64gYVqC{g#a}nkE9LLp!W0;CGRcq@y%Tje>(=1@4 zcRWfmIFwn?Paj#A(Uob0uAa?pr(fgUH-~Vi0HBT)CveyjgwVoG7(1Gfg<+p{&AztM z&=#FpfIa*61pPfdees}&l`@CVbAuH6vt`@%VnbUKeei6ay=?8A^rDGmX+)KX8-ome zmo;n8x(#g&%a=dT*AGAJ{WL7mXbr_@YucU$4a%D6z4yn?{qK+WO*AK)=>`D>*9R2z z9M+6Iv((VmFf6`HUVl88eP|e3IBqdN5+kxWcUe>R6l9^SVOiTbe)W6**QsGSCz&4* z()U=C_T;UGwua;O(k>HkPuhl~*~DqP +#endif +#if defined __x86_64__ && defined __LP64__ +# include +#endif +#if defined __x86_64__ && defined __ILP32__ +# include +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@gnu@stubs.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..6b817bd901cb0895041c2685cfc122e436002d9a GIT binary patch literal 1579 zcmah}%TC-d6g8+-7tl>Vq6?5?Myk5&Kd@#qa_mcD@Hmkl4B@|E&9C%Fs$M%87(?Pn zQ8qrd&pi)ckbl+l^(#3ctnGHd2GuCfD%}aLnX`g9k6+c2FG6$E5c=5FcObla04gpo zX$xF}UE56eoxNA4p;B4g+}YvJ@^$1V3(hiSgbor|t-M1DQW;MJ{tS{yoIj)d&_l%9 zApF*=9k?FEDqJ-V5T4<*s#zMCZ8p`Wx_V=SL?qls?91Pq*Nnm~a33tV?4WFlk>7Uf z=B_*--GC#2Mwylm+KZOk<>h+t;P$*M!v2(wM0U(Pdkb6>BM7F$TW1*l_AFZy@Q4>r?aWKKh. */ + +#ifndef _STDC_PREDEF_H +#define _STDC_PREDEF_H 1 + +/* This header is separate from features.h so that the compiler can + include it implicitly at the start of every compilation. It must + not itself include or any other header that includes + because the implicit include comes before any feature + test macros that may be defined in a source file before it first + explicitly includes a system header. GCC knows the name of this + header in order to preinclude it. */ + +/* glibc's intent is to support the IEC 559 math functionality, real + and complex. If the GCC (4.9 and later) predefined macros + specifying compiler intent are available, use them to determine + whether the overall intent is to support these features; otherwise, + presume an older compiler has intent to support these features and + define these macros by default. */ + +#ifdef __GCC_IEC_559 +# if __GCC_IEC_559 > 0 +# define __STDC_IEC_559__ 1 +# endif +#else +# define __STDC_IEC_559__ 1 +#endif + +#ifdef __GCC_IEC_559_COMPLEX +# if __GCC_IEC_559_COMPLEX > 0 +# define __STDC_IEC_559_COMPLEX__ 1 +# endif +#else +# define __STDC_IEC_559_COMPLEX__ 1 +#endif + +/* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is + synchronized with ISO/IEC 10646:2017, fifth edition, plus + the following additions from Amendment 1 to the fifth edition: + - 56 emoji characters + - 285 hentaigana + - 3 additional Zanabazar Square characters */ +#define __STDC_ISO_10646__ 201706L + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdc-predef.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdc-predef.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..8ab2c420b6252d8cffcbecd1f4c521c78544c0af GIT binary patch literal 1868 zcmah}L2lDP6rF@_(p43~0tul?MNknOJ5`#J1)HX+Kq_j~vH&)NJ)XvsI(9TOZen1` z6*vQ20M_LQNJy*@f?Kd5e2?Rhr13L(77vzNdf9y7Dyw4LxYm>fF@WT5s4-1Q!$_LPs*W3lYX3@Ku0f%@QJ zKGBePHqXCyVoAl&9^@mGIqWsfM`$D@3RNrl)oG^$5_Z1eY}V$CAqvJ^9dI&#{rJ-m z1ytxp0I6uy^M$K~8O)`DWHMfgOSLS$nq*bwuOCS|%13DupZH54Wx6(0(vvB2oo%p@ zuF#HIdK{M95RfP88Y`wc*(^Rx<~rA!ZeL(%3HHjqD6^oDO#Uy1kT%zZKF!q3c3;^3 zoQN!1-5`RWK;#HRH)%x&-e_DNr0%S6Wfo=FoOnw`{m=V~YcrXuZm52k{A0t&@t3df zwEgTMRNO-M)+@+dM`&&Q;`YZ@@9q9ij8C5(wD6PDV_dTu^#;ZWp*vfUI~LH*tGA`n zj#b;U8b=5fnj6h}F*y&>xBzA2ccZU=zVzN-&&t{@yt~`Pt>dSiqxN$}Z7otSVoEh& zw#wFiF*!5lYq57j-uz7#m=m#^IgGfZsJ6@7JH-N=4<{nOeSh`gP29*`~z&~uebmJ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h new file mode 100644 index 00000000..30969f63 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h @@ -0,0 +1,319 @@ +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * ISO C99: 7.18 Integer types + */ + +#ifndef _STDINT_H +#define _STDINT_H 1 + +#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +#include +#include +#include +#include + +/* Exact integral types. */ + +/* Signed. */ +#include + +/* Unsigned. */ +#include + + +/* Small types. */ + +/* Signed. */ +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + +/* Unsigned. */ +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; + + +/* Fast types. */ + +/* Signed. */ +typedef signed char int_fast8_t; +#if __WORDSIZE == 64 +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +#else +typedef int int_fast16_t; +typedef int int_fast32_t; +__extension__ +typedef long long int int_fast64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint_fast8_t; +#if __WORDSIZE == 64 +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +#else +typedef unsigned int uint_fast16_t; +typedef unsigned int uint_fast32_t; +__extension__ +typedef unsigned long long int uint_fast64_t; +#endif + + +/* Types for `void *' pointers. */ +#if __WORDSIZE == 64 +# ifndef __intptr_t_defined +typedef long int intptr_t; +# define __intptr_t_defined +# endif +typedef unsigned long int uintptr_t; +#else +# ifndef __intptr_t_defined +typedef int intptr_t; +# define __intptr_t_defined +# endif +typedef unsigned int uintptr_t; +#endif + + +/* Largest integral types. */ +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; + + +# if __WORDSIZE == 64 +# define __INT64_C(c) c ## L +# define __UINT64_C(c) c ## UL +# else +# define __INT64_C(c) c ## LL +# define __UINT64_C(c) c ## ULL +# endif + +/* Limits of integral types. */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN (-128) +# define INT_LEAST16_MIN (-32767-1) +# define INT_LEAST32_MIN (-2147483647-1) +# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX (127) +# define INT_LEAST16_MAX (32767) +# define INT_LEAST32_MAX (2147483647) +# define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX (255) +# define UINT_LEAST16_MAX (65535) +# define UINT_LEAST32_MAX (4294967295U) +# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) + + +/* Minimum of fast signed integral types having a minimum size. */ +# define INT_FAST8_MIN (-128) +# if __WORDSIZE == 64 +# define INT_FAST16_MIN (-9223372036854775807L-1) +# define INT_FAST32_MIN (-9223372036854775807L-1) +# else +# define INT_FAST16_MIN (-2147483647-1) +# define INT_FAST32_MIN (-2147483647-1) +# endif +# define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of fast signed integral types having a minimum size. */ +# define INT_FAST8_MAX (127) +# if __WORDSIZE == 64 +# define INT_FAST16_MAX (9223372036854775807L) +# define INT_FAST32_MAX (9223372036854775807L) +# else +# define INT_FAST16_MAX (2147483647) +# define INT_FAST32_MAX (2147483647) +# endif +# define INT_FAST64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of fast unsigned integral types having a minimum size. */ +# define UINT_FAST8_MAX (255) +# if __WORDSIZE == 64 +# define UINT_FAST16_MAX (18446744073709551615UL) +# define UINT_FAST32_MAX (18446744073709551615UL) +# else +# define UINT_FAST16_MAX (4294967295U) +# define UINT_FAST32_MAX (4294967295U) +# endif +# define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) + + +/* Values to test for integral types holding `void *' pointer. */ +# if __WORDSIZE == 64 +# define INTPTR_MIN (-9223372036854775807L-1) +# define INTPTR_MAX (9223372036854775807L) +# define UINTPTR_MAX (18446744073709551615UL) +# else +# define INTPTR_MIN (-2147483647-1) +# define INTPTR_MAX (2147483647) +# define UINTPTR_MAX (4294967295U) +# endif + + +/* Minimum for largest signed integral type. */ +# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum for largest signed integral type. */ +# define INTMAX_MAX (__INT64_C(9223372036854775807)) + +/* Maximum for largest unsigned integral type. */ +# define UINTMAX_MAX (__UINT64_C(18446744073709551615)) + + +/* Limits of other integer types. */ + +/* Limits of `ptrdiff_t' type. */ +# if __WORDSIZE == 64 +# define PTRDIFF_MIN (-9223372036854775807L-1) +# define PTRDIFF_MAX (9223372036854775807L) +# else +# if __WORDSIZE32_PTRDIFF_LONG +# define PTRDIFF_MIN (-2147483647L-1) +# define PTRDIFF_MAX (2147483647L) +# else +# define PTRDIFF_MIN (-2147483647-1) +# define PTRDIFF_MAX (2147483647) +# endif +# endif + +/* Limits of `sig_atomic_t'. */ +# define SIG_ATOMIC_MIN (-2147483647-1) +# define SIG_ATOMIC_MAX (2147483647) + +/* Limit of `size_t' type. */ +# if __WORDSIZE == 64 +# define SIZE_MAX (18446744073709551615UL) +# else +# if __WORDSIZE32_SIZE_ULONG +# define SIZE_MAX (4294967295UL) +# else +# define SIZE_MAX (4294967295U) +# endif +# endif + +/* Limits of `wchar_t'. */ +# ifndef WCHAR_MIN +/* These constants might also be defined in . */ +# define WCHAR_MIN __WCHAR_MIN +# define WCHAR_MAX __WCHAR_MAX +# endif + +/* Limits of `wint_t'. */ +# define WINT_MIN (0u) +# define WINT_MAX (4294967295u) + +/* Signed. */ +# define INT8_C(c) c +# define INT16_C(c) c +# define INT32_C(c) c +# if __WORDSIZE == 64 +# define INT64_C(c) c ## L +# else +# define INT64_C(c) c ## LL +# endif + +/* Unsigned. */ +# define UINT8_C(c) c +# define UINT16_C(c) c +# define UINT32_C(c) c ## U +# if __WORDSIZE == 64 +# define UINT64_C(c) c ## UL +# else +# define UINT64_C(c) c ## ULL +# endif + +/* Maximal type. */ +# if __WORDSIZE == 64 +# define INTMAX_C(c) c ## L +# define UINTMAX_C(c) c ## UL +# else +# define INTMAX_C(c) c ## LL +# define UINTMAX_C(c) c ## ULL +# endif + +#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) + +# define INT8_WIDTH 8 +# define UINT8_WIDTH 8 +# define INT16_WIDTH 16 +# define UINT16_WIDTH 16 +# define INT32_WIDTH 32 +# define UINT32_WIDTH 32 +# define INT64_WIDTH 64 +# define UINT64_WIDTH 64 + +# define INT_LEAST8_WIDTH 8 +# define UINT_LEAST8_WIDTH 8 +# define INT_LEAST16_WIDTH 16 +# define UINT_LEAST16_WIDTH 16 +# define INT_LEAST32_WIDTH 32 +# define UINT_LEAST32_WIDTH 32 +# define INT_LEAST64_WIDTH 64 +# define UINT_LEAST64_WIDTH 64 + +# define INT_FAST8_WIDTH 8 +# define UINT_FAST8_WIDTH 8 +# define INT_FAST16_WIDTH __WORDSIZE +# define UINT_FAST16_WIDTH __WORDSIZE +# define INT_FAST32_WIDTH __WORDSIZE +# define UINT_FAST32_WIDTH __WORDSIZE +# define INT_FAST64_WIDTH 64 +# define UINT_FAST64_WIDTH 64 + +# define INTPTR_WIDTH __WORDSIZE +# define UINTPTR_WIDTH __WORDSIZE + +# define INTMAX_WIDTH 64 +# define UINTMAX_WIDTH 64 + +# define PTRDIFF_WIDTH __WORDSIZE +# define SIG_ATOMIC_WIDTH 32 +# define SIZE_WIDTH __WORDSIZE +# define WCHAR_WIDTH 32 +# define WINT_WIDTH 32 + +#endif + +#endif /* stdint.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@stdint.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..c6726ccf7f04ab764adf4a466433b0d19c33ab91 GIT binary patch literal 12441 zcmb7J3tUvyy5Ad30hMSs8KM_QB;+vz^I`zS6dwo#Xo_f-j=+pCN+S(}g7z@VM_C@T zvQmF$J}Nz0nR>3-LwlUEQyyO@?P__C*~98ahw^Hf#QE0aTYK-B0XzQmbFtQ5|MmZ# z>)V?&>GzC16AnnSlvz9XPETgDx5gXD%&41NU0Ije;IGbX2*BTrTB&<=U8S!^GB?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Ca_{eL?X)^u}VL8A#Rv<7gV%V8RnMx_yI8c1w=yvCcAr7ykN zMt>t3RAO-sNOt}@^o8LIKm>`ZS39Rgt=?t73_R3MlTs9+60`(7yEX!Au9hjwAhkha z4>)~i?XAgM7A(-T7eU2MzXE!MbZnn1pF@&^#E$J)>Y33CzxZ(ogaZ9dFSChA8O?MT z@o>~|6y6a*PU9Z?WmWyYyG`yT{JWUmV`5VC<%~Qbw;Ec(@gVUAdb9lGosTBom?;dX z{<=amTfuAWw+#u9*a@`PVk7K0TH03(-E`u>PIjGAUO`tZZT~FvX8l?D8E#gPye#}1 D{Pmb@ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h new file mode 100644 index 00000000..57ca262b --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h @@ -0,0 +1,580 @@ +/* Copyright (C) 1992-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H 1 + +/* We are almost always included from features.h. */ +#ifndef _FEATURES_H +# include +#endif + +/* The GNU libc does not support any K&R compilers or the traditional mode + of ISO C compilers anymore. Check for some of the combinations not + supported anymore. */ +#if defined __GNUC__ && !defined __STDC__ +# error "You need a ISO C conforming compiler to use the glibc headers" +#endif + +/* Some user header file might have defined this before. */ +#undef __P +#undef __PMT + +#ifdef __GNUC__ + +/* All functions, except those with callbacks or those that + synchronize memory, are leaf functions. */ +# if __GNUC_PREREQ (4, 6) && !defined _LIBC +# define __LEAF , __leaf__ +# define __LEAF_ATTR __attribute__ ((__leaf__)) +# else +# define __LEAF +# define __LEAF_ATTR +# endif + +/* GCC can always grok prototypes. For C++ programs we add throw() + to help it optimize the function calls. But this only works with + gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + as non-throwing using a function attribute since programs can use + the -fexceptions options for C code as well. */ +# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# define __THROW __attribute__ ((__nothrow__ __LEAF)) +# define __THROWNL __attribute__ ((__nothrow__)) +# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct +# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct +# else +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# if __cplusplus >= 201103L +# define __THROW noexcept (true) +# else +# define __THROW throw () +# endif +# define __THROWNL __THROW +# define __NTH(fct) __LEAF_ATTR fct __THROW +# define __NTHNL(fct) fct __THROW +# else +# define __THROW +# define __THROWNL +# define __NTH(fct) fct +# define __NTHNL(fct) fct +# endif +# endif + +#else /* Not GCC. */ + +# if (defined __cplusplus \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) +# define __inline inline +# else +# define __inline /* No inline functions. */ +# endif + +# define __THROW +# define __THROWNL +# define __NTH(fct) fct + +#endif /* GCC. */ + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_extension(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_extension +# define __glibc_clang_has_extension(ext) __has_extension (ext) +#else +# define __glibc_clang_has_extension(ext) 0 +#endif + +/* These two macros are not used in glibc anymore. They are kept here + only because some other projects expect the macros to be defined. */ +#define __P(args) args +#define __PMT(args) args + +/* For these things, GCC behaves the ANSI way normally, + and the non-ANSI way under -traditional. */ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +/* This is not a typedef so `const __ptr_t' does the right thing. */ +#define __ptr_t void * + + +/* C++ needs to know that types and declarations are C, not C++. */ +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + + +/* Fortify support. */ +#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) +#define __bos0(ptr) __builtin_object_size (ptr, 0) + +/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ +#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) +# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) +# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) +#else +# define __glibc_objsize0(__o) __bos0 (__o) +# define __glibc_objsize(__o) __bos (__o) +#endif + +#if __GNUC_PREREQ (4,3) +# define __warnattr(msg) __attribute__((__warning__ (msg))) +# define __errordecl(name, msg) \ + extern void name (void) __attribute__((__error__ (msg))) +#else +# define __warnattr(msg) +# define __errordecl(name, msg) extern void name (void) +#endif + +/* Support for flexible arrays. + Headers that should use flexible arrays only if they're "real" + (e.g. only if they won't affect sizeof()) should test + #if __glibc_c99_flexarr_available. */ +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __flexarr [] +# define __glibc_c99_flexarr_available 1 +#elif __GNUC_PREREQ (2,97) +/* GCC 2.97 supports C99 flexible array members as an extension, + even when in C89 mode or compiling C++ (any version). */ +# define __flexarr [] +# define __glibc_c99_flexarr_available 1 +#elif defined __GNUC__ +/* Pre-2.97 GCC did not support C99 flexible arrays but did have + an equivalent extension with slightly different notation. */ +# define __flexarr [0] +# define __glibc_c99_flexarr_available 1 +#else +/* Some other non-C99 compiler. Approximate with [1]. */ +# define __flexarr [1] +# define __glibc_c99_flexarr_available 0 +#endif + + +/* __asm__ ("xyz") is used throughout the headers to rename functions + at the assembly language level. This is wrapped by the __REDIRECT + macro, in order to support compilers that can do this some other + way. When compilers don't support asm-names at all, we have to do + preprocessor tricks instead (which don't have exactly the right + semantics, but it's the best we can do). + + Example: + int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ + +#if defined __GNUC__ && __GNUC__ >= 2 + +# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +# ifdef __cplusplus +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __THROW __asm__ (__ASMNAME (#alias)) +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __THROWNL __asm__ (__ASMNAME (#alias)) +# else +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROW +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROWNL +# endif +# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +# define __ASMNAME2(prefix, cname) __STRING (prefix) cname + +/* +#elif __SOME_OTHER_COMPILER__ + +# define __REDIRECT(name, proto, alias) name proto; \ + _Pragma("let " #name " = " #alias) +*/ +#endif + +/* GCC has various useful declarations that can be made with the + `__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `malloc' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_malloc__ __attribute__ ((__malloc__)) +#else +# define __attribute_malloc__ /* Ignore */ +#endif + +/* Tell the compiler which arguments to an allocation function + indicate the size of the allocation. */ +#if __GNUC_PREREQ (4, 3) +# define __attribute_alloc_size__(params) \ + __attribute__ ((__alloc_size__ params)) +#else +# define __attribute_alloc_size__(params) /* Ignore. */ +#endif + +/* At some point during the gcc 2.96 development the `pure' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_pure__ __attribute__ ((__pure__)) +#else +# define __attribute_pure__ /* Ignore */ +#endif + +/* This declaration tells the compiler that the value is constant. */ +#if __GNUC_PREREQ (2,5) +# define __attribute_const__ __attribute__ ((__const__)) +#else +# define __attribute_const__ /* Ignore */ +#endif + +/* At some point during the gcc 3.1 development the `used' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (3,1) +# define __attribute_used__ __attribute__ ((__used__)) +# define __attribute_noinline__ __attribute__ ((__noinline__)) +#else +# define __attribute_used__ __attribute__ ((__unused__)) +# define __attribute_noinline__ /* Ignore */ +#endif + +/* Since version 3.2, gcc allows marking deprecated functions. */ +#if __GNUC_PREREQ (3,2) +# define __attribute_deprecated__ __attribute__ ((__deprecated__)) +#else +# define __attribute_deprecated__ /* Ignore */ +#endif + +/* Since version 4.5, gcc also allows one to specify the message printed + when a deprecated function is used. clang claims to be gcc 4.2, but + may also support this feature. */ +#if __GNUC_PREREQ (4,5) \ + || __glibc_clang_has_extension (__attribute_deprecated_with_message__) +# define __attribute_deprecated_msg__(msg) \ + __attribute__ ((__deprecated__ (msg))) +#else +# define __attribute_deprecated_msg__(msg) __attribute_deprecated__ +#endif + +/* At some point during the gcc 2.8 development the `format_arg' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. + If several `format_arg' attributes are given for the same function, in + gcc-3.0 and older, all but the last one are ignored. In newer gccs, + all designated arguments are considered. */ +#if __GNUC_PREREQ (2,8) +# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) +#else +# define __attribute_format_arg__(x) /* Ignore */ +#endif + +/* At some point during the gcc 2.97 development the `strfmon' format + attribute for functions was introduced. We don't want to use it + unconditionally (although this would be possible) since it + generates warnings. */ +#if __GNUC_PREREQ (2,97) +# define __attribute_format_strfmon__(a,b) \ + __attribute__ ((__format__ (__strfmon__, a, b))) +#else +# define __attribute_format_strfmon__(a,b) /* Ignore */ +#endif + +/* The nonull function attribute allows to mark pointer parameters which + must not be NULL. */ +#if __GNUC_PREREQ (3,3) +# define __nonnull(params) __attribute__ ((__nonnull__ params)) +#else +# define __nonnull(params) +#endif + +/* If fortification mode, we warn about unused results of certain + function calls which can lead to problems. */ +#if __GNUC_PREREQ (3,4) +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +# if __USE_FORTIFY_LEVEL > 0 +# define __wur __attribute_warn_unused_result__ +# endif +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif +#ifndef __wur +# define __wur /* Ignore */ +#endif + +/* Forces a function to be always inlined. */ +#if __GNUC_PREREQ (3,2) +/* The Linux kernel defines __always_inline in stddef.h (283d7573), and + it conflicts with this definition. Therefore undefine it first to + allow either header to be included first. */ +# undef __always_inline +# define __always_inline __inline __attribute__ ((__always_inline__)) +#else +# undef __always_inline +# define __always_inline __inline +#endif + +/* Associate error messages with the source location of the call site rather + than with the source location inside the function. */ +#if __GNUC_PREREQ (4,3) +# define __attribute_artificial__ __attribute__ ((__artificial__)) +#else +# define __attribute_artificial__ /* Ignore */ +#endif + +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ + or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions + older than 4.3 may define these macros and still not guarantee GNU inlining + semantics. + + clang++ identifies itself as gcc-4.2, but has support for GNU inlining + semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and + __GNUC_GNU_INLINE__ macro definitions. */ +#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ + || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ + || defined __GNUC_GNU_INLINE__))) +# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +#endif + +#ifdef __extern_always_inline +# define __fortify_function __extern_always_inline __attribute_artificial__ +#endif + +/* GCC 4.3 and above allow passing all anonymous arguments of an + __extern_always_inline function to some other vararg function. */ +#if __GNUC_PREREQ (4,3) +# define __va_arg_pack() __builtin_va_arg_pack () +# define __va_arg_pack_len() __builtin_va_arg_pack_len () +#endif + +/* It is possible to compile containing GCC extensions even if GCC is + run in pedantic mode if the uses are carefully marked using the + `__extension__' keyword. But this is not generally available before + version 2.8. */ +#if !__GNUC_PREREQ (2,8) +# define __extension__ /* Ignore */ +#endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict restrict +# else +# define __restrict /* Ignore */ +# endif +#endif + +/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is + array_name[restrict] + GCC 3.1 supports this. */ +#if __GNUC_PREREQ (3,1) && !defined __GNUG__ +# define __restrict_arr __restrict +#else +# ifdef __GNUC__ +# define __restrict_arr /* Not supported in old GCC. */ +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict_arr restrict +# else +/* Some other non-C99 compiler. */ +# define __restrict_arr /* Not supported. */ +# endif +# endif +#endif + +#if __GNUC__ >= 3 +# define __glibc_unlikely(cond) __builtin_expect ((cond), 0) +# define __glibc_likely(cond) __builtin_expect ((cond), 1) +#else +# define __glibc_unlikely(cond) (cond) +# define __glibc_likely(cond) (cond) +#endif + +#ifdef __has_attribute +# define __glibc_has_attribute(attr) __has_attribute (attr) +#else +# define __glibc_has_attribute(attr) 0 +#endif + +#if (!defined _Noreturn \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ + && !__GNUC_PREREQ (4,7)) +# if __GNUC_PREREQ (2,8) +# define _Noreturn __attribute__ ((__noreturn__)) +# else +# define _Noreturn +# endif +#endif + +#if __GNUC_PREREQ (8, 0) +/* Describes a char array whose address can safely be passed as the first + argument to strncpy and strncat, as the char array is not necessarily + a NUL-terminated string. */ +# define __attribute_nonstring__ __attribute__ ((__nonstring__)) +#else +# define __attribute_nonstring__ +#endif + +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + +#if (!defined _Static_assert && !defined __cplusplus \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ + && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) +# define _Static_assert(expr, diagnostic) \ + extern int (*__Static_assert_function (void)) \ + [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] +#endif + +#include +#include + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +# define __LDBL_COMPAT 1 +# ifdef __REDIRECT +# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) +# define __LDBL_REDIR(name, proto) \ + __LDBL_REDIR1 (name, proto, __nldbl_##name) +# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) +# define __LDBL_REDIR_NTH(name, proto) \ + __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); +# define __REDIRECT_LDBL(name, proto, alias) \ + __LDBL_REDIR1 (name, proto, __nldbl_##alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) +# endif +#endif +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT +# define __LDBL_REDIR1(name, proto, alias) name proto +# define __LDBL_REDIR(name, proto) name proto +# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW +# define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) +# define __LDBL_REDIR_DECL(name) +# ifdef __REDIRECT +# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# endif +#endif + +/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is + intended for use in preprocessor macros. + + Note: MESSAGE must be a _single_ string; concatenation of string + literals is not supported. */ +#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) +# define __glibc_macro_warning1(message) _Pragma (#message) +# define __glibc_macro_warning(message) \ + __glibc_macro_warning1 (GCC warning message) +#else +# define __glibc_macro_warning(msg) +#endif + +/* Generic selection (ISO C11) is a C-only feature, available in GCC + since version 4.9. Previous versions do not provide generic + selection, even though they might set __STDC_VERSION__ to 201112L, + when in -std=c11 mode. Thus, we must check for !defined __GNUC__ + when testing __STDC_VERSION__ for generic selection support. + On the other hand, Clang also defines __GNUC__, so a clang-specific + check is required to enable the use of generic selection. */ +#if !defined __cplusplus \ + && (__GNUC_PREREQ (4, 9) \ + || __glibc_clang_has_extension (c_generic_selections) \ + || (!defined __GNUC__ && defined __STDC_VERSION__ \ + && __STDC_VERSION__ >= 201112L)) +# define __HAVE_GENERIC_SELECTION 1 +#else +# define __HAVE_GENERIC_SELECTION 0 +#endif + +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, [, ]) */ +#define __attr_access(x) __attribute__ ((__access__ x)) +#else +# define __attr_access(x) +#endif + +/* Specify that a function such as setjmp or vfork may return + twice. */ +#if __GNUC_PREREQ (4, 1) +# define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) +#else +# define __attribute_returns_twice__ /* Ignore. */ +#endif + +#endif /* sys/cdefs.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@cdefs.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..facf2ecebd48dfc6e7c007fda650ea5d5908df04 GIT binary patch literal 9133 zcmai33v?9a6`mO$CSi$jjXXl6BSgBvY#!9a5KKt2Y#mzwd;4R?#!$4!8w?qEIc5yjj?Ye7P?n4vWua&w zoDAw^dNdf)qL6?Int|#HCE}1S7>XvmNemNEB?kL+N^2wo36cm!^mv~h7=KYg9_oqf zAkUx+hq}s`Ey^k?N-Ijs(}F^fpx#YsUwZ%g*D?g{*0n^^(Bl~knF=y3I733>PApBz z_#jl!!?57^3-t$jH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r=A)t5{2UKt%FMhcmZ{gujJXP;mB_8z-?;?jiX#wb6dORd5ptuVcgu}I|9 P%Mkx%*6Rp}@A>}$jMx&Q literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h new file mode 100644 index 00000000..188a7fe6 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h @@ -0,0 +1,128 @@ +/* `fd_set' type and related macros, and `select'/`pselect' declarations. + Copyright (C) 1996-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ + +#ifndef _SYS_SELECT_H +#define _SYS_SELECT_H 1 + +#include + +/* Get definition of needed basic types. */ +#include + +/* Get __FD_* definitions. */ +#include + +/* Get sigset_t. */ +#include + +/* Get definition of timer specification structures. */ +#include +#include +#ifdef __USE_XOPEN2K +# include +#endif + +#ifndef __suseconds_t_defined +typedef __suseconds_t suseconds_t; +# define __suseconds_t_defined +#endif + + +/* The fd_set member is required to be an array of longs. */ +typedef long int __fd_mask; + +/* Some versions of define this macros. */ +#undef __NFDBITS +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NFDBITS (8 * (int) sizeof (__fd_mask)) +#define __FD_ELT(d) ((d) / __NFDBITS) +#define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) + +/* fd_set for select and pselect. */ +typedef struct + { + /* XPG4.2 requires this member name. Otherwise avoid the name + from the global namespace. */ +#ifdef __USE_XOPEN + __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; +# define __FDS_BITS(set) ((set)->fds_bits) +#else + __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; +# define __FDS_BITS(set) ((set)->__fds_bits) +#endif + } fd_set; + +/* Maximum number of file descriptors in `fd_set'. */ +#define FD_SETSIZE __FD_SETSIZE + +#ifdef __USE_MISC +/* Sometimes the fd_set member is assumed to have this type. */ +typedef __fd_mask fd_mask; + +/* Number of bits per word of `fd_set' (some code assumes this is 32). */ +# define NFDBITS __NFDBITS +#endif + + +/* Access macros for `fd_set'. */ +#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) +#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) +#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) +#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) + + +__BEGIN_DECLS + +/* Check the first NFDS descriptors each in READFDS (if not NULL) for read + readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS + (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out + after waiting the interval specified therein. Returns the number of ready + descriptors, or -1 for errors. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int select (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + struct timeval *__restrict __timeout); + +#ifdef __USE_XOPEN2K +/* Same as above only that the TIMEOUT value is given with higher + resolution and a sigmask which is been set temporarily. This version + should be used. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pselect (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + const struct timespec *__restrict __timeout, + const __sigset_t *__restrict __sigmask); +#endif + + +/* Define some inlines helping to catch common problems. */ +#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ +# include +#endif + +__END_DECLS + +#endif /* sys/select.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@select.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..4bf10d118cf7ab417b2bfedc2f7b096327912e22 GIT binary patch literal 5672 zcmcgvdu&tJ89&!`Sz@BhM3AzSvePtVHpF(4k(63MOcQ4bHH5_ukFfS~eebb-8|Pkg z?{yM`KunWb${s};T2WV3>Z%U4swUK}teYy@Rhl}jLmNn~sJ2ck6WT_%Y135xqPzRf zxeq^Ln@*Z$MJLHQ-}#;I@%tX$i2faZb=;%oimR(Mx(nCwU?o;T($O z)Oivq$ywQmg!8H>YZS%b@}R@&D1In-OFBvB+;P(TA_L)B4QHoyQwk`*IVgr$j;Q7RBBs})6qH{^Mu z7l_yx)E1YsIsx%2xxAc?FkeIl2Eqg3{<1d>Ng^34d*Q>`H>(uQ5Wy&FM6UvJqQI=M z9^`qw-jh|5i(*dD8Uv+E2GJLVLSqSLy?lf;mT)<-+~t%qOxMP@EmK6G&|Hn{s_du` zlci>Yc7U75*J6o6^kzPWun%u;tT>}kNS26V$VREI9Oxp33L3EkO|z;h(3Y-sui9i~ z1e`A#WT~-K6UtNni|~3gGa1!sl(lAVg_M-^rZg~e8f14!2fh(0bepK#siiH_xL29h zEMXw1RCZayFlWI<(Jn9{-4L|uJgh^eiu7I(@>NPW(pjYlRiK#GL(Q1LYz5ym@p8fP z&TYI>DHRelF;`cqas{}}afC*-Sy1yTEwXAcov)wXuKCVGp9xp-x1vyOt~#hvF}nQ7 zEg7-pXI7?HRJQR(GOl?OjU<+ZIPobY?OK0F5cRd~Kx1tsbhOQ5er@~tYilpw`xCNc z5KX~AMO?7V2++TIUdc#$AI?ZTGy%Mk=b?Zbnk>>Ini!2w7d6=+jgQHaND2l!7ga?! zuw@ixg&EpX&0BO^EgF5;5-#_M8aZ(Ayr9noQDV>b;!`sz3`tTXSk`eC+PQ)kWg~}kayCaa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q* z@DL+sJduJuzr%ND&!Q%. */ + +/* + * POSIX Standard: 2.6 Primitive System Data Types + */ + +#ifndef _SYS_TYPES_H +#define _SYS_TYPES_H 1 + +#include + +__BEGIN_DECLS + +#include + +#ifdef __USE_MISC +# ifndef __u_char_defined +typedef __u_char u_char; +typedef __u_short u_short; +typedef __u_int u_int; +typedef __u_long u_long; +typedef __quad_t quad_t; +typedef __u_quad_t u_quad_t; +typedef __fsid_t fsid_t; +# define __u_char_defined +# endif +typedef __loff_t loff_t; +#endif + +#ifndef __ino_t_defined +# ifndef __USE_FILE_OFFSET64 +typedef __ino_t ino_t; +# else +typedef __ino64_t ino_t; +# endif +# define __ino_t_defined +#endif +#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined +typedef __ino64_t ino64_t; +# define __ino64_t_defined +#endif + +#ifndef __dev_t_defined +typedef __dev_t dev_t; +# define __dev_t_defined +#endif + +#ifndef __gid_t_defined +typedef __gid_t gid_t; +# define __gid_t_defined +#endif + +#ifndef __mode_t_defined +typedef __mode_t mode_t; +# define __mode_t_defined +#endif + +#ifndef __nlink_t_defined +typedef __nlink_t nlink_t; +# define __nlink_t_defined +#endif + +#ifndef __uid_t_defined +typedef __uid_t uid_t; +# define __uid_t_defined +#endif + +#ifndef __off_t_defined +# ifndef __USE_FILE_OFFSET64 +typedef __off_t off_t; +# else +typedef __off64_t off_t; +# endif +# define __off_t_defined +#endif +#if defined __USE_LARGEFILE64 && !defined __off64_t_defined +typedef __off64_t off64_t; +# define __off64_t_defined +#endif + +#ifndef __pid_t_defined +typedef __pid_t pid_t; +# define __pid_t_defined +#endif + +#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \ + && !defined __id_t_defined +typedef __id_t id_t; +# define __id_t_defined +#endif + +#ifndef __ssize_t_defined +typedef __ssize_t ssize_t; +# define __ssize_t_defined +#endif + +#ifdef __USE_MISC +# ifndef __daddr_t_defined +typedef __daddr_t daddr_t; +typedef __caddr_t caddr_t; +# define __daddr_t_defined +# endif +#endif + +#if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined +typedef __key_t key_t; +# define __key_t_defined +#endif + +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +# include +#endif +#include +#include +#include + +#ifdef __USE_XOPEN +# ifndef __useconds_t_defined +typedef __useconds_t useconds_t; +# define __useconds_t_defined +# endif +# ifndef __suseconds_t_defined +typedef __suseconds_t suseconds_t; +# define __suseconds_t_defined +# endif +#endif + +#define __need_size_t +#include + +#ifdef __USE_MISC +/* Old compatibility names for C types. */ +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; +#endif + +/* These size-specific names are used by some of the inet code. */ + +#include + +/* These were defined by ISO C without the first `_'. */ +typedef __uint8_t u_int8_t; +typedef __uint16_t u_int16_t; +typedef __uint32_t u_int32_t; +typedef __uint64_t u_int64_t; + +#if __GNUC_PREREQ (2, 7) +typedef int register_t __attribute__ ((__mode__ (__word__))); +#else +typedef int register_t; +#endif + +/* Some code from BIND tests this macro to see if the types above are + defined. */ +#define __BIT_TYPES_DEFINED__ 1 + + +#ifdef __USE_MISC +/* In BSD is expected to define BYTE_ORDER. */ +# include + +/* It also defines `fd_set' and the FD_* macros for `select'. */ +# include +#endif /* Use misc. */ + + +#if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ + && !defined __blksize_t_defined +typedef __blksize_t blksize_t; +# define __blksize_t_defined +#endif + +/* Types from the Large File Support interface. */ +#ifndef __USE_FILE_OFFSET64 +# ifndef __blkcnt_t_defined +typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ +# define __blkcnt_t_defined +# endif +# ifndef __fsblkcnt_t_defined +typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ +# define __fsblkcnt_t_defined +# endif +# ifndef __fsfilcnt_t_defined +typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ +# define __fsfilcnt_t_defined +# endif +#else +# ifndef __blkcnt_t_defined +typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ +# define __blkcnt_t_defined +# endif +# ifndef __fsblkcnt_t_defined +typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ +# define __fsblkcnt_t_defined +# endif +# ifndef __fsfilcnt_t_defined +typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ +# define __fsfilcnt_t_defined +# endif +#endif + +#ifdef __USE_LARGEFILE64 +typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ +typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ +typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ +#endif + + +/* Now add the thread types. */ +#if defined __USE_POSIX199506 || defined __USE_UNIX98 +# include +#endif + +__END_DECLS + +#endif /* sys/types.h */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@types.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@include@sys@types.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..09a8ea1ad0bf7a856f57f4b73651a174d4c1e988 GIT binary patch literal 8887 zcmai433L=i8m=CLf&^@1z&Jo?CX)e%WQITzW5R6`h)+TuL_vdeCNn+Bm|-T&kwaZT z5D`=m0r9!yASfuZD%!67qP}Jy!kS ze|`U7RsA%hTb7*#Er>(bGVff;TH`8p1*{gg*KTuL{XV)Ko}#tuJT~hymAJ$zLJay9TApU8Q~rmWQl! zyGpEbEUYOhmK4iK#ZWNBAvy8dU1y(c2{F_u*#beI&pelQr&DZsGNlifVSJ^7MULgm^^^DZ@irbk$e6a(E%EMyE9MQNeFLOD%TSzn9 zeS!&1Jd(e=AVc2MQ@eId=1{WBA$bC>KuxFXz!rOQg-@cH#y5T(LfE~1V=cdecoJU`GVTGD>_`6MXpv(v5o$LojNseSWtzFwpYs*)K^B%IS zyNZFN;}e{k~8uLIW`c75{UTUxvl zce#qE{-Ag#Ehho*Bsxj(_MlJJKl}LFkrZ!C(*BR1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$b(U+1Z2|VV=~ii4_{f$a(Hy>_Lbk9;vQz$E(it-f`ju zdIeR@(t0o7OVueZD<%uP$0J3F-`yu=a`n~+lp}-fz^!+UU@)aq1+O z9+M7U;gKS}_P5JNt^|5Ci{hlbLRyB|Ik|cHIoYBJEYbA7P8P^@xrN^XAID*2-EaMd zAH5U5%$QEUL#gVuKFS}b)G2O4%mnZekJPg4+NzYF?;pBQ6zQi2b+OjRh)M2|m`A`z zJW`}HQy)C?#^~>&07;S@@IM*gZ~Wk!UM-@K32p_y0ya=QQiS;<_D{XCX=Rae73$m; sdOuPpx!EzZ!4^DHBvaqfi)O#+CP*Q9)38Xs*lAE^#ms`(;E|yGAJ2D%n*aa+ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h new file mode 100644 index 00000000..15acd442 --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h @@ -0,0 +1,121 @@ +/*===---- stddef.h - Basic type definitions --------------------------------=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + *===-----------------------------------------------------------------------=== + */ + +#if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ + defined(__need_size_t) || defined(__need_wchar_t) || \ + defined(__need_NULL) || defined(__need_wint_t) + +#if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ + !defined(__need_wchar_t) && !defined(__need_NULL) && \ + !defined(__need_wint_t) +/* Always define miscellaneous pieces when modules are available. */ +#if !__has_feature(modules) +#define __STDDEF_H +#endif +#define __need_ptrdiff_t +#define __need_size_t +#define __need_wchar_t +#define __need_NULL +#define __need_STDDEF_H_misc +/* __need_wint_t is intentionally not defined here. */ +#endif + +#if defined(__need_ptrdiff_t) +#if !defined(_PTRDIFF_T) || __has_feature(modules) +/* Always define ptrdiff_t when modules are available. */ +#if !__has_feature(modules) +#define _PTRDIFF_T +#endif +typedef __PTRDIFF_TYPE__ ptrdiff_t; +#endif +#undef __need_ptrdiff_t +#endif /* defined(__need_ptrdiff_t) */ + +#if defined(__need_size_t) +#if !defined(_SIZE_T) || __has_feature(modules) +/* Always define size_t when modules are available. */ +#if !__has_feature(modules) +#define _SIZE_T +#endif +typedef __SIZE_TYPE__ size_t; +#endif +#undef __need_size_t +#endif /*defined(__need_size_t) */ + +#if defined(__need_STDDEF_H_misc) +/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is + * enabled. */ +#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ + !defined(_RSIZE_T)) || __has_feature(modules) +/* Always define rsize_t when modules are available. */ +#if !__has_feature(modules) +#define _RSIZE_T +#endif +typedef __SIZE_TYPE__ rsize_t; +#endif +#endif /* defined(__need_STDDEF_H_misc) */ + +#if defined(__need_wchar_t) +#ifndef __cplusplus +/* Always define wchar_t when modules are available. */ +#if !defined(_WCHAR_T) || __has_feature(modules) +#if !__has_feature(modules) +#define _WCHAR_T +#if defined(_MSC_EXTENSIONS) +#define _WCHAR_T_DEFINED +#endif +#endif +typedef __WCHAR_TYPE__ wchar_t; +#endif +#endif +#undef __need_wchar_t +#endif /* defined(__need_wchar_t) */ + +#if defined(__need_NULL) +#undef NULL +#ifdef __cplusplus +# if !defined(__MINGW32__) && !defined(_MSC_VER) +# define NULL __null +# else +# define NULL 0 +# endif +#else +# define NULL ((void*)0) +#endif +#ifdef __cplusplus +#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +namespace std { typedef decltype(nullptr) nullptr_t; } +using ::std::nullptr_t; +#endif +#endif +#undef __need_NULL +#endif /* defined(__need_NULL) */ + +#if defined(__need_STDDEF_H_misc) +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#include "__stddef_max_align_t.h" +#endif +#define offsetof(t, d) __builtin_offsetof(t, d) +#undef __need_STDDEF_H_misc +#endif /* defined(__need_STDDEF_H_misc) */ + +/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use +__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ +#if defined(__need_wint_t) +/* Always define wint_t when modules are available. */ +#if !defined(_WINT_T) || __has_feature(modules) +#if !__has_feature(modules) +#define _WINT_T +#endif +typedef __WINT_TYPE__ wint_t; +#endif +#undef __need_wint_t +#endif /* __need_wint_t */ + +#endif diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stddef.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..2de3b516329409ceadea4ce34dfdf0f3cfac88e4 GIT binary patch literal 1765 zcmah}&2G~`5MEc2kWi_5-~k1MqX8chn0HfW!?NcI_l2!rrW`we0zJ_M4e+ri?B>TpXPt3z1$p01~q< zlceT{)bWYnlnAMwS`QVd?*v_hPeZp4RI(9ZTB+b3I3Dm-hw(V%CoJe2O0{Q_U@O^vLm-NX!OE zH;7c@N3OsoB_!@tZVXu-rrBAMl|>YGIPGPU`qvLD%tTk!R8&9Ib2W@yKfAr>;m$lLoP6IU$9;3b8=g4_V5jz~9(H62MBGXb%ZQj#XD;jMtBG5_1n^WVe)v0ooN5OdHr>N_Fum( zyot-owtL=be*1WSXuoV9J+lv#W#f)wzyc`Fe_55y%I&peM-zSDr2oQya`E|3TYH+V QwNj(hX<6l~<-0BGFGK;4{r~^~ literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h new file mode 100644 index 00000000..192f653e --- /dev/null +++ b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h @@ -0,0 +1,693 @@ +/*===---- stdint.h - Standard header for sized integer types --------------===*\ + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * +\*===----------------------------------------------------------------------===*/ + +#ifndef __CLANG_STDINT_H +// AIX system headers need stdint.h to be re-enterable while _STD_TYPES_T +// is defined until an inclusion of it without _STD_TYPES_T occurs, in which +// case the header guard macro is defined. +#if !defined(_AIX) || !defined(_STD_TYPES_T) || !defined(__STDC_HOSTED__) +#define __CLANG_STDINT_H +#endif + +/* If we're hosted, fall back to the system's stdint.h, which might have + * additional definitions. + */ +#if __STDC_HOSTED__ && __has_include_next() + +// C99 7.18.3 Limits of other integer types +// +// Footnote 219, 220: C++ implementations should define these macros only when +// __STDC_LIMIT_MACROS is defined before is included. +// +// Footnote 222: C++ implementations should define these macros only when +// __STDC_CONSTANT_MACROS is defined before is included. +// +// C++11 [cstdint.syn]p2: +// +// The macros defined by are provided unconditionally. In particular, +// the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in +// footnotes 219, 220, and 222 in the C standard) play no role in C++. +// +// C11 removed the problematic footnotes. +// +// Work around this inconsistency by always defining those macros in C++ mode, +// so that a C library implementation which follows the C99 standard can be +// used in C++. +# ifdef __cplusplus +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS_DEFINED_BY_CLANG +# endif +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG +# endif +# endif + +# include_next + +# ifdef __STDC_LIMIT_MACROS_DEFINED_BY_CLANG +# undef __STDC_LIMIT_MACROS +# undef __STDC_LIMIT_MACROS_DEFINED_BY_CLANG +# endif +# ifdef __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG +# undef __STDC_CONSTANT_MACROS +# undef __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG +# endif + +#else + +/* C99 7.18.1.1 Exact-width integer types. + * C99 7.18.1.2 Minimum-width integer types. + * C99 7.18.1.3 Fastest minimum-width integer types. + * + * The standard requires that exact-width type be defined for 8-, 16-, 32-, and + * 64-bit types if they are implemented. Other exact width types are optional. + * This implementation defines an exact-width types for every integer width + * that is represented in the standard integer types. + * + * The standard also requires minimum-width types be defined for 8-, 16-, 32-, + * and 64-bit widths regardless of whether there are corresponding exact-width + * types. + * + * To accommodate targets that are missing types that are exactly 8, 16, 32, or + * 64 bits wide, this implementation takes an approach of cascading + * redefinitions, redefining __int_leastN_t to successively smaller exact-width + * types. It is therefore important that the types are defined in order of + * descending widths. + * + * We currently assume that the minimum-width types and the fastest + * minimum-width types are the same. This is allowed by the standard, but is + * suboptimal. + * + * In violation of the standard, some targets do not implement a type that is + * wide enough to represent all of the required widths (8-, 16-, 32-, 64-bit). + * To accommodate these targets, a required minimum-width type is only + * defined if there exists an exact-width type of equal or greater width. + */ + +#ifdef __INT64_TYPE__ +# ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/ +typedef __INT64_TYPE__ int64_t; +# endif /* __int8_t_defined */ +typedef __UINT64_TYPE__ uint64_t; +# define __int_least64_t int64_t +# define __uint_least64_t uint64_t +# define __int_least32_t int64_t +# define __uint_least32_t uint64_t +# define __int_least16_t int64_t +# define __uint_least16_t uint64_t +# define __int_least8_t int64_t +# define __uint_least8_t uint64_t +#endif /* __INT64_TYPE__ */ + +#ifdef __int_least64_t +typedef __int_least64_t int_least64_t; +typedef __uint_least64_t uint_least64_t; +typedef __int_least64_t int_fast64_t; +typedef __uint_least64_t uint_fast64_t; +#endif /* __int_least64_t */ + +#ifdef __INT56_TYPE__ +typedef __INT56_TYPE__ int56_t; +typedef __UINT56_TYPE__ uint56_t; +typedef int56_t int_least56_t; +typedef uint56_t uint_least56_t; +typedef int56_t int_fast56_t; +typedef uint56_t uint_fast56_t; +# define __int_least32_t int56_t +# define __uint_least32_t uint56_t +# define __int_least16_t int56_t +# define __uint_least16_t uint56_t +# define __int_least8_t int56_t +# define __uint_least8_t uint56_t +#endif /* __INT56_TYPE__ */ + + +#ifdef __INT48_TYPE__ +typedef __INT48_TYPE__ int48_t; +typedef __UINT48_TYPE__ uint48_t; +typedef int48_t int_least48_t; +typedef uint48_t uint_least48_t; +typedef int48_t int_fast48_t; +typedef uint48_t uint_fast48_t; +# define __int_least32_t int48_t +# define __uint_least32_t uint48_t +# define __int_least16_t int48_t +# define __uint_least16_t uint48_t +# define __int_least8_t int48_t +# define __uint_least8_t uint48_t +#endif /* __INT48_TYPE__ */ + + +#ifdef __INT40_TYPE__ +typedef __INT40_TYPE__ int40_t; +typedef __UINT40_TYPE__ uint40_t; +typedef int40_t int_least40_t; +typedef uint40_t uint_least40_t; +typedef int40_t int_fast40_t; +typedef uint40_t uint_fast40_t; +# define __int_least32_t int40_t +# define __uint_least32_t uint40_t +# define __int_least16_t int40_t +# define __uint_least16_t uint40_t +# define __int_least8_t int40_t +# define __uint_least8_t uint40_t +#endif /* __INT40_TYPE__ */ + + +#ifdef __INT32_TYPE__ + +# ifndef __int8_t_defined /* glibc sys/types.h also defines int32_t*/ +typedef __INT32_TYPE__ int32_t; +# endif /* __int8_t_defined */ + +# ifndef __uint32_t_defined /* more glibc compatibility */ +# define __uint32_t_defined +typedef __UINT32_TYPE__ uint32_t; +# endif /* __uint32_t_defined */ + +# define __int_least32_t int32_t +# define __uint_least32_t uint32_t +# define __int_least16_t int32_t +# define __uint_least16_t uint32_t +# define __int_least8_t int32_t +# define __uint_least8_t uint32_t +#endif /* __INT32_TYPE__ */ + +#ifdef __int_least32_t +typedef __int_least32_t int_least32_t; +typedef __uint_least32_t uint_least32_t; +typedef __int_least32_t int_fast32_t; +typedef __uint_least32_t uint_fast32_t; +#endif /* __int_least32_t */ + +#ifdef __INT24_TYPE__ +typedef __INT24_TYPE__ int24_t; +typedef __UINT24_TYPE__ uint24_t; +typedef int24_t int_least24_t; +typedef uint24_t uint_least24_t; +typedef int24_t int_fast24_t; +typedef uint24_t uint_fast24_t; +# define __int_least16_t int24_t +# define __uint_least16_t uint24_t +# define __int_least8_t int24_t +# define __uint_least8_t uint24_t +#endif /* __INT24_TYPE__ */ + +#ifdef __INT16_TYPE__ +#ifndef __int8_t_defined /* glibc sys/types.h also defines int16_t*/ +typedef __INT16_TYPE__ int16_t; +#endif /* __int8_t_defined */ +typedef __UINT16_TYPE__ uint16_t; +# define __int_least16_t int16_t +# define __uint_least16_t uint16_t +# define __int_least8_t int16_t +# define __uint_least8_t uint16_t +#endif /* __INT16_TYPE__ */ + +#ifdef __int_least16_t +typedef __int_least16_t int_least16_t; +typedef __uint_least16_t uint_least16_t; +typedef __int_least16_t int_fast16_t; +typedef __uint_least16_t uint_fast16_t; +#endif /* __int_least16_t */ + + +#ifdef __INT8_TYPE__ +#ifndef __int8_t_defined /* glibc sys/types.h also defines int8_t*/ +typedef __INT8_TYPE__ int8_t; +#endif /* __int8_t_defined */ +typedef __UINT8_TYPE__ uint8_t; +# define __int_least8_t int8_t +# define __uint_least8_t uint8_t +#endif /* __INT8_TYPE__ */ + +#ifdef __int_least8_t +typedef __int_least8_t int_least8_t; +typedef __uint_least8_t uint_least8_t; +typedef __int_least8_t int_fast8_t; +typedef __uint_least8_t uint_fast8_t; +#endif /* __int_least8_t */ + +/* prevent glibc sys/types.h from defining conflicting types */ +#ifndef __int8_t_defined +# define __int8_t_defined +#endif /* __int8_t_defined */ + +/* C99 7.18.1.4 Integer types capable of holding object pointers. + */ +#define __stdint_join3(a,b,c) a ## b ## c + +#ifndef _INTPTR_T +#ifndef __intptr_t_defined +typedef __INTPTR_TYPE__ intptr_t; +#define __intptr_t_defined +#define _INTPTR_T +#endif +#endif + +#ifndef _UINTPTR_T +typedef __UINTPTR_TYPE__ uintptr_t; +#define _UINTPTR_T +#endif + +/* C99 7.18.1.5 Greatest-width integer types. + */ +typedef __INTMAX_TYPE__ intmax_t; +typedef __UINTMAX_TYPE__ uintmax_t; + +/* C99 7.18.4 Macros for minimum-width integer constants. + * + * The standard requires that integer constant macros be defined for all the + * minimum-width types defined above. As 8-, 16-, 32-, and 64-bit minimum-width + * types are required, the corresponding integer constant macros are defined + * here. This implementation also defines minimum-width types for every other + * integer width that the target implements, so corresponding macros are + * defined below, too. + * + * These macros are defined using the same successive-shrinking approach as + * the type definitions above. It is likewise important that macros are defined + * in order of decending width. + * + * Note that C++ should not check __STDC_CONSTANT_MACROS here, contrary to the + * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). + */ + +#define __int_c_join(a, b) a ## b +#define __int_c(v, suffix) __int_c_join(v, suffix) +#define __uint_c(v, suffix) __int_c_join(v##U, suffix) + + +#ifdef __INT64_TYPE__ +# ifdef __INT64_C_SUFFIX__ +# define __int64_c_suffix __INT64_C_SUFFIX__ +# define __int32_c_suffix __INT64_C_SUFFIX__ +# define __int16_c_suffix __INT64_C_SUFFIX__ +# define __int8_c_suffix __INT64_C_SUFFIX__ +# else +# undef __int64_c_suffix +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT64_C_SUFFIX__ */ +#endif /* __INT64_TYPE__ */ + +#ifdef __int_least64_t +# ifdef __int64_c_suffix +# define INT64_C(v) __int_c(v, __int64_c_suffix) +# define UINT64_C(v) __uint_c(v, __int64_c_suffix) +# else +# define INT64_C(v) v +# define UINT64_C(v) v ## U +# endif /* __int64_c_suffix */ +#endif /* __int_least64_t */ + + +#ifdef __INT56_TYPE__ +# ifdef __INT56_C_SUFFIX__ +# define INT56_C(v) __int_c(v, __INT56_C_SUFFIX__) +# define UINT56_C(v) __uint_c(v, __INT56_C_SUFFIX__) +# define __int32_c_suffix __INT56_C_SUFFIX__ +# define __int16_c_suffix __INT56_C_SUFFIX__ +# define __int8_c_suffix __INT56_C_SUFFIX__ +# else +# define INT56_C(v) v +# define UINT56_C(v) v ## U +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT56_C_SUFFIX__ */ +#endif /* __INT56_TYPE__ */ + + +#ifdef __INT48_TYPE__ +# ifdef __INT48_C_SUFFIX__ +# define INT48_C(v) __int_c(v, __INT48_C_SUFFIX__) +# define UINT48_C(v) __uint_c(v, __INT48_C_SUFFIX__) +# define __int32_c_suffix __INT48_C_SUFFIX__ +# define __int16_c_suffix __INT48_C_SUFFIX__ +# define __int8_c_suffix __INT48_C_SUFFIX__ +# else +# define INT48_C(v) v +# define UINT48_C(v) v ## U +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT48_C_SUFFIX__ */ +#endif /* __INT48_TYPE__ */ + + +#ifdef __INT40_TYPE__ +# ifdef __INT40_C_SUFFIX__ +# define INT40_C(v) __int_c(v, __INT40_C_SUFFIX__) +# define UINT40_C(v) __uint_c(v, __INT40_C_SUFFIX__) +# define __int32_c_suffix __INT40_C_SUFFIX__ +# define __int16_c_suffix __INT40_C_SUFFIX__ +# define __int8_c_suffix __INT40_C_SUFFIX__ +# else +# define INT40_C(v) v +# define UINT40_C(v) v ## U +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT40_C_SUFFIX__ */ +#endif /* __INT40_TYPE__ */ + + +#ifdef __INT32_TYPE__ +# ifdef __INT32_C_SUFFIX__ +# define __int32_c_suffix __INT32_C_SUFFIX__ +# define __int16_c_suffix __INT32_C_SUFFIX__ +# define __int8_c_suffix __INT32_C_SUFFIX__ +#else +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT32_C_SUFFIX__ */ +#endif /* __INT32_TYPE__ */ + +#ifdef __int_least32_t +# ifdef __int32_c_suffix +# define INT32_C(v) __int_c(v, __int32_c_suffix) +# define UINT32_C(v) __uint_c(v, __int32_c_suffix) +# else +# define INT32_C(v) v +# define UINT32_C(v) v ## U +# endif /* __int32_c_suffix */ +#endif /* __int_least32_t */ + + +#ifdef __INT24_TYPE__ +# ifdef __INT24_C_SUFFIX__ +# define INT24_C(v) __int_c(v, __INT24_C_SUFFIX__) +# define UINT24_C(v) __uint_c(v, __INT24_C_SUFFIX__) +# define __int16_c_suffix __INT24_C_SUFFIX__ +# define __int8_c_suffix __INT24_C_SUFFIX__ +# else +# define INT24_C(v) v +# define UINT24_C(v) v ## U +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT24_C_SUFFIX__ */ +#endif /* __INT24_TYPE__ */ + + +#ifdef __INT16_TYPE__ +# ifdef __INT16_C_SUFFIX__ +# define __int16_c_suffix __INT16_C_SUFFIX__ +# define __int8_c_suffix __INT16_C_SUFFIX__ +#else +# undef __int16_c_suffix +# undef __int8_c_suffix +# endif /* __INT16_C_SUFFIX__ */ +#endif /* __INT16_TYPE__ */ + +#ifdef __int_least16_t +# ifdef __int16_c_suffix +# define INT16_C(v) __int_c(v, __int16_c_suffix) +# define UINT16_C(v) __uint_c(v, __int16_c_suffix) +# else +# define INT16_C(v) v +# define UINT16_C(v) v ## U +# endif /* __int16_c_suffix */ +#endif /* __int_least16_t */ + + +#ifdef __INT8_TYPE__ +# ifdef __INT8_C_SUFFIX__ +# define __int8_c_suffix __INT8_C_SUFFIX__ +#else +# undef __int8_c_suffix +# endif /* __INT8_C_SUFFIX__ */ +#endif /* __INT8_TYPE__ */ + +#ifdef __int_least8_t +# ifdef __int8_c_suffix +# define INT8_C(v) __int_c(v, __int8_c_suffix) +# define UINT8_C(v) __uint_c(v, __int8_c_suffix) +# else +# define INT8_C(v) v +# define UINT8_C(v) v ## U +# endif /* __int8_c_suffix */ +#endif /* __int_least8_t */ + + +/* C99 7.18.2.1 Limits of exact-width integer types. + * C99 7.18.2.2 Limits of minimum-width integer types. + * C99 7.18.2.3 Limits of fastest minimum-width integer types. + * + * The presence of limit macros are completely optional in C99. This + * implementation defines limits for all of the types (exact- and + * minimum-width) that it defines above, using the limits of the minimum-width + * type for any types that do not have exact-width representations. + * + * As in the type definitions, this section takes an approach of + * successive-shrinking to determine which limits to use for the standard (8, + * 16, 32, 64) bit widths when they don't have exact representations. It is + * therefore important that the definitions be kept in order of decending + * widths. + * + * Note that C++ should not check __STDC_LIMIT_MACROS here, contrary to the + * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). + */ + +#ifdef __INT64_TYPE__ +# define INT64_MAX INT64_C( 9223372036854775807) +# define INT64_MIN (-INT64_C( 9223372036854775807)-1) +# define UINT64_MAX UINT64_C(18446744073709551615) +# define __INT_LEAST64_MIN INT64_MIN +# define __INT_LEAST64_MAX INT64_MAX +# define __UINT_LEAST64_MAX UINT64_MAX +# define __INT_LEAST32_MIN INT64_MIN +# define __INT_LEAST32_MAX INT64_MAX +# define __UINT_LEAST32_MAX UINT64_MAX +# define __INT_LEAST16_MIN INT64_MIN +# define __INT_LEAST16_MAX INT64_MAX +# define __UINT_LEAST16_MAX UINT64_MAX +# define __INT_LEAST8_MIN INT64_MIN +# define __INT_LEAST8_MAX INT64_MAX +# define __UINT_LEAST8_MAX UINT64_MAX +#endif /* __INT64_TYPE__ */ + +#ifdef __INT_LEAST64_MIN +# define INT_LEAST64_MIN __INT_LEAST64_MIN +# define INT_LEAST64_MAX __INT_LEAST64_MAX +# define UINT_LEAST64_MAX __UINT_LEAST64_MAX +# define INT_FAST64_MIN __INT_LEAST64_MIN +# define INT_FAST64_MAX __INT_LEAST64_MAX +# define UINT_FAST64_MAX __UINT_LEAST64_MAX +#endif /* __INT_LEAST64_MIN */ + + +#ifdef __INT56_TYPE__ +# define INT56_MAX INT56_C(36028797018963967) +# define INT56_MIN (-INT56_C(36028797018963967)-1) +# define UINT56_MAX UINT56_C(72057594037927935) +# define INT_LEAST56_MIN INT56_MIN +# define INT_LEAST56_MAX INT56_MAX +# define UINT_LEAST56_MAX UINT56_MAX +# define INT_FAST56_MIN INT56_MIN +# define INT_FAST56_MAX INT56_MAX +# define UINT_FAST56_MAX UINT56_MAX +# define __INT_LEAST32_MIN INT56_MIN +# define __INT_LEAST32_MAX INT56_MAX +# define __UINT_LEAST32_MAX UINT56_MAX +# define __INT_LEAST16_MIN INT56_MIN +# define __INT_LEAST16_MAX INT56_MAX +# define __UINT_LEAST16_MAX UINT56_MAX +# define __INT_LEAST8_MIN INT56_MIN +# define __INT_LEAST8_MAX INT56_MAX +# define __UINT_LEAST8_MAX UINT56_MAX +#endif /* __INT56_TYPE__ */ + + +#ifdef __INT48_TYPE__ +# define INT48_MAX INT48_C(140737488355327) +# define INT48_MIN (-INT48_C(140737488355327)-1) +# define UINT48_MAX UINT48_C(281474976710655) +# define INT_LEAST48_MIN INT48_MIN +# define INT_LEAST48_MAX INT48_MAX +# define UINT_LEAST48_MAX UINT48_MAX +# define INT_FAST48_MIN INT48_MIN +# define INT_FAST48_MAX INT48_MAX +# define UINT_FAST48_MAX UINT48_MAX +# define __INT_LEAST32_MIN INT48_MIN +# define __INT_LEAST32_MAX INT48_MAX +# define __UINT_LEAST32_MAX UINT48_MAX +# define __INT_LEAST16_MIN INT48_MIN +# define __INT_LEAST16_MAX INT48_MAX +# define __UINT_LEAST16_MAX UINT48_MAX +# define __INT_LEAST8_MIN INT48_MIN +# define __INT_LEAST8_MAX INT48_MAX +# define __UINT_LEAST8_MAX UINT48_MAX +#endif /* __INT48_TYPE__ */ + + +#ifdef __INT40_TYPE__ +# define INT40_MAX INT40_C(549755813887) +# define INT40_MIN (-INT40_C(549755813887)-1) +# define UINT40_MAX UINT40_C(1099511627775) +# define INT_LEAST40_MIN INT40_MIN +# define INT_LEAST40_MAX INT40_MAX +# define UINT_LEAST40_MAX UINT40_MAX +# define INT_FAST40_MIN INT40_MIN +# define INT_FAST40_MAX INT40_MAX +# define UINT_FAST40_MAX UINT40_MAX +# define __INT_LEAST32_MIN INT40_MIN +# define __INT_LEAST32_MAX INT40_MAX +# define __UINT_LEAST32_MAX UINT40_MAX +# define __INT_LEAST16_MIN INT40_MIN +# define __INT_LEAST16_MAX INT40_MAX +# define __UINT_LEAST16_MAX UINT40_MAX +# define __INT_LEAST8_MIN INT40_MIN +# define __INT_LEAST8_MAX INT40_MAX +# define __UINT_LEAST8_MAX UINT40_MAX +#endif /* __INT40_TYPE__ */ + + +#ifdef __INT32_TYPE__ +# define INT32_MAX INT32_C(2147483647) +# define INT32_MIN (-INT32_C(2147483647)-1) +# define UINT32_MAX UINT32_C(4294967295) +# define __INT_LEAST32_MIN INT32_MIN +# define __INT_LEAST32_MAX INT32_MAX +# define __UINT_LEAST32_MAX UINT32_MAX +# define __INT_LEAST16_MIN INT32_MIN +# define __INT_LEAST16_MAX INT32_MAX +# define __UINT_LEAST16_MAX UINT32_MAX +# define __INT_LEAST8_MIN INT32_MIN +# define __INT_LEAST8_MAX INT32_MAX +# define __UINT_LEAST8_MAX UINT32_MAX +#endif /* __INT32_TYPE__ */ + +#ifdef __INT_LEAST32_MIN +# define INT_LEAST32_MIN __INT_LEAST32_MIN +# define INT_LEAST32_MAX __INT_LEAST32_MAX +# define UINT_LEAST32_MAX __UINT_LEAST32_MAX +# define INT_FAST32_MIN __INT_LEAST32_MIN +# define INT_FAST32_MAX __INT_LEAST32_MAX +# define UINT_FAST32_MAX __UINT_LEAST32_MAX +#endif /* __INT_LEAST32_MIN */ + + +#ifdef __INT24_TYPE__ +# define INT24_MAX INT24_C(8388607) +# define INT24_MIN (-INT24_C(8388607)-1) +# define UINT24_MAX UINT24_C(16777215) +# define INT_LEAST24_MIN INT24_MIN +# define INT_LEAST24_MAX INT24_MAX +# define UINT_LEAST24_MAX UINT24_MAX +# define INT_FAST24_MIN INT24_MIN +# define INT_FAST24_MAX INT24_MAX +# define UINT_FAST24_MAX UINT24_MAX +# define __INT_LEAST16_MIN INT24_MIN +# define __INT_LEAST16_MAX INT24_MAX +# define __UINT_LEAST16_MAX UINT24_MAX +# define __INT_LEAST8_MIN INT24_MIN +# define __INT_LEAST8_MAX INT24_MAX +# define __UINT_LEAST8_MAX UINT24_MAX +#endif /* __INT24_TYPE__ */ + + +#ifdef __INT16_TYPE__ +#define INT16_MAX INT16_C(32767) +#define INT16_MIN (-INT16_C(32767)-1) +#define UINT16_MAX UINT16_C(65535) +# define __INT_LEAST16_MIN INT16_MIN +# define __INT_LEAST16_MAX INT16_MAX +# define __UINT_LEAST16_MAX UINT16_MAX +# define __INT_LEAST8_MIN INT16_MIN +# define __INT_LEAST8_MAX INT16_MAX +# define __UINT_LEAST8_MAX UINT16_MAX +#endif /* __INT16_TYPE__ */ + +#ifdef __INT_LEAST16_MIN +# define INT_LEAST16_MIN __INT_LEAST16_MIN +# define INT_LEAST16_MAX __INT_LEAST16_MAX +# define UINT_LEAST16_MAX __UINT_LEAST16_MAX +# define INT_FAST16_MIN __INT_LEAST16_MIN +# define INT_FAST16_MAX __INT_LEAST16_MAX +# define UINT_FAST16_MAX __UINT_LEAST16_MAX +#endif /* __INT_LEAST16_MIN */ + + +#ifdef __INT8_TYPE__ +# define INT8_MAX INT8_C(127) +# define INT8_MIN (-INT8_C(127)-1) +# define UINT8_MAX UINT8_C(255) +# define __INT_LEAST8_MIN INT8_MIN +# define __INT_LEAST8_MAX INT8_MAX +# define __UINT_LEAST8_MAX UINT8_MAX +#endif /* __INT8_TYPE__ */ + +#ifdef __INT_LEAST8_MIN +# define INT_LEAST8_MIN __INT_LEAST8_MIN +# define INT_LEAST8_MAX __INT_LEAST8_MAX +# define UINT_LEAST8_MAX __UINT_LEAST8_MAX +# define INT_FAST8_MIN __INT_LEAST8_MIN +# define INT_FAST8_MAX __INT_LEAST8_MAX +# define UINT_FAST8_MAX __UINT_LEAST8_MAX +#endif /* __INT_LEAST8_MIN */ + +/* Some utility macros */ +#define __INTN_MIN(n) __stdint_join3( INT, n, _MIN) +#define __INTN_MAX(n) __stdint_join3( INT, n, _MAX) +#define __UINTN_MAX(n) __stdint_join3(UINT, n, _MAX) +#define __INTN_C(n, v) __stdint_join3( INT, n, _C(v)) +#define __UINTN_C(n, v) __stdint_join3(UINT, n, _C(v)) + +/* C99 7.18.2.4 Limits of integer types capable of holding object pointers. */ +/* C99 7.18.3 Limits of other integer types. */ + +#define INTPTR_MIN (-__INTPTR_MAX__-1) +#define INTPTR_MAX __INTPTR_MAX__ +#define UINTPTR_MAX __UINTPTR_MAX__ +#define PTRDIFF_MIN (-__PTRDIFF_MAX__-1) +#define PTRDIFF_MAX __PTRDIFF_MAX__ +#define SIZE_MAX __SIZE_MAX__ + +/* ISO9899:2011 7.20 (C11 Annex K): Define RSIZE_MAX if __STDC_WANT_LIB_EXT1__ + * is enabled. */ +#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 +#define RSIZE_MAX (SIZE_MAX >> 1) +#endif + +/* C99 7.18.2.5 Limits of greatest-width integer types. */ +#define INTMAX_MIN (-__INTMAX_MAX__-1) +#define INTMAX_MAX __INTMAX_MAX__ +#define UINTMAX_MAX __UINTMAX_MAX__ + +/* C99 7.18.3 Limits of other integer types. */ +#define SIG_ATOMIC_MIN __INTN_MIN(__SIG_ATOMIC_WIDTH__) +#define SIG_ATOMIC_MAX __INTN_MAX(__SIG_ATOMIC_WIDTH__) +#ifdef __WINT_UNSIGNED__ +# define WINT_MIN __UINTN_C(__WINT_WIDTH__, 0) +# define WINT_MAX __UINTN_MAX(__WINT_WIDTH__) +#else +# define WINT_MIN __INTN_MIN(__WINT_WIDTH__) +# define WINT_MAX __INTN_MAX(__WINT_WIDTH__) +#endif + +#ifndef WCHAR_MAX +# define WCHAR_MAX __WCHAR_MAX__ +#endif +#ifndef WCHAR_MIN +# if __WCHAR_MAX__ == __INTN_MAX(__WCHAR_WIDTH__) +# define WCHAR_MIN __INTN_MIN(__WCHAR_WIDTH__) +# else +# define WCHAR_MIN __UINTN_C(__WCHAR_WIDTH__, 0) +# endif +#endif + +/* 7.18.4.2 Macros for greatest-width integer constants. */ +#define INTMAX_C(v) __int_c(v, __INTMAX_C_SUFFIX__) +#define UINTMAX_C(v) __int_c(v, __UINTMAX_C_SUFFIX__) + +#endif /* __STDC_HOSTED__ */ +#endif /* __CLANG_STDINT_H */ diff --git a/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h.blob b/.local/src/st/.ccls-cache/@@home@yigit@.local@src@st/@usr@lib@clang@11.1.0@include@stdint.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..2a60afdb68a4f58ebab686d17a30146360d2122c GIT binary patch literal 2101 zcmah}&ubGw6rNoKy%aQoT&)NdlJ0H`($-dsZBlKZO>0{OE4XfUrpegNZkU~I8c%u= z5xjY`f{GUrPf{;ldJ#N&@aV-qp?J3S?QDKD>Fy+iVc~uAzVE&Fy~(1ZuYWcVkb;b= zS0hG~Rwy@g$FnWR@R@D+9R7M0ov|IutsrgJD?cJOr#nQmb2+U_EKJy-%UZ)@+tjUS zm@>HRvF43rIy7PgJ~OCmI{_vJaWS=AP;jL0uO9S-%9Q({4pWzF0UQz(Z`KK5X~iep z4D0D;b7PDST7EIIR(%J|@WsiG)z0C?)xJRH+S?+3xFXyUY^}5ip8nz}7(J z^Nd{K5??j~D172-vT$J;jbh?*%A2t`&|+(KMp`~N<-ka5?A4YzSzvRs7I3ngjFMP9 z?7t1{vNDCW!znXaTVVyU+y=bLV4F1`{6?@gVCp^>m9a)R_vF$dbF{$1iFINp!(kWg z)|;aF++vcwIF)(Fa$*x#+yEYlpzLchGl+DsC6Y$hqXrFV%t@4HF}oTos=E>c!baFM z*<2kjd{@1o?8I+)r~EdNveomHbu6sRqJLl1DTK}*qwJk0hac{~G|lymLf*`;l-4)q zN*m_#Tz+k39U(M&89Yf{GMt1^^o%~QiW40x2r1L4>DimgasBt-?@vGBnby6f;&QQ_ z)+{XCDwY-s=KMV~zcg364Lpl|JOl7bE|YtpiZf!JOigYA>s$5L{DzVlPkdU_3FmkP#}pZE7@CjcKx`doShVy|kS-@V`a@zIPL98R|gV_gKua95mY R{)w0}bbe?|6{k>v{sZZe^Sb~5 literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h new file mode 100644 index 00000000..32e4ee9f --- /dev/null +++ b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h @@ -0,0 +1,505 @@ +/* See LICENSE file for copyright and license details. */ + +/* + * appearance + * + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ +static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:autohint=true"; +static char *font2[] = { + "Symbola:pixelsize=16:antialias=true:autohint=true", +}; +char *iso14755_cmd = "cat /home/yigit/.local/share/nerdfont_icons | dmenu -w \"$WINDOWID\" -p \"Select icon\" -l 10 | cut -d\"(\" -f2 | cut -c 1-4"; + +static int borderpx = 2; + +/* + * What program is execed by st depends of these precedence rules: + * 1: program passed with -e + * 2: scroll and/or utmp + * 3: SHELL environment variable + * 4: value of shell in /etc/passwd + * 5: value of shell in config.h + */ +static char *shell = "/bin/zsh"; +char *utmp = NULL; +/* scroll program: to enable use a string like "scroll" */ +char *scroll = "scroll"; +char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; + +float alpha = 1, alphaUnfocused = 0.9; + +/* identification sequence returned in DA and DECID */ +char *vtiden = "\033[?6c"; + +/* Kerning / character bounding-box multipliers */ +static float cwscale = 1.0; +static float chscale = 1.0; + +/* + * word delimiter string + * + * More advanced example: L" `'\"()[]{}" + */ +wchar_t *worddelimiters = L" "; + +/* selection timeouts (in milliseconds) */ +static unsigned int doubleclicktimeout = 300; +static unsigned int tripleclicktimeout = 600; + +/* alt screens */ +int allowaltscreen = 1; + +/* allow certain non-interactive (insecure) window operations such as: + setting the clipboard text */ +int allowwindowops = 0; + +/* + * draw latency range in ms - from new content/keypress/etc until drawing. + * within this range, st draws when content stops arriving (idle). mostly it's + * near minlatency, but it waits longer for slow updates to avoid partial draw. + * low minlatency will tear/flicker more, as it can "detect" idle too early. + */ +static double minlatency = 8; +static double maxlatency = 33; + +/* + * blinking timeout (set to 0 to disable blinking) for the terminal blinking + * attribute. + */ +static unsigned int blinktimeout = 800; + +/* + * thickness of underline and bar cursors + */ +static unsigned int cursorthickness = 2; + +/* + * bell volume. It must be a value between -100 and 100. Use 0 for disabling + * it + */ +static int bellvolume = 0; + +/* default TERM value */ +char *termname = "st-256color"; + +/* + * spaces per tab + * + * When you are changing this value, don't forget to adapt the »it« value in + * the st.info and appropriately install the st.info in the environment where + * you use this st version. + * + * it#$tabspaces, + * + * Secondly make sure your kernel is not expanding tabs. When running `stty + * -a` »tab0« should appear. You can tell the terminal to not expand tabs by + * running following command: + * + * stty tabs + */ +unsigned int tabspaces = 8; + +static const char *colorname[] = { + + /* 8 normal colors */ + [0] = "#3b4252", /* black */ + [1] = "#bf616a", /* red */ + [2] = "#a3be8c", /* green */ + [3] = "#ebcb8b", /* yellow */ + [4] = "#81a1c1", /* blue */ + [5] = "#b48ead", /* magenta */ + [6] = "#88c0d0", /* cyan */ + [7] = "#e5e9f0", /* white */ + + /* 8 bright colors */ + [8] = "#4c566a", /* black */ + [9] = "#bf616a", /* red */ + [10] = "#a3be8c", /* green */ + [11] = "#ebcb8b", /* yellow */ + [12] = "#81a1c1", /* blue */ + [13] = "#b48ead", /* magenta */ + [14] = "#8fbcbb", /* cyan */ + [15] = "#eceff4", /* white */ + + /* special colors */ + [256] = "#0f111a", /* background */ + [257] = "#d8dee9", /* foreground */ + + /* More special colors */ +}; + +/* + * Default colors (colorname index) + * foreground, background, cursor, reverse cursor + */ +unsigned int defaultfg = 257; +unsigned int defaultbg = 256; +unsigned int bg = 256, bgUnfocused = 16; +static unsigned int defaultcs = 257; +static unsigned int defaultrcs = 256; + +static unsigned int defaultitalic = 7; +static unsigned int defaultunderline = 7; + +/* + * Default shape of cursor + * 2: Block ("█") + * 4: Underline ("_") + * 6: Bar ("|") + * 7: Snowman ("☃") + */ +static unsigned int cursorshape = 2; + +/* + * Default columns and rows numbers + */ + +static unsigned int cols = 80; +static unsigned int rows = 24; + +/* + * Default colour and shape of the mouse cursor + */ +static unsigned int mouseshape = XC_xterm; +static unsigned int mousefg = 7; +static unsigned int mousebg = 0; + +/* + * Color used to display font attributes when fontconfig selected a font which + * doesn't match the ones requested. + */ +static unsigned int defaultattr = 11; + +/* + * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). + * Note that if you want to use ShiftMask with selmasks, set this to an other + * modifier, set to 0 to not use it. + */ +static uint forcemousemod = ShiftMask; + +/* + * Internal mouse shortcuts. + * Beware that overloading Button1 will disable the selection. + */ +static MouseShortcut mshortcuts[] = { + /* mask button function argument release */ + { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, + { ShiftMask, Button4, kscrollup, {.i = 5} }, + { ShiftMask, Button5, kscrolldown, {.i = 5} }, +}; + +/* Internal keyboard shortcuts. */ +#define MODKEY Mod1Mask +#define TERMMOD (ControlMask|ShiftMask) +#define ALTMOD (Mod1Mask|ShiftMask) + +static char *openurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.local/bin/st-urlhandler -o", "externalpipe", NULL }; +static char *copyurlcmd[] = { "/bin/sh", "-c", "/home/yigit/.local/bin/st-urlhandler -c", "externalpipe", NULL }; +static char *copyoutput[] = { "/bin/sh", "-c", "/home/yigit/.local/bin/st-copyout", "externalpipe", NULL }; + +static unsigned int cursorstyle = 1; +static Rune stcursor = 0x2603; /* snowman (U+2603) */ + +static Shortcut shortcuts[] = { + /* mask keysym function argument */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { ShiftMask, XK_Print, printscreen, {.i = 0} }, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + { TERMMOD, XK_Prior, zoom, {.f = +1} }, + { TERMMOD, XK_Next, zoom, {.f = -1} }, + { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { TERMMOD, XK_C, clipcopy, {.i = 0} }, + { TERMMOD, XK_V, clippaste, {.i = 0} }, + { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { ShiftMask, XK_Insert, selpaste, {.i = 0} }, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, + { TERMMOD, XK_I, iso14755, {.i = 0} }, + { ALTMOD, XK_Up, zoom, {.f = +1} }, + { ALTMOD, XK_Down, zoom, {.f = -1} }, + { ALTMOD, XK_K, zoom, {.f = +1} }, + { ALTMOD, XK_J, zoom, {.f = -1} }, + { ALTMOD, XK_U, zoom, {.f = +2} }, + { ALTMOD, XK_D, zoom, {.f = -2} }, + { MODKEY, XK_l, externalpipe, {.v = openurlcmd } }, + { MODKEY, XK_y, externalpipe, {.v = copyurlcmd } }, + { MODKEY, XK_o, externalpipe, {.v = copyoutput } }, + { MODKEY, XK_u, kscrollup, {.i = -1} }, + { MODKEY, XK_d, kscrolldown, {.i = -1} }, + { MODKEY, XK_k, kscrollup, {.i = 2} }, + { MODKEY, XK_j, kscrolldown, {.i = 2} }, + { MODKEY, XK_s, changealpha, {.f = -0.05} }, + { MODKEY, XK_a, changealpha, {.f = +0.05} }, +}; + +/* + * Special keys (change & recompile st.info accordingly) + * + * Mask value: + * * Use XK_ANY_MOD to match the key no matter modifiers state + * * Use XK_NO_MOD to match the key alone (no modifiers) + * appkey value: + * * 0: no value + * * > 0: keypad application mode enabled + * * = 2: term.numlock = 1 + * * < 0: keypad application mode disabled + * appcursor value: + * * 0: no value + * * > 0: cursor application mode enabled + * * < 0: cursor application mode disabled + * + * Be careful with the order of the definitions because st searches in + * this table sequentially, so any XK_ANY_MOD must be in the last + * position for a key. + */ + +/* + * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) + * to be mapped below, add them to this array. + */ +static KeySym mappedkeys[] = { -1 }; + +/* + * State bits to ignore when matching key or button events. By default, + * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. + */ +static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; + +/* + * This is the huge key array which defines all compatibility to the Linux + * world. Please decide about changes wisely. + */ + +static Key key[] = { + /* keysym mask string appkey appcursor */ + { XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, + { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, + { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, + { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, + { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, + { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, + { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, + { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, + { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, + { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, + { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, + { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, + { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, + { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, + { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, + { XK_KP_End, ControlMask, "\033[J", -1, 0}, + { XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, + { XK_KP_End, ShiftMask, "\033[K", -1, 0}, + { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, + { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, + { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, + { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, + { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, + { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, + { XK_KP_Insert, ControlMask, "\033[L", -1, 0}, + { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, + { XK_KP_Delete, ControlMask, "\033[M", -1, 0}, + { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, + { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, + { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, + { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, + { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, + { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, + { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, + { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, + { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, + { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, + { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, + { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, + { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, + { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, + { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, + { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, + { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, + { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, + { XK_Up, ShiftMask, "\033[1;2A", 0, 0}, + { XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, + { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, + { XK_Up, ControlMask, "\033[1;5A", 0, 0}, + { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, + { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, + { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, + { XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, + { XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, + { XK_Down, ShiftMask, "\033[1;2B", 0, 0}, + { XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, + { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, + { XK_Down, ControlMask, "\033[1;5B", 0, 0}, + { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, + { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, + { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, + { XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, + { XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, + { XK_Left, ShiftMask, "\033[1;2D", 0, 0}, + { XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, + { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, + { XK_Left, ControlMask, "\033[1;5D", 0, 0}, + { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, + { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, + { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, + { XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, + { XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, + { XK_Right, ShiftMask, "\033[1;2C", 0, 0}, + { XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, + { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, + { XK_Right, ControlMask, "\033[1;5C", 0, 0}, + { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, + { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, + { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, + { XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, + { XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, + { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, + { XK_Return, Mod1Mask, "\033\r", 0, 0}, + { XK_Return, XK_ANY_MOD, "\r", 0, 0}, + { XK_Insert, ShiftMask, "\033[4l", -1, 0}, + { XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, + { XK_Insert, ControlMask, "\033[L", -1, 0}, + { XK_Insert, ControlMask, "\033[2;5~", +1, 0}, + { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, + { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, + { XK_Delete, ControlMask, "\033[M", -1, 0}, + { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, + { XK_Delete, ShiftMask, "\033[2K", -1, 0}, + { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, + { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, + { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, + { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, + { XK_Home, ShiftMask, "\033[2J", 0, -1}, + { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, + { XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, + { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, + { XK_End, ControlMask, "\033[J", -1, 0}, + { XK_End, ControlMask, "\033[1;5F", +1, 0}, + { XK_End, ShiftMask, "\033[K", -1, 0}, + { XK_End, ShiftMask, "\033[1;2F", +1, 0}, + { XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, + { XK_Prior, ControlMask, "\033[5;5~", 0, 0}, + { XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, + { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, + { XK_Next, ControlMask, "\033[6;5~", 0, 0}, + { XK_Next, ShiftMask, "\033[6;2~", 0, 0}, + { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, + { XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, + { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, + { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, + { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, + { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, + { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, + { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, + { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, + { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, + { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, + { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, + { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, + { XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, + { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, + { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, + { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, + { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, + { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, + { XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, + { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, + { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, + { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, + { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, + { XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, + { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, + { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, + { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, + { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, + { XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, + { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, + { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, + { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, + { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, + { XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, + { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, + { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, + { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, + { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, + { XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, + { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, + { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, + { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, + { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, + { XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, + { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, + { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, + { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, + { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, + { XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, + { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, + { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, + { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, + { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, + { XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, + { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, + { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, + { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, + { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, + { XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, + { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, + { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, + { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, + { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, + { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, + { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, + { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, + { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, + { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, + { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, + { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, + { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, + { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, + { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, + { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, + { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, + { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, + { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, + { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, + { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, + { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, + { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, + { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, + { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, + { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, + { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, + { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, +}; + +/* + * Selection types' masks. + * Use the same masks as usual. + * Button1Mask is always unset, to make masks match between ButtonPress. + * ButtonRelease and MotionNotify. + * If no match is found, regular selection is used. + */ +static uint selmasks[] = { + [SEL_RECTANGULAR] = Mod1Mask, +}; + +/* + * Printable characters in ASCII, used to estimate the advance width + * of single wide characters. + */ +static char ascii_printable[] = + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h.blob b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/config.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..bb4ab803c6a0394066c2390609a3385b976d967a GIT binary patch literal 8372 zcmb7J3zQVqnZDJ*W-JDmu!xfe+?yVR9+>W)8DPL!7#{PGf#DGcf(izzt8P!1Q(e_o zRZq_-;@NmSf~>^NL(EZ#9w6$H#8;B##C;gTuo5f0jLUr|CkyK~SOy-253Hy@}NR}+SM>o5Znr?%DW%n;Q|FMkzjk??W zGh~RAf4?UtZT;#8t>p#JzyJ0$_1QnN8-~319xpAgI@VJE<*5zH@~7Up^r6PbZrE1- z-Jjk$eeeq>zE|FT@@?b&1G_FS58Qay<8>=nk18L2q^0$b-Bkz514lQ%akS>XG! z-_!T(t>X3a4?4H(XnN%yrF{Q?W)I!EY5%Xw%_}b(J)z>%1LfatS%2NqxgYE+Ut!OE z`^O(P{leN9je%ELdwJ45@4WDX z2iw!-Z*~3m$$x)tYkT?4=H?9x7e6_%yyM@toY?u$jW4n%69$roqzhtt&7UfMhDj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7BTNZ43#c8z9L0u^kH8Slq>ca=qWD()rQX*RS+j&g<(7{o>2el* zT(QNCMSS-0z~lbJemKy6wm*C9b378NxG5p`)G`^v3)~xjl z8`U_Y6~L}Kpd%q_hp2lE0^t@>G*Q=>w=VXeZfjdhM=O(fB}WT`GlWCGa}s{UJj?l% zzVkcZ;5#rgYZgMm!pRF^Qw!O`rog7cZ+ihzFF>Q<>ZQK1K!^_AdH4&EgY8gZ<}Xa~ z4hXOa7sN*#B`8lrWS^|Zmmb3K_?zNXJ=A%2t-Rl9jQ73m~(_3Nd!3~{C+!<+4+^{_hy?u35gdFn>5l}H)A^~`4k3m--kYS>7DxoV=X1`rNK zm+hBd8Aa_0pM4onNk(l1B+j6)y(4x9%FsL59bp-&S-0K(K>3QO?@3hRQ=bODG;a6| it_Z}PL^12}5NE+9yzhFx!7-_;vI{-nF4h%*uKxoP5;0u> literal 0 HcmV?d00001 diff --git a/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h new file mode 100644 index 00000000..781f6c8f --- /dev/null +++ b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h @@ -0,0 +1,136 @@ +/* See LICENSE for license details. */ + +#include +#include + +/* macros */ +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define LEN(a) (sizeof(a) / sizeof(a)[0]) +#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) +#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) +#define DEFAULT(a, b) (a) = (a) ? (a) : (b) +#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) +#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ + (a).bg != (b).bg) +#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ + (t1.tv_nsec-t2.tv_nsec)/1E6) +#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) + +#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) +#define IS_TRUECOL(x) (1 << 24 & (x)) + +enum glyph_attribute { + ATTR_NULL = 0, + ATTR_BOLD = 1 << 0, + ATTR_FAINT = 1 << 1, + ATTR_ITALIC = 1 << 2, + ATTR_UNDERLINE = 1 << 3, + ATTR_BLINK = 1 << 4, + ATTR_REVERSE = 1 << 5, + ATTR_INVISIBLE = 1 << 6, + ATTR_STRUCK = 1 << 7, + ATTR_WRAP = 1 << 8, + ATTR_WIDE = 1 << 9, + ATTR_WDUMMY = 1 << 10, + ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, +}; + +enum selection_mode { + SEL_IDLE = 0, + SEL_EMPTY = 1, + SEL_READY = 2 +}; + +enum selection_type { + SEL_REGULAR = 1, + SEL_RECTANGULAR = 2 +}; + +enum selection_snap { + SNAP_WORD = 1, + SNAP_LINE = 2 +}; + +typedef unsigned char uchar; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned short ushort; + +typedef uint_least32_t Rune; + +#define Glyph Glyph_ +typedef struct { + Rune u; /* character code */ + ushort mode; /* attribute flags */ + uint32_t fg; /* foreground */ + uint32_t bg; /* background */ +} Glyph; + +typedef Glyph *Line; + +typedef union { + int i; + uint ui; + float f; + const void *v; + const char *s; +} Arg; + +void die(const char *, ...); +void redraw(void); +void tfulldirt(void); +void draw(void); + +void iso14755(const Arg *); +void externalpipe(const Arg *); +void kscrolldown(const Arg *); +void kscrollup(const Arg *); +void printscreen(const Arg *); +void printsel(const Arg *); +void sendbreak(const Arg *); +void toggleprinter(const Arg *); + +int tattrset(int); +void tnew(int, int); +void tresize(int, int); +void tsetdirtattr(int); +void ttyhangup(void); +int ttynew(char *, char *, char *, char **); +size_t ttyread(void); +void ttyresize(int, int); +void ttywrite(const char *, size_t, int); + +void resettitle(void); + +void selclear(void); +void selinit(void); +void selstart(int, int, int); +void selextend(int, int, int, int); +int selected(int, int); +char *getsel(void); + +size_t utf8encode(Rune, char *); + +void *xmalloc(size_t); +void *xrealloc(void *, size_t); +char *xstrdup(char *); + +/* config.h globals */ +extern char *utmp; +extern char *scroll; +extern char *stty_args; +extern char *vtiden; +extern wchar_t *worddelimiters; +extern int allowaltscreen; +extern int allowwindowops; +extern char *termname; +extern unsigned int tabspaces; +extern unsigned int defaultfg; +extern unsigned int defaultbg; +<<<<<<< +extern float alpha; +extern char *iso14755_cmd; +======= +extern float alpha, alphaUnfocused; +>>>>>>> diff --git a/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h.blob b/.local/src/st/.ccls-cache/@home@yigit@.local@src@st/st.h.blob new file mode 100644 index 0000000000000000000000000000000000000000..33a3ed1bf34a124271e6ab0e96e63cbe3a8d593f GIT binary patch literal 8869 zcmai233LeUKy61DGr_Krj3l4f1|RqmAdnA)d_h6z7|UbJk{FGAfVm!~ zX#xppN=WjcOSXMEdW5tDXuG7#oed$7hS#vepb1CPQMo! zhXSr%&Moo-oY6ghzOjdMdN|>J#KysZ(8v3|Mh`ClaX=WZ9$OnUuOJ)}3V6TU7xr)k zoZrJc{h;7CrlYMV6Mk~>VhEJ?@P5%4hGm>n;&70|XN9m^bclRE7YcIjv6;%pd2fh= z;|b?{ysLotqM)eARAefQDhi5txNdy**!9(kigt5OF)VPQ1V)O1#0p8E!x6fdNabW` z7);=N;K8vO4Z3@r!q`8%hD9zk=nRg1f;flY$c=qs92KyJ#FVkAB}?4^z`i8UDrUwx zgdF2N;~kXaKYsWn5c#>#cp(5(l$DOHI6;_^_i%oZ7l-e84s>xFg90bx;9G!|biF63 zjAeq){;T_NLmNFeOM zH{*CYD0$~TUWq?tbPDdCdny&nhx`0ofTKEIP<;Vhg9Blg@80PhHD3`#t4P7Ue~cz2 z6z2FcfY`|7CsHn3FHD<*OB0(v1aa_$gF5L>k5W_95cx|*h!RspEk%h)%tt6va`@tV zyMB4|m4N{70lI#t5748-sC0-)bV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CCwaP7>dLlO`=8rzzhNF^pS15QHhg}L-xqBrcNNf>^4tIs|->&Z(^Esgc0 z$fPPoMtXv)416wy;fELX&_Lmu^afmVMlc-UF)4kdNLRC4q$fDw4`?2M*FRWy%K=~T z!kLfvz0AEv%(U3+td<7F&|+CrEv+S*!k%pCVOQy-udf=X;D%#qBv{AxX+Y9Edfs#l zbJ(>>{pRWi9qmhZ)?Jdu&$>qJ94rja6na`uyb61An;LjM^CLsb33I~q78d)1P?XdN zMuKkMYwCdyNdcGB7Xp5`NDXQS;gjSb8k~zFOVH?vnx^9&l3Zov#SIb%#7G;7nXt2o HBk%tMMaxBu literal 0 HcmV?d00001 diff --git a/.local/src/st/config.h b/.local/src/st/config.h index d1243372..c958abf5 100644 --- a/.local/src/st/config.h +++ b/.local/src/st/config.h @@ -26,7 +26,8 @@ char *utmp = NULL; /* scroll program: to enable use a string like "scroll" */ char *scroll = "scroll"; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; -float alpha = 1; + +float alpha = 1, alphaUnfocused = 0.9; /* identification sequence returned in DA and DECID */ char *vtiden = "\033[?6c"; @@ -134,6 +135,7 @@ static const char *colorname[] = { */ unsigned int defaultfg = 257; unsigned int defaultbg = 256; +unsigned int bg = 256, bgUnfocused = 256; static unsigned int defaultcs = 257; static unsigned int defaultrcs = 256; diff --git a/.local/src/st/patches/st-focus-20200731-patch_alpha.diff b/.local/src/st/patches/st-focus-20200731-patch_alpha.diff new file mode 100644 index 00000000..42166b71 --- /dev/null +++ b/.local/src/st/patches/st-focus-20200731-patch_alpha.diff @@ -0,0 +1,167 @@ +From 3307b33b60adb4e1b5db4dd9849c78fce72b6ca4 Mon Sep 17 00:00:00 2001 +From: Julius Huelsmann +Date: Fri, 31 Jul 2020 10:13:30 +0200 +Subject: [PATCH] patch: focus + +--- + config.def.h | 5 +++-- + st.c | 1 - + st.h | 3 ++- + x.c | 44 ++++++++++++++++++++++++++++++-------------- + 4 files changed, 35 insertions(+), 18 deletions(-) + +diff --git a/config.def.h b/config.def.h +index b94b23c..577d1f1 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -85,7 +85,7 @@ char *termname = "st-256color"; + unsigned int tabspaces = 8; + + /* bg opacity */ +-float alpha = 0.8; ++float alpha = 0.8, alphaUnfocused = 0.6; + + /* Terminal colors (16 first used in escape sequence) */ + static const char *colorname[] = { +@@ -123,9 +123,10 @@ static const char *colorname[] = { + * foreground, background, cursor, reverse cursor + */ + unsigned int defaultfg = 7; +-unsigned int defaultbg = 258; ++unsigned int defaultbg = 0; + static unsigned int defaultcs = 256; + static unsigned int defaultrcs = 257; ++unsigned int bg = 17, bgUnfocused = 16; + + /* + * Default shape of cursor +diff --git a/st.c b/st.c +index 0ce6ac2..c7f40c8 100644 +--- a/st.c ++++ b/st.c +@@ -194,7 +194,6 @@ static void tsetscroll(int, int); + static void tswapscreen(void); + static void tsetmode(int, int, int *, int); + static int twrite(const char *, int, int); +-static void tfulldirt(void); + static void tcontrolcode(uchar ); + static void tdectest(char ); + static void tdefutf8(char); +diff --git a/st.h b/st.h +index 2c656af..44cb3fd 100644 +--- a/st.h ++++ b/st.h +@@ -79,6 +79,7 @@ typedef union { + + void die(const char *, ...); + void redraw(void); ++void tfulldirt(void); + void draw(void); + + void printscreen(const Arg *); +@@ -122,4 +123,4 @@ extern char *termname; + extern unsigned int tabspaces; + extern unsigned int defaultfg; + extern unsigned int defaultbg; +-extern float alpha; ++extern float alpha, alphaUnfocused; +diff --git a/x.c b/x.c +index 50da23c..a2e820f 100644 +--- a/x.c ++++ b/x.c +@@ -254,6 +254,8 @@ static char *opt_line = NULL; + static char *opt_name = NULL; + static char *opt_title = NULL; + ++static int focused = 0; ++ + static int oldbutton = 3; /* button event on startup: 3 = release */ + + void +@@ -774,35 +776,38 @@ xloadcolor(int i, const char *name, Color *ncolor) + return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); + } + ++void ++xloadalpha(void) ++{ ++ float const usedAlpha = focused ? alpha : alphaUnfocused; ++ if (opt_alpha) alpha = strtof(opt_alpha, NULL); ++ dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * usedAlpha); ++ dc.col[defaultbg].pixel &= 0x00FFFFFF; ++ dc.col[defaultbg].pixel |= (unsigned char)(0xff * usedAlpha) << 24; ++} ++ + void + xloadcols(void) + { +- int i; + static int loaded; + Color *cp; + +- if (loaded) { +- for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) +- XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); +- } else { +- dc.collen = MAX(LEN(colorname), 256); +- dc.col = xmalloc(dc.collen * sizeof(Color)); ++ if (!loaded) { ++ dc.collen = 1 + (defaultbg = MAX(LEN(colorname), 256)); ++ dc.col = xmalloc((dc.collen) * sizeof(Color)); + } + +- for (i = 0; i < dc.collen; i++) ++ for (int i = 0; i+1 < dc.collen; ++i) + if (!xloadcolor(i, NULL, &dc.col[i])) { + if (colorname[i]) + die("could not allocate color '%s'\n", colorname[i]); + else + die("could not allocate color %d\n", i); + } ++ if (dc.collen) // cannot die, as the color is already loaded. ++ xloadcolor(focused ?bg :bgUnfocused, NULL, &dc.col[defaultbg]); + +- /* set alpha value of bg color */ +- if (opt_alpha) +- alpha = strtof(opt_alpha, NULL); +- dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); +- dc.col[defaultbg].pixel &= 0x00FFFFFF; +- dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; ++ xloadalpha(); + loaded = 1; + } + +@@ -1747,12 +1752,22 @@ focus(XEvent *ev) + xseturgency(0); + if (IS_SET(MODE_FOCUS)) + ttywrite("\033[I", 3, 0); ++ if (!focused) { ++ focused = 1; ++ xloadcols(); ++ tfulldirt(); ++ } + } else { + if (xw.ime.xic) + XUnsetICFocus(xw.ime.xic); + win.mode &= ~MODE_FOCUSED; + if (IS_SET(MODE_FOCUS)) + ttywrite("\033[O", 3, 0); ++ if (focused) { ++ focused = 0; ++ xloadcols(); ++ tfulldirt(); ++ } + } + } + +@@ -2065,6 +2080,7 @@ run: + XSetLocaleModifiers(""); + cols = MAX(cols, 1); + rows = MAX(rows, 1); ++ defaultbg = MAX(LEN(colorname), 256); + tnew(cols, rows); + xinit(cols, rows); + xsetenv(); +-- +2.28.0 + diff --git a/.local/src/st/st b/.local/src/st/st new file mode 100755 index 0000000000000000000000000000000000000000..c3f9af3f5c75f1cc699fec99738f5dcce6b4105f GIT binary patch literal 111832 zcmeFadwdgB`ahnu87N4ZAatoLEEQ61L9`&%28cEgV2Uk9LB$Jl2`yAg8%qM{0xhPM zj$^Ri*6Xf#*QSeZJp6zJGnf zi_Cey&vTx0Kj%4@Ny{eYPKq;|P1+~kbc2b|>^l`ETlGkO`=U&?Da({-$~Fx){mIk~ z{ucb#X?$kGk3QM#+hj6^Tc(CHK3%H3_M|xIGwrZ%-v3Q}ZZ%wJ zfRZocbGjOV_SE9L1>vY%{-+$(xwjlOzu$<<25QMxklpW4*qskfQp%1yPzY2nQ#Gs8W=(I-yDnm@_*!+$Dv z3jee9#8%s^uXCPmX?rT|t1-bM-_19X4CRBukPLl@qyO56!as-qBtzv>3J?WZNJODUd)@7)M}sevQ-9y0oS{5d4xcX=e{_xS1<`~!&N z_v91M-hYpuA4AWQ?!PZTAqKw>h538>pNWyLo-y>a#7NI&G5FLNeE%5wKaY`~K`6Hr z{5O95G3wDBBfme#NKZ-(eshfUxMJwPJ4QV|5hI;ajClVOgTFgQxfREdKN5qNP>{dZ z9(Kn_|KJ#UX2mFX*V{4r^(`^v55!3S+8BD4$4F1F812v&gSW>hpWZR_-x{O* zC&tjTK1P0XW60kZL;m3y$({64vvxEr(>jlT#R(~ijkh|80o($M!eU?;LpWKzb8h#))?bPpBVYdh@ods zjCha4;5Wo5|Kb?w`7}nnePYNz7Nb0`ijl9kWAJ~A!S9Tb{t+?cm&Qo{OEK#4+ZgGe z6eC_+jP}+Lqx=Ig=%Z@@o_xTOwY&BhGDzE6u$E)&2ekaPI5ASe&nwFiTsGr=(a(AH|d>6c+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RkOu+MuQB2ybX55ZLL}%KFFH-*-o}mJcY`8m8SbSnN3ZGXB9*=^+ z&m7y~f|dE4Z@?hzrrblM@dTB;LZak z@+Dt>ufjPwv{pRT$?=YoFTYBm@4m#-vC0`FzBymV-)f@-YYp)GPLQJ}rz~*`prrWn z6Blk)2dv759~FQ3h3OUEESMg}I)BRlM1oDkn@yfS-0_K_wY>7edvGy?n)#Zq{Q4jH z99E~r(yw{4UFUb$xQoyfX(ng*@!At#e()_P%pz?2fo1z)klng|_>J{a|8&cE({;mT zqvcq9;nRw*^+m#l@o%aVCZ3Sll +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "st.h" +#include "win.h" + +#if defined(__linux) + #include +#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) + #include +#elif defined(__FreeBSD__) || defined(__DragonFly__) + #include +#endif + +/* Arbitrary sizes */ +#define UTF_INVALID 0xFFFD +#define UTF_SIZ 4 +#define ESC_BUF_SIZ (128*UTF_SIZ) +#define ESC_ARG_SIZ 16 +#define STR_BUF_SIZ ESC_BUF_SIZ +#define STR_ARG_SIZ ESC_ARG_SIZ +#define HISTSIZE 2000 + +/* macros */ +#define IS_SET(flag) ((term.mode & (flag)) != 0) +#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == 0x7f) +#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) +#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) +#define ISDELIM(u) (u && wcschr(worddelimiters, u)) +#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - \ + term.scr + HISTSIZE + 1) % HISTSIZE] : \ + term.line[(y) - term.scr]) + +enum term_mode { + MODE_WRAP = 1 << 0, + MODE_INSERT = 1 << 1, + MODE_ALTSCREEN = 1 << 2, + MODE_CRLF = 1 << 3, + MODE_ECHO = 1 << 4, + MODE_PRINT = 1 << 5, + MODE_UTF8 = 1 << 6, +}; + +enum cursor_movement { + CURSOR_SAVE, + CURSOR_LOAD +}; + +enum cursor_state { + CURSOR_DEFAULT = 0, + CURSOR_WRAPNEXT = 1, + CURSOR_ORIGIN = 2 +}; + +enum charset { + CS_GRAPHIC0, + CS_GRAPHIC1, + CS_UK, + CS_USA, + CS_MULTI, + CS_GER, + CS_FIN +}; + +enum escape_state { + ESC_START = 1, + ESC_CSI = 2, + ESC_STR = 4, /* DCS, OSC, PM, APC */ + ESC_ALTCHARSET = 8, + ESC_STR_END = 16, /* a final string was encountered */ + ESC_TEST = 32, /* Enter in test mode */ + ESC_UTF8 = 64, +}; + +typedef struct { + Glyph attr; /* current char attributes */ + int x; + int y; + char state; +} TCursor; + +typedef struct { + int mode; + int type; + int snap; + /* + * Selection variables: + * nb – normalized coordinates of the beginning of the selection + * ne – normalized coordinates of the end of the selection + * ob – original coordinates of the beginning of the selection + * oe – original coordinates of the end of the selection + */ + struct { + int x, y; + } nb, ne, ob, oe; + + int alt; +} Selection; + +/* Internal representation of the screen */ +typedef struct { + int row; /* nb row */ + int col; /* nb col */ + Line *line; /* screen */ + Line *alt; /* alternate screen */ + Line hist[HISTSIZE]; /* history buffer */ + int histi; /* history index */ + int scr; /* scroll back */ + int *dirty; /* dirtyness of lines */ + TCursor c; /* cursor */ + int ocx; /* old cursor col */ + int ocy; /* old cursor row */ + int top; /* top scroll limit */ + int bot; /* bottom scroll limit */ + int mode; /* terminal mode flags */ + int esc; /* escape state flags */ + char trantbl[4]; /* charset table translation */ + int charset; /* current charset */ + int icharset; /* selected charset for sequence */ + int *tabs; + Rune lastc; /* last printed char outside of sequence, 0 if control */ +} Term; + +/* CSI Escape sequence structs */ +/* ESC '[' [[ [] [;]] []] */ +typedef struct { + char buf[ESC_BUF_SIZ]; /* raw string */ + size_t len; /* raw string length */ + char priv; + int arg[ESC_ARG_SIZ]; + int narg; /* nb of args */ + char mode[2]; +} CSIEscape; + +/* STR Escape sequence structs */ +/* ESC type [[ [] [;]] ] ESC '\' */ +typedef struct { + char type; /* ESC type ... */ + char *buf; /* allocated raw string */ + size_t siz; /* allocation size */ + size_t len; /* raw string length */ + char *args[STR_ARG_SIZ]; + int narg; /* nb of args */ +} STREscape; + +static void execsh(char *, char **); +static void stty(char **); +static void sigchld(int); +static void ttywriteraw(const char *, size_t); + +static void csidump(void); +static void csihandle(void); +static void csiparse(void); +static void csireset(void); +static int eschandle(uchar); +static void strdump(void); +static void strhandle(void); +static void strparse(void); +static void strreset(void); + +static void tprinter(char *, size_t); +static void tdumpsel(void); +static void tdumpline(int); +static void tdump(void); +static void tclearregion(int, int, int, int); +static void tcursor(int); +static void tdeletechar(int); +static void tdeleteline(int); +static void tinsertblank(int); +static void tinsertblankline(int); +static int tlinelen(int); +static void tmoveto(int, int); +static void tmoveato(int, int); +static void tnewline(int); +static void tputtab(int); +static void tputc(Rune); +static void treset(void); +static void tscrollup(int, int, int); +static void tscrolldown(int, int, int); +static void tsetattr(int *, int); +static void tsetchar(Rune, Glyph *, int, int); +static void tsetdirt(int, int); +static void tsetscroll(int, int); +static void tswapscreen(void); +static void tsetmode(int, int, int *, int); +static int twrite(const char *, int, int); +static void tfulldirt(void); +static void tcontrolcode(uchar ); +static void tdectest(char ); +static void tdefutf8(char); +static int32_t tdefcolor(int *, int *, int); +static void tdeftran(char); +static void tstrsequence(uchar); + +static void drawregion(int, int, int, int); + +static void selnormalize(void); +static void selscroll(int, int); +static void selsnap(int *, int *, int); + +static size_t utf8decode(const char *, Rune *, size_t); +static Rune utf8decodebyte(char, size_t *); +static char utf8encodebyte(Rune, size_t); +static size_t utf8validate(Rune *, size_t); + +static char *base64dec(const char *); +static char base64dec_getc(const char **); + +static ssize_t xwrite(int, const char *, size_t); + +/* Globals */ +static Term term; +static Selection sel; +static CSIEscape csiescseq; +static STREscape strescseq; +static int iofd = 1; +static int cmdfd; +static pid_t pid; + +static uchar utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; +static uchar utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; +static Rune utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; +static Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; + +ssize_t +xwrite(int fd, const char *s, size_t len) +{ + size_t aux = len; + ssize_t r; + + while (len > 0) { + r = write(fd, s, len); + if (r < 0) + return r; + len -= r; + s += r; + } + + return aux; +} + +void * +xmalloc(size_t len) +{ + void *p; + + if (!(p = malloc(len))) + die("malloc: %s\n", strerror(errno)); + + return p; +} + +void * +xrealloc(void *p, size_t len) +{ + if ((p = realloc(p, len)) == NULL) + die("realloc: %s\n", strerror(errno)); + + return p; +} + +char * +xstrdup(char *s) +{ + if ((s = strdup(s)) == NULL) + die("strdup: %s\n", strerror(errno)); + + return s; +} + +size_t +utf8decode(const char *c, Rune *u, size_t clen) +{ + size_t i, j, len, type; + Rune udecoded; + + *u = UTF_INVALID; + if (!clen) + return 0; + udecoded = utf8decodebyte(c[0], &len); + if (!BETWEEN(len, 1, UTF_SIZ)) + return 1; + for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { + udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); + if (type != 0) + return j; + } + if (j < len) + return 0; + *u = udecoded; + utf8validate(u, len); + + return len; +} + +Rune +utf8decodebyte(char c, size_t *i) +{ + for (*i = 0; *i < LEN(utfmask); ++(*i)) + if (((uchar)c & utfmask[*i]) == utfbyte[*i]) + return (uchar)c & ~utfmask[*i]; + + return 0; +} + +size_t +utf8encode(Rune u, char *c) +{ + size_t len, i; + + len = utf8validate(&u, 0); + if (len > UTF_SIZ) + return 0; + + for (i = len - 1; i != 0; --i) { + c[i] = utf8encodebyte(u, 0); + u >>= 6; + } + c[0] = utf8encodebyte(u, len); + + return len; +} + +char +utf8encodebyte(Rune u, size_t i) +{ + return utfbyte[i] | (u & ~utfmask[i]); +} + +size_t +utf8validate(Rune *u, size_t i) +{ + if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) + *u = UTF_INVALID; + for (i = 1; *u > utfmax[i]; ++i) + ; + + return i; +} + +static const char base64_digits[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, + 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, -1, 0, 0, 0, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +char +base64dec_getc(const char **src) +{ + while (**src && !isprint(**src)) + (*src)++; + return **src ? *((*src)++) : '='; /* emulate padding if string ends */ +} + +char * +base64dec(const char *src) +{ + size_t in_len = strlen(src); + char *result, *dst; + + if (in_len % 4) + in_len += 4 - (in_len % 4); + result = dst = xmalloc(in_len / 4 * 3 + 1); + while (*src) { + int a = base64_digits[(unsigned char) base64dec_getc(&src)]; + int b = base64_digits[(unsigned char) base64dec_getc(&src)]; + int c = base64_digits[(unsigned char) base64dec_getc(&src)]; + int d = base64_digits[(unsigned char) base64dec_getc(&src)]; + + /* invalid input. 'a' can be -1, e.g. if src is "\n" (c-str) */ + if (a == -1 || b == -1) + break; + + *dst++ = (a << 2) | ((b & 0x30) >> 4); + if (c == -1) + break; + *dst++ = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); + if (d == -1) + break; + *dst++ = ((c & 0x03) << 6) | d; + } + *dst = '\0'; + return result; +} + +void +selinit(void) +{ + sel.mode = SEL_IDLE; + sel.snap = 0; + sel.ob.x = -1; +} + +int +tlinelen(int y) +{ + int i = term.col; + + if (TLINE(y)[i - 1].mode & ATTR_WRAP) + return i; + + while (i > 0 && TLINE(y)[i - 1].u == ' ') + --i; + + return i; +} + +void +selstart(int col, int row, int snap) +{ + selclear(); + sel.mode = SEL_EMPTY; + sel.type = SEL_REGULAR; + sel.alt = IS_SET(MODE_ALTSCREEN); + sel.snap = snap; + sel.oe.x = sel.ob.x = col; + sel.oe.y = sel.ob.y = row; + selnormalize(); + + if (sel.snap != 0) + sel.mode = SEL_READY; + tsetdirt(sel.nb.y, sel.ne.y); +} + +void +selextend(int col, int row, int type, int done) +{ + int oldey, oldex, oldsby, oldsey, oldtype; + + if (sel.mode == SEL_IDLE) + return; + if (done && sel.mode == SEL_EMPTY) { + selclear(); + return; + } + + oldey = sel.oe.y; + oldex = sel.oe.x; + oldsby = sel.nb.y; + oldsey = sel.ne.y; + oldtype = sel.type; + + sel.oe.x = col; + sel.oe.y = row; + selnormalize(); + sel.type = type; + + if (oldey != sel.oe.y || oldex != sel.oe.x || oldtype != sel.type || sel.mode == SEL_EMPTY) + tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey)); + + sel.mode = done ? SEL_IDLE : SEL_READY; +} + +void +selnormalize(void) +{ + int i; + + if (sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) { + sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x; + sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x; + } else { + sel.nb.x = MIN(sel.ob.x, sel.oe.x); + sel.ne.x = MAX(sel.ob.x, sel.oe.x); + } + sel.nb.y = MIN(sel.ob.y, sel.oe.y); + sel.ne.y = MAX(sel.ob.y, sel.oe.y); + + selsnap(&sel.nb.x, &sel.nb.y, -1); + selsnap(&sel.ne.x, &sel.ne.y, +1); + + /* expand selection over line breaks */ + if (sel.type == SEL_RECTANGULAR) + return; + i = tlinelen(sel.nb.y); + if (i < sel.nb.x) + sel.nb.x = i; + if (tlinelen(sel.ne.y) <= sel.ne.x) + sel.ne.x = term.col - 1; +} + +int +selected(int x, int y) +{ + if (sel.mode == SEL_EMPTY || sel.ob.x == -1 || + sel.alt != IS_SET(MODE_ALTSCREEN)) + return 0; + + if (sel.type == SEL_RECTANGULAR) + return BETWEEN(y, sel.nb.y, sel.ne.y) + && BETWEEN(x, sel.nb.x, sel.ne.x); + + return BETWEEN(y, sel.nb.y, sel.ne.y) + && (y != sel.nb.y || x >= sel.nb.x) + && (y != sel.ne.y || x <= sel.ne.x); +} + +void +selsnap(int *x, int *y, int direction) +{ + int newx, newy, xt, yt; + int delim, prevdelim; + Glyph *gp, *prevgp; + + switch (sel.snap) { + case SNAP_WORD: + /* + * Snap around if the word wraps around at the end or + * beginning of a line. + */ + prevgp = &TLINE(*y)[*x]; + prevdelim = ISDELIM(prevgp->u); + for (;;) { + newx = *x + direction; + newy = *y; + if (!BETWEEN(newx, 0, term.col - 1)) { + newy += direction; + newx = (newx + term.col) % term.col; + if (!BETWEEN(newy, 0, term.row - 1)) + break; + + if (direction > 0) + yt = *y, xt = *x; + else + yt = newy, xt = newx; + if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) + break; + } + + if (newx >= tlinelen(newy)) + break; + + gp = &TLINE(newy)[newx]; + delim = ISDELIM(gp->u); + if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim + || (delim && gp->u != prevgp->u))) + break; + + *x = newx; + *y = newy; + prevgp = gp; + prevdelim = delim; + } + break; + case SNAP_LINE: + /* + * Snap around if the the previous line or the current one + * has set ATTR_WRAP at its end. Then the whole next or + * previous line will be selected. + */ + *x = (direction < 0) ? 0 : term.col - 1; + if (direction < 0) { + for (; *y > 0; *y += direction) { + if (!(TLINE(*y-1)[term.col-1].mode + & ATTR_WRAP)) { + break; + } + } + } else if (direction > 0) { + for (; *y < term.row-1; *y += direction) { + if (!(TLINE(*y)[term.col-1].mode + & ATTR_WRAP)) { + break; + } + } + } + break; + } +} + +char * +getsel(void) +{ + char *str, *ptr; + int y, bufsize, lastx, linelen; + Glyph *gp, *last; + + if (sel.ob.x == -1) + return NULL; + + bufsize = (term.col+1) * (sel.ne.y-sel.nb.y+1) * UTF_SIZ; + ptr = str = xmalloc(bufsize); + + /* append every set & selected glyph to the selection */ + for (y = sel.nb.y; y <= sel.ne.y; y++) { + if ((linelen = tlinelen(y)) == 0) { + *ptr++ = '\n'; + continue; + } + + if (sel.type == SEL_RECTANGULAR) { + gp = &TLINE(y)[sel.nb.x]; + lastx = sel.ne.x; + } else { + gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; + lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; + } + last = &TLINE(y)[MIN(lastx, linelen-1)]; + while (last >= gp && last->u == ' ') + --last; + + for ( ; gp <= last; ++gp) { + if (gp->mode & ATTR_WDUMMY) + continue; + + ptr += utf8encode(gp->u, ptr); + } + + /* + * Copy and pasting of line endings is inconsistent + * in the inconsistent terminal and GUI world. + * The best solution seems like to produce '\n' when + * something is copied from st and convert '\n' to + * '\r', when something to be pasted is received by + * st. + * FIXME: Fix the computer world. + */ + if ((y < sel.ne.y || lastx >= linelen) && + (!(last->mode & ATTR_WRAP) || sel.type == SEL_RECTANGULAR)) + *ptr++ = '\n'; + } + *ptr = 0; + return str; +} + +void +selclear(void) +{ + if (sel.ob.x == -1) + return; + sel.mode = SEL_IDLE; + sel.ob.x = -1; + tsetdirt(sel.nb.y, sel.ne.y); +} + +void +die(const char *errstr, ...) +{ + va_list ap; + + va_start(ap, errstr); + vfprintf(stderr, errstr, ap); + va_end(ap); + exit(1); +} + +void +execsh(char *cmd, char **args) +{ + char *sh, *prog, *arg; + const struct passwd *pw; + + errno = 0; + if ((pw = getpwuid(getuid())) == NULL) { + if (errno) + die("getpwuid: %s\n", strerror(errno)); + else + die("who are you?\n"); + } + + if ((sh = getenv("SHELL")) == NULL) + sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd; + + if (args) { + prog = args[0]; + arg = NULL; + } else if (scroll) { + prog = scroll; + arg = utmp ? utmp : sh; + } else if (utmp) { + prog = utmp; + arg = NULL; + } else { + prog = sh; + arg = NULL; + } + DEFAULT(args, ((char *[]) {prog, arg, NULL})); + + unsetenv("COLUMNS"); + unsetenv("LINES"); + unsetenv("TERMCAP"); + setenv("LOGNAME", pw->pw_name, 1); + setenv("USER", pw->pw_name, 1); + setenv("SHELL", sh, 1); + setenv("HOME", pw->pw_dir, 1); + setenv("TERM", termname, 1); + + signal(SIGCHLD, SIG_DFL); + signal(SIGHUP, SIG_DFL); + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); + signal(SIGTERM, SIG_DFL); + signal(SIGALRM, SIG_DFL); + + execvp(prog, args); + _exit(1); +} + +void +sigchld(int a) +{ + int stat; + pid_t p; + + if ((p = waitpid(pid, &stat, WNOHANG)) < 0) + die("waiting for pid %hd failed: %s\n", pid, strerror(errno)); + + if (pid != p) { + if (p == 0 && waitpid(-1 ,&stat, WNOHANG) < 0) + /* Changed from wait(&stat) to waitpid(-1, &stat, WNOHANG) */ + /* Otherwise the terminal would hang after calling iso4755 */ + die("wait: %s\n", strerror(errno)); + + signal(SIGCHLD, sigchld); + return; + } + + if (WIFEXITED(stat) && WEXITSTATUS(stat)) + die("child exited with status %d\n", WEXITSTATUS(stat)); + else if (WIFSIGNALED(stat)) + die("child terminated due to signal %d\n", WTERMSIG(stat)); + _exit(0); +} + +void +stty(char **args) +{ + char cmd[_POSIX_ARG_MAX], **p, *q, *s; + size_t n, siz; + + if ((n = strlen(stty_args)) > sizeof(cmd)-1) + die("incorrect stty parameters\n"); + memcpy(cmd, stty_args, n); + q = cmd + n; + siz = sizeof(cmd) - n; + for (p = args; p && (s = *p); ++p) { + if ((n = strlen(s)) > siz-1) + die("stty parameter length too long\n"); + *q++ = ' '; + memcpy(q, s, n); + q += n; + siz -= n + 1; + } + *q = '\0'; + if (system(cmd) != 0) + perror("Couldn't call stty"); +} + +int +ttynew(char *line, char *cmd, char *out, char **args) +{ + int m, s; + + if (out) { + term.mode |= MODE_PRINT; + iofd = (!strcmp(out, "-")) ? + 1 : open(out, O_WRONLY | O_CREAT, 0666); + if (iofd < 0) { + fprintf(stderr, "Error opening %s:%s\n", + out, strerror(errno)); + } + } + + if (line) { + if ((cmdfd = open(line, O_RDWR)) < 0) + die("open line '%s' failed: %s\n", + line, strerror(errno)); + dup2(cmdfd, 0); + stty(args); + return cmdfd; + } + + /* seems to work fine on linux, openbsd and freebsd */ + if (openpty(&m, &s, NULL, NULL, NULL) < 0) + die("openpty failed: %s\n", strerror(errno)); + + switch (pid = fork()) { + case -1: + die("fork failed: %s\n", strerror(errno)); + break; + case 0: + close(iofd); + setsid(); /* create a new process group */ + dup2(s, 0); + dup2(s, 1); + dup2(s, 2); + if (ioctl(s, TIOCSCTTY, NULL) < 0) + die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); + close(s); + close(m); +#ifdef __OpenBSD__ + if (pledge("stdio getpw proc exec", NULL) == -1) + die("pledge\n"); +#endif + execsh(cmd, args); + break; + default: +#ifdef __OpenBSD__ + if (pledge("stdio rpath tty proc", NULL) == -1) + die("pledge\n"); +#endif + close(s); + cmdfd = m; + signal(SIGCHLD, sigchld); + break; + } + return cmdfd; +} + +size_t +ttyread(void) +{ + static char buf[BUFSIZ]; + static int buflen = 0; + int ret, written; + + /* append read bytes to unprocessed bytes */ + ret = read(cmdfd, buf+buflen, LEN(buf)-buflen); + + switch (ret) { + case 0: + exit(0); + case -1: + die("couldn't read from shell: %s\n", strerror(errno)); + default: + buflen += ret; + written = twrite(buf, buflen, 0); + buflen -= written; + /* keep any incomplete UTF-8 byte sequence for the next call */ + if (buflen > 0) + memmove(buf, buf + written, buflen); + return ret; + } +} + +void +ttywrite(const char *s, size_t n, int may_echo) +{ + const char *next; + Arg arg = (Arg) { .i = term.scr }; + + kscrolldown(&arg); + + if (may_echo && IS_SET(MODE_ECHO)) + twrite(s, n, 1); + + if (!IS_SET(MODE_CRLF)) { + ttywriteraw(s, n); + return; + } + + /* This is similar to how the kernel handles ONLCR for ttys */ + while (n > 0) { + if (*s == '\r') { + next = s + 1; + ttywriteraw("\r\n", 2); + } else { + next = memchr(s, '\r', n); + DEFAULT(next, s + n); + ttywriteraw(s, next - s); + } + n -= next - s; + s = next; + } +} + +void +ttywriteraw(const char *s, size_t n) +{ + fd_set wfd, rfd; + ssize_t r; + size_t lim = 256; + + /* + * Remember that we are using a pty, which might be a modem line. + * Writing too much will clog the line. That's why we are doing this + * dance. + * FIXME: Migrate the world to Plan 9. + */ + while (n > 0) { + FD_ZERO(&wfd); + FD_ZERO(&rfd); + FD_SET(cmdfd, &wfd); + FD_SET(cmdfd, &rfd); + + /* Check if we can write. */ + if (pselect(cmdfd+1, &rfd, &wfd, NULL, NULL, NULL) < 0) { + if (errno == EINTR) + continue; + die("select failed: %s\n", strerror(errno)); + } + if (FD_ISSET(cmdfd, &wfd)) { + /* + * Only write the bytes written by ttywrite() or the + * default of 256. This seems to be a reasonable value + * for a serial line. Bigger values might clog the I/O. + */ + if ((r = write(cmdfd, s, (n < lim)? n : lim)) < 0) + goto write_error; + if (r < n) { + /* + * We weren't able to write out everything. + * This means the buffer is getting full + * again. Empty it. + */ + if (n < lim) + lim = ttyread(); + n -= r; + s += r; + } else { + /* All bytes have been written. */ + break; + } + } + if (FD_ISSET(cmdfd, &rfd)) + lim = ttyread(); + } + return; + +write_error: + die("write error on tty: %s\n", strerror(errno)); +} + +void +ttyresize(int tw, int th) +{ + struct winsize w; + + w.ws_row = term.row; + w.ws_col = term.col; + w.ws_xpixel = tw; + w.ws_ypixel = th; + if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0) + fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno)); +} + +void +ttyhangup() +{ + /* Send SIGHUP to shell */ + kill(pid, SIGHUP); +} + +int +tattrset(int attr) +{ + int i, j; + + for (i = 0; i < term.row-1; i++) { + for (j = 0; j < term.col-1; j++) { + if (term.line[i][j].mode & attr) + return 1; + } + } + + return 0; +} + +void +tsetdirt(int top, int bot) +{ + int i; + + LIMIT(top, 0, term.row-1); + LIMIT(bot, 0, term.row-1); + + for (i = top; i <= bot; i++) + term.dirty[i] = 1; +} + +void +tsetdirtattr(int attr) +{ + int i, j; + + for (i = 0; i < term.row-1; i++) { + for (j = 0; j < term.col-1; j++) { + if (term.line[i][j].mode & attr) { + tsetdirt(i, i); + break; + } + } + } +} + +void +tfulldirt(void) +{ + tsetdirt(0, term.row-1); +} + +void +tcursor(int mode) +{ + static TCursor c[2]; + int alt = IS_SET(MODE_ALTSCREEN); + + if (mode == CURSOR_SAVE) { + c[alt] = term.c; + } else if (mode == CURSOR_LOAD) { + term.c = c[alt]; + tmoveto(c[alt].x, c[alt].y); + } +} + +void +treset(void) +{ + uint i; + + term.c = (TCursor){{ + .mode = ATTR_NULL, + .fg = defaultfg, + .bg = defaultbg + }, .x = 0, .y = 0, .state = CURSOR_DEFAULT}; + + memset(term.tabs, 0, term.col * sizeof(*term.tabs)); + for (i = tabspaces; i < term.col; i += tabspaces) + term.tabs[i] = 1; + term.top = 0; + term.bot = term.row - 1; + term.mode = MODE_WRAP|MODE_UTF8; + memset(term.trantbl, CS_USA, sizeof(term.trantbl)); + term.charset = 0; + + for (i = 0; i < 2; i++) { + tmoveto(0, 0); + tcursor(CURSOR_SAVE); + tclearregion(0, 0, term.col-1, term.row-1); + tswapscreen(); + } +} + +void +tnew(int col, int row) +{ + term = (Term){ .c = { .attr = { .fg = defaultfg, .bg = defaultbg } } }; + tresize(col, row); + treset(); +} + +void +tswapscreen(void) +{ + Line *tmp = term.line; + + term.line = term.alt; + term.alt = tmp; + term.mode ^= MODE_ALTSCREEN; + tfulldirt(); +} + +void +kscrolldown(const Arg* a) +{ + int n = a->i; + + if (n < 0) + n = term.row + n; + + if (n > term.scr) + n = term.scr; + + if (term.scr > 0) { + term.scr -= n; + selscroll(0, -n); + tfulldirt(); + } +} + +void +kscrollup(const Arg* a) +{ + int n = a->i; + + if (n < 0) + n = term.row + n; + + if (term.scr <= HISTSIZE-n) { + term.scr += n; + selscroll(0, n); + tfulldirt(); + } +} + +void +tscrolldown(int orig, int n, int copyhist) +{ + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + + if (copyhist) { + term.histi = (term.histi - 1 + HISTSIZE) % HISTSIZE; + temp = term.hist[term.histi]; + term.hist[term.histi] = term.line[term.bot]; + term.line[term.bot] = temp; + } + + tsetdirt(orig, term.bot-n); + tclearregion(0, term.bot-n+1, term.col-1, term.bot); + + for (i = term.bot; i >= orig+n; i--) { + temp = term.line[i]; + term.line[i] = term.line[i-n]; + term.line[i-n] = temp; + } + + if (term.scr == 0) + selscroll(orig, n); +} + +void +tscrollup(int orig, int n, int copyhist) +{ + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + + if (copyhist) { + term.histi = (term.histi + 1) % HISTSIZE; + temp = term.hist[term.histi]; + term.hist[term.histi] = term.line[orig]; + term.line[orig] = temp; + } + + if (term.scr > 0 && term.scr < HISTSIZE) + term.scr = MIN(term.scr + n, HISTSIZE-1); + + tclearregion(0, orig, term.col-1, orig+n-1); + tsetdirt(orig+n, term.bot); + + for (i = orig; i <= term.bot-n; i++) { + temp = term.line[i]; + term.line[i] = term.line[i+n]; + term.line[i+n] = temp; + } + + if (term.scr == 0) + selscroll(orig, -n); +} + +void +selscroll(int orig, int n) +{ + if (sel.ob.x == -1) + return; + + if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) { + selclear(); + } else if (BETWEEN(sel.nb.y, orig, term.bot)) { + sel.ob.y += n; + sel.oe.y += n; + if (sel.ob.y < term.top || sel.ob.y > term.bot || + sel.oe.y < term.top || sel.oe.y > term.bot) { + selclear(); + } else { + selnormalize(); + } + } +} + +void +tnewline(int first_col) +{ + int y = term.c.y; + + if (y == term.bot) { + tscrollup(term.top, 1, 1); + } else { + y++; + } + tmoveto(first_col ? 0 : term.c.x, y); +} + +void +csiparse(void) +{ + char *p = csiescseq.buf, *np; + long int v; + + csiescseq.narg = 0; + if (*p == '?') { + csiescseq.priv = 1; + p++; + } + + csiescseq.buf[csiescseq.len] = '\0'; + while (p < csiescseq.buf+csiescseq.len) { + np = NULL; + v = strtol(p, &np, 10); + if (np == p) + v = 0; + if (v == LONG_MAX || v == LONG_MIN) + v = -1; + csiescseq.arg[csiescseq.narg++] = v; + p = np; + if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) + break; + p++; + } + csiescseq.mode[0] = *p++; + csiescseq.mode[1] = (p < csiescseq.buf+csiescseq.len) ? *p : '\0'; +} + +/* for absolute user moves, when decom is set */ +void +tmoveato(int x, int y) +{ + tmoveto(x, y + ((term.c.state & CURSOR_ORIGIN) ? term.top: 0)); +} + +void +tmoveto(int x, int y) +{ + int miny, maxy; + + if (term.c.state & CURSOR_ORIGIN) { + miny = term.top; + maxy = term.bot; + } else { + miny = 0; + maxy = term.row - 1; + } + term.c.state &= ~CURSOR_WRAPNEXT; + term.c.x = LIMIT(x, 0, term.col-1); + term.c.y = LIMIT(y, miny, maxy); +} + +void +tsetchar(Rune u, Glyph *attr, int x, int y) +{ + static char *vt100_0[62] = { /* 0x41 - 0x7e */ + "↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */ + 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ + 0, 0, 0, 0, 0, 0, 0, 0, /* P - W */ + 0, 0, 0, 0, 0, 0, 0, " ", /* X - _ */ + "◆", "▒", "␉", "␌", "␍", "␊", "°", "±", /* ` - g */ + "␤", "␋", "┘", "┐", "┌", "└", "┼", "⎺", /* h - o */ + "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", /* p - w */ + "│", "≤", "≥", "π", "≠", "£", "·", /* x - ~ */ + }; + + /* + * The table is proudly stolen from rxvt. + */ + if (term.trantbl[term.charset] == CS_GRAPHIC0 && + BETWEEN(u, 0x41, 0x7e) && vt100_0[u - 0x41]) + utf8decode(vt100_0[u - 0x41], &u, UTF_SIZ); + + if (term.line[y][x].mode & ATTR_WIDE) { + if (x+1 < term.col) { + term.line[y][x+1].u = ' '; + term.line[y][x+1].mode &= ~ATTR_WDUMMY; + } + } else if (term.line[y][x].mode & ATTR_WDUMMY) { + term.line[y][x-1].u = ' '; + term.line[y][x-1].mode &= ~ATTR_WIDE; + } + + term.dirty[y] = 1; + term.line[y][x] = *attr; + term.line[y][x].u = u; +} + +void +tclearregion(int x1, int y1, int x2, int y2) +{ + int x, y, temp; + Glyph *gp; + + if (x1 > x2) + temp = x1, x1 = x2, x2 = temp; + if (y1 > y2) + temp = y1, y1 = y2, y2 = temp; + + LIMIT(x1, 0, term.col-1); + LIMIT(x2, 0, term.col-1); + LIMIT(y1, 0, term.row-1); + LIMIT(y2, 0, term.row-1); + + for (y = y1; y <= y2; y++) { + term.dirty[y] = 1; + for (x = x1; x <= x2; x++) { + gp = &term.line[y][x]; + if (selected(x, y)) + selclear(); + gp->fg = term.c.attr.fg; + gp->bg = term.c.attr.bg; + gp->mode = 0; + gp->u = ' '; + } + } +} + +void +tdeletechar(int n) +{ + int dst, src, size; + Glyph *line; + + LIMIT(n, 0, term.col - term.c.x); + + dst = term.c.x; + src = term.c.x + n; + size = term.col - src; + line = term.line[term.c.y]; + + memmove(&line[dst], &line[src], size * sizeof(Glyph)); + tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); +} + +void +tinsertblank(int n) +{ + int dst, src, size; + Glyph *line; + + LIMIT(n, 0, term.col - term.c.x); + + dst = term.c.x + n; + src = term.c.x; + size = term.col - dst; + line = term.line[term.c.y]; + + memmove(&line[dst], &line[src], size * sizeof(Glyph)); + tclearregion(src, term.c.y, dst - 1, term.c.y); +} + +void +tinsertblankline(int n) +{ + if (BETWEEN(term.c.y, term.top, term.bot)) + tscrolldown(term.c.y, n, 0); +} + +void +tdeleteline(int n) +{ + if (BETWEEN(term.c.y, term.top, term.bot)) + tscrollup(term.c.y, n, 0); +} + +int32_t +tdefcolor(int *attr, int *npar, int l) +{ + int32_t idx = -1; + uint r, g, b; + + switch (attr[*npar + 1]) { + case 2: /* direct color in RGB space */ + if (*npar + 4 >= l) { + fprintf(stderr, + "erresc(38): Incorrect number of parameters (%d)\n", + *npar); + break; + } + r = attr[*npar + 2]; + g = attr[*npar + 3]; + b = attr[*npar + 4]; + *npar += 4; + if (!BETWEEN(r, 0, 255) || !BETWEEN(g, 0, 255) || !BETWEEN(b, 0, 255)) + fprintf(stderr, "erresc: bad rgb color (%u,%u,%u)\n", + r, g, b); + else + idx = TRUECOLOR(r, g, b); + break; + case 5: /* indexed color */ + if (*npar + 2 >= l) { + fprintf(stderr, + "erresc(38): Incorrect number of parameters (%d)\n", + *npar); + break; + } + *npar += 2; + if (!BETWEEN(attr[*npar], 0, 255)) + fprintf(stderr, "erresc: bad fgcolor %d\n", attr[*npar]); + else + idx = attr[*npar]; + break; + case 0: /* implemented defined (only foreground) */ + case 1: /* transparent */ + case 3: /* direct color in CMY space */ + case 4: /* direct color in CMYK space */ + default: + fprintf(stderr, + "erresc(38): gfx attr %d unknown\n", attr[*npar]); + break; + } + + return idx; +} + +void +tsetattr(int *attr, int l) +{ + int i; + int32_t idx; + + for (i = 0; i < l; i++) { + switch (attr[i]) { + case 0: + term.c.attr.mode &= ~( + ATTR_BOLD | + ATTR_FAINT | + ATTR_ITALIC | + ATTR_UNDERLINE | + ATTR_BLINK | + ATTR_REVERSE | + ATTR_INVISIBLE | + ATTR_STRUCK ); + term.c.attr.fg = defaultfg; + term.c.attr.bg = defaultbg; + break; + case 1: + term.c.attr.mode |= ATTR_BOLD; + break; + case 2: + term.c.attr.mode |= ATTR_FAINT; + break; + case 3: + term.c.attr.mode |= ATTR_ITALIC; + break; + case 4: + term.c.attr.mode |= ATTR_UNDERLINE; + break; + case 5: /* slow blink */ + /* FALLTHROUGH */ + case 6: /* rapid blink */ + term.c.attr.mode |= ATTR_BLINK; + break; + case 7: + term.c.attr.mode |= ATTR_REVERSE; + break; + case 8: + term.c.attr.mode |= ATTR_INVISIBLE; + break; + case 9: + term.c.attr.mode |= ATTR_STRUCK; + break; + case 22: + term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT); + break; + case 23: + term.c.attr.mode &= ~ATTR_ITALIC; + break; + case 24: + term.c.attr.mode &= ~ATTR_UNDERLINE; + break; + case 25: + term.c.attr.mode &= ~ATTR_BLINK; + break; + case 27: + term.c.attr.mode &= ~ATTR_REVERSE; + break; + case 28: + term.c.attr.mode &= ~ATTR_INVISIBLE; + break; + case 29: + term.c.attr.mode &= ~ATTR_STRUCK; + break; + case 38: + if ((idx = tdefcolor(attr, &i, l)) >= 0) + term.c.attr.fg = idx; + break; + case 39: + term.c.attr.fg = defaultfg; + break; + case 48: + if ((idx = tdefcolor(attr, &i, l)) >= 0) + term.c.attr.bg = idx; + break; + case 49: + term.c.attr.bg = defaultbg; + break; + default: + if (BETWEEN(attr[i], 30, 37)) { + term.c.attr.fg = attr[i] - 30; + } else if (BETWEEN(attr[i], 40, 47)) { + term.c.attr.bg = attr[i] - 40; + } else if (BETWEEN(attr[i], 90, 97)) { + term.c.attr.fg = attr[i] - 90 + 8; + } else if (BETWEEN(attr[i], 100, 107)) { + term.c.attr.bg = attr[i] - 100 + 8; + } else { + fprintf(stderr, + "erresc(default): gfx attr %d unknown\n", + attr[i]); + csidump(); + } + break; + } + } +} + +void +tsetscroll(int t, int b) +{ + int temp; + + LIMIT(t, 0, term.row-1); + LIMIT(b, 0, term.row-1); + if (t > b) { + temp = t; + t = b; + b = temp; + } + term.top = t; + term.bot = b; +} + +void +tsetmode(int priv, int set, int *args, int narg) +{ + int alt, *lim; + + for (lim = args + narg; args < lim; ++args) { + if (priv) { + switch (*args) { + case 1: /* DECCKM -- Cursor key */ + xsetmode(set, MODE_APPCURSOR); + break; + case 5: /* DECSCNM -- Reverse video */ + xsetmode(set, MODE_REVERSE); + break; + case 6: /* DECOM -- Origin */ + MODBIT(term.c.state, set, CURSOR_ORIGIN); + tmoveato(0, 0); + break; + case 7: /* DECAWM -- Auto wrap */ + MODBIT(term.mode, set, MODE_WRAP); + break; + case 0: /* Error (IGNORED) */ + case 2: /* DECANM -- ANSI/VT52 (IGNORED) */ + case 3: /* DECCOLM -- Column (IGNORED) */ + case 4: /* DECSCLM -- Scroll (IGNORED) */ + case 8: /* DECARM -- Auto repeat (IGNORED) */ + case 18: /* DECPFF -- Printer feed (IGNORED) */ + case 19: /* DECPEX -- Printer extent (IGNORED) */ + case 42: /* DECNRCM -- National characters (IGNORED) */ + case 12: /* att610 -- Start blinking cursor (IGNORED) */ + break; + case 25: /* DECTCEM -- Text Cursor Enable Mode */ + xsetmode(!set, MODE_HIDE); + break; + case 9: /* X10 mouse compatibility mode */ + xsetpointermotion(0); + xsetmode(0, MODE_MOUSE); + xsetmode(set, MODE_MOUSEX10); + break; + case 1000: /* 1000: report button press */ + xsetpointermotion(0); + xsetmode(0, MODE_MOUSE); + xsetmode(set, MODE_MOUSEBTN); + break; + case 1002: /* 1002: report motion on button press */ + xsetpointermotion(0); + xsetmode(0, MODE_MOUSE); + xsetmode(set, MODE_MOUSEMOTION); + break; + case 1003: /* 1003: enable all mouse motions */ + xsetpointermotion(set); + xsetmode(0, MODE_MOUSE); + xsetmode(set, MODE_MOUSEMANY); + break; + case 1004: /* 1004: send focus events to tty */ + xsetmode(set, MODE_FOCUS); + break; + case 1006: /* 1006: extended reporting mode */ + xsetmode(set, MODE_MOUSESGR); + break; + case 1034: + xsetmode(set, MODE_8BIT); + break; + case 1049: /* swap screen & set/restore cursor as xterm */ + if (!allowaltscreen) + break; + tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); + /* FALLTHROUGH */ + case 47: /* swap screen */ + case 1047: + if (!allowaltscreen) + break; + alt = IS_SET(MODE_ALTSCREEN); + if (alt) { + tclearregion(0, 0, term.col-1, + term.row-1); + } + if (set ^ alt) /* set is always 1 or 0 */ + tswapscreen(); + if (*args != 1049) + break; + /* FALLTHROUGH */ + case 1048: + tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); + break; + case 2004: /* 2004: bracketed paste mode */ + xsetmode(set, MODE_BRCKTPASTE); + break; + /* Not implemented mouse modes. See comments there. */ + case 1001: /* mouse highlight mode; can hang the + terminal by design when implemented. */ + case 1005: /* UTF-8 mouse mode; will confuse + applications not supporting UTF-8 + and luit. */ + case 1015: /* urxvt mangled mouse mode; incompatible + and can be mistaken for other control + codes. */ + break; + default: + fprintf(stderr, + "erresc: unknown private set/reset mode %d\n", + *args); + break; + } + } else { + switch (*args) { + case 0: /* Error (IGNORED) */ + break; + case 2: + xsetmode(set, MODE_KBDLOCK); + break; + case 4: /* IRM -- Insertion-replacement */ + MODBIT(term.mode, set, MODE_INSERT); + break; + case 12: /* SRM -- Send/Receive */ + MODBIT(term.mode, !set, MODE_ECHO); + break; + case 20: /* LNM -- Linefeed/new line */ + MODBIT(term.mode, set, MODE_CRLF); + break; + default: + fprintf(stderr, + "erresc: unknown set/reset mode %d\n", + *args); + break; + } + } + } +} + +void +csihandle(void) +{ + char buf[40]; + int len; + + switch (csiescseq.mode[0]) { + default: + unknown: + fprintf(stderr, "erresc: unknown csi "); + csidump(); + /* die(""); */ + break; + case '@': /* ICH -- Insert blank char */ + DEFAULT(csiescseq.arg[0], 1); + tinsertblank(csiescseq.arg[0]); + break; + case 'A': /* CUU -- Cursor Up */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(term.c.x, term.c.y-csiescseq.arg[0]); + break; + case 'B': /* CUD -- Cursor Down */ + case 'e': /* VPR --Cursor Down */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(term.c.x, term.c.y+csiescseq.arg[0]); + break; + case 'i': /* MC -- Media Copy */ + switch (csiescseq.arg[0]) { + case 0: + tdump(); + break; + case 1: + tdumpline(term.c.y); + break; + case 2: + tdumpsel(); + break; + case 4: + term.mode &= ~MODE_PRINT; + break; + case 5: + term.mode |= MODE_PRINT; + break; + } + break; + case 'c': /* DA -- Device Attributes */ + if (csiescseq.arg[0] == 0) + ttywrite(vtiden, strlen(vtiden), 0); + break; + case 'b': /* REP -- if last char is printable print it more times */ + DEFAULT(csiescseq.arg[0], 1); + if (term.lastc) + while (csiescseq.arg[0]-- > 0) + tputc(term.lastc); + break; + case 'C': /* CUF -- Cursor Forward */ + case 'a': /* HPR -- Cursor Forward */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(term.c.x+csiescseq.arg[0], term.c.y); + break; + case 'D': /* CUB -- Cursor Backward */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(term.c.x-csiescseq.arg[0], term.c.y); + break; + case 'E': /* CNL -- Cursor Down and first col */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(0, term.c.y+csiescseq.arg[0]); + break; + case 'F': /* CPL -- Cursor Up and first col */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(0, term.c.y-csiescseq.arg[0]); + break; + case 'g': /* TBC -- Tabulation clear */ + switch (csiescseq.arg[0]) { + case 0: /* clear current tab stop */ + term.tabs[term.c.x] = 0; + break; + case 3: /* clear all the tabs */ + memset(term.tabs, 0, term.col * sizeof(*term.tabs)); + break; + default: + goto unknown; + } + break; + case 'G': /* CHA -- Move to */ + case '`': /* HPA */ + DEFAULT(csiescseq.arg[0], 1); + tmoveto(csiescseq.arg[0]-1, term.c.y); + break; + case 'H': /* CUP -- Move to */ + case 'f': /* HVP */ + DEFAULT(csiescseq.arg[0], 1); + DEFAULT(csiescseq.arg[1], 1); + tmoveato(csiescseq.arg[1]-1, csiescseq.arg[0]-1); + break; + case 'I': /* CHT -- Cursor Forward Tabulation tab stops */ + DEFAULT(csiescseq.arg[0], 1); + tputtab(csiescseq.arg[0]); + break; + case 'J': /* ED -- Clear screen */ + switch (csiescseq.arg[0]) { + case 0: /* below */ + tclearregion(term.c.x, term.c.y, term.col-1, term.c.y); + if (term.c.y < term.row-1) { + tclearregion(0, term.c.y+1, term.col-1, + term.row-1); + } + break; + case 1: /* above */ + if (term.c.y > 1) + tclearregion(0, 0, term.col-1, term.c.y-1); + tclearregion(0, term.c.y, term.c.x, term.c.y); + break; + case 2: /* all */ + tclearregion(0, 0, term.col-1, term.row-1); + break; + default: + goto unknown; + } + break; + case 'K': /* EL -- Clear line */ + switch (csiescseq.arg[0]) { + case 0: /* right */ + tclearregion(term.c.x, term.c.y, term.col-1, + term.c.y); + break; + case 1: /* left */ + tclearregion(0, term.c.y, term.c.x, term.c.y); + break; + case 2: /* all */ + tclearregion(0, term.c.y, term.col-1, term.c.y); + break; + } + break; + case 'S': /* SU -- Scroll line up */ + DEFAULT(csiescseq.arg[0], 1); + tscrollup(term.top, csiescseq.arg[0], 0); + break; + case 'T': /* SD -- Scroll line down */ + DEFAULT(csiescseq.arg[0], 1); + tscrolldown(term.top, csiescseq.arg[0], 0); + break; + case 'L': /* IL -- Insert blank lines */ + DEFAULT(csiescseq.arg[0], 1); + tinsertblankline(csiescseq.arg[0]); + break; + case 'l': /* RM -- Reset Mode */ + tsetmode(csiescseq.priv, 0, csiescseq.arg, csiescseq.narg); + break; + case 'M': /* DL -- Delete lines */ + DEFAULT(csiescseq.arg[0], 1); + tdeleteline(csiescseq.arg[0]); + break; + case 'X': /* ECH -- Erase char */ + DEFAULT(csiescseq.arg[0], 1); + tclearregion(term.c.x, term.c.y, + term.c.x + csiescseq.arg[0] - 1, term.c.y); + break; + case 'P': /* DCH -- Delete char */ + DEFAULT(csiescseq.arg[0], 1); + tdeletechar(csiescseq.arg[0]); + break; + case 'Z': /* CBT -- Cursor Backward Tabulation tab stops */ + DEFAULT(csiescseq.arg[0], 1); + tputtab(-csiescseq.arg[0]); + break; + case 'd': /* VPA -- Move to */ + DEFAULT(csiescseq.arg[0], 1); + tmoveato(term.c.x, csiescseq.arg[0]-1); + break; + case 'h': /* SM -- Set terminal mode */ + tsetmode(csiescseq.priv, 1, csiescseq.arg, csiescseq.narg); + break; + case 'm': /* SGR -- Terminal attribute (color) */ + tsetattr(csiescseq.arg, csiescseq.narg); + break; + case 'n': /* DSR – Device Status Report (cursor position) */ + if (csiescseq.arg[0] == 6) { + len = snprintf(buf, sizeof(buf), "\033[%i;%iR", + term.c.y+1, term.c.x+1); + ttywrite(buf, len, 0); + } + break; + case 'r': /* DECSTBM -- Set Scrolling Region */ + if (csiescseq.priv) { + goto unknown; + } else { + DEFAULT(csiescseq.arg[0], 1); + DEFAULT(csiescseq.arg[1], term.row); + tsetscroll(csiescseq.arg[0]-1, csiescseq.arg[1]-1); + tmoveato(0, 0); + } + break; + case 's': /* DECSC -- Save cursor position (ANSI.SYS) */ + tcursor(CURSOR_SAVE); + break; + case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ + tcursor(CURSOR_LOAD); + break; + case ' ': + switch (csiescseq.mode[1]) { + case 'q': /* DECSCUSR -- Set Cursor Style */ + if (xsetcursor(csiescseq.arg[0])) + goto unknown; + break; + default: + goto unknown; + } + break; + } +} + +void +csidump(void) +{ + size_t i; + uint c; + + fprintf(stderr, "ESC["); + for (i = 0; i < csiescseq.len; i++) { + c = csiescseq.buf[i] & 0xff; + if (isprint(c)) { + putc(c, stderr); + } else if (c == '\n') { + fprintf(stderr, "(\\n)"); + } else if (c == '\r') { + fprintf(stderr, "(\\r)"); + } else if (c == 0x1b) { + fprintf(stderr, "(\\e)"); + } else { + fprintf(stderr, "(%02x)", c); + } + } + putc('\n', stderr); +} + +void +csireset(void) +{ + memset(&csiescseq, 0, sizeof(csiescseq)); +} + +void +strhandle(void) +{ + char *p = NULL, *dec; + int j, narg, par; + + term.esc &= ~(ESC_STR_END|ESC_STR); + strparse(); + par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0; + + switch (strescseq.type) { + case ']': /* OSC -- Operating System Command */ + switch (par) { + case 0: + if (narg > 1) { + xsettitle(strescseq.args[1]); + xseticontitle(strescseq.args[1]); + } + return; + case 1: + if (narg > 1) + xseticontitle(strescseq.args[1]); + return; + case 2: + if (narg > 1) + xsettitle(strescseq.args[1]); + return; + case 52: + if (narg > 2 && allowwindowops) { + dec = base64dec(strescseq.args[2]); + if (dec) { + xsetsel(dec); + xclipcopy(); + } else { + fprintf(stderr, "erresc: invalid base64\n"); + } + } + return; + case 4: /* color set */ + if (narg < 3) + break; + p = strescseq.args[2]; + /* FALLTHROUGH */ + case 104: /* color reset, here p = NULL */ + j = (narg > 1) ? atoi(strescseq.args[1]) : -1; + if (xsetcolorname(j, p)) { + if (par == 104 && narg <= 1) + return; /* color reset without parameter */ + fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", + j, p ? p : "(null)"); + } else { + /* + * TODO if defaultbg color is changed, borders + * are dirty + */ + redraw(); + } + return; + } + break; + case 'k': /* old title set compatibility */ + xsettitle(strescseq.args[0]); + return; + case 'P': /* DCS -- Device Control String */ + case '_': /* APC -- Application Program Command */ + case '^': /* PM -- Privacy Message */ + return; + } + + fprintf(stderr, "erresc: unknown str "); + strdump(); +} + +void +strparse(void) +{ + int c; + char *p = strescseq.buf; + + strescseq.narg = 0; + strescseq.buf[strescseq.len] = '\0'; + + if (*p == '\0') + return; + + while (strescseq.narg < STR_ARG_SIZ) { + strescseq.args[strescseq.narg++] = p; + while ((c = *p) != ';' && c != '\0') + ++p; + if (c == '\0') + return; + *p++ = '\0'; + } +} + +void +externalpipe(const Arg *arg) +{ + int to[2]; + char buf[UTF_SIZ]; + void (*oldsigpipe)(int); + Glyph *bp, *end; + int lastpos, n, newline; + + if (pipe(to) == -1) + return; + + switch (fork()) { + case -1: + close(to[0]); + close(to[1]); + return; + case 0: + dup2(to[0], STDIN_FILENO); + close(to[0]); + close(to[1]); + execvp(((char **)arg->v)[0], (char **)arg->v); + fprintf(stderr, "st: execvp %s\n", ((char **)arg->v)[0]); + perror("failed"); + exit(0); + } + + close(to[0]); + /* ignore sigpipe for now, in case child exists early */ + oldsigpipe = signal(SIGPIPE, SIG_IGN); + newline = 0; + for (n = 0; n < term.row; n++) { + bp = term.line[n]; + lastpos = MIN(tlinelen(n) + 1, term.col) - 1; + if (lastpos < 0) + break; + end = &bp[lastpos + 1]; + for (; bp < end; ++bp) + if (xwrite(to[1], buf, utf8encode(bp->u, buf)) < 0) + break; + if ((newline = term.line[n][lastpos].mode & ATTR_WRAP)) + continue; + if (xwrite(to[1], "\n", 1) < 0) + break; + newline = 0; + } + if (newline) + (void)xwrite(to[1], "\n", 1); + close(to[1]); + /* restore */ + signal(SIGPIPE, oldsigpipe); +} + +void +strdump(void) +{ + size_t i; + uint c; + + fprintf(stderr, "ESC%c", strescseq.type); + for (i = 0; i < strescseq.len; i++) { + c = strescseq.buf[i] & 0xff; + if (c == '\0') { + putc('\n', stderr); + return; + } else if (isprint(c)) { + putc(c, stderr); + } else if (c == '\n') { + fprintf(stderr, "(\\n)"); + } else if (c == '\r') { + fprintf(stderr, "(\\r)"); + } else if (c == 0x1b) { + fprintf(stderr, "(\\e)"); + } else { + fprintf(stderr, "(%02x)", c); + } + } + fprintf(stderr, "ESC\\\n"); +} + +void +strreset(void) +{ + strescseq = (STREscape){ + .buf = xrealloc(strescseq.buf, STR_BUF_SIZ), + .siz = STR_BUF_SIZ, + }; +} + +void +sendbreak(const Arg *arg) +{ + if (tcsendbreak(cmdfd, 0)) + perror("Error sending break"); +} + +void +tprinter(char *s, size_t len) +{ + if (iofd != -1 && xwrite(iofd, s, len) < 0) { + perror("Error writing to output file"); + close(iofd); + iofd = -1; + } +} + +void +iso14755(const Arg *arg) +{ + FILE *p; + char *us, *e, codepoint[9], uc[UTF_SIZ]; + unsigned long utf32; + + if (!(p = popen(iso14755_cmd, "r"))) + return; + + us = fgets(codepoint, sizeof(codepoint), p); + pclose(p); + + if (!us || *us == '\0' || *us == '-' || strlen(us) > 7) + return; + if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX || + (*e != '\n' && *e != '\0')) + return; + + ttywrite(uc, utf8encode(utf32, uc), 1); +} + +void +toggleprinter(const Arg *arg) +{ + term.mode ^= MODE_PRINT; +} + +void +printscreen(const Arg *arg) +{ + tdump(); +} + +void +printsel(const Arg *arg) +{ + tdumpsel(); +} + +void +tdumpsel(void) +{ + char *ptr; + + if ((ptr = getsel())) { + tprinter(ptr, strlen(ptr)); + free(ptr); + } +} + +void +tdumpline(int n) +{ + char buf[UTF_SIZ]; + Glyph *bp, *end; + + bp = &term.line[n][0]; + end = &bp[MIN(tlinelen(n), term.col) - 1]; + if (bp != end || bp->u != ' ') { + for ( ; bp <= end; ++bp) + tprinter(buf, utf8encode(bp->u, buf)); + } + tprinter("\n", 1); +} + +void +tdump(void) +{ + int i; + + for (i = 0; i < term.row; ++i) + tdumpline(i); +} + +void +tputtab(int n) +{ + uint x = term.c.x; + + if (n > 0) { + while (x < term.col && n--) + for (++x; x < term.col && !term.tabs[x]; ++x) + /* nothing */ ; + } else if (n < 0) { + while (x > 0 && n++) + for (--x; x > 0 && !term.tabs[x]; --x) + /* nothing */ ; + } + term.c.x = LIMIT(x, 0, term.col-1); +} + +void +tdefutf8(char ascii) +{ + if (ascii == 'G') + term.mode |= MODE_UTF8; + else if (ascii == '@') + term.mode &= ~MODE_UTF8; +} + +void +tdeftran(char ascii) +{ + static char cs[] = "0B"; + static int vcs[] = {CS_GRAPHIC0, CS_USA}; + char *p; + + if ((p = strchr(cs, ascii)) == NULL) { + fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii); + } else { + term.trantbl[term.icharset] = vcs[p - cs]; + } +} + +void +tdectest(char c) +{ + int x, y; + + if (c == '8') { /* DEC screen alignment test. */ + for (x = 0; x < term.col; ++x) { + for (y = 0; y < term.row; ++y) + tsetchar('E', &term.c.attr, x, y); + } + } +} + +void +tstrsequence(uchar c) +{ + switch (c) { + case 0x90: /* DCS -- Device Control String */ + c = 'P'; + break; + case 0x9f: /* APC -- Application Program Command */ + c = '_'; + break; + case 0x9e: /* PM -- Privacy Message */ + c = '^'; + break; + case 0x9d: /* OSC -- Operating System Command */ + c = ']'; + break; + } + strreset(); + strescseq.type = c; + term.esc |= ESC_STR; +} + +void +tcontrolcode(uchar ascii) +{ + switch (ascii) { + case '\t': /* HT */ + tputtab(1); + return; + case '\b': /* BS */ + tmoveto(term.c.x-1, term.c.y); + return; + case '\r': /* CR */ + tmoveto(0, term.c.y); + return; + case '\f': /* LF */ + case '\v': /* VT */ + case '\n': /* LF */ + /* go to first col if the mode is set */ + tnewline(IS_SET(MODE_CRLF)); + return; + case '\a': /* BEL */ + if (term.esc & ESC_STR_END) { + /* backwards compatibility to xterm */ + strhandle(); + } else { + xbell(); + } + break; + case '\033': /* ESC */ + csireset(); + term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST); + term.esc |= ESC_START; + return; + case '\016': /* SO (LS1 -- Locking shift 1) */ + case '\017': /* SI (LS0 -- Locking shift 0) */ + term.charset = 1 - (ascii - '\016'); + return; + case '\032': /* SUB */ + tsetchar('?', &term.c.attr, term.c.x, term.c.y); + /* FALLTHROUGH */ + case '\030': /* CAN */ + csireset(); + break; + case '\005': /* ENQ (IGNORED) */ + case '\000': /* NUL (IGNORED) */ + case '\021': /* XON (IGNORED) */ + case '\023': /* XOFF (IGNORED) */ + case 0177: /* DEL (IGNORED) */ + return; + case 0x80: /* TODO: PAD */ + case 0x81: /* TODO: HOP */ + case 0x82: /* TODO: BPH */ + case 0x83: /* TODO: NBH */ + case 0x84: /* TODO: IND */ + break; + case 0x85: /* NEL -- Next line */ + tnewline(1); /* always go to first col */ + break; + case 0x86: /* TODO: SSA */ + case 0x87: /* TODO: ESA */ + break; + case 0x88: /* HTS -- Horizontal tab stop */ + term.tabs[term.c.x] = 1; + break; + case 0x89: /* TODO: HTJ */ + case 0x8a: /* TODO: VTS */ + case 0x8b: /* TODO: PLD */ + case 0x8c: /* TODO: PLU */ + case 0x8d: /* TODO: RI */ + case 0x8e: /* TODO: SS2 */ + case 0x8f: /* TODO: SS3 */ + case 0x91: /* TODO: PU1 */ + case 0x92: /* TODO: PU2 */ + case 0x93: /* TODO: STS */ + case 0x94: /* TODO: CCH */ + case 0x95: /* TODO: MW */ + case 0x96: /* TODO: SPA */ + case 0x97: /* TODO: EPA */ + case 0x98: /* TODO: SOS */ + case 0x99: /* TODO: SGCI */ + break; + case 0x9a: /* DECID -- Identify Terminal */ + ttywrite(vtiden, strlen(vtiden), 0); + break; + case 0x9b: /* TODO: CSI */ + case 0x9c: /* TODO: ST */ + break; + case 0x90: /* DCS -- Device Control String */ + case 0x9d: /* OSC -- Operating System Command */ + case 0x9e: /* PM -- Privacy Message */ + case 0x9f: /* APC -- Application Program Command */ + tstrsequence(ascii); + return; + } + /* only CAN, SUB, \a and C1 chars interrupt a sequence */ + term.esc &= ~(ESC_STR_END|ESC_STR); +} + +/* + * returns 1 when the sequence is finished and it hasn't to read + * more characters for this sequence, otherwise 0 + */ +int +eschandle(uchar ascii) +{ + switch (ascii) { + case '[': + term.esc |= ESC_CSI; + return 0; + case '#': + term.esc |= ESC_TEST; + return 0; + case '%': + term.esc |= ESC_UTF8; + return 0; + case 'P': /* DCS -- Device Control String */ + case '_': /* APC -- Application Program Command */ + case '^': /* PM -- Privacy Message */ + case ']': /* OSC -- Operating System Command */ + case 'k': /* old title set compatibility */ + tstrsequence(ascii); + return 0; + case 'n': /* LS2 -- Locking shift 2 */ + case 'o': /* LS3 -- Locking shift 3 */ + term.charset = 2 + (ascii - 'n'); + break; + case '(': /* GZD4 -- set primary charset G0 */ + case ')': /* G1D4 -- set secondary charset G1 */ + case '*': /* G2D4 -- set tertiary charset G2 */ + case '+': /* G3D4 -- set quaternary charset G3 */ + term.icharset = ascii - '('; + term.esc |= ESC_ALTCHARSET; + return 0; + case 'D': /* IND -- Linefeed */ + if (term.c.y == term.bot) { + tscrollup(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y+1); + } + break; + case 'E': /* NEL -- Next line */ + tnewline(1); /* always go to first col */ + break; + case 'H': /* HTS -- Horizontal tab stop */ + term.tabs[term.c.x] = 1; + break; + case 'M': /* RI -- Reverse index */ + if (term.c.y == term.top) { + tscrolldown(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y-1); + } + break; + case 'Z': /* DECID -- Identify Terminal */ + ttywrite(vtiden, strlen(vtiden), 0); + break; + case 'c': /* RIS -- Reset to initial state */ + treset(); + resettitle(); + xloadcols(); + break; + case '=': /* DECPAM -- Application keypad */ + xsetmode(1, MODE_APPKEYPAD); + break; + case '>': /* DECPNM -- Normal keypad */ + xsetmode(0, MODE_APPKEYPAD); + break; + case '7': /* DECSC -- Save Cursor */ + tcursor(CURSOR_SAVE); + break; + case '8': /* DECRC -- Restore Cursor */ + tcursor(CURSOR_LOAD); + break; + case '\\': /* ST -- String Terminator */ + if (term.esc & ESC_STR_END) + strhandle(); + break; + default: + fprintf(stderr, "erresc: unknown sequence ESC 0x%02X '%c'\n", + (uchar) ascii, isprint(ascii)? ascii:'.'); + break; + } + return 1; +} + +void +tputc(Rune u) +{ + char c[UTF_SIZ]; + int control; + int width, len; + Glyph *gp; + + control = ISCONTROL(u); + if (u < 127 || !IS_SET(MODE_UTF8)) { + c[0] = u; + width = len = 1; + } else { + len = utf8encode(u, c); + if (!control && (width = wcwidth(u)) == -1) + width = 1; + } + + if (IS_SET(MODE_PRINT)) + tprinter(c, len); + + /* + * STR sequence must be checked before anything else + * because it uses all following characters until it + * receives a ESC, a SUB, a ST or any other C1 control + * character. + */ + if (term.esc & ESC_STR) { + if (u == '\a' || u == 030 || u == 032 || u == 033 || + ISCONTROLC1(u)) { + term.esc &= ~(ESC_START|ESC_STR); + term.esc |= ESC_STR_END; + goto check_control_code; + } + + if (strescseq.len+len >= strescseq.siz) { + /* + * Here is a bug in terminals. If the user never sends + * some code to stop the str or esc command, then st + * will stop responding. But this is better than + * silently failing with unknown characters. At least + * then users will report back. + * + * In the case users ever get fixed, here is the code: + */ + /* + * term.esc = 0; + * strhandle(); + */ + if (strescseq.siz > (SIZE_MAX - UTF_SIZ) / 2) + return; + strescseq.siz *= 2; + strescseq.buf = xrealloc(strescseq.buf, strescseq.siz); + } + + memmove(&strescseq.buf[strescseq.len], c, len); + strescseq.len += len; + return; + } + +check_control_code: + /* + * Actions of control codes must be performed as soon they arrive + * because they can be embedded inside a control sequence, and + * they must not cause conflicts with sequences. + */ + if (control) { + tcontrolcode(u); + /* + * control codes are not shown ever + */ + if (!term.esc) + term.lastc = 0; + return; + } else if (term.esc & ESC_START) { + if (term.esc & ESC_CSI) { + csiescseq.buf[csiescseq.len++] = u; + if (BETWEEN(u, 0x40, 0x7E) + || csiescseq.len >= \ + sizeof(csiescseq.buf)-1) { + term.esc = 0; + csiparse(); + csihandle(); + } + return; + } else if (term.esc & ESC_UTF8) { + tdefutf8(u); + } else if (term.esc & ESC_ALTCHARSET) { + tdeftran(u); + } else if (term.esc & ESC_TEST) { + tdectest(u); + } else { + if (!eschandle(u)) + return; + /* sequence already finished */ + } + term.esc = 0; + /* + * All characters which form part of a sequence are not + * printed + */ + return; + } + if (selected(term.c.x, term.c.y)) + selclear(); + + gp = &term.line[term.c.y][term.c.x]; + if (IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) { + gp->mode |= ATTR_WRAP; + tnewline(1); + gp = &term.line[term.c.y][term.c.x]; + } + + if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) + memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph)); + + if (term.c.x+width > term.col) { + tnewline(1); + gp = &term.line[term.c.y][term.c.x]; + } + + tsetchar(u, &term.c.attr, term.c.x, term.c.y); + term.lastc = u; + + if (width == 2) { + gp->mode |= ATTR_WIDE; + if (term.c.x+1 < term.col) { + gp[1].u = '\0'; + gp[1].mode = ATTR_WDUMMY; + } + } + if (term.c.x+width < term.col) { + tmoveto(term.c.x+width, term.c.y); + } else { + term.c.state |= CURSOR_WRAPNEXT; + } +} + +int +twrite(const char *buf, int buflen, int show_ctrl) +{ + int charsize; + Rune u; + int n; + + for (n = 0; n < buflen; n += charsize) { + if (IS_SET(MODE_UTF8)) { + /* process a complete utf8 char */ + charsize = utf8decode(buf + n, &u, buflen - n); + if (charsize == 0) + break; + } else { + u = buf[n] & 0xFF; + charsize = 1; + } + if (show_ctrl && ISCONTROL(u)) { + if (u & 0x80) { + u &= 0x7f; + tputc('^'); + tputc('['); + } else if (u != '\n' && u != '\r' && u != '\t') { + u ^= 0x40; + tputc('^'); + } + } + tputc(u); + } + return n; +} + +void +tresize(int col, int row) +{ + int i, j; + int minrow = MIN(row, term.row); + int mincol = MIN(col, term.col); + int *bp; + TCursor c; + + if (col < 1 || row < 1) { + fprintf(stderr, + "tresize: error resizing to %dx%d\n", col, row); + return; + } + + /* + * slide screen to keep cursor where we expect it - + * tscrollup would work here, but we can optimize to + * memmove because we're freeing the earlier lines + */ + for (i = 0; i <= term.c.y - row; i++) { + free(term.line[i]); + free(term.alt[i]); + } + /* ensure that both src and dst are not NULL */ + if (i > 0) { + memmove(term.line, term.line + i, row * sizeof(Line)); + memmove(term.alt, term.alt + i, row * sizeof(Line)); + } + for (i += row; i < term.row; i++) { + free(term.line[i]); + free(term.alt[i]); + } + + /* resize to new height */ + term.line = xrealloc(term.line, row * sizeof(Line)); + term.alt = xrealloc(term.alt, row * sizeof(Line)); + term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); + term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); + + for (i = 0; i < HISTSIZE; i++) { + term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); + for (j = mincol; j < col; j++) { + term.hist[i][j] = term.c.attr; + term.hist[i][j].u = ' '; + } + } + + /* resize each row to new width, zero-pad if needed */ + for (i = 0; i < minrow; i++) { + term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); + term.alt[i] = xrealloc(term.alt[i], col * sizeof(Glyph)); + } + + /* allocate any new rows */ + for (/* i = minrow */; i < row; i++) { + term.line[i] = xmalloc(col * sizeof(Glyph)); + term.alt[i] = xmalloc(col * sizeof(Glyph)); + } + if (col > term.col) { + bp = term.tabs + term.col; + + memset(bp, 0, sizeof(*term.tabs) * (col - term.col)); + while (--bp > term.tabs && !*bp) + /* nothing */ ; + for (bp += tabspaces; bp < term.tabs + col; bp += tabspaces) + *bp = 1; + } + /* update terminal size */ + term.col = col; + term.row = row; + /* reset scrolling region */ + tsetscroll(0, row-1); + /* make use of the LIMIT in tmoveto */ + tmoveto(term.c.x, term.c.y); + /* Clearing both screens (it makes dirty all lines) */ + c = term.c; + for (i = 0; i < 2; i++) { + if (mincol < col && 0 < minrow) { + tclearregion(mincol, 0, col - 1, minrow - 1); + } + if (0 < col && minrow < row) { + tclearregion(0, minrow, col - 1, row - 1); + } + tswapscreen(); + tcursor(CURSOR_LOAD); + } + term.c = c; +} + +void +resettitle(void) +{ + xsettitle(NULL); +} + +void +drawregion(int x1, int y1, int x2, int y2) +{ + int y; + + for (y = y1; y < y2; y++) { + if (!term.dirty[y]) + continue; + + term.dirty[y] = 0; + xdrawline(TLINE(y), x1, y, x2); + } +} + +void +draw(void) +{ + int cx = term.c.x, ocx = term.ocx, ocy = term.ocy; + + if (!xstartdraw()) + return; + + /* adjust cursor position */ + LIMIT(term.ocx, 0, term.col-1); + LIMIT(term.ocy, 0, term.row-1); + if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY) + term.ocx--; + if (term.line[term.c.y][cx].mode & ATTR_WDUMMY) + cx--; + + drawregion(0, 0, term.col, term.row); + if (term.scr == 0) + xdrawcursor(cx, term.c.y, term.line[term.c.y][cx], + term.ocx, term.ocy, term.line[term.ocy][term.ocx]); + term.ocx = cx; + term.ocy = term.c.y; + xfinishdraw(); + if (ocx != term.ocx || ocy != term.ocy) + xximspot(term.ocx, term.ocy); +} + +void +redraw(void) +{ + tfulldirt(); + draw(); +} diff --git a/.local/src/st/st.h b/.local/src/st/st.h index 2248634f..01de29f3 100644 --- a/.local/src/st/st.h +++ b/.local/src/st/st.h @@ -79,6 +79,7 @@ typedef union { void die(const char *, ...); void redraw(void); +void tfulldirt(void); void draw(void); void iso14755(const Arg *); @@ -129,3 +130,4 @@ extern unsigned int defaultfg; extern unsigned int defaultbg; extern float alpha; extern char *iso14755_cmd; +extern float alpha, alphaUnfocused; diff --git a/.local/src/st/st.h.orig b/.local/src/st/st.h.orig new file mode 100644 index 00000000..2248634f --- /dev/null +++ b/.local/src/st/st.h.orig @@ -0,0 +1,131 @@ +/* See LICENSE for license details. */ + +#include +#include + +/* macros */ +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define LEN(a) (sizeof(a) / sizeof(a)[0]) +#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) +#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) +#define DEFAULT(a, b) (a) = (a) ? (a) : (b) +#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) +#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ + (a).bg != (b).bg) +#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ + (t1.tv_nsec-t2.tv_nsec)/1E6) +#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) + +#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) +#define IS_TRUECOL(x) (1 << 24 & (x)) + +enum glyph_attribute { + ATTR_NULL = 0, + ATTR_BOLD = 1 << 0, + ATTR_FAINT = 1 << 1, + ATTR_ITALIC = 1 << 2, + ATTR_UNDERLINE = 1 << 3, + ATTR_BLINK = 1 << 4, + ATTR_REVERSE = 1 << 5, + ATTR_INVISIBLE = 1 << 6, + ATTR_STRUCK = 1 << 7, + ATTR_WRAP = 1 << 8, + ATTR_WIDE = 1 << 9, + ATTR_WDUMMY = 1 << 10, + ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, +}; + +enum selection_mode { + SEL_IDLE = 0, + SEL_EMPTY = 1, + SEL_READY = 2 +}; + +enum selection_type { + SEL_REGULAR = 1, + SEL_RECTANGULAR = 2 +}; + +enum selection_snap { + SNAP_WORD = 1, + SNAP_LINE = 2 +}; + +typedef unsigned char uchar; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned short ushort; + +typedef uint_least32_t Rune; + +#define Glyph Glyph_ +typedef struct { + Rune u; /* character code */ + ushort mode; /* attribute flags */ + uint32_t fg; /* foreground */ + uint32_t bg; /* background */ +} Glyph; + +typedef Glyph *Line; + +typedef union { + int i; + uint ui; + float f; + const void *v; + const char *s; +} Arg; + +void die(const char *, ...); +void redraw(void); +void draw(void); + +void iso14755(const Arg *); +void externalpipe(const Arg *); +void kscrolldown(const Arg *); +void kscrollup(const Arg *); +void printscreen(const Arg *); +void printsel(const Arg *); +void sendbreak(const Arg *); +void toggleprinter(const Arg *); + +int tattrset(int); +void tnew(int, int); +void tresize(int, int); +void tsetdirtattr(int); +void ttyhangup(void); +int ttynew(char *, char *, char *, char **); +size_t ttyread(void); +void ttyresize(int, int); +void ttywrite(const char *, size_t, int); + +void resettitle(void); + +void selclear(void); +void selinit(void); +void selstart(int, int, int); +void selextend(int, int, int, int); +int selected(int, int); +char *getsel(void); + +size_t utf8encode(Rune, char *); + +void *xmalloc(size_t); +void *xrealloc(void *, size_t); +char *xstrdup(char *); + +/* config.h globals */ +extern char *utmp; +extern char *scroll; +extern char *stty_args; +extern char *vtiden; +extern wchar_t *worddelimiters; +extern int allowaltscreen; +extern int allowwindowops; +extern char *termname; +extern unsigned int tabspaces; +extern unsigned int defaultfg; +extern unsigned int defaultbg; +extern float alpha; +extern char *iso14755_cmd; diff --git a/.local/src/st/st.o b/.local/src/st/st.o new file mode 100644 index 0000000000000000000000000000000000000000..cb25c103e0e92169e908489ce391448d791b96c0 GIT binary patch literal 79560 zcmeFa3w%`7_4s=x86YBNqM}m4GD=XQsJyHU56!@!CpJ73RH|4WlK_!GBAJ0$frL(? z9K#?gK1-|h(bAT-)(5^Q5W-7E4fvvpHX`bbBZ#OF9-6z>-fK;E799J#zyJMw?&p4P z&xgsJ^WE#Lz4qGgefAluMigF=;qh2}c&y8;)+?r#mDR76<|~|Uoobz81)ak|=a9X* zJ+c?@Phq?re%bM%_!ac6>TEgNLTA4+s8ff?sdj9g$9CG=vF3Ks-AcT{w`%>t#u2_% z+e2qJHq>>nx0(?uMLj7cB~!yvX||=Q)Jh9d-j4L+X>}% z>AP-odsJuFZjYX8*8wTAFVNw>+J7jigdN+^>&Bac6M{Dde;J(EP~aRbaK5wSk=!ib zn#&Vk|IpH6*A?bw+3~Ae?AYPVxielyGYUZ<$BupPnbX&<16e!p(VW5cP3?ou=AduQ zkZy&}fy8rgZ|H<(J2o#j$BGWMV+|fV@L}}L^bH;V37V{AxTU2f=!~!mov#v&D!$U( ztmH_b|HP=0!{N+!K1>dV?*!gacar+6vLw*FAe^akC2#Y>&D+3{c6hU0vhJ;sQ*!M3 z=JTAx^@qFXHI}SvgrL05cDTi+ysQf~cd_GR_SxZjyS~Y5dm0bqxAR0#seNTZc5I+O zdV(EGxH(|H)Ys$D*rcoGcZB1%^t{9Z{Xm9&l}cYN>Xp@@3rdUHPEq7YgHhyY2FJu|dj{$|L-BktDCis2>?r31_E&WXeC_P_joRiYTN>!rq~|3S z>&rTdZO*;}N>zrk%s1i^4E1bEEClB_Xx;URj98PWwk0~ye$bA0-iQ)*-g@?H+`IG} zUzt+kJK3V7+s>FAZL%|_OGB*16Y(_Q-6|*3N}PA?yiIm|z&}7i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4d8049 100644 --- a/.local/src/st/x.c +++ b/.local/src/st/x.c @@ -257,6 +257,8 @@ static char *opt_line = NULL; static char *opt_name = NULL; static char *opt_title = NULL; +static int focused = 0; + static int oldbutton = 3; /* button event on startup: 3 = release */ static int cursorblinks = 0; @@ -793,35 +795,38 @@ xloadcolor(int i, const char *name, Color *ncolor) return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); } +void +xloadalpha(void) +{ + float const usedAlpha = focused ? alpha : alphaUnfocused; + if (opt_alpha) alpha = strtof(opt_alpha, NULL); + dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * usedAlpha); + dc.col[defaultbg].pixel &= 0x00FFFFFF; + dc.col[defaultbg].pixel |= (unsigned char)(0xff * usedAlpha) << 24; +} + void xloadcols(void) { - int i; static int loaded; Color *cp; - if (loaded) { - for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) - XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); - } else { - dc.collen = MAX(LEN(colorname), 256); - dc.col = xmalloc(dc.collen * sizeof(Color)); + if (!loaded) { + dc.collen = 1 + (defaultbg = MAX(LEN(colorname), 256)); + dc.col = xmalloc((dc.collen) * sizeof(Color)); } - for (i = 0; i < dc.collen; i++) + for (int i = 0; i+1 < dc.collen; ++i) if (!xloadcolor(i, NULL, &dc.col[i])) { if (colorname[i]) die("could not allocate color '%s'\n", colorname[i]); else die("could not allocate color %d\n", i); } + if (dc.collen) // cannot die, as the color is already loaded. + xloadcolor(focused ?bg :bgUnfocused, NULL, &dc.col[defaultbg]); - /* set alpha value of bg color */ - if (opt_alpha) - alpha = strtof(opt_alpha, NULL); - dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); - dc.col[defaultbg].pixel &= 0x00FFFFFF; - dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; + xloadalpha(); loaded = 1; } @@ -1895,12 +1900,22 @@ focus(XEvent *ev) xseturgency(0); if (IS_SET(MODE_FOCUS)) ttywrite("\033[I", 3, 0); + if (!focused) { + focused = 1; + xloadcols(); + tfulldirt(); + } } else { if (xw.ime.xic) XUnsetICFocus(xw.ime.xic); win.mode &= ~MODE_FOCUSED; if (IS_SET(MODE_FOCUS)) ttywrite("\033[O", 3, 0); + if (focused) { + focused = 0; + xloadcols(); + tfulldirt(); + } } } @@ -2211,6 +2226,7 @@ run: XSetLocaleModifiers(""); cols = MAX(cols, 1); rows = MAX(rows, 1); + defaultbg = MAX(LEN(colorname), 256); tnew(cols, rows); xinit(cols, rows); xsetenv(); diff --git a/.local/src/st/x.c.orig b/.local/src/st/x.c.orig new file mode 100644 index 00000000..83c4ab5e --- /dev/null +++ b/.local/src/st/x.c.orig @@ -0,0 +1,2221 @@ +/* See LICENSE for license details. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char *argv0; +#include "arg.h" +#include "st.h" +#include "win.h" + +/* types used in config.h */ +typedef struct { + uint mod; + KeySym keysym; + void (*func)(const Arg *); + const Arg arg; +} Shortcut; + +typedef struct { + uint mod; + uint button; + void (*func)(const Arg *); + const Arg arg; + uint release; +} MouseShortcut; + +typedef struct { + KeySym k; + uint mask; + char *s; + /* three-valued logic variables: 0 indifferent, 1 on, -1 off */ + signed char appkey; /* application keypad */ + signed char appcursor; /* application cursor */ +} Key; + +/* X modifiers */ +#define XK_ANY_MOD UINT_MAX +#define XK_NO_MOD 0 +#define XK_SWITCH_MOD (1<<13) + +/* function definitions used in config.h */ +static void clipcopy(const Arg *); +static void clippaste(const Arg *); +static void changealpha(const Arg *); +static void numlock(const Arg *); +static void selpaste(const Arg *); +static void zoom(const Arg *); +static void zoomabs(const Arg *); +static void zoomreset(const Arg *); +static void ttysend(const Arg *); + +/* config.h for applying patches and the configuration. */ +#include "config.h" + +/* XEMBED messages */ +#define XEMBED_FOCUS_IN 4 +#define XEMBED_FOCUS_OUT 5 + +/* macros */ +#define IS_SET(flag) ((win.mode & (flag)) != 0) +#define TRUERED(x) (((x) & 0xff0000) >> 8) +#define TRUEGREEN(x) (((x) & 0xff00)) +#define TRUEBLUE(x) (((x) & 0xff) << 8) + +typedef XftDraw *Draw; +typedef XftColor Color; +typedef XftGlyphFontSpec GlyphFontSpec; + +/* Purely graphic info */ +typedef struct { + int tw, th; /* tty width and height */ + int w, h; /* window width and height */ + int ch; /* char height */ + int cw; /* char width */ + int mode; /* window state/mode flags */ + int cursor; /* cursor style */ +} TermWindow; + +typedef struct { + Display *dpy; + Colormap cmap; + Window win; + Drawable buf; + GlyphFontSpec *specbuf; /* font spec buffer used for rendering */ + Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid; + struct { + XIM xim; + XIC xic; + XPoint spot; + XVaNestedList spotlist; + } ime; + Draw draw; + Visual *vis; + XSetWindowAttributes attrs; + int scr; + int isfixed; /* is fixed geometry? */ + int depth; /* bit depth */ + int l, t; /* left and top offset */ + int gm; /* geometry mask */ +} XWindow; + +typedef struct { + Atom xtarget; + char *primary, *clipboard; + struct timespec tclick1; + struct timespec tclick2; +} XSelection; + +/* Font structure */ +#define Font Font_ +typedef struct { + int height; + int width; + int ascent; + int descent; + int badslant; + int badweight; + short lbearing; + short rbearing; + XftFont *match; + FcFontSet *set; + FcPattern *pattern; +} Font; + +/* Drawing Context */ +typedef struct { + Color *col; + size_t collen; + Font font, bfont, ifont, ibfont; + GC gc; +} DC; + +static inline ushort sixd_to_16bit(int); +static int xmakeglyphfontspecs(XftGlyphFontSpec *, const Glyph *, int, int, int); +static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int); +static void xdrawglyph(Glyph, int, int); +static void xclear(int, int, int, int); +static int xgeommasktogravity(int); +static int ximopen(Display *); +static void ximinstantiate(Display *, XPointer, XPointer); +static void ximdestroy(XIM, XPointer, XPointer); +static int xicdestroy(XIC, XPointer, XPointer); +static void xinit(int, int); +static void cresize(int, int); +static void xresize(int, int); +static void xhints(void); +static int xloadcolor(int, const char *, Color *); +static int xloadfont(Font *, FcPattern *); +static void xloadfonts(char *, double); +static int xloadsparefont(FcPattern *, int); +static void xloadsparefonts(void); +static void xunloadfont(Font *); +static void xunloadfonts(void); +static void xsetenv(void); +static void xseturgency(int); +static int evcol(XEvent *); +static int evrow(XEvent *); + +static void expose(XEvent *); +static void visibility(XEvent *); +static void unmap(XEvent *); +static void kpress(XEvent *); +static void cmessage(XEvent *); +static void resize(XEvent *); +static void focus(XEvent *); +static uint buttonmask(uint); +static int mouseaction(XEvent *, uint); +static void brelease(XEvent *); +static void bpress(XEvent *); +static void bmotion(XEvent *); +static void propnotify(XEvent *); +static void selnotify(XEvent *); +static void selclear_(XEvent *); +static void selrequest(XEvent *); +static void setsel(char *, Time); +static void mousesel(XEvent *, int); +static void mousereport(XEvent *); +static char *kmap(KeySym, uint); +static int match(uint, uint); + +static void run(void); +static void usage(void); + +static void (*handler[LASTEvent])(XEvent *) = { + [KeyPress] = kpress, + [ClientMessage] = cmessage, + [ConfigureNotify] = resize, + [VisibilityNotify] = visibility, + [UnmapNotify] = unmap, + [Expose] = expose, + [FocusIn] = focus, + [FocusOut] = focus, + [MotionNotify] = bmotion, + [ButtonPress] = bpress, + [ButtonRelease] = brelease, +/* + * Uncomment if you want the selection to disappear when you select something + * different in another window. + */ +/* [SelectionClear] = selclear_, */ + [SelectionNotify] = selnotify, +/* + * PropertyNotify is only turned on when there is some INCR transfer happening + * for the selection retrieval. + */ + [PropertyNotify] = propnotify, + [SelectionRequest] = selrequest, +}; + +/* Globals */ +static DC dc; +static XWindow xw; +static XSelection xsel; +static TermWindow win; + +/* Font Ring Cache */ +enum { + FRC_NORMAL, + FRC_ITALIC, + FRC_BOLD, + FRC_ITALICBOLD +}; + +typedef struct { + XftFont *font; + int flags; + Rune unicodep; +} Fontcache; + +/* Fontcache is an array now. A new font will be appended to the array. */ +static Fontcache *frc = NULL; +static int frclen = 0; +static int frccap = 0; +static char *usedfont = NULL; +static double usedfontsize = 0; +static double defaultfontsize = 0; + +static char *opt_alpha = NULL; +static char *opt_class = NULL; +static char **opt_cmd = NULL; +static char *opt_embed = NULL; +static char *opt_font = NULL; +static char *opt_io = NULL; +static char *opt_line = NULL; +static char *opt_name = NULL; +static char *opt_title = NULL; + +static int oldbutton = 3; /* button event on startup: 3 = release */ +static int cursorblinks = 0; + +void +clipcopy(const Arg *dummy) +{ + Atom clipboard; + + free(xsel.clipboard); + xsel.clipboard = NULL; + + if (xsel.primary != NULL) { + xsel.clipboard = xstrdup(xsel.primary); + clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); + XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime); + } +} + +void +clippaste(const Arg *dummy) +{ + Atom clipboard; + + clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); + XConvertSelection(xw.dpy, clipboard, xsel.xtarget, clipboard, + xw.win, CurrentTime); +} + +void +selpaste(const Arg *dummy) +{ + XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY, + xw.win, CurrentTime); +} + +void +numlock(const Arg *dummy) +{ + win.mode ^= MODE_NUMLOCK; +} + +void +zoom(const Arg *arg) +{ + Arg larg; + + larg.f = usedfontsize + arg->f; + zoomabs(&larg); +} + +void +zoomabs(const Arg *arg) +{ + xunloadfonts(); + xloadfonts(usedfont, arg->f); + xloadsparefonts(); + cresize(0, 0); + redraw(); + xhints(); +} + +void +zoomreset(const Arg *arg) +{ + Arg larg; + + if (defaultfontsize > 0) { + larg.f = defaultfontsize; + zoomabs(&larg); + } +} + +void +ttysend(const Arg *arg) +{ + ttywrite(arg->s, strlen(arg->s), 1); +} + +void +changealpha(const Arg *arg) +{ + if((alpha > 0 && arg->f < 0) || (alpha < 1 && arg->f > 0)) + alpha += arg->f; + if(alpha < 0) + alpha = 0; + if(alpha > 1) + alpha = 1; + + xloadcols(); + redraw(); +} + +int +evcol(XEvent *e) +{ + int x = e->xbutton.x - borderpx; + LIMIT(x, 0, win.tw - 1); + return x / win.cw; +} + +int +evrow(XEvent *e) +{ + int y = e->xbutton.y - borderpx; + LIMIT(y, 0, win.th - 1); + return y / win.ch; +} + +void +mousesel(XEvent *e, int done) +{ + int type, seltype = SEL_REGULAR; + uint state = e->xbutton.state & ~(Button1Mask | forcemousemod); + + for (type = 1; type < LEN(selmasks); ++type) { + if (match(selmasks[type], state)) { + seltype = type; + break; + } + } + selextend(evcol(e), evrow(e), seltype, done); + if (done) + setsel(getsel(), e->xbutton.time); +} + +void +mousereport(XEvent *e) +{ + int len, x = evcol(e), y = evrow(e), + button = e->xbutton.button, state = e->xbutton.state; + char buf[40]; + static int ox, oy; + + /* from urxvt */ + if (e->xbutton.type == MotionNotify) { + if (x == ox && y == oy) + return; + if (!IS_SET(MODE_MOUSEMOTION) && !IS_SET(MODE_MOUSEMANY)) + return; + /* MOUSE_MOTION: no reporting if no button is pressed */ + if (IS_SET(MODE_MOUSEMOTION) && oldbutton == 3) + return; + + button = oldbutton + 32; + ox = x; + oy = y; + } else { + if (!IS_SET(MODE_MOUSESGR) && e->xbutton.type == ButtonRelease) { + button = 3; + } else { + button -= Button1; + if (button >= 3) + button += 64 - 3; + } + if (e->xbutton.type == ButtonPress) { + oldbutton = button; + ox = x; + oy = y; + } else if (e->xbutton.type == ButtonRelease) { + oldbutton = 3; + /* MODE_MOUSEX10: no button release reporting */ + if (IS_SET(MODE_MOUSEX10)) + return; + if (button == 64 || button == 65) + return; + } + } + + if (!IS_SET(MODE_MOUSEX10)) { + button += ((state & ShiftMask ) ? 4 : 0) + + ((state & Mod4Mask ) ? 8 : 0) + + ((state & ControlMask) ? 16 : 0); + } + + if (IS_SET(MODE_MOUSESGR)) { + len = snprintf(buf, sizeof(buf), "\033[<%d;%d;%d%c", + button, x+1, y+1, + e->xbutton.type == ButtonRelease ? 'm' : 'M'); + } else if (x < 223 && y < 223) { + len = snprintf(buf, sizeof(buf), "\033[M%c%c%c", + 32+button, 32+x+1, 32+y+1); + } else { + return; + } + + ttywrite(buf, len, 0); +} + +uint +buttonmask(uint button) +{ + return button == Button1 ? Button1Mask + : button == Button2 ? Button2Mask + : button == Button3 ? Button3Mask + : button == Button4 ? Button4Mask + : button == Button5 ? Button5Mask + : 0; +} + +int +mouseaction(XEvent *e, uint release) +{ + MouseShortcut *ms; + + /* ignore Buttonmask for Button - it's set on release */ + uint state = e->xbutton.state & ~buttonmask(e->xbutton.button); + + for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { + if (ms->release == release && + ms->button == e->xbutton.button && + (match(ms->mod, state) || /* exact or forced */ + match(ms->mod, state & ~forcemousemod))) { + ms->func(&(ms->arg)); + return 1; + } + } + + return 0; +} + +void +bpress(XEvent *e) +{ + struct timespec now; + int snap; + + if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { + mousereport(e); + return; + } + + if (mouseaction(e, 0)) + return; + + if (e->xbutton.button == Button1) { + /* + * If the user clicks below predefined timeouts specific + * snapping behaviour is exposed. + */ + clock_gettime(CLOCK_MONOTONIC, &now); + if (TIMEDIFF(now, xsel.tclick2) <= tripleclicktimeout) { + snap = SNAP_LINE; + } else if (TIMEDIFF(now, xsel.tclick1) <= doubleclicktimeout) { + snap = SNAP_WORD; + } else { + snap = 0; + } + xsel.tclick2 = xsel.tclick1; + xsel.tclick1 = now; + + selstart(evcol(e), evrow(e), snap); + } +} + +void +propnotify(XEvent *e) +{ + XPropertyEvent *xpev; + Atom clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); + + xpev = &e->xproperty; + if (xpev->state == PropertyNewValue && + (xpev->atom == XA_PRIMARY || + xpev->atom == clipboard)) { + selnotify(e); + } +} + +void +selnotify(XEvent *e) +{ + ulong nitems, ofs, rem; + int format; + uchar *data, *last, *repl; + Atom type, incratom, property = None; + + incratom = XInternAtom(xw.dpy, "INCR", 0); + + ofs = 0; + if (e->type == SelectionNotify) + property = e->xselection.property; + else if (e->type == PropertyNotify) + property = e->xproperty.atom; + + if (property == None) + return; + + do { + if (XGetWindowProperty(xw.dpy, xw.win, property, ofs, + BUFSIZ/4, False, AnyPropertyType, + &type, &format, &nitems, &rem, + &data)) { + fprintf(stderr, "Clipboard allocation failed\n"); + return; + } + + if (e->type == PropertyNotify && nitems == 0 && rem == 0) { + /* + * If there is some PropertyNotify with no data, then + * this is the signal of the selection owner that all + * data has been transferred. We won't need to receive + * PropertyNotify events anymore. + */ + MODBIT(xw.attrs.event_mask, 0, PropertyChangeMask); + XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, + &xw.attrs); + } + + if (type == incratom) { + /* + * Activate the PropertyNotify events so we receive + * when the selection owner does send us the next + * chunk of data. + */ + MODBIT(xw.attrs.event_mask, 1, PropertyChangeMask); + XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, + &xw.attrs); + + /* + * Deleting the property is the transfer start signal. + */ + XDeleteProperty(xw.dpy, xw.win, (int)property); + continue; + } + + /* + * As seen in getsel: + * Line endings are inconsistent in the terminal and GUI world + * copy and pasting. When receiving some selection data, + * replace all '\n' with '\r'. + * FIXME: Fix the computer world. + */ + repl = data; + last = data + nitems * format / 8; + while ((repl = memchr(repl, '\n', last - repl))) { + *repl++ = '\r'; + } + + if (IS_SET(MODE_BRCKTPASTE) && ofs == 0) + ttywrite("\033[200~", 6, 0); + ttywrite((char *)data, nitems * format / 8, 1); + if (IS_SET(MODE_BRCKTPASTE) && rem == 0) + ttywrite("\033[201~", 6, 0); + XFree(data); + /* number of 32-bit chunks returned */ + ofs += nitems * format / 32; + } while (rem > 0); + + /* + * Deleting the property again tells the selection owner to send the + * next data chunk in the property. + */ + XDeleteProperty(xw.dpy, xw.win, (int)property); +} + +void +xclipcopy(void) +{ + clipcopy(NULL); +} + +void +selclear_(XEvent *e) +{ + selclear(); +} + +void +selrequest(XEvent *e) +{ + XSelectionRequestEvent *xsre; + XSelectionEvent xev; + Atom xa_targets, string, clipboard; + char *seltext; + + xsre = (XSelectionRequestEvent *) e; + xev.type = SelectionNotify; + xev.requestor = xsre->requestor; + xev.selection = xsre->selection; + xev.target = xsre->target; + xev.time = xsre->time; + if (xsre->property == None) + xsre->property = xsre->target; + + /* reject */ + xev.property = None; + + xa_targets = XInternAtom(xw.dpy, "TARGETS", 0); + if (xsre->target == xa_targets) { + /* respond with the supported type */ + string = xsel.xtarget; + XChangeProperty(xsre->display, xsre->requestor, xsre->property, + XA_ATOM, 32, PropModeReplace, + (uchar *) &string, 1); + xev.property = xsre->property; + } else if (xsre->target == xsel.xtarget || xsre->target == XA_STRING) { + /* + * xith XA_STRING non ascii characters may be incorrect in the + * requestor. It is not our problem, use utf8. + */ + clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); + if (xsre->selection == XA_PRIMARY) { + seltext = xsel.primary; + } else if (xsre->selection == clipboard) { + seltext = xsel.clipboard; + } else { + fprintf(stderr, + "Unhandled clipboard selection 0x%lx\n", + xsre->selection); + return; + } + if (seltext != NULL) { + XChangeProperty(xsre->display, xsre->requestor, + xsre->property, xsre->target, + 8, PropModeReplace, + (uchar *)seltext, strlen(seltext)); + xev.property = xsre->property; + } + } + + /* all done, send a notification to the listener */ + if (!XSendEvent(xsre->display, xsre->requestor, 1, 0, (XEvent *) &xev)) + fprintf(stderr, "Error sending SelectionNotify event\n"); +} + +void +setsel(char *str, Time t) +{ + if (!str) + return; + + free(xsel.primary); + xsel.primary = str; + + XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t); + if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win) + selclear(); +} + +void +xsetsel(char *str) +{ + setsel(str, CurrentTime); +} + +void +brelease(XEvent *e) +{ + if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { + mousereport(e); + return; + } + + if (mouseaction(e, 1)) + return; + if (e->xbutton.button == Button1) + mousesel(e, 1); +} + +void +bmotion(XEvent *e) +{ + if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { + mousereport(e); + return; + } + + mousesel(e, 0); +} + +void +cresize(int width, int height) +{ + int col, row; + + if (width != 0) + win.w = width; + if (height != 0) + win.h = height; + + col = (win.w - 2 * borderpx) / win.cw; + row = (win.h - 2 * borderpx) / win.ch; + col = MAX(1, col); + row = MAX(1, row); + + tresize(col, row); + xresize(col, row); + ttyresize(win.tw, win.th); +} + +void +xresize(int col, int row) +{ + win.tw = col * win.cw; + win.th = row * win.ch; + + XFreePixmap(xw.dpy, xw.buf); + xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, + xw.depth); + XftDrawChange(xw.draw, xw.buf); + xclear(0, 0, win.w, win.h); + + /* resize to new width */ + xw.specbuf = xrealloc(xw.specbuf, col * sizeof(GlyphFontSpec)); +} + +ushort +sixd_to_16bit(int x) +{ + return x == 0 ? 0 : 0x3737 + 0x2828 * x; +} + +int +xloadcolor(int i, const char *name, Color *ncolor) +{ + XRenderColor color = { .alpha = 0xffff }; + + if (!name) { + if (BETWEEN(i, 16, 255)) { /* 256 color */ + if (i < 6*6*6+16) { /* same colors as xterm */ + color.red = sixd_to_16bit( ((i-16)/36)%6 ); + color.green = sixd_to_16bit( ((i-16)/6) %6 ); + color.blue = sixd_to_16bit( ((i-16)/1) %6 ); + } else { /* greyscale */ + color.red = 0x0808 + 0x0a0a * (i - (6*6*6+16)); + color.green = color.blue = color.red; + } + return XftColorAllocValue(xw.dpy, xw.vis, + xw.cmap, &color, ncolor); + } else + name = colorname[i]; + } + + return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); +} + +void +xloadcols(void) +{ + int i; + static int loaded; + Color *cp; + + if (loaded) { + for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) + XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); + } else { + dc.collen = MAX(LEN(colorname), 256); + dc.col = xmalloc(dc.collen * sizeof(Color)); + } + + for (i = 0; i < dc.collen; i++) + if (!xloadcolor(i, NULL, &dc.col[i])) { + if (colorname[i]) + die("could not allocate color '%s'\n", colorname[i]); + else + die("could not allocate color %d\n", i); + } + + /* set alpha value of bg color */ + if (opt_alpha) + alpha = strtof(opt_alpha, NULL); + dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); + dc.col[defaultbg].pixel &= 0x00FFFFFF; + dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; + loaded = 1; +} + +int +xsetcolorname(int x, const char *name) +{ + Color ncolor; + + if (!BETWEEN(x, 0, dc.collen)) + return 1; + + if (!xloadcolor(x, name, &ncolor)) + return 1; + + XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]); + dc.col[x] = ncolor; + + return 0; +} + +/* + * Absolute coordinates. + */ +void +xclear(int x1, int y1, int x2, int y2) +{ + XftDrawRect(xw.draw, + &dc.col[IS_SET(MODE_REVERSE)? defaultfg : defaultbg], + x1, y1, x2-x1, y2-y1); +} + +void +xhints(void) +{ + XClassHint class = {opt_name ? opt_name : termname, + opt_class ? opt_class : termname}; + XWMHints wm = {.flags = InputHint, .input = 1}; + XSizeHints *sizeh; + + sizeh = XAllocSizeHints(); + + sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize; + sizeh->height = win.h; + sizeh->width = win.w; + sizeh->height_inc = win.ch; + sizeh->width_inc = win.cw; + sizeh->base_height = 2 * borderpx; + sizeh->base_width = 2 * borderpx; + sizeh->min_height = win.ch + 2 * borderpx; + sizeh->min_width = win.cw + 2 * borderpx; + if (xw.isfixed) { + sizeh->flags |= PMaxSize; + sizeh->min_width = sizeh->max_width = win.w; + sizeh->min_height = sizeh->max_height = win.h; + } + if (xw.gm & (XValue|YValue)) { + sizeh->flags |= USPosition | PWinGravity; + sizeh->x = xw.l; + sizeh->y = xw.t; + sizeh->win_gravity = xgeommasktogravity(xw.gm); + } + + XSetWMProperties(xw.dpy, xw.win, NULL, NULL, NULL, 0, sizeh, &wm, + &class); + XFree(sizeh); +} + +int +xgeommasktogravity(int mask) +{ + switch (mask & (XNegative|YNegative)) { + case 0: + return NorthWestGravity; + case XNegative: + return NorthEastGravity; + case YNegative: + return SouthWestGravity; + } + + return SouthEastGravity; +} + +int +xloadfont(Font *f, FcPattern *pattern) +{ + FcPattern *configured; + FcPattern *match; + FcResult result; + XGlyphInfo extents; + int wantattr, haveattr; + + /* + * Manually configure instead of calling XftMatchFont + * so that we can use the configured pattern for + * "missing glyph" lookups. + */ + configured = FcPatternDuplicate(pattern); + if (!configured) + return 1; + + FcConfigSubstitute(NULL, configured, FcMatchPattern); + XftDefaultSubstitute(xw.dpy, xw.scr, configured); + + match = FcFontMatch(NULL, configured, &result); + if (!match) { + FcPatternDestroy(configured); + return 1; + } + + if (!(f->match = XftFontOpenPattern(xw.dpy, match))) { + FcPatternDestroy(configured); + FcPatternDestroy(match); + return 1; + } + + if ((XftPatternGetInteger(pattern, "slant", 0, &wantattr) == + XftResultMatch)) { + /* + * Check if xft was unable to find a font with the appropriate + * slant but gave us one anyway. Try to mitigate. + */ + if ((XftPatternGetInteger(f->match->pattern, "slant", 0, + &haveattr) != XftResultMatch) || haveattr < wantattr) { + f->badslant = 1; + fputs("font slant does not match\n", stderr); + } + } + + if ((XftPatternGetInteger(pattern, "weight", 0, &wantattr) == + XftResultMatch)) { + if ((XftPatternGetInteger(f->match->pattern, "weight", 0, + &haveattr) != XftResultMatch) || haveattr != wantattr) { + f->badweight = 1; + fputs("font weight does not match\n", stderr); + } + } + + XftTextExtentsUtf8(xw.dpy, f->match, + (const FcChar8 *) ascii_printable, + strlen(ascii_printable), &extents); + + f->set = NULL; + f->pattern = configured; + + f->ascent = f->match->ascent; + f->descent = f->match->descent; + f->lbearing = 0; + f->rbearing = f->match->max_advance_width; + + f->height = f->ascent + f->descent; + f->width = DIVCEIL(extents.xOff, strlen(ascii_printable)); + + return 0; +} + +void +xloadfonts(char *fontstr, double fontsize) +{ + FcPattern *pattern; + double fontval; + + if (fontstr[0] == '-') + pattern = XftXlfdParse(fontstr, False, False); + else + pattern = FcNameParse((FcChar8 *)fontstr); + + if (!pattern) + die("can't open font %s\n", fontstr); + + if (fontsize > 1) { + FcPatternDel(pattern, FC_PIXEL_SIZE); + FcPatternDel(pattern, FC_SIZE); + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)fontsize); + usedfontsize = fontsize; + } else { + if (FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == + FcResultMatch) { + usedfontsize = fontval; + } else if (FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval) == + FcResultMatch) { + usedfontsize = -1; + } else { + /* + * Default font size is 12, if none given. This is to + * have a known usedfontsize value. + */ + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, 12); + usedfontsize = 12; + } + defaultfontsize = usedfontsize; + } + + if (xloadfont(&dc.font, pattern)) + die("can't open font %s\n", fontstr); + + if (usedfontsize < 0) { + FcPatternGetDouble(dc.font.match->pattern, + FC_PIXEL_SIZE, 0, &fontval); + usedfontsize = fontval; + if (fontsize == 0) + defaultfontsize = fontval; + } + + /* Setting character width and height. */ + win.cw = ceilf(dc.font.width * cwscale); + win.ch = ceilf(dc.font.height * chscale); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); + if (xloadfont(&dc.ifont, pattern)) + die("can't open font %s\n", fontstr); + + FcPatternDel(pattern, FC_WEIGHT); + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); + if (xloadfont(&dc.ibfont, pattern)) + die("can't open font %s\n", fontstr); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); + if (xloadfont(&dc.bfont, pattern)) + die("can't open font %s\n", fontstr); + + FcPatternDestroy(pattern); +} + +int +xloadsparefont(FcPattern *pattern, int flags) +{ + FcPattern *match; + FcResult result; + + match = FcFontMatch(NULL, pattern, &result); + if (!match) { + return 1; + } + + if (!(frc[frclen].font = XftFontOpenPattern(xw.dpy, match))) { + FcPatternDestroy(match); + return 1; + } + + frc[frclen].flags = flags; + /* Believe U+0000 glyph will present in each default font */ + frc[frclen].unicodep = 0; + frclen++; + + return 0; +} + +void +xloadsparefonts(void) +{ + FcPattern *pattern; + double sizeshift, fontval; + int fc; + char **fp; + + if (frclen != 0) + die("can't embed spare fonts. cache isn't empty"); + + /* Calculate count of spare fonts */ + fc = sizeof(font2) / sizeof(*font2); + if (fc == 0) + return; + + /* Allocate memory for cache entries. */ + if (frccap < 4 * fc) { + frccap += 4 * fc - frccap; + frc = xrealloc(frc, frccap * sizeof(Fontcache)); + } + + for (fp = font2; fp - font2 < fc; ++fp) { + + if (**fp == '-') + pattern = XftXlfdParse(*fp, False, False); + else + pattern = FcNameParse((FcChar8 *)*fp); + + if (!pattern) + die("can't open spare font %s\n", *fp); + + if (defaultfontsize > 0) { + sizeshift = usedfontsize - defaultfontsize; + if (sizeshift != 0 && + FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == + FcResultMatch) { + fontval += sizeshift; + FcPatternDel(pattern, FC_PIXEL_SIZE); + FcPatternDel(pattern, FC_SIZE); + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); + } + } + + FcPatternAddBool(pattern, FC_SCALABLE, 1); + + FcConfigSubstitute(NULL, pattern, FcMatchPattern); + XftDefaultSubstitute(xw.dpy, xw.scr, pattern); + + if (xloadsparefont(pattern, FRC_NORMAL)) + die("can't open spare font %s\n", *fp); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); + if (xloadsparefont(pattern, FRC_ITALIC)) + die("can't open spare font %s\n", *fp); + + FcPatternDel(pattern, FC_WEIGHT); + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); + if (xloadsparefont(pattern, FRC_ITALICBOLD)) + die("can't open spare font %s\n", *fp); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); + if (xloadsparefont(pattern, FRC_BOLD)) + die("can't open spare font %s\n", *fp); + + FcPatternDestroy(pattern); + } +} + +void +xunloadfont(Font *f) +{ + XftFontClose(xw.dpy, f->match); + FcPatternDestroy(f->pattern); + if (f->set) + FcFontSetDestroy(f->set); +} + +void +xunloadfonts(void) +{ + /* Free the loaded fonts in the font cache. */ + while (frclen > 0) + XftFontClose(xw.dpy, frc[--frclen].font); + + xunloadfont(&dc.font); + xunloadfont(&dc.bfont); + xunloadfont(&dc.ifont); + xunloadfont(&dc.ibfont); +} + +int +ximopen(Display *dpy) +{ + XIMCallback imdestroy = { .client_data = NULL, .callback = ximdestroy }; + XICCallback icdestroy = { .client_data = NULL, .callback = xicdestroy }; + + xw.ime.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); + if (xw.ime.xim == NULL) + return 0; + + if (XSetIMValues(xw.ime.xim, XNDestroyCallback, &imdestroy, NULL)) + fprintf(stderr, "XSetIMValues: " + "Could not set XNDestroyCallback.\n"); + + xw.ime.spotlist = XVaCreateNestedList(0, XNSpotLocation, &xw.ime.spot, + NULL); + + if (xw.ime.xic == NULL) { + xw.ime.xic = XCreateIC(xw.ime.xim, XNInputStyle, + XIMPreeditNothing | XIMStatusNothing, + XNClientWindow, xw.win, + XNDestroyCallback, &icdestroy, + NULL); + } + if (xw.ime.xic == NULL) + fprintf(stderr, "XCreateIC: Could not create input context.\n"); + + return 1; +} + +void +ximinstantiate(Display *dpy, XPointer client, XPointer call) +{ + if (ximopen(dpy)) + XUnregisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, + ximinstantiate, NULL); +} + +void +ximdestroy(XIM xim, XPointer client, XPointer call) +{ + xw.ime.xim = NULL; + XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, + ximinstantiate, NULL); + XFree(xw.ime.spotlist); +} + +int +xicdestroy(XIC xim, XPointer client, XPointer call) +{ + xw.ime.xic = NULL; + return 1; +} + +void +xinit(int cols, int rows) +{ + XGCValues gcvalues; + Cursor cursor; + Window parent; + pid_t thispid = getpid(); + XColor xmousefg, xmousebg; + XWindowAttributes attr; + XVisualInfo vis; + + if (!(xw.dpy = XOpenDisplay(NULL))) + die("can't open display\n"); + xw.scr = XDefaultScreen(xw.dpy); + + if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { + parent = XRootWindow(xw.dpy, xw.scr); + xw.depth = 32; + } else { + XGetWindowAttributes(xw.dpy, parent, &attr); + xw.depth = attr.depth; + } + + XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis); + xw.vis = vis.visual; + + /* font */ + if (!FcInit()) + die("could not init fontconfig.\n"); + + usedfont = (opt_font == NULL)? font : opt_font; + xloadfonts(usedfont, 0); + + /* spare fonts */ + xloadsparefonts(); + + /* colors */ + xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); + xloadcols(); + + /* adjust fixed window geometry */ + win.w = 2 * borderpx + cols * win.cw; + win.h = 2 * borderpx + rows * win.ch; + if (xw.gm & XNegative) + xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2; + if (xw.gm & YNegative) + xw.t += DisplayHeight(xw.dpy, xw.scr) - win.h - 2; + + /* Events */ + xw.attrs.background_pixel = dc.col[defaultbg].pixel; + xw.attrs.border_pixel = dc.col[defaultbg].pixel; + xw.attrs.bit_gravity = NorthWestGravity; + xw.attrs.event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask + | ExposureMask | VisibilityChangeMask | StructureNotifyMask + | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; + xw.attrs.colormap = xw.cmap; + + xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, + win.w, win.h, 0, xw.depth, InputOutput, + xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity + | CWEventMask | CWColormap, &xw.attrs); + + memset(&gcvalues, 0, sizeof(gcvalues)); + gcvalues.graphics_exposures = False; + xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth); + dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues); + XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); + XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); + + /* font spec buffer */ + xw.specbuf = xmalloc(cols * sizeof(GlyphFontSpec)); + + /* Xft rendering context */ + xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); + + /* input methods */ + if (!ximopen(xw.dpy)) { + XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, + ximinstantiate, NULL); + } + + /* white cursor, black outline */ + cursor = XCreateFontCursor(xw.dpy, mouseshape); + XDefineCursor(xw.dpy, xw.win, cursor); + + if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { + xmousefg.red = 0xffff; + xmousefg.green = 0xffff; + xmousefg.blue = 0xffff; + } + + if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { + xmousebg.red = 0x0000; + xmousebg.green = 0x0000; + xmousebg.blue = 0x0000; + } + + XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); + + xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); + xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); + xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False); + xw.netwmiconname = XInternAtom(xw.dpy, "_NET_WM_ICON_NAME", False); + XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1); + + xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False); + XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32, + PropModeReplace, (uchar *)&thispid, 1); + + win.mode = MODE_NUMLOCK; + resettitle(); + xhints(); + XMapWindow(xw.dpy, xw.win); + XSync(xw.dpy, False); + + clock_gettime(CLOCK_MONOTONIC, &xsel.tclick1); + clock_gettime(CLOCK_MONOTONIC, &xsel.tclick2); + xsel.primary = NULL; + xsel.clipboard = NULL; + xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); + if (xsel.xtarget == None) + xsel.xtarget = XA_STRING; +} + +int +xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x, int y) +{ + float winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, xp, yp; + ushort mode, prevmode = USHRT_MAX; + Font *font = &dc.font; + int frcflags = FRC_NORMAL; + float runewidth = win.cw; + Rune rune; + FT_UInt glyphidx; + FcResult fcres; + FcPattern *fcpattern, *fontpattern; + FcFontSet *fcsets[] = { NULL }; + FcCharSet *fccharset; + int i, f, numspecs = 0; + + for (i = 0, xp = winx, yp = winy + font->ascent; i < len; ++i) { + /* Fetch rune and mode for current glyph. */ + rune = glyphs[i].u; + mode = glyphs[i].mode; + + /* Skip dummy wide-character spacing. */ + if (mode == ATTR_WDUMMY) + continue; + + /* Determine font for glyph if different from previous glyph. */ + if (prevmode != mode) { + prevmode = mode; + font = &dc.font; + frcflags = FRC_NORMAL; + runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f); + if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) { + font = &dc.ibfont; + frcflags = FRC_ITALICBOLD; + } else if (mode & ATTR_ITALIC) { + font = &dc.ifont; + frcflags = FRC_ITALIC; + } else if (mode & ATTR_BOLD) { + font = &dc.bfont; + frcflags = FRC_BOLD; + } + yp = winy + font->ascent; + } + + /* Lookup character index with default font. */ + glyphidx = XftCharIndex(xw.dpy, font->match, rune); + if (glyphidx) { + specs[numspecs].font = font->match; + specs[numspecs].glyph = glyphidx; + specs[numspecs].x = (short)xp; + specs[numspecs].y = (short)yp; + xp += runewidth; + numspecs++; + continue; + } + + /* Fallback on font cache, search the font cache for match. */ + for (f = 0; f < frclen; f++) { + glyphidx = XftCharIndex(xw.dpy, frc[f].font, rune); + /* Everything correct. */ + if (glyphidx && frc[f].flags == frcflags) + break; + /* We got a default font for a not found glyph. */ + if (!glyphidx && frc[f].flags == frcflags + && frc[f].unicodep == rune) { + break; + } + } + + /* Nothing was found. Use fontconfig to find matching font. */ + if (f >= frclen) { + if (!font->set) + font->set = FcFontSort(0, font->pattern, + 1, 0, &fcres); + fcsets[0] = font->set; + + /* + * Nothing was found in the cache. Now use + * some dozen of Fontconfig calls to get the + * font for one single character. + * + * Xft and fontconfig are design failures. + */ + fcpattern = FcPatternDuplicate(font->pattern); + fccharset = FcCharSetCreate(); + + FcCharSetAddChar(fccharset, rune); + FcPatternAddCharSet(fcpattern, FC_CHARSET, + fccharset); + FcPatternAddBool(fcpattern, FC_SCALABLE, 1); + + FcConfigSubstitute(0, fcpattern, + FcMatchPattern); + FcDefaultSubstitute(fcpattern); + + fontpattern = FcFontSetMatch(0, fcsets, 1, + fcpattern, &fcres); + + /* Allocate memory for the new cache entry. */ + if (frclen >= frccap) { + frccap += 16; + frc = xrealloc(frc, frccap * sizeof(Fontcache)); + } + + frc[frclen].font = XftFontOpenPattern(xw.dpy, + fontpattern); + if (!frc[frclen].font) + die("XftFontOpenPattern failed seeking fallback font: %s\n", + strerror(errno)); + frc[frclen].flags = frcflags; + frc[frclen].unicodep = rune; + + glyphidx = XftCharIndex(xw.dpy, frc[frclen].font, rune); + + f = frclen; + frclen++; + + FcPatternDestroy(fcpattern); + FcCharSetDestroy(fccharset); + } + + specs[numspecs].font = frc[f].font; + specs[numspecs].glyph = glyphidx; + specs[numspecs].x = (short)xp; + specs[numspecs].y = (short)yp; + xp += runewidth; + numspecs++; + } + + return numspecs; +} + +void +xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y) +{ + int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1); + int winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, + width = charlen * win.cw; + Color *fg, *bg, *temp, revfg, revbg, truefg, truebg; + XRenderColor colfg, colbg; + XRectangle r; + + /* Fallback on color display for attributes not supported by the font */ + if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) { + if (dc.ibfont.badslant || dc.ibfont.badweight) + base.fg = defaultattr; + } else if ((base.mode & ATTR_ITALIC && dc.ifont.badslant) || + (base.mode & ATTR_BOLD && dc.bfont.badweight)) { + base.fg = defaultattr; + } + + if (IS_TRUECOL(base.fg)) { + colfg.alpha = 0xffff; + colfg.red = TRUERED(base.fg); + colfg.green = TRUEGREEN(base.fg); + colfg.blue = TRUEBLUE(base.fg); + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &truefg); + fg = &truefg; + } else { + fg = &dc.col[base.fg]; + } + + if (IS_TRUECOL(base.bg)) { + colbg.alpha = 0xffff; + colbg.green = TRUEGREEN(base.bg); + colbg.red = TRUERED(base.bg); + colbg.blue = TRUEBLUE(base.bg); + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &truebg); + bg = &truebg; + } else { + bg = &dc.col[base.bg]; + } + + /* Change basic system colors [0-7] to bright system colors [8-15] */ + if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) + fg = &dc.col[base.fg + 8]; + + if (IS_SET(MODE_REVERSE)) { + if (fg == &dc.col[defaultfg]) { + fg = &dc.col[defaultbg]; + } else { + colfg.red = ~fg->color.red; + colfg.green = ~fg->color.green; + colfg.blue = ~fg->color.blue; + colfg.alpha = fg->color.alpha; + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, + &revfg); + fg = &revfg; + } + + if (bg == &dc.col[defaultbg]) { + bg = &dc.col[defaultfg]; + } else { + colbg.red = ~bg->color.red; + colbg.green = ~bg->color.green; + colbg.blue = ~bg->color.blue; + colbg.alpha = bg->color.alpha; + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, + &revbg); + bg = &revbg; + } + } + + if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) { + colfg.red = fg->color.red / 2; + colfg.green = fg->color.green / 2; + colfg.blue = fg->color.blue / 2; + colfg.alpha = fg->color.alpha; + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg); + fg = &revfg; + } + + if (base.mode & ATTR_REVERSE) { + temp = fg; + fg = bg; + bg = temp; + } + + if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK) + fg = bg; + + if (base.mode & ATTR_INVISIBLE) + fg = bg; + + /* Intelligent cleaning up of the borders. */ + if (x == 0) { + xclear(0, (y == 0)? 0 : winy, borderpx, + winy + win.ch + + ((winy + win.ch >= borderpx + win.th)? win.h : 0)); + } + if (winx + width >= borderpx + win.tw) { + xclear(winx + width, (y == 0)? 0 : winy, win.w, + ((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch))); + } + if (y == 0) + xclear(winx, 0, winx + width, borderpx); + if (winy + win.ch >= borderpx + win.th) + xclear(winx, winy + win.ch, winx + width, win.h); + + /* Clean up the region we want to draw to. */ + XftDrawRect(xw.draw, bg, winx, winy, width, win.ch); + + /* Set the clip region because Xft is sometimes dirty. */ + r.x = 0; + r.y = 0; + r.height = win.ch; + r.width = width; + XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); + + /* Render the glyphs. */ + XftDrawGlyphFontSpec(xw.draw, fg, specs, len); + + /* Render underline and strikethrough. */ + if (base.mode & ATTR_UNDERLINE) { + XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1, + width, 1); + } + + if (base.mode & ATTR_STRUCK) { + XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3, + width, 1); + } + + /* Reset clip to none. */ + XftDrawSetClip(xw.draw, 0); +} + +void +xdrawglyph(Glyph g, int x, int y) +{ + int numspecs; + XftGlyphFontSpec spec; + + numspecs = xmakeglyphfontspecs(&spec, &g, 1, x, y); + xdrawglyphfontspecs(&spec, g, numspecs, x, y); +} + +void +xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) +{ + Color drawcol; + + /* remove the old cursor */ + if (selected(ox, oy)) + og.mode ^= ATTR_REVERSE; + xdrawglyph(og, ox, oy); + + if (IS_SET(MODE_HIDE)) + return; + + /* + * Select the right color for the right mode. + */ + g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; + + if (IS_SET(MODE_REVERSE)) { + g.mode |= ATTR_REVERSE; + g.bg = defaultfg; + if (selected(cx, cy)) { + drawcol = dc.col[defaultcs]; + g.fg = defaultrcs; + } else { + drawcol = dc.col[defaultrcs]; + g.fg = defaultcs; + } + } else { + if (selected(cx, cy)) { + g.fg = defaultfg; + g.bg = defaultrcs; + } else { + g.fg = defaultbg; + g.bg = defaultcs; + } + drawcol = dc.col[g.bg]; + } + + /* draw the new one */ + if (IS_SET(MODE_FOCUSED)) { + switch (win.cursor) { + case 0: /* Blinking block */ + case 1: /* Blinking block (default) */ + if (IS_SET(MODE_BLINK)) + break; + /* FALLTHROUGH */ + case 2: /* Steady block */ + xdrawglyph(g, cx, cy); + break; + case 3: /* Blinking underline */ + if (IS_SET(MODE_BLINK)) + break; + /* FALLTHROUGH */ + case 4: /* Steady underline */ + XftDrawRect(xw.draw, &drawcol, + borderpx + cx * win.cw, + borderpx + (cy + 1) * win.ch - \ + cursorthickness, + win.cw, cursorthickness); + break; + case 5: /* Blinking bar */ + if (IS_SET(MODE_BLINK)) + break; + /* FALLTHROUGH */ + case 6: /* Steady bar */ + XftDrawRect(xw.draw, &drawcol, + borderpx + cx * win.cw, + borderpx + cy * win.ch, + cursorthickness, win.ch); + break; + case 7: /* Blinking st cursor */ + if (IS_SET(MODE_BLINK)) + break; + /* FALLTHROUGH */ + case 8: /* Steady st cursor */ + g.u = stcursor; + xdrawglyph(g, cx, cy); + break; + } + } else { + XftDrawRect(xw.draw, &drawcol, + borderpx + cx * win.cw, + borderpx + cy * win.ch, + win.cw - 1, 1); + XftDrawRect(xw.draw, &drawcol, + borderpx + cx * win.cw, + borderpx + cy * win.ch, + 1, win.ch - 1); + XftDrawRect(xw.draw, &drawcol, + borderpx + (cx + 1) * win.cw - 1, + borderpx + cy * win.ch, + 1, win.ch - 1); + XftDrawRect(xw.draw, &drawcol, + borderpx + cx * win.cw, + borderpx + (cy + 1) * win.ch - 1, + win.cw, 1); + } +} + +void +xsetenv(void) +{ + char buf[sizeof(long) * 8 + 1]; + + snprintf(buf, sizeof(buf), "%lu", xw.win); + setenv("WINDOWID", buf, 1); +} + +void +xseticontitle(char *p) +{ + XTextProperty prop; + DEFAULT(p, opt_title); + + Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, + &prop); + XSetWMIconName(xw.dpy, xw.win, &prop); + XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmiconname); + XFree(prop.value); +} + +void +xsettitle(char *p) +{ + XTextProperty prop; + DEFAULT(p, opt_title); + + Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, + &prop); + XSetWMName(xw.dpy, xw.win, &prop); + XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmname); + XFree(prop.value); +} + +int +xstartdraw(void) +{ + return IS_SET(MODE_VISIBLE); +} + +void +xdrawline(Line line, int x1, int y1, int x2) +{ + int i, x, ox, numspecs; + Glyph base, new; + XftGlyphFontSpec *specs = xw.specbuf; + + numspecs = xmakeglyphfontspecs(specs, &line[x1], x2 - x1, x1, y1); + i = ox = 0; + for (x = x1; x < x2 && i < numspecs; x++) { + new = line[x]; + if (new.mode == ATTR_WDUMMY) + continue; + if (selected(x, y1)) + new.mode ^= ATTR_REVERSE; + if (i > 0 && ATTRCMP(base, new)) { + xdrawglyphfontspecs(specs, base, i, ox, y1); + specs += i; + numspecs -= i; + i = 0; + } + if (i == 0) { + ox = x; + base = new; + } + i++; + } + if (i > 0) + xdrawglyphfontspecs(specs, base, i, ox, y1); +} + +void +xfinishdraw(void) +{ + XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, + win.h, 0, 0); + XSetForeground(xw.dpy, dc.gc, + dc.col[IS_SET(MODE_REVERSE)? + defaultfg : defaultbg].pixel); +} + +void +xximspot(int x, int y) +{ + if (xw.ime.xic == NULL) + return; + + xw.ime.spot.x = borderpx + x * win.cw; + xw.ime.spot.y = borderpx + (y + 1) * win.ch; + + XSetICValues(xw.ime.xic, XNPreeditAttributes, xw.ime.spotlist, NULL); +} + +void +expose(XEvent *ev) +{ + redraw(); +} + +void +visibility(XEvent *ev) +{ + XVisibilityEvent *e = &ev->xvisibility; + + MODBIT(win.mode, e->state != VisibilityFullyObscured, MODE_VISIBLE); +} + +void +unmap(XEvent *ev) +{ + win.mode &= ~MODE_VISIBLE; +} + +void +xsetpointermotion(int set) +{ + MODBIT(xw.attrs.event_mask, set, PointerMotionMask); + XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); +} + +void +xsetmode(int set, unsigned int flags) +{ + int mode = win.mode; + MODBIT(win.mode, set, flags); + if ((win.mode & MODE_REVERSE) != (mode & MODE_REVERSE)) + redraw(); +} + +int +xsetcursor(int cursor) +{ + if (!BETWEEN(cursor, 0, 8)) /* 7-8: st extensions */ + return 1; + win.cursor = cursor; + cursorblinks = win.cursor == 0 || win.cursor == 1 || + win.cursor == 3 || win.cursor == 5 || + win.cursor == 7; + return 0; +} + +void +xseturgency(int add) +{ + XWMHints *h = XGetWMHints(xw.dpy, xw.win); + + MODBIT(h->flags, add, XUrgencyHint); + XSetWMHints(xw.dpy, xw.win, h); + XFree(h); +} + +void +xbell(void) +{ + if (!(IS_SET(MODE_FOCUSED))) + xseturgency(1); + if (bellvolume) + XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); +} + +void +focus(XEvent *ev) +{ + XFocusChangeEvent *e = &ev->xfocus; + + if (e->mode == NotifyGrab) + return; + + if (ev->type == FocusIn) { + if (xw.ime.xic) + XSetICFocus(xw.ime.xic); + win.mode |= MODE_FOCUSED; + xseturgency(0); + if (IS_SET(MODE_FOCUS)) + ttywrite("\033[I", 3, 0); + } else { + if (xw.ime.xic) + XUnsetICFocus(xw.ime.xic); + win.mode &= ~MODE_FOCUSED; + if (IS_SET(MODE_FOCUS)) + ttywrite("\033[O", 3, 0); + } +} + +int +match(uint mask, uint state) +{ + return mask == XK_ANY_MOD || mask == (state & ~ignoremod); +} + +char* +kmap(KeySym k, uint state) +{ + Key *kp; + int i; + + /* Check for mapped keys out of X11 function keys. */ + for (i = 0; i < LEN(mappedkeys); i++) { + if (mappedkeys[i] == k) + break; + } + if (i == LEN(mappedkeys)) { + if ((k & 0xFFFF) < 0xFD00) + return NULL; + } + + for (kp = key; kp < key + LEN(key); kp++) { + if (kp->k != k) + continue; + + if (!match(kp->mask, state)) + continue; + + if (IS_SET(MODE_APPKEYPAD) ? kp->appkey < 0 : kp->appkey > 0) + continue; + if (IS_SET(MODE_NUMLOCK) && kp->appkey == 2) + continue; + + if (IS_SET(MODE_APPCURSOR) ? kp->appcursor < 0 : kp->appcursor > 0) + continue; + + return kp->s; + } + + return NULL; +} + +void +kpress(XEvent *ev) +{ + XKeyEvent *e = &ev->xkey; + KeySym ksym; + char buf[64], *customkey; + int len; + Rune c; + Status status; + Shortcut *bp; + + if (IS_SET(MODE_KBDLOCK)) + return; + + if (xw.ime.xic) + len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status); + else + len = XLookupString(e, buf, sizeof buf, &ksym, NULL); + /* 1. shortcuts */ + for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) { + if (ksym == bp->keysym && match(bp->mod, e->state)) { + bp->func(&(bp->arg)); + return; + } + } + + /* 2. custom keys from config.h */ + if ((customkey = kmap(ksym, e->state))) { + ttywrite(customkey, strlen(customkey), 1); + return; + } + + /* 3. composed string from input method */ + if (len == 0) + return; + if (len == 1 && e->state & Mod1Mask) { + if (IS_SET(MODE_8BIT)) { + if (*buf < 0177) { + c = *buf | 0x80; + len = utf8encode(c, buf); + } + } else { + buf[1] = buf[0]; + buf[0] = '\033'; + len = 2; + } + } + ttywrite(buf, len, 1); +} + +void +cmessage(XEvent *e) +{ + /* + * See xembed specs + * http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html + */ + if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) { + if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) { + win.mode |= MODE_FOCUSED; + xseturgency(0); + } else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) { + win.mode &= ~MODE_FOCUSED; + } + } else if (e->xclient.data.l[0] == xw.wmdeletewin) { + ttyhangup(); + exit(0); + } +} + +void +resize(XEvent *e) +{ + if (e->xconfigure.width == win.w && e->xconfigure.height == win.h) + return; + + cresize(e->xconfigure.width, e->xconfigure.height); +} + +void +run(void) +{ + XEvent ev; + int w = win.w, h = win.h; + fd_set rfd; + int xfd = XConnectionNumber(xw.dpy), ttyfd, xev, drawing; + struct timespec seltv, *tv, now, lastblink, trigger; + double timeout; + + /* Waiting for window mapping */ + do { + XNextEvent(xw.dpy, &ev); + /* + * This XFilterEvent call is required because of XOpenIM. It + * does filter out the key event and some client message for + * the input method too. + */ + if (XFilterEvent(&ev, None)) + continue; + if (ev.type == ConfigureNotify) { + w = ev.xconfigure.width; + h = ev.xconfigure.height; + } + } while (ev.type != MapNotify); + + ttyfd = ttynew(opt_line, shell, opt_io, opt_cmd); + cresize(w, h); + + for (timeout = -1, drawing = 0, lastblink = (struct timespec){0};;) { + FD_ZERO(&rfd); + FD_SET(ttyfd, &rfd); + FD_SET(xfd, &rfd); + + if (XPending(xw.dpy)) + timeout = 0; /* existing events might not set xfd */ + + seltv.tv_sec = timeout / 1E3; + seltv.tv_nsec = 1E6 * (timeout - 1E3 * seltv.tv_sec); + tv = timeout >= 0 ? &seltv : NULL; + + if (pselect(MAX(xfd, ttyfd)+1, &rfd, NULL, NULL, tv, NULL) < 0) { + if (errno == EINTR) + continue; + die("select failed: %s\n", strerror(errno)); + } + clock_gettime(CLOCK_MONOTONIC, &now); + + if (FD_ISSET(ttyfd, &rfd)) + ttyread(); + + xev = 0; + while (XPending(xw.dpy)) { + xev = 1; + XNextEvent(xw.dpy, &ev); + if (XFilterEvent(&ev, None)) + continue; + if (handler[ev.type]) + (handler[ev.type])(&ev); + } + + /* + * To reduce flicker and tearing, when new content or event + * triggers drawing, we first wait a bit to ensure we got + * everything, and if nothing new arrives - we draw. + * We start with trying to wait minlatency ms. If more content + * arrives sooner, we retry with shorter and shorter periods, + * and eventually draw even without idle after maxlatency ms. + * Typically this results in low latency while interacting, + * maximum latency intervals during `cat huge.txt`, and perfect + * sync with periodic updates from animations/key-repeats/etc. + */ + if (FD_ISSET(ttyfd, &rfd) || xev) { + if (!drawing) { + trigger = now; + if (IS_SET(MODE_BLINK)) { + win.mode ^= MODE_BLINK; + } + lastblink = now; + drawing = 1; + } + timeout = (maxlatency - TIMEDIFF(now, trigger)) \ + / maxlatency * minlatency; + if (timeout > 0) + continue; /* we have time, try to find idle */ + } + + /* idle detected or maxlatency exhausted -> draw */ + timeout = -1; + if (blinktimeout && (cursorblinks || tattrset(ATTR_BLINK))) { + timeout = blinktimeout - TIMEDIFF(now, lastblink); + if (timeout <= 0) { + if (-timeout > blinktimeout) /* start visible */ + win.mode |= MODE_BLINK; + win.mode ^= MODE_BLINK; + tsetdirtattr(ATTR_BLINK); + lastblink = now; + timeout = blinktimeout; + } + } + + draw(); + XFlush(xw.dpy); + drawing = 0; + } +} + +void +usage(void) +{ + die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" + " [-n name] [-o file]\n" + " [-T title] [-t title] [-w windowid]" + " [[-e] command [args ...]]\n" + " %s [-aiv] [-c class] [-f font] [-g geometry]" + " [-n name] [-o file]\n" + " [-T title] [-t title] [-w windowid] -l line" + " [stty_args ...]\n", argv0, argv0); +} + +int +main(int argc, char *argv[]) +{ + xw.l = xw.t = 0; + xw.isfixed = False; + xsetcursor(cursorstyle); + + ARGBEGIN { + case 'a': + allowaltscreen = 0; + break; + case 'A': + opt_alpha = EARGF(usage()); + break; + case 'c': + opt_class = EARGF(usage()); + break; + case 'e': + if (argc > 0) + --argc, ++argv; + goto run; + case 'f': + opt_font = EARGF(usage()); + break; + case 'g': + xw.gm = XParseGeometry(EARGF(usage()), + &xw.l, &xw.t, &cols, &rows); + break; + case 'i': + xw.isfixed = 1; + break; + case 'o': + opt_io = EARGF(usage()); + break; + case 'l': + opt_line = EARGF(usage()); + break; + case 'n': + opt_name = EARGF(usage()); + break; + case 't': + case 'T': + opt_title = EARGF(usage()); + break; + case 'w': + opt_embed = EARGF(usage()); + break; + case 'v': + die("%s " VERSION "\n", argv0); + break; + default: + usage(); + } ARGEND; + +run: + if (argc > 0) /* eat all remaining arguments */ + opt_cmd = argv; + + if (!opt_title) + opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0]; + + setlocale(LC_CTYPE, ""); + XSetLocaleModifiers(""); + cols = MAX(cols, 1); + rows = MAX(rows, 1); + tnew(cols, rows); + xinit(cols, rows); + xsetenv(); + selinit(); + run(); + + return 0; +} diff --git a/.local/src/st/x.o b/.local/src/st/x.o new file mode 100644 index 0000000000000000000000000000000000000000..c099b2fe5d6695fffbe3619600c18e97f00600b7 GIT binary patch literal 82304 zcmeFa33yf2_4j`=fB`W#3RYD7dDT!s1p@>~6l*TIfrAE!0)m2K$N-U$#N-BoMTI6& zuQ7_PwYIe_wzk^VR;=@!FgvuxS?h#DHEA4hLY&C^U3;&UtnB2F_kEw||9}3^|LK97 zbIxb4z4qE`k7u8A&%Hb^e_CQff+t&o_XDr{OeprJcGDb#bG#$G!@YGAtxTe~xoLV% zeOqGP_nHnR)Ovtr?&B10q-?gvfqxz8~yl=A+ukY-PrLKGL<2O4yv-gE=XbIidvNDSngjXB#D}{KVLA?2Mgm!>p4YGIGtPlzK#sZ+p-L+0yC}RKF!< zGbvhPoR#9ozwzT=^pJ>~T>J5M-$s9oN=Zxf0{*F{%xVunmQog;zuDN>@hNA?niv1n zZ#J1TdAGSRwxGoP_$M>sJB$6Mhzn9y?)b>y&ZS2>wF(PblrdO zH@@93+Ub`)n|*o^5;MO=>)&EEgXNQ^{b;t?`R&9lkmi2 zh~mX}j@}VFu(YgY)Tri-lPAN{cxJj^^b*wAIR6R9_x@ihilry|McZ}iU$=gJ^yr<< z!*UXyHANiXJ9?+2ew9rX1dHrLZf<=`GRpRR%htW9rdk=rJ;}ad=@(4lg~m2$I^#KLwA~lBlRs5()n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