diff --git a/dunst/dunstrc b/dunst/dunstrc
deleted file mode 100644
index 78193d7..0000000
--- a/dunst/dunstrc
+++ /dev/null
@@ -1,77 +0,0 @@
-[global]
- monitor = 0
- follow = none
- width = 300
- height = 300
- origin = top-right
- offset = 10x50
- scale = 0
- notification_limit = 20
- progress_bar = true
- progress_bar_height = 10
- progress_bar_frame_width = 1
- progress_bar_min_width = 150
- progress_bar_max_width = 300
- progress_bar_corner_radius = 0
- progress_bar_corners = all
- icon_corner_radius = 10
- icon_corners = all
- indicate_hidden = yes
- transparency = 0
- separator_height = 2
- padding = 8
- horizontal_padding = 8
- text_icon_padding = 0
- frame_width = 3
- frame_color = "#aaaaaa"
- gap_size = 0
- separator_color = frame
- sort = yes
- font = JetBrainsMono Nerd Font Mono 11
- line_height = 0
- markup = full
- format = "%s\n%b"
- alignment = left
- vertical_alignment = center
- show_age_threshold = 60
- ellipsize = middle
- ignore_newline = no
- stack_duplicates = true
- hide_duplicate_count = false
- show_indicators = yes
- enable_recursive_icon_lookup = true
- icon_theme = "Papirus-Dark"
- icon_position = left
- min_icon_size = 32
- max_icon_size = 128
- icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
- sticky_history = yes
- history_length = 20
- dmenu = /usr/bin/dmenu -p dunst:
- browser = /usr/bin/xdg-open
- always_run_script = true
- title = Dunst
- class = Dunst
- corner_radius = 10
- corners = all
- ignore_dbusclose = false
- force_xwayland = false
- force_xinerama = false
- mouse_left_click = close_current
- mouse_middle_click = do_action, close_current
- mouse_right_click = close_all
-[urgency_low]
- background = "#222222"
- foreground = "#888888"
- timeout = 10
-[urgency_normal]
- background = "#000000"
- foreground = "#ffffff"
- timeout = 10
- override_pause_level = 30
-[urgency_critical]
- background = "#900000"
- foreground = "#ffffff"
- frame_color = "#ff0000"
- timeout = 0
- override_pause_level = 60
diff --git a/dwm/Xresources b/dwm/Xresources
deleted file mode 100644
index 0cccbf4..0000000
--- a/dwm/Xresources
+++ /dev/null
@@ -1,13 +0,0 @@
-cursor.size: 24
-
-xterm*Background: black
-xterm*Foreground: white
-xterm*faceName: JetBrainsMono Nerd Font Mono
-xterm*faceSize: 14
-
-dwm.normbordercolor: #444444
-dwm.normbgcolor: #222222
-dwm.normfgcolor: #bbbbbb
-dwm.selbordercolor: #00ffff
-dwm.selbgcolor: #000000
-dwm.selfgcolor: #eeeeee
diff --git a/dwm/background.sh b/dwm/background.sh
deleted file mode 100755
index 50ac97e..0000000
--- a/dwm/background.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-directory=~/Pictures/wallpaper
-
-while true; do
- if [ -d "$directory" ]; then
- random_background=$(ls $directory/* | shuf -n 1)
-
- feh --bg-fill $random_background
- fi
- sleep 60
-done
-
diff --git a/dwm/bin/dmenu-powermenu b/dwm/bin/dmenu-powermenu
deleted file mode 100755
index de1d9c2..0000000
--- a/dwm/bin/dmenu-powermenu
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-case "$(printf "Shutdown\nRestart\nLogout\nSuspend\nLock" | dmenu \
- -i -z 200 -p \
- "Power:" -l 5)" in
- Shutdown) exec systemctl poweroff;;
- Restart) exec systemctl reboot;;
- Logout) kill -HUP $XDG_SESSION_PID;;
- Suspend) exec systemctl suspend;;
- Lock) exec systemctl --user start lock.target;;
-esac
diff --git a/dwm/bin/picom b/dwm/bin/picom
deleted file mode 100755
index 0045322..0000000
--- a/dwm/bin/picom
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-~/dotfiles/dwm/picom/build/src/picom -b --animations --animation-window-mass 0.5 --animation-for-open-window zoom --animation-stiffnes 500
diff --git a/dwm/bin/startslstatus b/dwm/bin/startslstatus
deleted file mode 100755
index 24e0f00..0000000
--- a/dwm/bin/startslstatus
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-~/dotfiles/dwm/bin/wttrd &
-while true; do
- if [ -f /tmp/wttr ]; then
- slstatus &
- break
- fi
- sleep 1
-done
-
diff --git a/dwm/bin/volume b/dwm/bin/volume
deleted file mode 100755
index b11d8ab..0000000
--- a/dwm/bin/volume
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/bash
-
-iDIR="$HOME/.config/hypr/mako/icons"
-
-# Get Volume
-get_volume() {
- volume=$(pamixer --get-volume)
- echo "$volume"
-}
-
-# Get icons
-get_icon() {
- current=$(get_volume)
- if [[ "$current" -eq "0" ]]; then
- echo "$iDIR/volume-mute.png"
- elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
- echo "$iDIR/volume-low.png"
- elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
- echo "$iDIR/volume-mid.png"
- elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
- echo "$iDIR/volume-high.png"
- fi
-}
-
-# Notify
-notify_user() {
- notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume : $(get_volume) %"
-}
-
-# Increase Volume
-inc_volume() {
- pamixer -i 5 && notify_user
-}
-
-# Decrease Volume
-dec_volume() {
- pamixer -d 5 && notify_user
-}
-
-# Toggle Mute
-toggle_mute() {
- if [ "$(pamixer --get-mute)" == "false" ]; then
- pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
- elif [ "$(pamixer --get-mute)" == "true" ]; then
- pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON"
- fi
-}
-
-# Toggle Mic
-toggle_mic() {
- if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
- pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
- elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
- pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
- fi
-}
-# Get icons
-get_mic_icon() {
- current=$(pamixer --default-source --get-volume)
- if [[ "$current" -eq "0" ]]; then
- echo "$iDIR/microphone.png"
- elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
- echo "$iDIR/microphone.png"
- elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
- echo "$iDIR/microphone.png"
- elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
- echo "$iDIR/microphone.png"
- fi
-}
-# Notify
-notify_mic_user() {
- notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_mic_icon)" "Mic-Level : $(pamixer --default-source --get-volume) %"
-}
-
-# Increase MIC Volume
-inc_mic_volume() {
- pamixer --default-source -i 5 && notify_mic_user
-}
-
-# Decrease MIC Volume
-dec_mic_volume() {
- pamixer --default-source -d 5 && notify_mic_user
-}
-
-# Execute accordingly
-if [[ "$1" == "--get" ]]; then
- get_volume
-elif [[ "$1" == "--inc" ]]; then
- inc_volume
-elif [[ "$1" == "--dec" ]]; then
- dec_volume
-elif [[ "$1" == "--toggle" ]]; then
- toggle_mute
-elif [[ "$1" == "--toggle-mic" ]]; then
- toggle_mic
-elif [[ "$1" == "--get-icon" ]]; then
- get_icon
-elif [[ "$1" == "--get-mic-icon" ]]; then
- get_mic_icon
-elif [[ "$1" == "--mic-inc" ]]; then
- inc_mic_volume
-elif [[ "$1" == "--mic-dec" ]]; then
- dec_mic_volume
-else
- get_volume
-fi
diff --git a/dwm/bin/wttrd b/dwm/bin/wttrd
deleted file mode 100755
index 388b18e..0000000
--- a/dwm/bin/wttrd
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-while true; do
- ~/dotfiles/dwm/slstatus/components/wttr.sh
- sleep 1800
-done
diff --git a/dwm/dunst/dunstrc b/dwm/dunst/dunstrc
deleted file mode 100644
index 81bc713..0000000
--- a/dwm/dunst/dunstrc
+++ /dev/null
@@ -1,144 +0,0 @@
-
-[global]
-
- monitor = 0
-
- follow = none
-
- width = 300
-
- height = 300
-
- origin = top-right
-
- offset = 10x50
-
- scale = 0
-
- notification_limit = 20
-
- progress_bar = true
-
- progress_bar_height = 10
-
- progress_bar_frame_width = 1
-
- progress_bar_min_width = 150
-
- progress_bar_max_width = 300
-
- progress_bar_corner_radius = 0
-
- progress_bar_corners = all
-
- icon_corner_radius = 10
-
- icon_corners = all
-
- indicate_hidden = yes
-
- transparency = 0
-
- separator_height = 2
-
- padding = 8
-
- horizontal_padding = 8
-
- text_icon_padding = 0
-
- frame_width = 3
-
- frame_color = "#aaaaaa"
-
- gap_size = 0
-
- separator_color = frame
-
- sort = yes
-
- font = JetBrainsMono Nerd Font Mono 11
-
- line_height = 0
-
- markup = full
-
- format = "%s\n%b"
-
- alignment = left
-
- vertical_alignment = center
-
- show_age_threshold = 60
-
- ellipsize = middle
-
- ignore_newline = no
-
- stack_duplicates = true
-
- hide_duplicate_count = false
-
- show_indicators = yes
-
- enable_recursive_icon_lookup = true
-
- icon_theme = "Papirus-Dark"
-
- icon_position = left
-
- min_icon_size = 32
-
- max_icon_size = 128
-
- icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
-
- sticky_history = yes
-
- history_length = 20
-
- dmenu = /usr/bin/dmenu -p dunst:
-
- browser = /usr/bin/xdg-open
-
- always_run_script = true
-
- title = Dunst
-
- class = Dunst
-
- corner_radius = 10
-
- corners = all
-
- ignore_dbusclose = false
-
- force_xwayland = false
-
- force_xinerama = false
-
- mouse_left_click = close_current
- mouse_middle_click = do_action, close_current
- mouse_right_click = close_all
-
-[experimental]
- per_monitor_dpi = false
-
-
-[urgency_low]
- background = "#222222"
- foreground = "#888888"
- timeout = 10
-
-[urgency_normal]
- background = "#000000"
- foreground = "#ffffff"
- timeout = 10
- override_pause_level = 30
-
-[urgency_critical]
- background = "#900000"
- foreground = "#ffffff"
- frame_color = "#ff0000"
- timeout = 0
- override_pause_level = 60
diff --git a/dwm/dwm.desktop b/dwm/dwm.desktop
deleted file mode 100644
index 2cadcd8..0000000
--- a/dwm/dwm.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Name=DWM
-Icon=dwm
-Comment=An dynamic window manager for linux xorg
-Exec=/home/tola/dotfiles/dwm/startdwm.sh
-Type=XSession
diff --git a/dwm/dwm/LICENSE b/dwm/dwm/LICENSE
deleted file mode 100644
index 995172f..0000000
--- a/dwm/dwm/LICENSE
+++ /dev/null
@@ -1,38 +0,0 @@
-MIT/X Consortium License
-
-© 2006-2019 Anselm R Garbe
-© 2006-2009 Jukka Salmi
-© 2006-2007 Sander van Dijk
-© 2007-2011 Peter Hartlich
-© 2007-2009 Szabolcs Nagy
-© 2007-2009 Christof Musik
-© 2007-2009 Premysl Hruby
-© 2007-2008 Enno Gottox Boland
-© 2008 Martin Hurton
-© 2008 Neale Pickett
-© 2009 Mate Nagy
-© 2010-2016 Hiltjo Posthuma
-© 2010-2012 Connor Lane Smith
-© 2011 Christoph Lohmann <20h@r-36.net>
-© 2015-2016 Quentin Rameau
-© 2015-2016 Eric Pruitt
-© 2016-2017 Markus Teich
-© 2020-2022 Chris Down
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/dwm/dwm/Makefile b/dwm/dwm/Makefile
deleted file mode 100644
index ffa69b4..0000000
--- a/dwm/dwm/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-# dwm - dynamic window manager
-# See LICENSE file for copyright and license details.
-
-include config.mk
-
-SRC = drw.c dwm.c util.c
-OBJ = ${SRC:.c=.o}
-
-all: dwm
-
-.c.o:
- ${CC} -c ${CFLAGS} $<
-
-${OBJ}: config.h config.mk
-
-config.h:
- cp config.def.h $@
-
-dwm: ${OBJ}
- ${CC} -o $@ ${OBJ} ${LDFLAGS}
-
-clean:
- rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
-
-dist: clean
- mkdir -p dwm-${VERSION}
- cp -R LICENSE Makefile README config.def.h config.mk\
- dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
- tar -cf dwm-${VERSION}.tar dwm-${VERSION}
- gzip dwm-${VERSION}.tar
- rm -rf dwm-${VERSION}
-
-install: all
- mkdir -p ${DESTDIR}${PREFIX}/bin
- cp -f dwm ${DESTDIR}${PREFIX}/bin
- chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
- mkdir -p ${DESTDIR}${MANPREFIX}/man1
- sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
- chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
-
-uninstall:
- rm -f ${DESTDIR}${PREFIX}/bin/dwm\
- ${DESTDIR}${MANPREFIX}/man1/dwm.1
-
-.PHONY: all clean dist install uninstall
diff --git a/dwm/dwm/README b/dwm/dwm/README
deleted file mode 100644
index 95d4fd0..0000000
--- a/dwm/dwm/README
+++ /dev/null
@@ -1,48 +0,0 @@
-dwm - dynamic window manager
-============================
-dwm is an extremely fast, small, and dynamic window manager for X.
-
-
-Requirements
-------------
-In order to build dwm you need the Xlib header files.
-
-
-Installation
-------------
-Edit config.mk to match your local setup (dwm is installed into
-the /usr/local namespace by default).
-
-Afterwards enter the following command to build and install dwm (if
-necessary as root):
-
- make clean install
-
-
-Running dwm
------------
-Add the following line to your .xinitrc to start dwm using startx:
-
- exec dwm
-
-In order to connect dwm to a specific display, make sure that
-the DISPLAY environment variable is set correctly, e.g.:
-
- DISPLAY=foo.bar:1 exec dwm
-
-(This will start dwm on display :1 of the host foo.bar.)
-
-In order to display status info in the bar, you can do something
-like this in your .xinitrc:
-
- while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
- do
- sleep 1
- done &
- exec dwm
-
-
-Configuration
--------------
-The configuration of dwm is done by creating a custom config.h
-and (re)compiling the source code.
diff --git a/dwm/dwm/config.def.h b/dwm/dwm/config.def.h
deleted file mode 100644
index 2175bf4..0000000
--- a/dwm/dwm/config.def.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-/* appearance */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const unsigned int gappx = 5; /* gaps between windows */
-static const int showbar = 1; /* 0 means no bar */
-static const int topbar = 1; /* 0 means bottom bar */
-static const char *fonts[] = { "JetBrains Mono Nerd font:size=12" };
-static const char dmenufont[] = "JetBrains Mono Nerd font:size=12";
-static char normbgcolor[] = "#222222";
-static char normbordercolor[] = "#444444";
-static char normfgcolor[] = "#bbbbbb";
-static char selfgcolor[] = "#eeeeee";
-static char selbordercolor[] = "#00ffff";
-static char selbgcolor[] = "#005577";
-static char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
- [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
-};
-// static const char col_gray1[] = "#222222";
-// static const char col_gray2[] = "#444444";
-// static const char col_gray3[] = "#bbbbbb";
-// static const char col_gray4[] = "#eeeeee";
-// static const char col_cyan[] = "#00ffff";
-// static const char color_black[] = "#000000";
-// static const char *colors[][3] = {
-// /* fg bg border */
-// [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
-// [SchemeSel] = { col_gray4, color_black, col_cyan },
-// };
-
-/* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
-static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
-};
-
-/* layout(s) */
-static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
-static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
-
-static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-};
-
-/* key definitions */
-#define MODKEY Mod1Mask
-#define TAGKEYS(KEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
-/* commands */
-
-//------------------------------------------------- dmenu -------------------------------------------------
-static char dmenumon[2] = "0"; // component of dmenucmd, manipulated in spawn()
-// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
-static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
-//---------------------------------------------------------------------------------------------------------
-
-//-------------------------- applications ---------------------------------------------------------
-static const char *termcmd[] = { "st", NULL };
-static const char *roficmd[] = { "/home/tola/dotfiles/rofi/launcher/launcher.sh", NULL };
-static const char *powermenucmd[] = { "/home/tola/dotfiles/rofi/powermenu/powermenu.sh", NULL };
-static const char *clipboardcmd[] = { "/home/tola/dotfiles/rofi/clipboard/clipboard.sh", NULL };
-static const char *rofimojicmd[] = { "/home/tola/dotfiles/rofi/emoji/rofimoji.sh", NULL };
-static const char *filemanagercmd[] = { "thunar", NULL };
-static const char *telegramcmd[] = { "telegram-desktop", NULL };
-static const char *googlecmd[] = { "google-chrome-stable", NULL };
-static const char *lockercmd[] = { "i3lock", "-c", "000000", NULL };
-//-------------------------------------------------------------------------------------------------
-
-//---------------------------- pamixer ------------------------------
-static const char *pamixericmd[] = { "pamixer", "-i", "10", NULL };
-static const char *pamixerdcmd[] = { "pamixer", "-d", "10", NULL };
-static const char *pamixermutecmd[] = { "pamixer", "-t", NULL };
-//-------------------------------------------------------------------
-
-//----------------------------- brightness --------------------------
-static const char *brightnessupcmd[] = { "brightnessctl", "s", "10%+", NULL };
-static const char *brightnessdowncmd[] = { "brightnessctl", "s", "10%-", NULL };
-//-------------------------------------------------------------------
-
-//------------------------------ keyboard brightness ----------------
-static const char *keyboardbrightnessupcmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%+", NULL };
-static const char *keyboardbrightnessdowncmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%-", NULL };
-//-------------------------------------------------------------------
-
-static const Key keys[] = {
- /* modifier key function argument */
-
- //-------------- pamixer -----------------------------------------------------------
- // XF86AudioRaiseVolume
- { 0, 0x1008ff13, spawn, {.v = pamixericmd } },
- // XF86AudioLowerVolume
- { 0, 0x1008ff11, spawn, {.v = pamixerdcmd } },
- // equal
- { MODKEY, 0x3d, spawn, {.v = pamixericmd } },
- // minus
- { MODKEY, 0x2d, spawn, {.v = pamixerdcmd } },
- // XF86AudioMute
- { 0, 0x1008ff12, spawn, {.v = pamixermutecmd } },
- { MODKEY|ShiftMask, XK_m, spawn, {.v = pamixermutecmd } },
- //----------------------------------------------------------------------------------
-
- //---------------------------------- brightness ------------------------------------
- // XF86MonBrightnessUp
- { 0, 0x1008ff02, spawn, {.v = brightnessupcmd } },
- // XF86MonBrightnessDown
- { 0, 0x1008ff03, spawn, {.v = brightnessdowncmd } },
- //----------------------------------------------------------------------------------
-
- //-------------------------------- keyboard brightness -----------------------------
- // XF86KbdBrightnessUp
- { 0, 0x1008ff05, spawn, {.v = keyboardbrightnessupcmd } },
- // XF86KbdBrightnessDown
- { 0, 0x1008ff06, spawn, {.v = keyboardbrightnessdowncmd } },
- //----------------------------------------------------------------------------------
-
- //--------------------------------- applications -----------------------------------
- { MODKEY|ShiftMask, XK_l, spawn, {.v = lockercmd } },
- { MODKEY, XK_p, spawn, {.v = roficmd } },
- { MODKEY|ShiftMask, XK_p, spawn, {.v = powermenucmd } },
- { MODKEY, XK_c, spawn, {.v = clipboardcmd } },
- { MODKEY, XK_e, spawn, {.v = rofimojicmd} },
- { MODKEY, XK_Return, spawn, {.v = termcmd } },
- { MODKEY, XK_s, spawn, {.v = filemanagercmd } },
- { MODKEY, XK_a, spawn, {.v = telegramcmd } },
- { MODKEY, XK_g, spawn, {.v = googlecmd } },
- //----------------------------------------------------------------------------------
-
- //------------------------------------ gaps ----------------------------
- { MODKEY|ShiftMask, XK_minus, setgaps, {.i = -1 } },
- { MODKEY|ShiftMask, XK_equal, setgaps, {.i = +1 } },
- { MODKEY|ShiftMask, XK_n, setgaps, {.i = 0 } },
- //----------------------------------------------------------------------
-
- { MODKEY, XK_F5, xrdb, {.v = NULL } },
- { MODKEY, XK_b, togglebar, {0} },
- { MODKEY, XK_j, focusstack, {.i = +1 } },
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_i, incnmaster, {.i = +1 } },
- { MODKEY, XK_d, incnmaster, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY, XK_l, setmfact, {.f = +0.05} },
- { MODKEY, XK_w, zoom, {0} },
- { MODKEY, XK_Tab, view, {0} },
- { MODKEY, XK_q, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
- { MODKEY, XK_space, setlayout, {0} },
- { MODKEY, XK_v, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
- { MODKEY, XK_comma, focusmon, {.i = -1 } },
- { MODKEY, XK_period, focusmon, {.i = +1 } },
- { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
- { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
- TAGKEYS( XK_4, 3)
- TAGKEYS( XK_5, 4)
- TAGKEYS( XK_6, 5)
- TAGKEYS( XK_7, 6)
- TAGKEYS( XK_8, 7)
- TAGKEYS( XK_9, 8)
- { MODKEY|ShiftMask, XK_q, quit, {0} },
-};
-
-/* button definitions */
-/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
-static const Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
- { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
-};
-
diff --git a/dwm/dwm/config.h b/dwm/dwm/config.h
deleted file mode 100644
index 6367e12..0000000
--- a/dwm/dwm/config.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-/* appearance */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const unsigned int gappx = 5; /* gaps between windows */
-static const int showbar = 1; /* 0 means no bar */
-static const int topbar = 1; /* 0 means bottom bar */
-static const char *fonts[] = { "JetBrains Mono Nerd font:size=12" };
-static const char dmenufont[] = "JetBrains Mono Nerd font:size=12";
-static char normbgcolor[] = "#222222";
-static char normbordercolor[] = "#444444";
-static char normfgcolor[] = "#bbbbbb";
-static char selfgcolor[] = "#eeeeee";
-static char selbordercolor[] = "#00ffff";
-static char selbgcolor[] = "#005577";
-static char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
- [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
-};
-
-/* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
-static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
-};
-
-/* layout(s) */
-static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
-static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
-
-static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-};
-
-/* key definitions */
-#define MODKEY Mod1Mask
-#define TAGKEYS(KEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
-/* commands */
-
-//------------------------------------------------- dmenu -------------------------------------------------
-static char dmenumon[2] = "0"; // component of dmenucmd, manipulated in spawn()
-// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
-static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
-//---------------------------------------------------------------------------------------------------------
-
-//-------------------------- applications ---------------------------------------------------------
-static const char *termcmd[] = { "st", NULL };
-static const char *roficmd[] = { "/home/tola/dotfiles/rofi/launcher/launcher.sh", NULL };
-static const char *powermenucmd[] = { "/home/tola/dotfiles/rofi/powermenu/powermenu.sh", NULL };
-static const char *clipboardcmd[] = { "/home/tola/dotfiles/rofi/clipboard/clipboard.sh", NULL };
-static const char *rofimojicmd[] = { "/home/tola/dotfiles/rofi/emoji/rofimoji.sh", NULL };
-static const char *filemanagercmd[] = { "thunar", NULL };
-static const char *telegramcmd[] = { "telegram-desktop", NULL };
-static const char *googlecmd[] = { "google-chrome-stable", NULL };
-static const char *lockercmd[] = { "i3lock", "-c", "000000", NULL };
-//-------------------------------------------------------------------------------------------------
-
-//---------------------------- pamixer ------------------------------
-static const char *pamixericmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--inc", NULL };
-static const char *pamixerdcmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--dec", NULL };
-static const char *pamixermutecmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--toggle", NULL };
-//-------------------------------------------------------------------
-
-//----------------------------- brightness --------------------------
-static const char *brightnessupcmd[] = { "brightnessctl", "s", "10%+", NULL };
-static const char *brightnessdowncmd[] = { "brightnessctl", "s", "10%-", NULL };
-//-------------------------------------------------------------------
-
-//------------------------------ keyboard brightness ----------------
-static const char *keyboardbrightnessupcmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%+", NULL };
-static const char *keyboardbrightnessdowncmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%-", NULL };
-//-------------------------------------------------------------------
-
-static const Key keys[] = {
- /* modifier key function argument */
-
- //-------------- pamixer -----------------------------------------------------------
- // XF86AudioRaiseVolume
- { 0, 0x1008ff13, spawn, {.v = pamixericmd } },
- // XF86AudioLowerVolume
- { 0, 0x1008ff11, spawn, {.v = pamixerdcmd } },
- // equal
- { MODKEY, 0x3d, spawn, {.v = pamixericmd } },
- // minus
- { MODKEY, 0x2d, spawn, {.v = pamixerdcmd } },
- // XF86AudioMute
- { 0, 0x1008ff12, spawn, {.v = pamixermutecmd } },
- { MODKEY|ShiftMask, XK_m, spawn, {.v = pamixermutecmd } },
- //----------------------------------------------------------------------------------
-
- //---------------------------------- brightness ------------------------------------
- // XF86MonBrightnessUp
- { 0, 0x1008ff02, spawn, {.v = brightnessupcmd } },
- // XF86MonBrightnessDown
- { 0, 0x1008ff03, spawn, {.v = brightnessdowncmd } },
- //----------------------------------------------------------------------------------
-
- //-------------------------------- keyboard brightness -----------------------------
- // XF86KbdBrightnessUp
- { 0, 0x1008ff05, spawn, {.v = keyboardbrightnessupcmd } },
- // XF86KbdBrightnessDown
- { 0, 0x1008ff06, spawn, {.v = keyboardbrightnessdowncmd } },
- //----------------------------------------------------------------------------------
-
- //--------------------------------- applications -----------------------------------
- { MODKEY|ShiftMask, XK_l, spawn, {.v = lockercmd } },
- { MODKEY, XK_p, spawn, {.v = roficmd } },
- { MODKEY|ShiftMask, XK_p, spawn, {.v = powermenucmd } },
- { MODKEY, XK_c, spawn, {.v = clipboardcmd } },
- { MODKEY, XK_e, spawn, {.v = rofimojicmd} },
- { MODKEY, XK_Return, spawn, {.v = termcmd } },
- { MODKEY, XK_s, spawn, {.v = filemanagercmd } },
- { MODKEY, XK_a, spawn, {.v = telegramcmd } },
- { MODKEY, XK_g, spawn, {.v = googlecmd } },
- //----------------------------------------------------------------------------------
-
- //------------------------------------ gaps ----------------------------
- { MODKEY|ShiftMask, XK_minus, setgaps, {.i = -1 } },
- { MODKEY|ShiftMask, XK_equal, setgaps, {.i = +1 } },
- { MODKEY|ShiftMask, XK_n, setgaps, {.i = 0 } },
- //----------------------------------------------------------------------
-
- { MODKEY, XK_F5, xrdb, {.v = NULL } },
- { MODKEY, XK_b, togglebar, {0} },
- { MODKEY, XK_j, focusstack, {.i = +1 } },
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_i, incnmaster, {.i = +1 } },
- { MODKEY, XK_d, incnmaster, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY, XK_l, setmfact, {.f = +0.05} },
- { MODKEY, XK_w, zoom, {0} },
- { MODKEY, XK_Tab, view, {0} },
- { MODKEY, XK_q, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
- { MODKEY, XK_space, setlayout, {0} },
- { MODKEY, XK_v, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
- { MODKEY, XK_comma, focusmon, {.i = -1 } },
- { MODKEY, XK_period, focusmon, {.i = +1 } },
- { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
- { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
- TAGKEYS( XK_4, 3)
- TAGKEYS( XK_5, 4)
- TAGKEYS( XK_6, 5)
- TAGKEYS( XK_7, 6)
- TAGKEYS( XK_8, 7)
- TAGKEYS( XK_9, 8)
- { MODKEY|ShiftMask, XK_q, quit, {0} },
-};
-
-/* button definitions */
-/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
-static const Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
- { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
-};
-
diff --git a/dwm/dwm/config.mk b/dwm/dwm/config.mk
deleted file mode 100644
index 8efca9a..0000000
--- a/dwm/dwm/config.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# dwm version
-VERSION = 6.5
-
-# Customize below to fit your system
-
-# paths
-PREFIX = /usr/local
-MANPREFIX = ${PREFIX}/share/man
-
-X11INC = /usr/X11R6/include
-X11LIB = /usr/X11R6/lib
-
-# Xinerama, comment if you don't want it
-XINERAMALIBS = -lXinerama
-XINERAMAFLAGS = -DXINERAMA
-
-# freetype
-FREETYPELIBS = -lfontconfig -lXft
-FREETYPEINC = /usr/include/freetype2
-# OpenBSD (uncomment)
-#FREETYPEINC = ${X11INC}/freetype2
-#MANPREFIX = ${PREFIX}/man
-
-# includes and libs
-INCS = -I${X11INC} -I${FREETYPEINC}
-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
-
-# flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
-#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
-CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
-LDFLAGS = ${LIBS}
-
-# Solaris
-#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
-#LDFLAGS = ${LIBS}
-
-# compiler and linker
-CC = cc
diff --git a/dwm/dwm/drw.c b/dwm/dwm/drw.c
deleted file mode 100644
index f8a82f5..0000000
--- a/dwm/dwm/drw.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-#include
-
-#include "drw.h"
-#include "util.h"
-
-#define UTF_INVALID 0xFFFD
-#define UTF_SIZ 4
-
-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};
-
-static long
-utf8decodebyte(const char c, size_t *i)
-{
- for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
- if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
- return (unsigned char)c & ~utfmask[*i];
- return 0;
-}
-
-static size_t
-utf8validate(long *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 size_t
-utf8decode(const char *c, long *u, size_t clen)
-{
- size_t i, j, len, type;
- long 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)
- return j;
- }
- if (j < len)
- return 0;
- *u = udecoded;
- utf8validate(u, len);
-
- return len;
-}
-
-Drw *
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
-{
- Drw *drw = ecalloc(1, sizeof(Drw));
-
- drw->dpy = dpy;
- drw->screen = screen;
- drw->root = root;
- drw->w = w;
- drw->h = h;
- drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
- drw->gc = XCreateGC(dpy, root, 0, NULL);
- XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
-
- return drw;
-}
-
-void
-drw_resize(Drw *drw, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- drw->w = w;
- drw->h = h;
- if (drw->drawable)
- XFreePixmap(drw->dpy, drw->drawable);
- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
-}
-
-void
-drw_free(Drw *drw)
-{
- XFreePixmap(drw->dpy, drw->drawable);
- XFreeGC(drw->dpy, drw->gc);
- drw_fontset_free(drw->fonts);
- free(drw);
-}
-
-/* This function is an implementation detail. Library users should use
- * drw_fontset_create instead.
- */
-static Fnt *
-xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
-{
- Fnt *font;
- XftFont *xfont = NULL;
- FcPattern *pattern = NULL;
-
- if (fontname) {
- /* Using the pattern found at font->xfont->pattern does not yield the
- * same substitution results as using the pattern returned by
- * FcNameParse; using the latter results in the desired fallback
- * behaviour whereas the former just results in missing-character
- * rectangles being drawn, at least with some fonts. */
- if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
- fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
- return NULL;
- }
- if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
- fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
- } else if (fontpattern) {
- if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
- fprintf(stderr, "error, cannot load font from pattern.\n");
- return NULL;
- }
- } else {
- die("no font specified.");
- }
-
- font = ecalloc(1, sizeof(Fnt));
- font->xfont = xfont;
- font->pattern = pattern;
- font->h = xfont->ascent + xfont->descent;
- font->dpy = drw->dpy;
-
- return font;
-}
-
-static void
-xfont_free(Fnt *font)
-{
- if (!font)
- return;
- if (font->pattern)
- FcPatternDestroy(font->pattern);
- XftFontClose(font->dpy, font->xfont);
- free(font);
-}
-
-Fnt*
-drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
-{
- Fnt *cur, *ret = NULL;
- size_t i;
-
- if (!drw || !fonts)
- return NULL;
-
- for (i = 1; i <= fontcount; i++) {
- if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
- cur->next = ret;
- ret = cur;
- }
- }
- return (drw->fonts = ret);
-}
-
-void
-drw_fontset_free(Fnt *font)
-{
- if (font) {
- drw_fontset_free(font->next);
- xfont_free(font);
- }
-}
-
-void
-drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
-{
- if (!drw || !dest || !clrname)
- return;
-
- if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen),
- clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
-}
-
-/* Wrapper to create color schemes. The caller has to call free(3) on the
- * returned color scheme when done using it. */
-Clr *
-drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount)
-{
- size_t i;
- Clr *ret;
-
- /* need at least two colors for a scheme */
- if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
- return NULL;
-
- for (i = 0; i < clrcount; i++)
- drw_clr_create(drw, &ret[i], clrnames[i]);
- return ret;
-}
-
-void
-drw_setfontset(Drw *drw, Fnt *set)
-{
- if (drw)
- drw->fonts = set;
-}
-
-void
-drw_setscheme(Drw *drw, Clr *scm)
-{
- if (drw)
- drw->scheme = scm;
-}
-
-void
-drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
-{
- if (!drw || !drw->scheme)
- return;
- XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
- if (filled)
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- else
- XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
-}
-
-int
-drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
-{
- int i, ty, ellipsis_x = 0;
- unsigned int tmpw, ew, ellipsis_w = 0, ellipsis_len;
- XftDraw *d = NULL;
- Fnt *usedfont, *curfont, *nextfont;
- int utf8strlen, utf8charlen, render = x || y || w || h;
- long utf8codepoint = 0;
- const char *utf8str;
- FcCharSet *fccharset;
- FcPattern *fcpattern;
- FcPattern *match;
- XftResult result;
- int charexists = 0, overflow = 0;
- /* keep track of a couple codepoints for which we have no match. */
- enum { nomatches_len = 64 };
- static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches;
- static unsigned int ellipsis_width = 0;
-
- if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts)
- return 0;
-
- if (!render) {
- w = invert ? invert : ~invert;
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- d = XftDrawCreate(drw->dpy, drw->drawable,
- DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen));
- x += lpad;
- w -= lpad;
- }
-
- usedfont = drw->fonts;
- if (!ellipsis_width && render)
- ellipsis_width = drw_fontset_getwidth(drw, "...");
- while (1) {
- ew = ellipsis_len = utf8strlen = 0;
- utf8str = text;
- nextfont = NULL;
- while (*text) {
- utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
- for (curfont = drw->fonts; curfont; curfont = curfont->next) {
- charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
- if (charexists) {
- drw_font_getexts(curfont, text, utf8charlen, &tmpw, NULL);
- if (ew + ellipsis_width <= w) {
- /* keep track where the ellipsis still fits */
- ellipsis_x = x + ew;
- ellipsis_w = w - ew;
- ellipsis_len = utf8strlen;
- }
-
- if (ew + tmpw > w) {
- overflow = 1;
- /* called from drw_fontset_getwidth_clamp():
- * it wants the width AFTER the overflow
- */
- if (!render)
- x += tmpw;
- else
- utf8strlen = ellipsis_len;
- } else if (curfont == usedfont) {
- utf8strlen += utf8charlen;
- text += utf8charlen;
- ew += tmpw;
- } else {
- nextfont = curfont;
- }
- break;
- }
- }
-
- if (overflow || !charexists || nextfont)
- break;
- else
- charexists = 0;
- }
-
- if (utf8strlen) {
- if (render) {
- ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
- XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
- usedfont->xfont, x, ty, (XftChar8 *)utf8str, utf8strlen);
- }
- x += ew;
- w -= ew;
- }
- if (render && overflow)
- drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert);
-
- if (!*text || overflow) {
- break;
- } else if (nextfont) {
- charexists = 0;
- usedfont = nextfont;
- } else {
- /* Regardless of whether or not a fallback font is found, the
- * character must be drawn. */
- charexists = 1;
-
- for (i = 0; i < nomatches_len; ++i) {
- /* avoid calling XftFontMatch if we know we won't find a match */
- if (utf8codepoint == nomatches.codepoint[i])
- goto no_match;
- }
-
- fccharset = FcCharSetCreate();
- FcCharSetAddChar(fccharset, utf8codepoint);
-
- if (!drw->fonts->pattern) {
- /* Refer to the comment in xfont_create for more information. */
- die("the first font in the cache must be loaded from a font string.");
- }
-
- fcpattern = FcPatternDuplicate(drw->fonts->pattern);
- FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
- FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
-
- FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
- FcDefaultSubstitute(fcpattern);
- match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
-
- FcCharSetDestroy(fccharset);
- FcPatternDestroy(fcpattern);
-
- if (match) {
- usedfont = xfont_create(drw, NULL, match);
- if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
- for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
- ; /* NOP */
- curfont->next = usedfont;
- } else {
- xfont_free(usedfont);
- nomatches.codepoint[++nomatches.idx % nomatches_len] = utf8codepoint;
-no_match:
- usedfont = drw->fonts;
- }
- }
- }
- }
- if (d)
- XftDrawDestroy(d);
-
- return x + (render ? w : 0);
-}
-
-void
-drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
- XSync(drw->dpy, False);
-}
-
-unsigned int
-drw_fontset_getwidth(Drw *drw, const char *text)
-{
- if (!drw || !drw->fonts || !text)
- return 0;
- return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
-}
-
-unsigned int
-drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n)
-{
- unsigned int tmp = 0;
- if (drw && drw->fonts && text && n)
- tmp = drw_text(drw, 0, 0, 0, 0, 0, text, n);
- return MIN(n, tmp);
-}
-
-void
-drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
-{
- XGlyphInfo ext;
-
- if (!font || !text)
- return;
-
- XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
- if (w)
- *w = ext.xOff;
- if (h)
- *h = font->h;
-}
-
-Cur *
-drw_cur_create(Drw *drw, int shape)
-{
- Cur *cur;
-
- if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
- return NULL;
-
- cur->cursor = XCreateFontCursor(drw->dpy, shape);
-
- return cur;
-}
-
-void
-drw_cur_free(Drw *drw, Cur *cursor)
-{
- if (!cursor)
- return;
-
- XFreeCursor(drw->dpy, cursor->cursor);
- free(cursor);
-}
diff --git a/dwm/dwm/drw.h b/dwm/dwm/drw.h
deleted file mode 100644
index bdbf950..0000000
--- a/dwm/dwm/drw.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-typedef struct {
- Cursor cursor;
-} Cur;
-
-typedef struct Fnt {
- Display *dpy;
- unsigned int h;
- XftFont *xfont;
- FcPattern *pattern;
- struct Fnt *next;
-} Fnt;
-
-enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */
-typedef XftColor Clr;
-
-typedef struct {
- unsigned int w, h;
- Display *dpy;
- int screen;
- Window root;
- Drawable drawable;
- GC gc;
- Clr *scheme;
- Fnt *fonts;
-} Drw;
-
-/* Drawable abstraction */
-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
-void drw_resize(Drw *drw, unsigned int w, unsigned int h);
-void drw_free(Drw *drw);
-
-/* Fnt abstraction */
-Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
-void drw_fontset_free(Fnt* set);
-unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
-unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
-void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
-
-/* Colorscheme abstraction */
-void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
-Clr *drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount);
-
-/* Cursor abstraction */
-Cur *drw_cur_create(Drw *drw, int shape);
-void drw_cur_free(Drw *drw, Cur *cursor);
-
-/* Drawing context manipulation */
-void drw_setfontset(Drw *drw, Fnt *set);
-void drw_setscheme(Drw *drw, Clr *scm);
-
-/* 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);
-
-/* Map functions */
-void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
diff --git a/dwm/dwm/dwm.1 b/dwm/dwm/dwm.1
deleted file mode 100644
index ddc8321..0000000
--- a/dwm/dwm/dwm.1
+++ /dev/null
@@ -1,176 +0,0 @@
-.TH DWM 1 dwm\-VERSION
-.SH NAME
-dwm \- dynamic window manager
-.SH SYNOPSIS
-.B dwm
-.RB [ \-v ]
-.SH DESCRIPTION
-dwm is a dynamic window manager for X. It manages windows in tiled, monocle
-and floating layouts. Either layout can be applied dynamically, optimising the
-environment for the application in use and the task performed.
-.P
-In tiled layouts windows are managed in a master and stacking area. The master
-area on the left contains one window by default, and the stacking area on the
-right contains all other windows. The number of master area windows can be
-adjusted from zero to an arbitrary number. In monocle layout all windows are
-maximised to the screen size. In floating layout windows can be resized and
-moved freely. Dialog windows are always managed floating, regardless of the
-layout applied.
-.P
-Windows are grouped by tags. Each window can be tagged with one or multiple
-tags. Selecting certain tags displays all windows with these tags.
-.P
-Each screen contains a small status bar which displays all available tags, the
-layout, the title of the focused window, and the text read from the root window
-name property, if the screen is focused. A floating window is indicated with an
-empty square and a maximised floating window is indicated with a filled square
-before the windows title. The selected tags are indicated with a different
-color. The tags of the focused window are indicated with a filled square in the
-top left corner. The tags which are applied to one or more windows are
-indicated with an empty square in the top left corner.
-.P
-dwm draws a small border around windows to indicate the focus state.
-.SH OPTIONS
-.TP
-.B \-v
-prints version information to stderr, then exits.
-.SH USAGE
-.SS Status bar
-.TP
-.B X root window name
-is read and displayed in the status text area. It can be set with the
-.BR xsetroot (1)
-command.
-.TP
-.B Button1
-click on a tag label to display all windows with that tag, click on the layout
-label toggles between tiled and floating layout.
-.TP
-.B Button3
-click on a tag label adds/removes all windows with that tag to/from the view.
-.TP
-.B Mod1\-Button1
-click on a tag label applies that tag to the focused window.
-.TP
-.B Mod1\-Button3
-click on a tag label adds/removes that tag to/from the focused window.
-.SS Keyboard commands
-.TP
-.B Mod1\-Shift\-Return
-Start
-.BR st(1).
-.TP
-.B Mod1\-p
-Spawn
-.BR dmenu(1)
-for launching other programs.
-.TP
-.B Mod1\-,
-Focus previous screen, if any.
-.TP
-.B Mod1\-.
-Focus next screen, if any.
-.TP
-.B Mod1\-Shift\-,
-Send focused window to previous screen, if any.
-.TP
-.B Mod1\-Shift\-.
-Send focused window to next screen, if any.
-.TP
-.B Mod1\-b
-Toggles bar on and off.
-.TP
-.B Mod1\-t
-Sets tiled layout.
-.TP
-.B Mod1\-f
-Sets floating layout.
-.TP
-.B Mod1\-m
-Sets monocle layout.
-.TP
-.B Mod1\-space
-Toggles between current and previous layout.
-.TP
-.B Mod1\-j
-Focus next window.
-.TP
-.B Mod1\-k
-Focus previous window.
-.TP
-.B Mod1\-i
-Increase number of windows in master area.
-.TP
-.B Mod1\-d
-Decrease number of windows in master area.
-.TP
-.B Mod1\-l
-Increase master area size.
-.TP
-.B Mod1\-h
-Decrease master area size.
-.TP
-.B Mod1\-Return
-Zooms/cycles focused window to/from master area (tiled layouts only).
-.TP
-.B Mod1\-Shift\-c
-Close focused window.
-.TP
-.B Mod1\-Shift\-space
-Toggle focused window between tiled and floating state.
-.TP
-.B Mod1\-Tab
-Toggles to the previously selected tags.
-.TP
-.B Mod1\-Shift\-[1..n]
-Apply nth tag to focused window.
-.TP
-.B Mod1\-Shift\-0
-Apply all tags to focused window.
-.TP
-.B Mod1\-Control\-Shift\-[1..n]
-Add/remove nth tag to/from focused window.
-.TP
-.B Mod1\-[1..n]
-View all windows with nth tag.
-.TP
-.B Mod1\-0
-View all windows with any tag.
-.TP
-.B Mod1\-Control\-[1..n]
-Add/remove all windows with nth tag to/from the view.
-.TP
-.B Mod1\-Shift\-q
-Quit dwm.
-.SS Mouse commands
-.TP
-.B Mod1\-Button1
-Move focused window while dragging. Tiled windows will be toggled to the floating state.
-.TP
-.B Mod1\-Button2
-Toggles focused window between floating and tiled state.
-.TP
-.B Mod1\-Button3
-Resize focused window while dragging. Tiled windows will be toggled to the floating state.
-.SH CUSTOMIZATION
-dwm is customized by creating a custom config.h and (re)compiling the source
-code. This keeps it fast, secure and simple.
-.SH SEE ALSO
-.BR dmenu (1),
-.BR st (1)
-.SH ISSUES
-Java applications which use the XToolkit/XAWT backend may draw grey windows
-only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
-JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds
-are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the
-environment variable
-.BR AWT_TOOLKIT=MToolkit
-(to use the older Motif backend instead) or running
-.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D
-or
-.B wmname LG3D
-(to pretend that a non-reparenting window manager is running that the
-XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
-.BR _JAVA_AWT_WM_NONREPARENTING=1 .
-.SH BUGS
-Send all bug reports with a patch to hackers@suckless.org.
diff --git a/dwm/dwm/dwm.c b/dwm/dwm/dwm.c
deleted file mode 100644
index be8b2cd..0000000
--- a/dwm/dwm/dwm.c
+++ /dev/null
@@ -1,2325 +0,0 @@
-/* See LICENSE file for copyright and license details.
- *
- * dynamic window manager is designed like any other X client as well. It is
- * driven through handling X events. In contrast to other X clients, a window
- * manager selects for SubstructureRedirectMask on the root window, to receive
- * events about window (dis-)appearance. Only one X connection at a time is
- * allowed to select for this event mask.
- *
- * The event handlers of dwm are organized in an array which is accessed
- * whenever a new event has been fetched. This allows event dispatching
- * in O(1) time.
- *
- * Each child of the root window is called a client, except windows which have
- * set the override_redirect flag. Clients are organized in a linked client
- * list on each monitor, the focus history is remembered through a stack list
- * on each monitor. Each client contains a bit array to indicate the tags of a
- * client.
- *
- * Keys and tagging rules are organized as arrays and defined in config.h.
- *
- * To understand everything else, start reading main().
- */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#ifdef XINERAMA
-#include
-#endif /* XINERAMA */
-#include
-
-#include "drw.h"
-#include "util.h"
-
-/* macros */
-#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
-#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
-#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)))
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
-#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 TAGMASK ((1 << LENGTH(tags)) - 1)
-#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
-#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'; \
- } \
- } \
- }
-
-/* enums */
-enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel }; /* color schemes */
-enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
- NetWMFullscreen, NetActiveWindow, NetWMWindowType,
- NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
-enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
-enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
- ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
-
-typedef union {
- int i;
- unsigned int ui;
- float f;
- const void *v;
-} Arg;
-
-typedef struct {
- unsigned int click;
- unsigned int mask;
- unsigned int button;
- void (*func)(const Arg *arg);
- const Arg arg;
-} Button;
-
-typedef struct Monitor Monitor;
-typedef struct Client Client;
-struct Client {
- char name[256];
- float mina, maxa;
- int x, y, w, h;
- int oldx, oldy, oldw, oldh;
- int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid;
- int bw, oldbw;
- unsigned int tags;
- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
- Client *next;
- Client *snext;
- Monitor *mon;
- Window win;
-};
-
-typedef struct {
- unsigned int mod;
- KeySym keysym;
- void (*func)(const Arg *);
- const Arg arg;
-} Key;
-
-typedef struct {
- const char *symbol;
- void (*arrange)(Monitor *);
-} Layout;
-
-typedef struct Pertag Pertag;
-struct Monitor {
- char ltsymbol[16];
- float mfact;
- int nmaster;
- int num;
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
- int wx, wy, ww, wh; /* window area */
- int gappx; /* gaps between windows */
- unsigned int seltags;
- unsigned int sellt;
- unsigned int tagset[2];
- int showbar;
- int topbar;
- Client *clients;
- Client *sel;
- Client *stack;
- Monitor *next;
- Window barwin;
- const Layout *lt[2];
- Pertag *pertag;
-};
-
-typedef struct {
- const char *class;
- const char *instance;
- const char *title;
- unsigned int tags;
- int isfloating;
- int monitor;
-} Rule;
-
-/* function declarations */
-static void applyrules(Client *c);
-static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
-static void arrange(Monitor *m);
-static void arrangemon(Monitor *m);
-static void attach(Client *c);
-static void attachstack(Client *c);
-static void buttonpress(XEvent *e);
-static void checkotherwm(void);
-static void cleanup(void);
-static void cleanupmon(Monitor *mon);
-static void clientmessage(XEvent *e);
-static void configure(Client *c);
-static void configurenotify(XEvent *e);
-static void configurerequest(XEvent *e);
-static Monitor *createmon(void);
-static void destroynotify(XEvent *e);
-static void detach(Client *c);
-static void detachstack(Client *c);
-static Monitor *dirtomon(int dir);
-static void drawbar(Monitor *m);
-static void drawbars(void);
-static void enternotify(XEvent *e);
-static void expose(XEvent *e);
-static void focus(Client *c);
-static void focusin(XEvent *e);
-static void focusmon(const Arg *arg);
-static void focusstack(const Arg *arg);
-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);
-static void grabkeys(void);
-static void incnmaster(const Arg *arg);
-static void keypress(XEvent *e);
-static void killclient(const Arg *arg);
-static void loadxrdb(void);
-static void manage(Window w, XWindowAttributes *wa);
-static void mappingnotify(XEvent *e);
-static void maprequest(XEvent *e);
-static void monocle(Monitor *m);
-static void motionnotify(XEvent *e);
-static void movemouse(const Arg *arg);
-static Client *nexttiled(Client *c);
-static void pop(Client *c);
-static void propertynotify(XEvent *e);
-static void quit(const Arg *arg);
-static Monitor *recttomon(int x, int y, int w, int h);
-static void resize(Client *c, int x, int y, int w, int h, int interact);
-static void resizeclient(Client *c, int x, int y, int w, int h);
-static void resizemouse(const Arg *arg);
-static void restack(Monitor *m);
-static void run(void);
-static void scan(void);
-static int sendevent(Client *c, Atom proto);
-static void sendmon(Client *c, Monitor *m);
-static void setclientstate(Client *c, long state);
-static void setfocus(Client *c);
-static void setfullscreen(Client *c, int fullscreen);
-static void setgaps(const Arg *arg);
-static void setlayout(const Arg *arg);
-static void setmfact(const Arg *arg);
-static void setup(void);
-static void seturgent(Client *c, int urg);
-static void showhide(Client *c);
-static void spawn(const Arg *arg);
-static void tag(const Arg *arg);
-static void tagmon(const Arg *arg);
-static void tile(Monitor *m);
-static void togglebar(const Arg *arg);
-static void togglefloating(const Arg *arg);
-static void toggletag(const Arg *arg);
-static void toggleview(const Arg *arg);
-static void unfocus(Client *c, int setfocus);
-static void unmanage(Client *c, int destroyed);
-static void unmapnotify(XEvent *e);
-static void updatebarpos(Monitor *m);
-static void updatebars(void);
-static void updateclientlist(void);
-static int updategeom(void);
-static void updatenumlockmask(void);
-static void updatesizehints(Client *c);
-static void updatestatus(void);
-static void updatetitle(Client *c);
-static void updatewindowtype(Client *c);
-static void updatewmhints(Client *c);
-static void view(const Arg *arg);
-static Client *wintoclient(Window w);
-static Monitor *wintomon(Window w);
-static int xerror(Display *dpy, XErrorEvent *ee);
-static int xerrordummy(Display *dpy, XErrorEvent *ee);
-static int xerrorstart(Display *dpy, XErrorEvent *ee);
-static void xrdb(const Arg *arg);
-static void zoom(const Arg *arg);
-
-/* variables */
-static const char broken[] = "broken";
-static char stext[256];
-static int screen;
-static int sw, sh; /* X display screen geometry width, height */
-static int bh; /* bar height */
-static int lrpad; /* sum of left and right padding for text */
-static int (*xerrorxlib)(Display *, XErrorEvent *);
-static unsigned int numlockmask = 0;
-static void (*handler[LASTEvent]) (XEvent *) = {
- [ButtonPress] = buttonpress,
- [ClientMessage] = clientmessage,
- [ConfigureRequest] = configurerequest,
- [ConfigureNotify] = configurenotify,
- [DestroyNotify] = destroynotify,
- [EnterNotify] = enternotify,
- [Expose] = expose,
- [FocusIn] = focusin,
- [KeyPress] = keypress,
- [MappingNotify] = mappingnotify,
- [MapRequest] = maprequest,
- [MotionNotify] = motionnotify,
- [PropertyNotify] = propertynotify,
- [UnmapNotify] = unmapnotify
-};
-static Atom wmatom[WMLast], netatom[NetLast];
-static int running = 1;
-static Cur *cursor[CurLast];
-static Clr **scheme;
-static Display *dpy;
-static Drw *drw;
-static Monitor *mons, *selmon;
-static Window root, wmcheckwin;
-
-/* configuration, allows nested code to access above variables */
-#include "config.h"
-
-struct Pertag {
- unsigned int curtag, prevtag; /* current and previous tag */
- int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
- float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
- unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
- const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
- int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
-};
-
-/* compile-time check if all tags fit into an unsigned int bit array. */
-struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
-
-/* function implementations */
-void
-applyrules(Client *c)
-{
- const char *class, *instance;
- unsigned int i;
- const Rule *r;
- Monitor *m;
- XClassHint ch = { NULL, NULL };
-
- /* rule matching */
- 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;
-
- 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;
- c->tags |= r->tags;
- for (m = mons; m && m->num != r->monitor; m = m->next);
- if (m)
- c->mon = m;
- }
- }
- if (ch.res_class)
- XFree(ch.res_class);
- if (ch.res_name)
- XFree(ch.res_name);
- c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
-}
-
-int
-applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact)
-{
- int baseismin;
- Monitor *m = c->mon;
-
- /* set minimum possible */
- *w = MAX(1, *w);
- *h = MAX(1, *h);
- if (interact) {
- if (*x > sw)
- *x = sw - WIDTH(c);
- if (*y > sh)
- *y = sh - HEIGHT(c);
- if (*x + *w + 2 * c->bw < 0)
- *x = 0;
- if (*y + *h + 2 * c->bw < 0)
- *y = 0;
- } else {
- if (*x >= m->wx + m->ww)
- *x = m->wx + m->ww - WIDTH(c);
- if (*y >= m->wy + m->wh)
- *y = m->wy + m->wh - HEIGHT(c);
- if (*x + *w + 2 * c->bw <= m->wx)
- *x = m->wx;
- if (*y + *h + 2 * c->bw <= m->wy)
- *y = m->wy;
- }
- if (*h < bh)
- *h = bh;
- if (*w < bh)
- *w = bh;
- if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) {
- if (!c->hintsvalid)
- updatesizehints(c);
- /* see last two sentences in ICCCM 4.1.2.3 */
- baseismin = c->basew == c->minw && c->baseh == c->minh;
- if (!baseismin) { /* temporarily remove base dimensions */
- *w -= c->basew;
- *h -= c->baseh;
- }
- /* adjust for aspect limits */
- if (c->mina > 0 && c->maxa > 0) {
- if (c->maxa < (float)*w / *h)
- *w = *h * c->maxa + 0.5;
- else if (c->mina < (float)*h / *w)
- *h = *w * c->mina + 0.5;
- }
- if (baseismin) { /* increment calculation requires this */
- *w -= c->basew;
- *h -= c->baseh;
- }
- /* adjust for increment value */
- if (c->incw)
- *w -= *w % c->incw;
- if (c->inch)
- *h -= *h % c->inch;
- /* restore base dimensions */
- *w = MAX(*w + c->basew, c->minw);
- *h = MAX(*h + c->baseh, c->minh);
- if (c->maxw)
- *w = MIN(*w, c->maxw);
- if (c->maxh)
- *h = MIN(*h, c->maxh);
- }
- return *x != c->x || *y != c->y || *w != c->w || *h != c->h;
-}
-
-void
-arrange(Monitor *m)
-{
- if (m)
- showhide(m->stack);
- else for (m = mons; m; m = m->next)
- showhide(m->stack);
- if (m) {
- arrangemon(m);
- restack(m);
- } else for (m = mons; m; m = m->next)
- arrangemon(m);
-}
-
-void
-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);
-}
-
-void
-attach(Client *c)
-{
- c->next = c->mon->clients;
- c->mon->clients = c;
-}
-
-void
-attachstack(Client *c)
-{
- c->snext = c->mon->stack;
- c->mon->stack = c;
-}
-
-void
-buttonpress(XEvent *e)
-{
- unsigned int i, x, click;
- Arg arg = {0};
- Client *c;
- Monitor *m;
- XButtonPressedEvent *ev = &e->xbutton;
-
- click = ClkRootWin;
- /* focus monitor if necessary */
- if ((m = wintomon(ev->window)) && m != selmon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- focus(NULL);
- }
- if (ev->window == selmon->barwin) {
- i = x = 0;
- do
- x += TEXTW(tags[i]);
- while (ev->x >= x && ++i < LENGTH(tags));
- if (i < LENGTH(tags)) {
- click = ClkTagBar;
- arg.ui = 1 << i;
- } else if (ev->x < x + TEXTW(selmon->ltsymbol))
- click = ClkLtSymbol;
- else if (ev->x > selmon->ww - (int)TEXTW(stext))
- click = ClkStatusText;
- else
- click = ClkWinTitle;
- } else if ((c = wintoclient(ev->window))) {
- focus(c);
- restack(selmon);
- XAllowEvents(dpy, ReplayPointer, CurrentTime);
- click = ClkClientWin;
- }
- 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))
- buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
-}
-
-void
-checkotherwm(void)
-{
- xerrorxlib = XSetErrorHandler(xerrorstart);
- /* this causes an error if some other window manager is running */
- XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XSync(dpy, False);
-}
-
-void
-cleanup(void)
-{
- Arg a = {.ui = ~0};
- Layout foo = { "", NULL };
- Monitor *m;
- size_t i;
-
- view(&a);
- selmon->lt[selmon->sellt] = &foo;
- for (m = mons; m; m = m->next)
- while (m->stack)
- unmanage(m->stack, 0);
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- while (mons)
- cleanupmon(mons);
- for (i = 0; i < CurLast; i++)
- drw_cur_free(drw, cursor[i]);
- for (i = 0; i < LENGTH(colors); i++)
- free(scheme[i]);
- free(scheme);
- XDestroyWindow(dpy, wmcheckwin);
- drw_free(drw);
- XSync(dpy, False);
- XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
-}
-
-void
-cleanupmon(Monitor *mon)
-{
- Monitor *m;
-
- if (mon == mons)
- mons = mons->next;
- else {
- for (m = mons; m && m->next != mon; m = m->next);
- m->next = mon->next;
- }
- XUnmapWindow(dpy, mon->barwin);
- XDestroyWindow(dpy, mon->barwin);
- free(mon);
-}
-
-void
-clientmessage(XEvent *e)
-{
- XClientMessageEvent *cme = &e->xclient;
- Client *c = wintoclient(cme->window);
-
- if (!c)
- return;
- if (cme->message_type == netatom[NetWMState]) {
- if (cme->data.l[1] == netatom[NetWMFullscreen]
- || cme->data.l[2] == netatom[NetWMFullscreen])
- setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
- || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
- } else if (cme->message_type == netatom[NetActiveWindow]) {
- if (c != selmon->sel && !c->isurgent)
- seturgent(c, 1);
- }
-}
-
-void
-configure(Client *c)
-{
- XConfigureEvent ce;
-
- ce.type = ConfigureNotify;
- ce.display = dpy;
- ce.event = c->win;
- ce.window = c->win;
- ce.x = c->x;
- ce.y = c->y;
- ce.width = c->w;
- ce.height = c->h;
- ce.border_width = c->bw;
- ce.above = None;
- ce.override_redirect = False;
- XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
-}
-
-void
-configurenotify(XEvent *e)
-{
- Monitor *m;
- Client *c;
- XConfigureEvent *ev = &e->xconfigure;
- int dirty;
-
- /* TODO: updategeom handling sucks, needs to be simplified */
- if (ev->window == root) {
- dirty = (sw != ev->width || sh != ev->height);
- sw = ev->width;
- sh = ev->height;
- if (updategeom() || dirty) {
- drw_resize(drw, sw, bh);
- updatebars();
- for (m = mons; m; m = m->next) {
- for (c = m->clients; c; c = c->next)
- if (c->isfullscreen)
- resizeclient(c, m->mx, m->my, m->mw, m->mh);
- XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
- }
- focus(NULL);
- arrange(NULL);
- }
- }
-}
-
-void
-configurerequest(XEvent *e)
-{
- Client *c;
- Monitor *m;
- XConfigureRequestEvent *ev = &e->xconfigurerequest;
- XWindowChanges wc;
-
- if ((c = wintoclient(ev->window))) {
- if (ev->value_mask & CWBorderWidth)
- c->bw = ev->border_width;
- else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) {
- m = c->mon;
- 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;
- }
- if (ev->value_mask & CWWidth) {
- c->oldw = c->w;
- c->w = ev->width;
- }
- if (ev->value_mask & CWHeight) {
- c->oldh = c->h;
- c->h = ev->height;
- }
- if ((c->x + c->w) > m->mx + m->mw && c->isfloating)
- c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */
- if ((c->y + c->h) > m->my + m->mh && c->isfloating)
- c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */
- if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
- configure(c);
- if (ISVISIBLE(c))
- XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
- } else
- configure(c);
- } else {
- wc.x = ev->x;
- wc.y = ev->y;
- wc.width = ev->width;
- wc.height = ev->height;
- wc.border_width = ev->border_width;
- wc.sibling = ev->above;
- wc.stack_mode = ev->detail;
- XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
- }
- XSync(dpy, False);
-}
-
-Monitor *
-createmon(void)
-{
- Monitor *m;
- unsigned int i;
-
- m = ecalloc(1, sizeof(Monitor));
- m->tagset[0] = m->tagset[1] = 1;
- m->mfact = mfact;
- m->nmaster = nmaster;
- m->showbar = showbar;
- m->topbar = topbar;
- m->gappx = gappx;
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
- m->pertag = ecalloc(1, sizeof(Pertag));
- m->pertag->curtag = m->pertag->prevtag = 1;
-
- for (i = 0; i <= LENGTH(tags); i++) {
- m->pertag->nmasters[i] = m->nmaster;
- m->pertag->mfacts[i] = m->mfact;
-
- m->pertag->ltidxs[i][0] = m->lt[0];
- m->pertag->ltidxs[i][1] = m->lt[1];
- m->pertag->sellts[i] = m->sellt;
-
- m->pertag->showbars[i] = m->showbar;
- }
-
- return m;
-}
-
-void
-destroynotify(XEvent *e)
-{
- Client *c;
- XDestroyWindowEvent *ev = &e->xdestroywindow;
-
- if ((c = wintoclient(ev->window)))
- unmanage(c, 1);
-}
-
-void
-detach(Client *c)
-{
- Client **tc;
-
- for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next);
- *tc = c->next;
-}
-
-void
-detachstack(Client *c)
-{
- Client **tc, *t;
-
- for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext);
- *tc = c->snext;
-
- if (c == c->mon->sel) {
- for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext);
- c->mon->sel = t;
- }
-}
-
-Monitor *
-dirtomon(int dir)
-{
- Monitor *m = NULL;
-
- if (dir > 0) {
- if (!(m = selmon->next))
- m = mons;
- } else if (selmon == mons)
- for (m = mons; m->next; m = m->next);
- else
- for (m = mons; m->next != selmon; m = m->next);
- return m;
-}
-
-void
-drawbar(Monitor *m)
-{
- int x, w, tw = 0;
- int boxs = drw->fonts->h / 9;
- int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0;
- Client *c;
-
- if (!m->showbar)
- return;
-
- /* draw status first so it can be overdrawn by tags later */
- if (m == selmon) { /* status is only drawn on selected monitor */
- drw_setscheme(drw, scheme[SchemeNorm]);
- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
- }
-
- for (c = m->clients; c; c = c->next) {
- occ |= c->tags;
- if (c->isurgent)
- urg |= c->tags;
- }
- x = 0;
- for (i = 0; i < LENGTH(tags); i++) {
- w = TEXTW(tags[i]);
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
- if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
- x += w;
- }
- w = TEXTW(m->ltsymbol);
- drw_setscheme(drw, scheme[SchemeNorm]);
- x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
-
- if ((w = m->ww - tw - x) > bh) {
- if (m->sel) {
- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
- if (m->sel->isfloating)
- drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, x, 0, w, bh, 1, 1);
- }
- }
- drw_map(drw, m->barwin, 0, 0, m->ww, bh);
-}
-
-void
-drawbars(void)
-{
- Monitor *m;
-
- for (m = mons; m; m = m->next)
- drawbar(m);
-}
-
-void
-enternotify(XEvent *e)
-{
- Client *c;
- Monitor *m;
- XCrossingEvent *ev = &e->xcrossing;
-
- if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
- return;
- c = wintoclient(ev->window);
- m = c ? c->mon : wintomon(ev->window);
- if (m != selmon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- } else if (!c || c == selmon->sel)
- return;
- focus(c);
-}
-
-void
-expose(XEvent *e)
-{
- Monitor *m;
- XExposeEvent *ev = &e->xexpose;
-
- if (ev->count == 0 && (m = wintomon(ev->window)))
- drawbar(m);
-}
-
-void
-focus(Client *c)
-{
- if (!c || !ISVISIBLE(c))
- for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
- if (selmon->sel && selmon->sel != c)
- unfocus(selmon->sel, 0);
- if (c) {
- if (c->mon != selmon)
- selmon = c->mon;
- if (c->isurgent)
- seturgent(c, 0);
- detachstack(c);
- attachstack(c);
- grabbuttons(c, 1);
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
- setfocus(c);
- } else {
- XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
- }
- selmon->sel = c;
- drawbars();
-}
-
-/* there are some broken focus acquiring clients needing extra handling */
-void
-focusin(XEvent *e)
-{
- XFocusChangeEvent *ev = &e->xfocus;
-
- if (selmon->sel && ev->window != selmon->sel->win)
- setfocus(selmon->sel);
-}
-
-void
-focusmon(const Arg *arg)
-{
- Monitor *m;
-
- if (!mons->next)
- return;
- if ((m = dirtomon(arg->i)) == selmon)
- return;
- unfocus(selmon->sel, 0);
- selmon = m;
- focus(NULL);
-}
-
-void
-focusstack(const Arg *arg)
-{
- Client *c = NULL, *i;
-
- if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
- return;
- if (arg->i > 0) {
- for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
- if (!c)
- for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
- } else {
- for (i = selmon->clients; i != selmon->sel; i = i->next)
- if (ISVISIBLE(i))
- c = i;
- if (!c)
- for (; i; i = i->next)
- if (ISVISIBLE(i))
- c = i;
- }
- if (c) {
- focus(c);
- restack(selmon);
- }
-}
-
-Atom
-getatomprop(Client *c, Atom prop)
-{
- int di;
- unsigned long dl;
- unsigned char *p = NULL;
- Atom da, atom = None;
-
- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM,
- &da, &di, &dl, &dl, &p) == Success && p) {
- atom = *(Atom *)p;
- XFree(p);
- }
- return atom;
-}
-
-int
-getrootptr(int *x, int *y)
-{
- int di;
- unsigned int dui;
- Window dummy;
-
- return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui);
-}
-
-long
-getstate(Window w)
-{
- int format;
- long result = -1;
- unsigned char *p = NULL;
- unsigned long n, extra;
- Atom real;
-
- if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
- &real, &format, &n, &extra, (unsigned char **)&p) != Success)
- return -1;
- if (n != 0)
- result = *p;
- XFree(p);
- return result;
-}
-
-int
-gettextprop(Window w, Atom atom, char *text, unsigned int size)
-{
- char **list = NULL;
- int n;
- XTextProperty name;
-
- if (!text || size == 0)
- return 0;
- text[0] = '\0';
- if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems)
- return 0;
- if (name.encoding == XA_STRING) {
- strncpy(text, (char *)name.value, size - 1);
- } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) {
- strncpy(text, *list, size - 1);
- XFreeStringList(list);
- }
- text[size - 1] = '\0';
- XFree(name.value);
- return 1;
-}
-
-void
-grabbuttons(Client *c, int focused)
-{
- updatenumlockmask();
- {
- unsigned int i, j;
- unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
- XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- if (!focused)
- XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
- BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
- for (i = 0; i < LENGTH(buttons); i++)
- if (buttons[i].click == ClkClientWin)
- for (j = 0; j < LENGTH(modifiers); j++)
- XGrabButton(dpy, buttons[i].button,
- buttons[i].mask | modifiers[j],
- c->win, False, BUTTONMASK,
- GrabModeAsync, GrabModeSync, None, None);
- }
-}
-
-void
-grabkeys(void)
-{
- updatenumlockmask();
- {
- unsigned int i, j, k;
- unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
- int start, end, skip;
- KeySym *syms;
-
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- XDisplayKeycodes(dpy, &start, &end);
- syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip);
- if (!syms)
- return;
- for (k = start; k <= end; k++)
- for (i = 0; i < LENGTH(keys); i++)
- /* skip modifier codes, we do that ourselves */
- if (keys[i].keysym == syms[(k - start) * skip])
- for (j = 0; j < LENGTH(modifiers); j++)
- XGrabKey(dpy, k,
- keys[i].mod | modifiers[j],
- root, True,
- GrabModeAsync, GrabModeAsync);
- XFree(syms);
- }
-}
-
-void
-incnmaster(const Arg *arg)
-{
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
-}
-
-#ifdef XINERAMA
-static int
-isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
-{
- while (n--)
- if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org
- && unique[n].width == info->width && unique[n].height == info->height)
- return 0;
- return 1;
-}
-#endif /* XINERAMA */
-
-void
-keypress(XEvent *e)
-{
- unsigned int i;
- KeySym keysym;
- XKeyEvent *ev;
-
- ev = &e->xkey;
- keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
- for (i = 0; i < LENGTH(keys); i++)
- if (keysym == keys[i].keysym
- && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
- && keys[i].func)
- keys[i].func(&(keys[i].arg));
-}
-
-void
-killclient(const Arg *arg)
-{
- if (!selmon->sel)
- return;
- if (!sendevent(selmon->sel, wmatom[WMDelete])) {
- XGrabServer(dpy);
- XSetErrorHandler(xerrordummy);
- XSetCloseDownMode(dpy, DestroyAll);
- XKillClient(dpy, selmon->sel->win);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XUngrabServer(dpy);
- }
-}
-
-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.normbordercolor", normbordercolor);
- XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
- XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor);
- XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
- XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
- XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
- }
- }
- }
-
- XCloseDisplay(display);
-}
-
-void
-manage(Window w, XWindowAttributes *wa)
-{
- Client *c, *t = NULL;
- Window trans = None;
- XWindowChanges wc;
-
- c = ecalloc(1, sizeof(Client));
- c->win = w;
- /* 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;
-
- updatetitle(c);
- if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
- c->mon = t->mon;
- c->tags = t->tags;
- } else {
- c->mon = selmon;
- applyrules(c);
- }
-
- if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww)
- c->x = c->mon->wx + c->mon->ww - WIDTH(c);
- if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh)
- c->y = c->mon->wy + c->mon->wh - HEIGHT(c);
- c->x = MAX(c->x, c->mon->wx);
- c->y = MAX(c->y, c->mon->wy);
- c->bw = borderpx;
-
- wc.border_width = c->bw;
- XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
- configure(c); /* propagates border_width, if size doesn't change */
- updatewindowtype(c);
- updatesizehints(c);
- updatewmhints(c);
- c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
- c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
- XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
- grabbuttons(c, 0);
- if (!c->isfloating)
- c->isfloating = c->oldstate = trans != None || c->isfixed;
- if (c->isfloating)
- XRaiseWindow(dpy, c->win);
- attach(c);
- attachstack(c);
- XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
- (unsigned char *) &(c->win), 1);
- XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
- setclientstate(c, NormalState);
- if (c->mon == selmon)
- unfocus(selmon->sel, 0);
- c->mon->sel = c;
- arrange(c->mon);
- XMapWindow(dpy, c->win);
- focus(NULL);
-}
-
-void
-mappingnotify(XEvent *e)
-{
- XMappingEvent *ev = &e->xmapping;
-
- XRefreshKeyboardMapping(ev);
- if (ev->request == MappingKeyboard)
- grabkeys();
-}
-
-void
-maprequest(XEvent *e)
-{
- static XWindowAttributes wa;
- XMapRequestEvent *ev = &e->xmaprequest;
-
- if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect)
- return;
- if (!wintoclient(ev->window))
- manage(ev->window, &wa);
-}
-
-void
-monocle(Monitor *m)
-{
- unsigned int n = 0;
- Client *c;
-
- 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);
- 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);
-}
-
-void
-motionnotify(XEvent *e)
-{
- static Monitor *mon = NULL;
- Monitor *m;
- XMotionEvent *ev = &e->xmotion;
-
- if (ev->window != root)
- return;
- if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- focus(NULL);
- }
- mon = m;
-}
-
-void
-movemouse(const Arg *arg)
-{
- int x, y, ocx, ocy, nx, ny;
- Client *c;
- Monitor *m;
- XEvent ev;
- Time lasttime = 0;
-
- if (!(c = selmon->sel))
- return;
- if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
- return;
- restack(selmon);
- ocx = c->x;
- ocy = c->y;
- if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
- None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess)
- return;
- 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 (abs(selmon->wx - nx) < snap)
- nx = selmon->wx;
- else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap)
- nx = selmon->wx + selmon->ww - WIDTH(c);
- if (abs(selmon->wy - ny) < snap)
- ny = selmon->wy;
- else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap)
- 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))
- togglefloating(NULL);
- if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, nx, ny, c->w, c->h, 1);
- break;
- }
- } while (ev.type != ButtonRelease);
- XUngrabPointer(dpy, CurrentTime);
- if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
- sendmon(c, m);
- selmon = m;
- focus(NULL);
- }
-}
-
-Client *
-nexttiled(Client *c)
-{
- for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
- return c;
-}
-
-void
-pop(Client *c)
-{
- detach(c);
- attach(c);
- focus(c);
- arrange(c->mon);
-}
-
-void
-propertynotify(XEvent *e)
-{
- Client *c;
- Window trans;
- XPropertyEvent *ev = &e->xproperty;
-
- if ((ev->window == root) && (ev->atom == XA_WM_NAME))
- updatestatus();
- else if (ev->state == PropertyDelete)
- return; /* ignore */
- else if ((c = wintoclient(ev->window))) {
- switch(ev->atom) {
- default: break;
- case XA_WM_TRANSIENT_FOR:
- if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) &&
- (c->isfloating = (wintoclient(trans)) != NULL))
- arrange(c->mon);
- break;
- case XA_WM_NORMAL_HINTS:
- c->hintsvalid = 0;
- break;
- case XA_WM_HINTS:
- updatewmhints(c);
- drawbars();
- break;
- }
- if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
- updatetitle(c);
- if (c == c->mon->sel)
- drawbar(c->mon);
- }
- if (ev->atom == netatom[NetWMWindowType])
- updatewindowtype(c);
- }
-}
-
-void
-quit(const Arg *arg)
-{
- running = 0;
-}
-
-Monitor *
-recttomon(int x, int y, int w, int h)
-{
- Monitor *m, *r = selmon;
- int a, area = 0;
-
- for (m = mons; m; m = m->next)
- if ((a = INTERSECT(x, y, w, h, m)) > area) {
- area = a;
- r = m;
- }
- return r;
-}
-
-void
-resize(Client *c, int x, int y, int w, int h, int interact)
-{
- if (applysizehints(c, &x, &y, &w, &h, interact))
- resizeclient(c, x, y, w, h);
-}
-
-void
-resizeclient(Client *c, int x, int y, int w, int h)
-{
- XWindowChanges wc;
-
- c->oldx = c->x; c->x = wc.x = x;
- 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;
- wc.border_width = c->bw;
- if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
- || &monocle == c->mon->lt[c->mon->sellt]->arrange)
- && !c->isfullscreen && !c->isfloating) {
- c->w = wc.width += c->bw * 2;
- c->h = wc.height += c->bw * 2;
- wc.border_width = 0;
- }
- XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
- configure(c);
- XSync(dpy, False);
-}
-
-void
-resizemouse(const Arg *arg)
-{
- int ocx, ocy, nw, nh;
- Client *c;
- Monitor *m;
- XEvent ev;
- Time lasttime = 0;
-
- if (!(c = selmon->sel))
- return;
- if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
- return;
- restack(selmon);
- ocx = c->x;
- ocy = c->y;
- 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);
- 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;
-
- nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
- nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
- 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))
- togglefloating(NULL);
- }
- if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, c->x, c->y, nw, nh, 1);
- break;
- }
- } while (ev.type != ButtonRelease);
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
- XUngrabPointer(dpy, CurrentTime);
- while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
- if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
- sendmon(c, m);
- selmon = m;
- focus(NULL);
- }
-}
-
-void
-restack(Monitor *m)
-{
- Client *c;
- XEvent ev;
- XWindowChanges wc;
-
- drawbar(m);
- if (!m->sel)
- return;
- if (m->sel->isfloating || !m->lt[m->sellt]->arrange)
- XRaiseWindow(dpy, m->sel->win);
- if (m->lt[m->sellt]->arrange) {
- wc.stack_mode = Below;
- wc.sibling = m->barwin;
- for (c = m->stack; c; c = c->snext)
- if (!c->isfloating && ISVISIBLE(c)) {
- XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
- wc.sibling = c->win;
- }
- }
- XSync(dpy, False);
- while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
-}
-
-void
-run(void)
-{
- XEvent ev;
- /* main event loop */
- XSync(dpy, False);
- while (running && !XNextEvent(dpy, &ev))
- if (handler[ev.type])
- handler[ev.type](&ev); /* call handler */
-}
-
-void
-scan(void)
-{
- unsigned int i, num;
- Window d1, d2, *wins = NULL;
- XWindowAttributes wa;
-
- if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
- for (i = 0; i < num; i++) {
- if (!XGetWindowAttributes(dpy, wins[i], &wa)
- || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1))
- continue;
- if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)
- manage(wins[i], &wa);
- }
- for (i = 0; i < num; i++) { /* now the transients */
- if (!XGetWindowAttributes(dpy, wins[i], &wa))
- continue;
- if (XGetTransientForHint(dpy, wins[i], &d1)
- && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
- manage(wins[i], &wa);
- }
- if (wins)
- XFree(wins);
- }
-}
-
-void
-sendmon(Client *c, Monitor *m)
-{
- if (c->mon == m)
- return;
- unfocus(c, 1);
- detach(c);
- detachstack(c);
- c->mon = m;
- c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
- attachstack(c);
- focus(NULL);
- arrange(NULL);
-}
-
-void
-setclientstate(Client *c, long state)
-{
- long data[] = { state, None };
-
- XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32,
- PropModeReplace, (unsigned char *)data, 2);
-}
-
-int
-sendevent(Client *c, Atom proto)
-{
- int n;
- Atom *protocols;
- int exists = 0;
- XEvent ev;
-
- if (XGetWMProtocols(dpy, c->win, &protocols, &n)) {
- while (!exists && n--)
- exists = protocols[n] == proto;
- XFree(protocols);
- }
- if (exists) {
- 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);
- }
- return exists;
-}
-
-void
-setfocus(Client *c)
-{
- if (!c->neverfocus) {
- XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
- XChangeProperty(dpy, root, netatom[NetActiveWindow],
- XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &(c->win), 1);
- }
- sendevent(c, wmatom[WMTakeFocus]);
-}
-
-void
-setfullscreen(Client *c, int fullscreen)
-{
- if (fullscreen && !c->isfullscreen) {
- XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
- PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
- c->isfullscreen = 1;
- c->oldstate = c->isfloating;
- c->oldbw = c->bw;
- 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 (!fullscreen && c->isfullscreen){
- XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
- PropModeReplace, (unsigned char*)0, 0);
- c->isfullscreen = 0;
- c->isfloating = c->oldstate;
- c->bw = c->oldbw;
- 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);
- arrange(c->mon);
- }
-}
-
-void
-setgaps(const Arg *arg)
-{
- if ((arg->i == 0) || (selmon->gappx + arg->i < 0))
- selmon->gappx = 0;
- else
- selmon->gappx += arg->i;
- arrange(selmon);
-}
-
-void
-setlayout(const Arg *arg)
-{
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
- selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
- if (arg && arg->v)
- selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
- if (selmon->sel)
- arrange(selmon);
- else
- drawbar(selmon);
-}
-
-/* arg > 1.0 will set mfact absolutely */
-void
-setmfact(const Arg *arg)
-{
- float f;
-
- if (!arg || !selmon->lt[selmon->sellt]->arrange)
- return;
- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
- if (f < 0.05 || f > 0.95)
- return;
- selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
- arrange(selmon);
-}
-
-void
-setup(void)
-{
- int i;
- XSetWindowAttributes wa;
- Atom utf8string;
- struct sigaction sa;
-
- /* do not transform children into zombies when they terminate */
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART;
- sa.sa_handler = SIG_IGN;
- sigaction(SIGCHLD, &sa, NULL);
-
- /* clean up any zombies (inherited from .xinitrc etc) immediately */
- while (waitpid(-1, NULL, WNOHANG) > 0);
-
- /* init screen */
- screen = DefaultScreen(dpy);
- sw = DisplayWidth(dpy, screen);
- sh = DisplayHeight(dpy, screen);
- root = RootWindow(dpy, screen);
- drw = drw_create(dpy, screen, root, sw, sh);
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- lrpad = drw->fonts->h;
- bh = drw->fonts->h + 2;
- updategeom();
- /* init atoms */
- utf8string = XInternAtom(dpy, "UTF8_STRING", False);
- wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
- wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
- wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
- wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
- netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
- netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
- 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[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
- netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
- /* init cursors */
- cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
- cursor[CurResize] = drw_cur_create(drw, XC_sizing);
- cursor[CurMove] = drw_cur_create(drw, XC_fleur);
- /* init appearance */
- scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
- for (i = 0; i < LENGTH(colors); i++)
- scheme[i] = drw_scm_create(drw, colors[i], 3);
- /* init bars */
- updatebars();
- updatestatus();
- /* supporting window for NetWMCheck */
- wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0);
- XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) &wmcheckwin, 1);
- XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8,
- PropModeReplace, (unsigned char *) "dwm", 3);
- XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) &wmcheckwin, 1);
- /* EWMH support per view */
- XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
- PropModeReplace, (unsigned char *) netatom, NetLast);
- XDeleteProperty(dpy, root, netatom[NetClientList]);
- /* select events */
- wa.cursor = cursor[CurNormal]->cursor;
- wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask
- |ButtonPressMask|PointerMotionMask|EnterWindowMask
- |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask;
- XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
- XSelectInput(dpy, root, wa.event_mask);
- grabkeys();
- focus(NULL);
-}
-
-void
-seturgent(Client *c, int urg)
-{
- XWMHints *wmh;
-
- c->isurgent = urg;
- if (!(wmh = XGetWMHints(dpy, c->win)))
- return;
- wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint);
- XSetWMHints(dpy, c->win, wmh);
- XFree(wmh);
-}
-
-void
-showhide(Client *c)
-{
- if (!c)
- return;
- if (ISVISIBLE(c)) {
- /* show clients top down */
- XMoveWindow(dpy, c->win, c->x, c->y);
- if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
- resize(c, c->x, c->y, c->w, c->h, 0);
- showhide(c->snext);
- } else {
- /* hide clients bottom up */
- showhide(c->snext);
- XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
- }
-}
-
-void
-spawn(const Arg *arg)
-{
- struct sigaction sa;
-
- if (arg->v == dmenucmd)
- dmenumon[0] = '0' + selmon->num;
- if (fork() == 0) {
- if (dpy)
- close(ConnectionNumber(dpy));
- setsid();
-
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
- sigaction(SIGCHLD, &sa, NULL);
-
- execvp(((char **)arg->v)[0], (char **)arg->v);
- die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
- }
-}
-
-void
-tag(const Arg *arg)
-{
- if (selmon->sel && arg->ui & TAGMASK) {
- selmon->sel->tags = arg->ui & TAGMASK;
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-tagmon(const Arg *arg)
-{
- if (!selmon->sel || !mons->next)
- return;
- sendmon(selmon->sel, dirtomon(arg->i));
-}
-
-void
-tile(Monitor *m)
-{
- unsigned int i, n, h, mw, my, ty;
- Client *c;
-
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
- if (n == 0)
- return;
-
- if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
- mw = m->ww - m->gappx;
- for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
- if (i < m->nmaster) {
- h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
- resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
- if (my + HEIGHT(c) + m->gappx < m->wh)
- my += HEIGHT(c) + m->gappx;
- } else {
- h = (m->wh - ty) / (n - i) - m->gappx;
- resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
- if (ty + HEIGHT(c) + m->gappx < m->wh)
- ty += HEIGHT(c) + m->gappx;
- }
-}
-
-void
-togglebar(const Arg *arg)
-{
- selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
- updatebarpos(selmon);
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- arrange(selmon);
-}
-
-void
-togglefloating(const Arg *arg)
-{
- if (!selmon->sel)
- return;
- if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
- return;
- selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
- if (selmon->sel->isfloating)
- resize(selmon->sel, selmon->sel->x, selmon->sel->y,
- selmon->sel->w, selmon->sel->h, 0);
- arrange(selmon);
-}
-
-void
-toggletag(const Arg *arg)
-{
- unsigned int newtags;
-
- if (!selmon->sel)
- return;
- newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
- if (newtags) {
- selmon->sel->tags = newtags;
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-toggleview(const Arg *arg)
-{
- unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
- int i;
-
- if (newtagset) {
- selmon->tagset[selmon->seltags] = newtagset;
-
- if (newtagset == ~0) {
- selmon->pertag->prevtag = selmon->pertag->curtag;
- selmon->pertag->curtag = 0;
- }
-
- /* test if the user did not select the same tag */
- if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
- selmon->pertag->prevtag = selmon->pertag->curtag;
- for (i = 0; !(newtagset & 1 << i); i++) ;
- selmon->pertag->curtag = i + 1;
- }
-
- /* apply settings for this view */
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
- 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 (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
- togglebar(NULL);
-
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-unfocus(Client *c, int setfocus)
-{
- if (!c)
- return;
- grabbuttons(c, 0);
- XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
- if (setfocus) {
- XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
- }
-}
-
-void
-unmanage(Client *c, int destroyed)
-{
- Monitor *m = c->mon;
- XWindowChanges wc;
-
- detach(c);
- detachstack(c);
- if (!destroyed) {
- wc.border_width = c->oldbw;
- XGrabServer(dpy); /* avoid race conditions */
- XSetErrorHandler(xerrordummy);
- XSelectInput(dpy, c->win, NoEventMask);
- XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
- XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- setclientstate(c, WithdrawnState);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XUngrabServer(dpy);
- }
- free(c);
- focus(NULL);
- updateclientlist();
- arrange(m);
-}
-
-void
-unmapnotify(XEvent *e)
-{
- Client *c;
- XUnmapEvent *ev = &e->xunmap;
-
- if ((c = wintoclient(ev->window))) {
- if (ev->send_event)
- setclientstate(c, WithdrawnState);
- else
- unmanage(c, 0);
- }
-}
-
-void
-updatebars(void)
-{
- Monitor *m;
- XSetWindowAttributes wa = {
- .override_redirect = True,
- .background_pixmap = ParentRelative,
- .event_mask = ButtonPressMask|ExposureMask
- };
- XClassHint ch = {"dwm", "dwm"};
- for (m = mons; m; m = m->next) {
- if (m->barwin)
- continue;
- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
- CopyFromParent, DefaultVisual(dpy, screen),
- CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
- XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
- XMapRaised(dpy, m->barwin);
- XSetClassHint(dpy, m->barwin, &ch);
- }
-}
-
-void
-updatebarpos(Monitor *m)
-{
- m->wy = m->my;
- m->wh = m->mh;
- if (m->showbar) {
- m->wh -= bh;
- m->by = m->topbar ? m->wy : m->wy + m->wh;
- m->wy = m->topbar ? m->wy + bh : m->wy;
- } else
- m->by = -bh;
-}
-
-void
-updateclientlist(void)
-{
- Client *c;
- Monitor *m;
-
- XDeleteProperty(dpy, root, netatom[NetClientList]);
- for (m = mons; m; m = m->next)
- for (c = m->clients; c; c = c->next)
- XChangeProperty(dpy, root, netatom[NetClientList],
- XA_WINDOW, 32, PropModeAppend,
- (unsigned char *) &(c->win), 1);
-}
-
-int
-updategeom(void)
-{
- int dirty = 0;
-
-#ifdef XINERAMA
- if (XineramaIsActive(dpy)) {
- int i, j, n, nn;
- Client *c;
- Monitor *m;
- XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn);
- XineramaScreenInfo *unique = NULL;
-
- for (n = 0, m = mons; m; m = m->next, n++);
- /* only consider unique geometries as separate screens */
- unique = ecalloc(nn, sizeof(XineramaScreenInfo));
- for (i = 0, j = 0; i < nn; i++)
- if (isuniquegeom(unique, j, &info[i]))
- memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo));
- XFree(info);
- nn = j;
-
- /* new monitors if nn > n */
- for (i = n; i < nn; i++) {
- for (m = mons; m && m->next; m = m->next);
- if (m)
- m->next = createmon();
- else
- mons = createmon();
- }
- for (i = 0, m = mons; i < nn && m; m = m->next, i++)
- if (i >= n
- || unique[i].x_org != m->mx || unique[i].y_org != m->my
- || unique[i].width != m->mw || unique[i].height != m->mh)
- {
- dirty = 1;
- m->num = i;
- m->mx = m->wx = unique[i].x_org;
- m->my = m->wy = unique[i].y_org;
- m->mw = m->ww = unique[i].width;
- m->mh = m->wh = unique[i].height;
- updatebarpos(m);
- }
- /* removed monitors if n > nn */
- for (i = nn; i < n; i++) {
- for (m = mons; m && m->next; m = m->next);
- while ((c = m->clients)) {
- dirty = 1;
- m->clients = c->next;
- detachstack(c);
- c->mon = mons;
- attach(c);
- attachstack(c);
- }
- if (m == selmon)
- selmon = mons;
- cleanupmon(m);
- }
- free(unique);
- } else
-#endif /* XINERAMA */
- { /* default monitor setup */
- if (!mons)
- mons = createmon();
- if (mons->mw != sw || mons->mh != sh) {
- dirty = 1;
- mons->mw = mons->ww = sw;
- mons->mh = mons->wh = sh;
- updatebarpos(mons);
- }
- }
- if (dirty) {
- selmon = mons;
- selmon = wintomon(root);
- }
- return dirty;
-}
-
-void
-updatenumlockmask(void)
-{
- unsigned int i, j;
- XModifierKeymap *modmap;
-
- numlockmask = 0;
- modmap = XGetModifierMapping(dpy);
- for (i = 0; i < 8; i++)
- for (j = 0; j < modmap->max_keypermod; j++)
- if (modmap->modifiermap[i * modmap->max_keypermod + j]
- == XKeysymToKeycode(dpy, XK_Num_Lock))
- numlockmask = (1 << i);
- XFreeModifiermap(modmap);
-}
-
-void
-updatesizehints(Client *c)
-{
- long msize;
- XSizeHints size;
-
- if (!XGetWMNormalHints(dpy, c->win, &size, &msize))
- /* size is uninitialized, ensure that size.flags aren't used */
- size.flags = PSize;
- if (size.flags & PBaseSize) {
- c->basew = size.base_width;
- c->baseh = size.base_height;
- } else if (size.flags & PMinSize) {
- c->basew = size.min_width;
- c->baseh = size.min_height;
- } else
- c->basew = c->baseh = 0;
- if (size.flags & PResizeInc) {
- c->incw = size.width_inc;
- c->inch = size.height_inc;
- } else
- c->incw = c->inch = 0;
- if (size.flags & PMaxSize) {
- c->maxw = size.max_width;
- c->maxh = size.max_height;
- } else
- c->maxw = c->maxh = 0;
- if (size.flags & PMinSize) {
- c->minw = size.min_width;
- c->minh = size.min_height;
- } else if (size.flags & PBaseSize) {
- c->minw = size.base_width;
- c->minh = size.base_height;
- } else
- c->minw = c->minh = 0;
- if (size.flags & PAspect) {
- c->mina = (float)size.min_aspect.y / size.min_aspect.x;
- c->maxa = (float)size.max_aspect.x / size.max_aspect.y;
- } else
- c->maxa = c->mina = 0.0;
- c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
- c->hintsvalid = 1;
-}
-
-void
-updatestatus(void)
-{
- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
- strcpy(stext, "dwm-"VERSION);
- drawbar(selmon);
-}
-
-void
-updatetitle(Client *c)
-{
- 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);
-}
-
-void
-updatewindowtype(Client *c)
-{
- Atom state = getatomprop(c, netatom[NetWMState]);
- Atom wtype = getatomprop(c, netatom[NetWMWindowType]);
-
- if (state == netatom[NetWMFullscreen])
- setfullscreen(c, 1);
- if (wtype == netatom[NetWMWindowTypeDialog])
- c->isfloating = 1;
-}
-
-void
-updatewmhints(Client *c)
-{
- XWMHints *wmh;
-
- if ((wmh = XGetWMHints(dpy, c->win))) {
- if (c == selmon->sel && wmh->flags & XUrgencyHint) {
- wmh->flags &= ~XUrgencyHint;
- XSetWMHints(dpy, c->win, wmh);
- } else
- c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
- if (wmh->flags & InputHint)
- c->neverfocus = !wmh->input;
- else
- c->neverfocus = 0;
- XFree(wmh);
- }
-}
-
-void
-view(const Arg *arg)
-{
- int i;
- unsigned int tmptag;
-
- if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
- return;
- selmon->seltags ^= 1; /* toggle sel tagset */
- if (arg->ui & TAGMASK) {
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
- selmon->pertag->prevtag = selmon->pertag->curtag;
-
- if (arg->ui == ~0)
- selmon->pertag->curtag = 0;
- else {
- for (i = 0; !(arg->ui & 1 << i); i++) ;
- selmon->pertag->curtag = i + 1;
- }
- } else {
- tmptag = selmon->pertag->prevtag;
- selmon->pertag->prevtag = selmon->pertag->curtag;
- selmon->pertag->curtag = tmptag;
- }
-
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
- 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 (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
- togglebar(NULL);
-
- focus(NULL);
- arrange(selmon);
-}
-
-Client *
-wintoclient(Window w)
-{
- Client *c;
- Monitor *m;
-
- for (m = mons; m; m = m->next)
- for (c = m->clients; c; c = c->next)
- if (c->win == w)
- return c;
- return NULL;
-}
-
-Monitor *
-wintomon(Window w)
-{
- int x, y;
- Client *c;
- Monitor *m;
-
- if (w == root && getrootptr(&x, &y))
- return recttomon(x, y, 1, 1);
- for (m = mons; m; m = m->next)
- if (w == m->barwin)
- return m;
- if ((c = wintoclient(w)))
- return c->mon;
- return selmon;
-}
-
-/* There's no way to check accesses to destroyed windows, thus those cases are
- * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
- * default error handler, which may call exit. */
-int
-xerror(Display *dpy, XErrorEvent *ee)
-{
- if (ee->error_code == BadWindow
- || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
- || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)
- || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable)
- || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable)
- || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch)
- || (ee->request_code == X_GrabButton && ee->error_code == BadAccess)
- || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)
- || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
- return 0;
- fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
- ee->request_code, ee->error_code);
- return xerrorxlib(dpy, ee); /* may call exit */
-}
-
-int
-xerrordummy(Display *dpy, XErrorEvent *ee)
-{
- return 0;
-}
-
-/* Startup Error handler to check if another window manager
- * is already running. */
-int
-xerrorstart(Display *dpy, XErrorEvent *ee)
-{
- die("dwm: another window manager is already running");
- return -1;
-}
-
-void
-xrdb(const Arg *arg)
-{
- loadxrdb();
- int i;
- for (i = 0; i < LENGTH(colors); i++)
- scheme[i] = drw_scm_create(drw, colors[i], 3);
- focus(NULL);
- arrange(NULL);
-}
-
-void
-zoom(const Arg *arg)
-{
- Client *c = selmon->sel;
-
- if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating)
- return;
- if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
- return;
- pop(c);
-}
-
-int
-main(int argc, char *argv[])
-{
- if (argc == 2 && !strcmp("-v", argv[1]))
- die("dwm-"VERSION);
- else if (argc != 1)
- die("usage: dwm [-v]");
- if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
- fputs("warning: no locale support\n", stderr);
- if (!(dpy = XOpenDisplay(NULL)))
- die("dwm: cannot open display");
- checkotherwm();
- XrmInitialize();
- loadxrdb();
- setup();
-#ifdef __OpenBSD__
- if (pledge("stdio rpath proc exec", NULL) == -1)
- die("pledge");
-#endif /* __OpenBSD__ */
- scan();
- run();
- cleanup();
- XCloseDisplay(dpy);
- return EXIT_SUCCESS;
-}
diff --git a/dwm/dwm/dwm.png b/dwm/dwm/dwm.png
deleted file mode 100644
index b1f9ba7..0000000
Binary files a/dwm/dwm/dwm.png and /dev/null differ
diff --git a/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff b/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff
deleted file mode 100644
index 03ea9ef..0000000
--- a/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up dwm/dwm.c dwmmod/dwm.c
---- dwm/dwm.c 2020-06-25 00:21:30.383692180 -0300
-+++ dwmmod/dwm.c 2020-06-25 00:20:35.643692330 -0300
-@@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa)
- updatewindowtype(c);
- updatesizehints(c);
- updatewmhints(c);
-+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
-+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
- XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
- grabbuttons(c, 0);
- if (!c->isfloating)
diff --git a/dwm/dwm/patches/dwm-fullgaps-6.4.diff b/dwm/dwm/patches/dwm-fullgaps-6.4.diff
deleted file mode 100644
index dc52139..0000000
--- a/dwm/dwm/patches/dwm-fullgaps-6.4.diff
+++ /dev/null
@@ -1,94 +0,0 @@
-diff -up a/config.def.h b/config.def.h
---- a/config.def.h
-+++ b/config.def.h
-@@ -2,6 +2,7 @@
-
- /* appearance */
- static const unsigned int borderpx = 1; /* border pixel of windows */
-+static const unsigned int gappx = 5; /* gaps between windows */
- static const unsigned int snap = 32; /* snap pixel */
- static const int showbar = 1; /* 0 means no bar */
- static const int topbar = 1; /* 0 means bottom bar */
-@@ -85,6 +86,9 @@ static const Key keys[] = {
- { MODKEY, XK_period, focusmon, {.i = +1 } },
- { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
- { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
-+ { MODKEY, XK_minus, setgaps, {.i = -1 } },
-+ { MODKEY, XK_equal, setgaps, {.i = +1 } },
-+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
-diff -up a/dwm.c b/dwm.c
---- a/dwm.c 2023-04-30
-+++ b/dwm.c 2023-04-30
-@@ -119,6 +119,7 @@ struct Monitor {
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
- int wx, wy, ww, wh; /* window area */
-+ int gappx; /* gaps between windows */
- unsigned int seltags;
- unsigned int sellt;
- unsigned int tagset[2];
-@@ -200,6 +201,7 @@ static void sendmon(Client *c, Monitor *
- static void setclientstate(Client *c, long state);
- static void setfocus(Client *c);
- static void setfullscreen(Client *c, int fullscreen);
-+static void setgaps(const Arg *arg);
- static void setlayout(const Arg *arg);
- static void setmfact(const Arg *arg);
- static void setup(void);
-@@ -641,6 +643,7 @@ createmon(void)
- m->nmaster = nmaster;
- m->showbar = showbar;
- m->topbar = topbar;
-+ m->gappx = gappx;
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
-@@ -1508,6 +1511,16 @@ setfullscreen(Client *c, int fullscreen)
- }
-
- void
-+setgaps(const Arg *arg)
-+{
-+ if ((arg->i == 0) || (selmon->gappx + arg->i < 0))
-+ selmon->gappx = 0;
-+ else
-+ selmon->gappx += arg->i;
-+ arrange(selmon);
-+}
-+
-+void
- setlayout(const Arg *arg)
- {
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
-@@ -1697,18 +1710,18 @@ tile(Monitor *m)
- if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
-- mw = m->ww;
-- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
-- if (i < m->nmaster) {
-- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
-- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
-- if (my + HEIGHT(c) < m->wh)
-- my += HEIGHT(c);
-+ mw = m->ww - m->gappx;
-+ for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
-+ if (i < m->nmaster) {
-+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
-+ resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
-+ if (my + HEIGHT(c) + m->gappx < m->wh)
-+ my += HEIGHT(c) + m->gappx;
- } else {
-- h = (m->wh - ty) / (n - i);
-- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
-- if (ty + HEIGHT(c) < m->wh)
-- ty += HEIGHT(c);
-+ h = (m->wh - ty) / (n - i) - m->gappx;
-+ resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
-+ if (ty + HEIGHT(c) + m->gappx < m->wh)
-+ ty += HEIGHT(c) + m->gappx;
- }
- }
diff --git a/dwm/dwm/patches/dwm-noborder-6.2.diff b/dwm/dwm/patches/dwm-noborder-6.2.diff
deleted file mode 100644
index f381eb8..0000000
--- a/dwm/dwm/patches/dwm-noborder-6.2.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-From 9102fdb9c670218373bbe83c891c8e8138d6a6f4 Mon Sep 17 00:00:00 2001
-From: redacted
-Date: Tue, 23 Apr 2019 00:39:27 +0100
-Subject: [PATCH] added noborder patch
-
----
- dwm.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/dwm.c b/dwm.c
-index 4465af1..685eca1 100644
---- a/dwm.c
-+++ b/dwm.c
-@@ -1282,6 +1282,13 @@ resizeclient(Client *c, int x, int y, int w, int h)
- c->oldw = c->w; c->w = wc.width = w;
- c->oldh = c->h; c->h = wc.height = h;
- wc.border_width = c->bw;
-+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
-+ || &monocle == c->mon->lt[c->mon->sellt]->arrange)
-+ && !c->isfullscreen && !c->isfloating) {
-+ c->w = wc.width += c->bw * 2;
-+ c->h = wc.height += c->bw * 2;
-+ wc.border_width = 0;
-+ }
- XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
- configure(c);
- XSync(dpy, False);
---
-2.21.0
-
diff --git a/dwm/dwm/patches/dwm-pertag-6.2.diff b/dwm/dwm/patches/dwm-pertag-6.2.diff
deleted file mode 100644
index d753727..0000000
--- a/dwm/dwm/patches/dwm-pertag-6.2.diff
+++ /dev/null
@@ -1,177 +0,0 @@
-diff --git a/dwm.c b/dwm.c
-index 4465af1..6474055 100644
---- a/dwm.c
-+++ b/dwm.c
-@@ -111,6 +111,7 @@ typedef struct {
- void (*arrange)(Monitor *);
- } Layout;
-
-+typedef struct Pertag Pertag;
- struct Monitor {
- char ltsymbol[16];
- float mfact;
-@@ -130,6 +131,7 @@ struct Monitor {
- Monitor *next;
- Window barwin;
- const Layout *lt[2];
-+ Pertag *pertag;
- };
-
- typedef struct {
-@@ -271,6 +273,15 @@ static Window root, wmcheckwin;
- /* configuration, allows nested code to access above variables */
- #include "config.h"
-
-+struct Pertag {
-+ unsigned int curtag, prevtag; /* current and previous tag */
-+ int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
-+ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
-+ unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
-+ const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
-+ int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
-+};
-+
- /* compile-time check if all tags fit into an unsigned int bit array. */
- struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
-
-@@ -631,6 +642,7 @@ Monitor *
- createmon(void)
- {
- Monitor *m;
-+ unsigned int i;
-
- m = ecalloc(1, sizeof(Monitor));
- m->tagset[0] = m->tagset[1] = 1;
-@@ -641,6 +653,20 @@ createmon(void)
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
-+ m->pertag = ecalloc(1, sizeof(Pertag));
-+ m->pertag->curtag = m->pertag->prevtag = 1;
-+
-+ for (i = 0; i <= LENGTH(tags); i++) {
-+ m->pertag->nmasters[i] = m->nmaster;
-+ m->pertag->mfacts[i] = m->mfact;
-+
-+ m->pertag->ltidxs[i][0] = m->lt[0];
-+ m->pertag->ltidxs[i][1] = m->lt[1];
-+ m->pertag->sellts[i] = m->sellt;
-+
-+ m->pertag->showbars[i] = m->showbar;
-+ }
-+
- return m;
- }
-
-@@ -966,7 +992,7 @@ grabkeys(void)
- void
- incnmaster(const Arg *arg)
- {
-- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
- }
-
-@@ -1501,9 +1527,9 @@ void
- setlayout(const Arg *arg)
- {
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
-- selmon->sellt ^= 1;
-+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
- if (arg && arg->v)
-- selmon->lt[selmon->sellt] = (Layout *)arg->v;
-+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
- if (selmon->sel)
- arrange(selmon);
-@@ -1522,7 +1548,7 @@ setmfact(const Arg *arg)
- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
- if (f < 0.1 || f > 0.9)
- return;
-- selmon->mfact = f;
-+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
- arrange(selmon);
- }
-
-@@ -1699,7 +1725,7 @@ tile(Monitor *m)
- void
- togglebar(const Arg *arg)
- {
-- selmon->showbar = !selmon->showbar;
-+ selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
- updatebarpos(selmon);
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- arrange(selmon);
-@@ -1738,9 +1764,33 @@ void
- toggleview(const Arg *arg)
- {
- unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
-+ int i;
-
- if (newtagset) {
- selmon->tagset[selmon->seltags] = newtagset;
-+
-+ if (newtagset == ~0) {
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ selmon->pertag->curtag = 0;
-+ }
-+
-+ /* test if the user did not select the same tag */
-+ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ for (i = 0; !(newtagset & 1 << i); i++) ;
-+ selmon->pertag->curtag = i + 1;
-+ }
-+
-+ /* apply settings for this view */
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
-+ 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 (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
-+ togglebar(NULL);
-+
- focus(NULL);
- arrange(selmon);
- }
-@@ -2035,11 +2085,37 @@ updatewmhints(Client *c)
- void
- view(const Arg *arg)
- {
-+ int i;
-+ unsigned int tmptag;
-+
- if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
- return;
- selmon->seltags ^= 1; /* toggle sel tagset */
-- if (arg->ui & TAGMASK)
-+ if (arg->ui & TAGMASK) {
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+
-+ if (arg->ui == ~0)
-+ selmon->pertag->curtag = 0;
-+ else {
-+ for (i = 0; !(arg->ui & 1 << i); i++) ;
-+ selmon->pertag->curtag = i + 1;
-+ }
-+ } else {
-+ tmptag = selmon->pertag->prevtag;
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ selmon->pertag->curtag = tmptag;
-+ }
-+
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
-+ 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 (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
-+ togglebar(NULL);
-+
- focus(NULL);
- arrange(selmon);
- }
diff --git a/dwm/dwm/patches/dwm-xrdb-6.4.diff b/dwm/dwm/patches/dwm-xrdb-6.4.diff
deleted file mode 100644
index 929b4e6..0000000
--- a/dwm/dwm/patches/dwm-xrdb-6.4.diff
+++ /dev/null
@@ -1,203 +0,0 @@
-From e7c65d2ce902a19a20daa751b42f8ba0209fdb61 Mon Sep 17 00:00:00 2001
-From: NekoCWD
-Date: Sun, 22 Jan 2023 23:42:57 +0300
-Subject: [PATCH] [dwm] xrdb update 6.4
-
----
- config.def.h | 22 ++++++++++---------
- drw.c | 2 +-
- drw.h | 2 +-
- dwm.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 76 insertions(+), 12 deletions(-)
-
-diff --git a/config.def.h b/config.def.h
-index 061ad66..686b947 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -7,15 +7,16 @@ static const int showbar = 1; /* 0 means no bar */
- static const int topbar = 1; /* 0 means bottom bar */
- static const char *fonts[] = { "monospace:size=10" };
- static const char dmenufont[] = "monospace:size=10";
--static const char col_gray1[] = "#222222";
--static const char col_gray2[] = "#444444";
--static const char col_gray3[] = "#bbbbbb";
--static const char col_gray4[] = "#eeeeee";
--static const char col_cyan[] = "#005577";
--static const char *colors[][3] = {
-- /* fg bg border */
-- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
-- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
-+static char normbgcolor[] = "#222222";
-+static char normbordercolor[] = "#444444";
-+static char normfgcolor[] = "#bbbbbb";
-+static char selfgcolor[] = "#eeeeee";
-+static char selbordercolor[] = "#005577";
-+static char selbgcolor[] = "#005577";
-+static char *colors[][3] = {
-+ /* fg bg border */
-+ [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
-+ [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
- };
-
- /* tagging */
-@@ -56,7 +57,7 @@ static const Layout layouts[] = {
- #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-
- /* commands */
--static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
-+static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
- static const char *termcmd[] = { "st", NULL };
-
- static const Key keys[] = {
-@@ -84,6 +85,7 @@ static const Key keys[] = {
- { MODKEY, XK_period, focusmon, {.i = +1 } },
- { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
- { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
-+ { MODKEY, XK_F5, xrdb, {.v = NULL } },
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
-diff --git a/drw.c b/drw.c
-index a58a2b4..f8a82f5 100644
---- a/drw.c
-+++ b/drw.c
-@@ -195,7 +195,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
- /* Wrapper to create color schemes. The caller has to call free(3) on the
- * returned color scheme when done using it. */
- Clr *
--drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
-+drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount)
- {
- size_t i;
- Clr *ret;
-diff --git a/drw.h b/drw.h
-index 6471431..bdbf950 100644
---- a/drw.h
-+++ b/drw.h
-@@ -40,7 +40,7 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in
-
- /* Colorscheme abstraction */
- void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
--Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
-+Clr *drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount);
-
- /* Cursor abstraction */
- Cur *drw_cur_create(Drw *drw, int shape);
-diff --git a/dwm.c b/dwm.c
-index e5efb6a..3fe76be 100644
---- a/dwm.c
-+++ b/dwm.c
-@@ -35,6 +35,7 @@
- #include
- #include
- #include
-+#include
- #include
- #ifdef XINERAMA
- #include
-@@ -56,6 +57,21 @@
- #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
- #define TAGMASK ((1 << LENGTH(tags)) - 1)
- #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
-+#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'; \
-+ } \
-+ } \
-+ }
-
- /* enums */
- enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-@@ -178,6 +194,7 @@ static void grabkeys(void);
- static void incnmaster(const Arg *arg);
- static void keypress(XEvent *e);
- static void killclient(const Arg *arg);
-+static void loadxrdb(void);
- static void manage(Window w, XWindowAttributes *wa);
- static void mappingnotify(XEvent *e);
- static void maprequest(XEvent *e);
-@@ -233,6 +250,7 @@ static Monitor *wintomon(Window w);
- static int xerror(Display *dpy, XErrorEvent *ee);
- static int xerrordummy(Display *dpy, XErrorEvent *ee);
- static int xerrorstart(Display *dpy, XErrorEvent *ee);
-+static void xrdb(const Arg *arg);
- static void zoom(const Arg *arg);
-
- /* variables */
-@@ -1019,6 +1037,37 @@ killclient(const Arg *arg)
- }
- }
-
-+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.normbordercolor", normbordercolor);
-+ XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
-+ XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor);
-+ XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
-+ XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
-+ XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
-+ }
-+ }
-+ }
-+
-+ XCloseDisplay(display);
-+}
-+
- void
- manage(Window w, XWindowAttributes *wa)
- {
-@@ -2110,6 +2159,17 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
- return -1;
- }
-
-+void
-+xrdb(const Arg *arg)
-+{
-+ loadxrdb();
-+ int i;
-+ for (i = 0; i < LENGTH(colors); i++)
-+ scheme[i] = drw_scm_create(drw, colors[i], 3);
-+ focus(NULL);
-+ arrange(NULL);
-+}
-+
- void
- zoom(const Arg *arg)
- {
-@@ -2134,6 +2194,8 @@ main(int argc, char *argv[])
- if (!(dpy = XOpenDisplay(NULL)))
- die("dwm: cannot open display");
- checkotherwm();
-+ XrmInitialize();
-+ loadxrdb();
- setup();
- #ifdef __OpenBSD__
- if (pledge("stdio rpath proc exec", NULL) == -1)
---
-2.38.2
-
diff --git a/dwm/dwm/transient.c b/dwm/dwm/transient.c
deleted file mode 100644
index 040adb5..0000000
--- a/dwm/dwm/transient.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* cc transient.c -o transient -lX11 */
-
-#include
-#include
-#include
-#include
-
-int main(void) {
- Display *d;
- Window r, f, t = None;
- XSizeHints h;
- XEvent e;
-
- d = XOpenDisplay(NULL);
- if (!d)
- exit(1);
- r = DefaultRootWindow(d);
-
- f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
- h.min_width = h.max_width = h.min_height = h.max_height = 400;
- h.flags = PMinSize | PMaxSize;
- XSetWMNormalHints(d, f, &h);
- XStoreName(d, f, "floating");
- XMapWindow(d, f);
-
- XSelectInput(d, f, ExposureMask);
- while (1) {
- XNextEvent(d, &e);
-
- if (t == None) {
- sleep(5);
- t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
- XSetTransientForHint(d, t, f);
- XStoreName(d, t, "transient");
- XMapWindow(d, t);
- XSelectInput(d, t, ExposureMask);
- }
- }
-
- XCloseDisplay(d);
- exit(0);
-}
diff --git a/dwm/dwm/util.c b/dwm/dwm/util.c
deleted file mode 100644
index 96b82c9..0000000
--- a/dwm/dwm/util.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-
-#include "util.h"
-
-void
-die(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
-
- if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
- fputc(' ', stderr);
- perror(NULL);
- } else {
- fputc('\n', stderr);
- }
-
- exit(1);
-}
-
-void *
-ecalloc(size_t nmemb, size_t size)
-{
- void *p;
-
- if (!(p = calloc(nmemb, size)))
- die("calloc:");
- return p;
-}
diff --git a/dwm/dwm/util.h b/dwm/dwm/util.h
deleted file mode 100644
index f633b51..0000000
--- a/dwm/dwm/util.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define MAX(A, B) ((A) > (B) ? (A) : (B))
-#define MIN(A, B) ((A) < (B) ? (A) : (B))
-#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
-
-void die(const char *fmt, ...);
-void *ecalloc(size_t nmemb, size_t size);
diff --git a/dwm/dwmbar/COPYING b/dwm/dwmbar/COPYING
deleted file mode 100644
index f288702..0000000
--- a/dwm/dwmbar/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/dwm/dwmbar/README.md b/dwm/dwmbar/README.md
deleted file mode 100644
index c252d8c..0000000
--- a/dwm/dwmbar/README.md
+++ /dev/null
@@ -1,166 +0,0 @@
-dwmbar - A Modular Status Bar for dwm
-=====================================
-
-
-dwmbar is a very simple status bar written for dwm.
-
-**This project is no longer actively maintained. You will likely not receive support from the devs if something's not right. If you are somebody who is interested in taking over this project, please contact me (thytom) and we can discuss adding you as a contributor. You are also more than welcome to fork the project if you wish to make improvements on your own.**
-
-# Installation
-
-## Prerequisites
-
-While some modules will work without these dependencies, we recommend grabbing
-the ones you want for specific modules.
-
-Highly Recommended:
-* Any patched Nerd Font for icons.
-
-Optional (By module):
-
-See [module prerequisites](#module-prerequisites).
-
-
-## Arch Linux
-
-There is an [AUR package](https://aur.archlinux.org/packages/dwmbar-git) for
-dwmbar, which can be installed with your favourite aur helper, or manually.
-
-Please see the [archwiki
-page](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages)
-for how to manually install AUR packages.
-
-## Manual Installation
-
-```bash
-$ git clone https://github.com/thytom/dwmbar
-$ cd dwmbar
-$ sudo ./install.sh
-```
-# Usage
-
-dwmbar works by setting the root window name, which dwm displays. It does this
-by calling the dwmbarrc file in your .config/dwmbar folder.
-
-Add the line `dwmbar &` to your .xinitrc file to run on startup. You can also
-run `dwmbar` in terminal for testing purposes.
-
-# Customisation
-
-## Configuring the Bar
-
-Most non-modular configuration is done in `~/.config/dwmbar/dwmbarrc`, a bash
-script that calls scripts in turn, caching their output and then constructing
-the bar from that.
-
-To add a module to the bar, simply include its name in the MODULES variable:
-
-```bash
-MODULES="mpd volumebar wifi battery"
-```
-
-Modules are displayed left-to-right in the order they are written in `MODULES`.
-By default, they are delimited by the `SEPARATOR` variable, which you can
-change.
-
-We also offer a `PADDING` variable, which contains a string you can include at
-the start of your bar, on the very right. This can either be padding spaces, to
-move the bar away from the right edge, or even text. By default, we set
-`PADDING` to `$USER@$HOSTNAME`. Feel free to change this.
-
-## Writing Modules
-
-Default modules are located within `/usr/share/dwmbar/modules`, and custom
-modules can be placed in `~/.config/dwmbar/modules/custom`. If a default module
-exists with the same name as a custom module, then the custom module will take
-precedence.
-
-**Default modules will possibly be overwritten during updates, so if you want
-to modify them be sure to make a copy in the custom folder, which will not be
-touched, and edit it there.**
-
-Modules can be written in any language, so long as they are executable and
-print their output to stdout.
-
-Currently available default modules are:
-- archupdates - Gets the number of updates available **Arch Linux Only**
-- backlight - Shows the brightness of the screen
-- battery - Gets battery percentage
-- bluetooth - Shows bluetooth status
-- cpuload - Shows the CPU load in %
-- date - Shows the calendar date
-- daypercentage - Shows how far through the day you are, in %
-- disksize - Shows the disk usage
-- ethernet - Shows ethernet connection
-- fanspeed - Shows the rpm of your main fan
-- hostname - Shows your current user and hostname
-- internet - Shows whether internet is available (TODO)
-- kernel - Shows the kernel version
-- localip - Shows your local IP address
-- mail - Shows how much mail you have
-- mpd - Shows MPD status
-- networkdowntraffic - Gets the download traffic in Kb/s
-- networkuptraffic - Gets the upload traffic in Kb/s
-- publicip - Shows your public IP address
-- ram - Shows RAM usage
-- redshift - Shows current screen temperature from Redshift
-- sunmoon - Displays a sun or moon for time of day
-- temperature - Displays the temperature of the CPU
-- time - Displays time
-- todo - Prints the number of todos for the "t" todo manager
-- tor - Prints if the tor service is enabled
-- voidupdates - Gets the number of updates available **Void Linux Only**
-- volumebar - Displays a volume bar
-- volume - Prints volume in %
-- weather - Shows weather info
-- wifi - Shows wifi connection
-
-## Module Prerequisites
-
-See Module Dependencies
- * archupdates
- - Arch Linux
- - yay
- - pacman-contrib
-* backlight
- - light
-* bluetooth
- - bluez
-* fanspeed
- - lm_sensors
-* mail
- - mutt/neomutt (We recommend [Luke Smith's Mutt-Wizard](https://github.com/LukeSmithxyz/mutt-wizard)) for configuration.
-* mpd
- - mpd
- - mpc
-* publicip
- - curl
-* redshift
- - redshift
-* sunmoon
- - redshift
-* temperature
- - lm_sensors
-* todo
- - [t todo manager](https://github.com/sjl/t)
-* tor
- - tor
-* voidupdates
- - xbps package manager
-* volume
- - pulseaudio
-* volumebar
- - pulseaudio
-* weather
- - curl
- - Internet connection
-* wifi
- - Wifi card
-
-# Feature Wishlist
-
-* Paralellised Modules
- - Some modules are slower than others. Have modules set a DELAY variable;
- if they don't have one, use a default.
- - Modules are called and bar is updated when a module finishes, but an
- internal bar clock updates the clock at a specific delay.
diff --git a/dwm/dwmbar/bar.sh b/dwm/dwmbar/bar.sh
deleted file mode 100755
index f396834..0000000
--- a/dwm/dwmbar/bar.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-# Copyright 2019 Archie Hilton
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-if [[ ! -z $CACHE_DIR ]]; then
- OUTPUT_CACHE="$CACHE_DIR"
-else
- OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
-fi
-
-source "$CONFIG_FILE"
-
-OUTPUT=""
-
-get_bar()
-{
- for module in $MODULES; do
- if [[ $INTERNET -eq 0 ]] || [[ $ONLINE_MODULES != *"$module"* ]];then
- module_out="$(cat "$OUTPUT_CACHE""$module" | sed 's/\.$//g')"
- bar="$bar$module_out"
- fi
- done
- # Uncomment to remove last separator
- # bar="$(echo "$bar" | sed 's/.$//g')"
- echo "$LEFT_PADDING${bar::-2}$RIGHT_PADDING"
-}
-
-run_module()
-{
- if [[ -f "$CUSTOM_DIR$1" ]]
- then
- out="$("$CUSTOM_DIR""$1")"
- else
- out="$("$DEFAULT_MODULES_DIR""$1")"
- fi
-
- if [[ "$out" = " " ]]; then
- echo "" > "$OUTPUT_CACHE$module"
- elif [[ ! "$out" = "" ]]; then
- out="$out$SEPARATOR."
- echo "$out" > "$OUTPUT_CACHE$module"
- fi
-}
-
-run()
-{
- for module in $MODULES; do
- [[ ! -f "$OUTPUT_CACHE$module" ]] && touch "$OUTPUT_CACHE$module"
- pgrep "$module" &> /dev/null
- notrunning=$([[ $? -eq 1 ]])
- if $notrunning && [[ $INTERNET -eq 0 ]]; then
- run_module "$module"
- elif $notrunning && [[ $INTERNET -eq 1 ]]; then
- [[ "$ONLINE_MODULES" != *"$module"* ]] && run_module "$module"
- fi
- done
-
- get_bar
- sleep "$DELAY";
-}
-
-run
diff --git a/dwm/dwmbar/config b/dwm/dwmbar/config
deleted file mode 100644
index b89c22e..0000000
--- a/dwm/dwmbar/config
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# What modules, in what order
-MODULES="weather volume disksize wifi internet cpuload ram cputemp date time"
-
-# Modules that require an active internet connection
-ONLINE_MODULES="weather internet"
-
-# Delay between showing the status bar
-DELAY="0.05"
-
-# Where the custom modules are stored
-CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/"
-
-# Separator between modules
-SEPARATOR=" | "
-
-# Padding at the end and beginning of the status bar
-RIGHT_PADDING=" "
-LEFT_PADDING=" "
diff --git a/dwm/dwmbar/dwmbar b/dwm/dwmbar/dwmbar
deleted file mode 100755
index ba0de22..0000000
--- a/dwm/dwmbar/dwmbar
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/bash
-# Copyright 2019 Archie Hilton
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-VERSION="1.0"
-
-DEFAULT_CONFIG_DIR="/usr/share/dwmbar"
-export DEFAULT_CONFIG_DIR
-DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules/"
-export DEFAULT_MODULES_DIR
-DEFAULT_BAR_LOCATION="$DEFAULT_CONFIG_DIR/bar.sh"
-export DEFAULT_BAR_LOCATION
-DEFAULT_CONFIG_LOCATION="$DEFAULT_CONFIG_DIR/config"
-export DEFAULT_CONFIG_LOCATION
-
-CONFIG_DIR="/home/$USER/.config/dwmbar/"
-export CONFIG_DIR
-
-CUSTOM_DIR="$CONFIG_DIR/custom/"
-export CUSTOM_DIR
-
-CONFIG_FILE="$CONFIG_DIR/config"
-if [[ ! -f "$CONFIG_FILE" ]]; then
- CONFIG_FILE=$DEFAULT_CONFIG_LOCATION
-fi
-export CONFIG_FILE
-
-CACHE_DIR="$HOME/.cache/dwmbar/"
-export CACHE_DIR
-
-INTERNET=1 # No internet
-export INTERNET
-
-print_help(){
- echo "dwmbar $VERSION
--v Display this help message.
--c Copy default files to /home/$USER/.config/dwmbar
-"
-}
-
-copy_usr_to_home(){
- mkdir -p "$CUSTOM_DIR"
- cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR"
-}
-
-check_files(){
- if [[ ! -d "$DEFAULT_CONFIG_DIR" ]]; then
- echo "$DEFAULT_CONFIG_DIR does not exist." > /dev/stderr
- exit 1
- fi
-
- if [[ ! -d "$DEFAULT_MODULES_DIR" ]]; then
- echo "$DEFAULT_MODULES_DIR does not exist." > /dev/stderr
- exit 1
- fi
-
- if [[ ! -d "$CACHE_DIR" ]]; then
- mkdir -p "$CACHE_DIR"
- fi
-
- if [[ ! -f "$DEFAULT_BAR_LOCATION" ]]; then
- echo "$DEFAULT_BAR_LOCATION does not exist." > /dev/stderr
- exit 1
- fi
-
- if [[ ! -f "$DEFAULT_CONFIG_LOCATION" ]]; then
- echo "$DEFAULT_CONFIG_LOCATION does not exist." > /dev/stderr
- exit 1
- fi
-}
-
-while getopts 'vc' flag; do
- case "${flag}" in
- v) print_help
- exit 0 ;;
- c) copy_usr_to_home
- exit 0 ;;
- esac
-done
-
-check_internet() {
- wget --spider -q --timeout=2 www.google.com
- if [[ $? -eq 0 ]]; then
- echo 0
- else
- echo 1
- fi
-}
-
-check_files
-
-while :; do
- date=$(date +'%S')
- if [ $(( 10#$date % 5 )) -eq 0 ]; then
- INTERNET=$(check_internet)
- fi
- xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
-done
diff --git a/dwm/dwmbar/install.sh b/dwm/dwmbar/install.sh
deleted file mode 100755
index eb26b1d..0000000
--- a/dwm/dwmbar/install.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-# Copyright 2019 Archie Hilton
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-DWMBAR="/usr/bin/dwmbar"
-
-if [ "$EUID" -ne 0 ]
- then echo "Please run as root" > /dev/stderr
- exit 1
-fi
-
-if [[ ! -f "dwmbar" ]]; then
- echo "dwmbar executable not found." > /dev/stderr
- exit 1
-fi
-
-# Create /usr/share/dwmbar
-# Containing example bar.sh and modules
-
-mkdir --parents "/usr/share/dwmbar/"
-
-echo "./modules --> /usr/share/dwmbar/modules"
-cp -rT "./modules" "/usr/share/dwmbar/modules"
-
-echo "./bar.sh --> /usr/share/dwmbar/bar.sh"
-cp "./bar.sh" "/usr/share/dwmbar/bar.sh"
-
-echo "./config --> /usr/share/dwmbar/config"
-cp -r "./config" "/usr/share/dwmbar/config"
-
-echo "./dwmbar --> /usr/bin/dwmbar"
-cp "./dwmbar" "/usr/bin/dwmbar"
-[[ $? -eq 0 ]] && echo "Installation completed successfully"
diff --git a/dwm/dwmbar/modules/archupdates b/dwm/dwmbar/modules/archupdates
deleted file mode 100755
index d4cbc44..0000000
--- a/dwm/dwmbar/modules/archupdates
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# Prints out the number of pacman updates (Arch Linux)
-# Requires an internet connection
-# Depends on yay and checkupdates (pacman-contrib)
-# Optional: add --devel flag to the yay cmd to check for *-git package updates.
-
-PREFIX=' Updates: '
-
-get_updates()
-{
- if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
- updates_arch=0
- fi
-
- if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
- updates_aur=0
- fi
-
- updates=$(("$updates_arch" + "$updates_aur"))
-
- echo "$PREFIX$updates"
-}
-
-if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then
- get_updates
-fi
diff --git a/dwm/dwmbar/modules/backlight b/dwm/dwmbar/modules/backlight
deleted file mode 100755
index 2e4fe88..0000000
--- a/dwm/dwmbar/modules/backlight
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints the backlight percentage
-# Requires the light package
-
-PREFIX='ﯧ'
-
-get_backlight()
-{
- echo "$PREFIX $(light | sed 's/\..*//g')%"
-}
-
-get_backlight
diff --git a/dwm/dwmbar/modules/battery b/dwm/dwmbar/modules/battery
deleted file mode 100755
index 737290b..0000000
--- a/dwm/dwmbar/modules/battery
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# Prints out battery percentage
-
-CHARGING_ICON=' '
-WARNING_ICON=' '
-BATTERY_FULL_ICON=''
-BATTERY_2_ICON=''
-BATTERY_3_ICON=''
-BATTERY_4_ICON=''
-
-FULL_AT=98
-
-BAT_ICON=""
-ICON=""
-
-get_battery()
-{
- # The vast majority of people only use one battery.
-
- if [ -d /sys/class/power_supply/BAT0 ]; then
- capacity=$(cat /sys/class/power_supply/BAT0/capacity)
- charging=$(cat /sys/class/power_supply/BAT0/status)
- if [[ "$charging" == "Charging" ]]; then
- ICON="$CHARGING_ICON"
- elif [[ $capacity -le 25 ]]; then
- ICON="$WARNING_ICON"
- fi
-
- if [[ $capacity -ge $FULL_AT ]]; then
- BAT_ICON=$BATTERY_FULL_ICON
- elif [[ $capacity -le 25 ]]; then
- BAT_ICON=$BATTERY_4_ICON
- elif [[ $capacity -le 60 ]]; then
- BAT_ICON=$BATTERY_3_ICON
- elif [[ $capacity -le $FULL_AT ]]; then
- BAT_ICON=$BATTERY_2_ICON
- fi
- fi
- echo "$ICON$BAT_ICON $capacity%"
-}
-
-get_battery
diff --git a/dwm/dwmbar/modules/bluetooth b/dwm/dwmbar/modules/bluetooth
deleted file mode 100755
index 5dea2b0..0000000
--- a/dwm/dwmbar/modules/bluetooth
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# Prints out the bluetooth status
-
-BLUETOOTH_ON_ICON=''
-BLUETOOTH_OFF_ICON=''
-
-get_bluetooth()
-{
- status=$(systemctl is-active bluetooth.service)
-
- if [ "$status" == "active" ]
- then
- echo "$BLUETOOTH_ON_ICON"
- else
- :
- #echo "$BLUETOOTH_OFF_ICON"
- fi
-}
-
-get_bluetooth
diff --git a/dwm/dwmbar/modules/cpuload b/dwm/dwmbar/modules/cpuload
deleted file mode 100755
index 133a748..0000000
--- a/dwm/dwmbar/modules/cpuload
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Prints out the CPU load percentage
-
-PREFIX=' '
-
-get_load()
-{
- # Get the first line with aggregate of all CPUs
- cpu_last=($(head -n1 /proc/stat))
- cpu_last_sum="${cpu_last[@]:1}"
- cpu_last_sum=$((${cpu_last_sum// /+}))
-
- sleep 0.05
-
- cpu_now=($(head -n1 /proc/stat))
- cpu_sum="${cpu_now[@]:1}"
- cpu_sum=$((${cpu_sum// /+}))
-
- cpu_delta=$((cpu_sum - cpu_last_sum))
- cpu_idle=$((cpu_now[4]- cpu_last[4]))
- cpu_used=$((cpu_delta - cpu_idle))
- cpu_usage=$((100 * cpu_used / cpu_delta))
-
- # Keep this as last for our next read
- cpu_last=("${cpu_now[@]}")
- cpu_last_sum=$cpu_sum
-
- echo "$PREFIX $cpu_usage%"
-}
-
-get_load
diff --git a/dwm/dwmbar/modules/cputemp b/dwm/dwmbar/modules/cputemp
deleted file mode 100755
index da8f183..0000000
--- a/dwm/dwmbar/modules/cputemp
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Gets temperature of the CPU
-# Dependencies: lm_sensors
-
-PREFIX=' '
-FIRE=' '
-
-WARNING_LEVEL=80
-
-get_cputemp()
-{
- # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input)
- # CPU_TEMP=$(expr $CPU_T / 1000)
-
- CPU_TEMP="$(sensors | grep temp1 | awk 'NR==1{gsub("+", " "); gsub("\\..", " "); print $2}')"
-
- if [ "$CPU_TEMP" -ge $WARNING_LEVEL ]; then
- PREFIX="$FIRE$PREFIX"
- fi
-
- echo "$PREFIX$CPU_TEMP°C"
-}
-
-get_cputemp
diff --git a/dwm/dwmbar/modules/date b/dwm/dwmbar/modules/date
deleted file mode 100755
index cc5ccc2..0000000
--- a/dwm/dwmbar/modules/date
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints out the date
-
-PREFIX=''
-
-get_date()
-{
- echo "$PREFIX $(date '+%d-%m-%y (%a)')"
-}
-
-get_date
diff --git a/dwm/dwmbar/modules/day_of_week b/dwm/dwmbar/modules/day_of_week
deleted file mode 100755
index 160da42..0000000
--- a/dwm/dwmbar/modules/day_of_week
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints out the date
-
-PREFIX=''
-
-get_day()
-{
- echo "$PREFIX $(date '+%a')"
-}
-
-get_day
diff --git a/dwm/dwmbar/modules/daypercentage b/dwm/dwmbar/modules/daypercentage
deleted file mode 100755
index d97d6d8..0000000
--- a/dwm/dwmbar/modules/daypercentage
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python3
-
-PREFIX = ' '
-
-import datetime
-
-now = datetime.datetime.now()
-minutes = now.hour * 60 + now.minute
-percentage = round(minutes * 100 / 1440)
-
-print(PREFIX + str(percentage) + "%")
diff --git a/dwm/dwmbar/modules/default_shell b/dwm/dwmbar/modules/default_shell
deleted file mode 100755
index 913ccb2..0000000
--- a/dwm/dwmbar/modules/default_shell
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints out the name of the default shell
-
-PREFIX=' '
-
-get_default_shell()
-{
- echo "$PREFIX$(echo $SHELL |sed 's/.*\///g')"
-}
-
-get_default_shell
diff --git a/dwm/dwmbar/modules/disksize b/dwm/dwmbar/modules/disksize
deleted file mode 100755
index 8284894..0000000
--- a/dwm/dwmbar/modules/disksize
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Prints out the total disk memory and the available memory
-
-PREFIX=' '
-
-get_disk()
-{
- TOTAL_SIZE=$( df -h --total | rg 230 | awk {'printf $2'})
- USED_SIZE=$(df -h --total | rg 230 | awk {'printf $3'})
- PERCENTAGE=$(df -h --total | rg 230 | awk {'printf $5'})
-
- echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
-}
-
-get_disk
diff --git a/dwm/dwmbar/modules/ethernet b/dwm/dwmbar/modules/ethernet
deleted file mode 100755
index 0ebe572..0000000
--- a/dwm/dwmbar/modules/ethernet
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Prints out if there is an ethernet cable connected
-
-ETHERNET_ICON=''
-
-get_ethernet()
-{
- if [ -d /sys/class/net/eth? ]; then
- if [ "$(cat /sys/class/net/eth?/carrier)" == "1" ]; then
- echo "$ETHERNET_ICON"
- fi
- fi
-}
-
-get_ethernet
diff --git a/dwm/dwmbar/modules/fanspeed b/dwm/dwmbar/modules/fanspeed
deleted file mode 100755
index 8cc4c52..0000000
--- a/dwm/dwmbar/modules/fanspeed
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints the fan RPM
-# Depends on lm_sensors
-
-PREFIX=' '
-
-get_fan_speed()
-{
- echo "$PREFIX$(sensors | grep fan1 | awk 'NR==1{print $2}') RPM"
-}
-
-get_fan_speed
diff --git a/dwm/dwmbar/modules/hostname b/dwm/dwmbar/modules/hostname
deleted file mode 100755
index 41ec4fa..0000000
--- a/dwm/dwmbar/modules/hostname
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints USER@hostname
-
-PREFIX=' '
-
-get_hostname()
-{
- echo "$PREFIX$USER@$(hostname)"
-}
-
-get_hostname
diff --git a/dwm/dwmbar/modules/internet b/dwm/dwmbar/modules/internet
deleted file mode 100755
index 22cbd6a..0000000
Binary files a/dwm/dwmbar/modules/internet and /dev/null differ
diff --git a/dwm/dwmbar/modules/kernel b/dwm/dwmbar/modules/kernel
deleted file mode 100755
index 1ee3939..0000000
--- a/dwm/dwmbar/modules/kernel
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints out the kernel version
-
-PREFIX=' '
-
-get_kernel()
-{
- echo "$PREFIX$(uname -r)"
-}
-
-get_kernel
diff --git a/dwm/dwmbar/modules/localip b/dwm/dwmbar/modules/localip
deleted file mode 100755
index 91a74c0..0000000
--- a/dwm/dwmbar/modules/localip
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Prints out your local IP
-
-PREFIX='ﯱ '
-
-get_local_ip()
-{
- IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g')
-
- echo "$PREFIX$IP"
-}
-
-get_local_ip
diff --git a/dwm/dwmbar/modules/mail b/dwm/dwmbar/modules/mail
deleted file mode 100755
index 52660d5..0000000
--- a/dwm/dwmbar/modules/mail
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Prints number of unread mail
-# Requires mutt/neomutt
-
-MAIL_DIR="/home/$USER/Mail/INBOX/new/*"
-PREFIX=' :'
-
-get_mail()
-{
- echo "$PREFIX$(du -a $MAIL_DIR 2>/dev/null | wc -l)"
-}
-
-get_mail
diff --git a/dwm/dwmbar/modules/mpd b/dwm/dwmbar/modules/mpd
deleted file mode 100755
index ecbdd4e..0000000
--- a/dwm/dwmbar/modules/mpd
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-PREFIX_PLAY=' '
-PREFIX_PAUSE=' '
-
-get_mpd()
-{
- current_song="$(mpc current)"
-
- if [[ "$current_song" = "" ]]; then
- echo " "
- exit 0
- else
- playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}')
- if [[ "$playpause" = "[playing]" ]]; then
- current_song="$PREFIX_PLAY $current_song"
- elif [[ "$playpause" = "[paused]" ]]; then
- current_song="$PREFIX_PAUSE $current_song"
- fi
- fi
-
- echo "$current_song"
-}
-
-get_mpd
diff --git a/dwm/dwmbar/modules/networkdowntraffic b/dwm/dwmbar/modules/networkdowntraffic
deleted file mode 100755
index 76e8d8d..0000000
--- a/dwm/dwmbar/modules/networkdowntraffic
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-# Prints out the current down network traffic in MB
-
-PREFIX=' '
-
-get_down_traffic()
-{
- RECEIVE1=0
- RECEIVE2=0
-
- IFACES=$(ip -o link show | awk -F': ' '{print $2}')
- for IFACE in $IFACES; do
- if [ $IFACE != "lo" ]; then
- RECEIVE1=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECEIVE1))
- fi
- done
-
- sleep 1
-
- IFACES=$(ip -o link show | awk -F': ' '{print $2}')
- for IFACE in $IFACES; do
- if [ $IFACE != "lo" ]; then
- RECEIVE2=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECEIVE2))
- fi
- done
-
- echo "$PREFIX$(expr $(expr $RECEIVE2 - $RECEIVE1 ) / 1000)KB/s"
-}
-
-get_down_traffic
diff --git a/dwm/dwmbar/modules/networkuptraffic b/dwm/dwmbar/modules/networkuptraffic
deleted file mode 100755
index 396e969..0000000
--- a/dwm/dwmbar/modules/networkuptraffic
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Prints out the current up network traffic in MB
-
-PREFIX=' '
-
-get_up_traffic()
-{
- TRANSMIT1=0
- TRANSMIT2=0
-
- IFACES=$(ip -o link show | awk -F': ' '{print $2}')
- for IFACE in $IFACES; do
- if [ $IFACE != "lo" ]; then
- TRANSMIT1=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT1))
- fi
- done
-
- sleep 1
-
- IFACES=$(ip -o link show | awk -F': ' '{print $2}')
- for IFACE in $IFACES; do
- if [ $IFACE != "lo" ]; then
- TRANSMIT2=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT2))
- fi
- done
-
- echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000)KB/s"
-}
-
-get_up_traffic
-
diff --git a/dwm/dwmbar/modules/nvidia_gpu_temp b/dwm/dwmbar/modules/nvidia_gpu_temp
deleted file mode 100755
index 5fc26e7..0000000
--- a/dwm/dwmbar/modules/nvidia_gpu_temp
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# Gets temperature of the GPU
-# Dependencies: nvidia drivers and nvidia-settings
-
-PREFIX=' '
-FIRE=' '
-
-WARNING_LEVEL=80
-
-get_gputemp()
-{
- GPU_TEMP="$(nvidia-settings -q gpucoretemp -t | head -n 1)"
-
- if [ "$GPU_TEMP" -ge $WARNING_LEVEL ]; then
- PREFIX="$FIRE$PREFIX"
- fi
-
- echo "$PREFIX$GPU_TEMP°C"
-}
-
-get_gputemp
diff --git a/dwm/dwmbar/modules/os-release b/dwm/dwmbar/modules/os-release
deleted file mode 100755
index 165a7c3..0000000
--- a/dwm/dwmbar/modules/os-release
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Prints out your OS name
-
-PREFIX=' '
-
-get_os_name()
-{
- OS=$(cat /etc/os-release | head -n 1 | sed 's/NAME=//g')
-
- echo "$PREFIX$OS"
-}
-
-get_os_name
diff --git a/dwm/dwmbar/modules/process_count b/dwm/dwmbar/modules/process_count
deleted file mode 100755
index 7d4d0ca..0000000
--- a/dwm/dwmbar/modules/process_count
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Prints out your process count
-
-PREFIX=' '
-
-get_proc_count()
-{
- PROC_COUNT=$(ps -Al | wc -l)
-
- echo "$PREFIX$PROC_COUNT"
-}
-
-get_proc_count
diff --git a/dwm/dwmbar/modules/publicip b/dwm/dwmbar/modules/publicip
deleted file mode 100755
index bdcb6a1..0000000
--- a/dwm/dwmbar/modules/publicip
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints out your public IP address
-# Depends on curl
-
-PREFIX=' '
-
-get_pub_ip()
-{
- echo "$PREFIX$(curl -s ifconfig.co)"
-}
-
-get_pub_ip
diff --git a/dwm/dwmbar/modules/ram b/dwm/dwmbar/modules/ram
deleted file mode 100755
index 4fc567c..0000000
--- a/dwm/dwmbar/modules/ram
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Prints the total ram and used ram in Mb
-
-PREFIX=' '
-
-get_ram()
-{
- TOTAL_RAM=$(free -mh --si | awk {'print $2'} | head -n 2 | tail -1)
- USED_RAM=$(free -mh --si | awk {'print $3'} | head -n 2 | tail -1)
- MB="MB"
-
- echo "$PREFIX$USED_RAM/$TOTAL_RAM"
-}
-
-get_ram
diff --git a/dwm/dwmbar/modules/ram_perc b/dwm/dwmbar/modules/ram_perc
deleted file mode 100755
index 40c2b2f..0000000
--- a/dwm/dwmbar/modules/ram_perc
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints the total ram and used ram in Mb
-
-PREFIX=' '
-
-get_ram()
-{
- USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}')
- echo "$PREFIX$USED_RAM%"
-}
-
-get_ram
diff --git a/dwm/dwmbar/modules/redshift b/dwm/dwmbar/modules/redshift
deleted file mode 100755
index 69f3f9e..0000000
--- a/dwm/dwmbar/modules/redshift
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints out the screen color temperature
-# Requires the redshift package
-
-PREFIX=''
-
-get_redshift()
-{
- echo "$PREFIX$(redshift -p 2> /dev/null | grep "temp" | awk '{print $3}')"
-}
-
-get_redshift
diff --git a/dwm/dwmbar/modules/src/internet.c b/dwm/dwmbar/modules/src/internet.c
deleted file mode 100644
index 916445b..0000000
--- a/dwm/dwmbar/modules/src/internet.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include
-
-int main()
-{
- char *internet_icon = " ";
-
- printf("%s\n", internet_icon);
-
- return 0;
-}
diff --git a/dwm/dwmbar/modules/sunmoon b/dwm/dwmbar/modules/sunmoon
deleted file mode 100755
index 4bbc062..0000000
--- a/dwm/dwmbar/modules/sunmoon
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# Outputs sun if its daytime and moon if its nighttime
-# Requires the redshift package
-
-SUN_ICON='盛'
-MOON_ICON=''
-
-get_sunmoon()
-{
- if [[ $(redshift -p | grep "Period" | awk '{print $2}') == "Night" ]]; then
- echo "$MOON_ICON"
- else
- echo "$SUN_ICON"
- fi
-}
-
-get_sunmoon
diff --git a/dwm/dwmbar/modules/time b/dwm/dwmbar/modules/time
deleted file mode 100755
index dfd2400..0000000
--- a/dwm/dwmbar/modules/time
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Prints out the time
-
-PREFIX=' '
-
-get_time()
-{
- echo "$PREFIX$(date '+%H:%M')"
-}
-
-get_time
diff --git a/dwm/dwmbar/modules/todo b/dwm/dwmbar/modules/todo
deleted file mode 100755
index 09b00ca..0000000
--- a/dwm/dwmbar/modules/todo
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# Prints number of todos
-# Requires t todo manager (https://github.com/sjl/t)
-
-TASKS_DIR="/home/$USER/.todo"
-TASKS_NAME="tasks"
-PREFIX=': '
-
-get_todo()
-{
-echo "$PREFIX$(t --task-dir $TASKS_DIR --list $TASKS_NAME | wc -l)"
-}
-
-get_todo
diff --git a/dwm/dwmbar/modules/tor b/dwm/dwmbar/modules/tor
deleted file mode 100755
index 74ff5b1..0000000
--- a/dwm/dwmbar/modules/tor
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-# Prints if the tor service is enabled or not
-# Requires tor
-
-TOR_ENABLED='ﴣ'
-TOR_DISABLED=''
-
-get_tor()
-{
- status=$(systemctl is-active tor.service)
-
- if [ "$status" == "active" ]
- then
- echo "$TOR_ENABLED"
- else
- :
- #echo "$TOR_DISABLED"
- fi
-
-}
-
-get_tor
diff --git a/dwm/dwmbar/modules/uptime b/dwm/dwmbar/modules/uptime
deleted file mode 100755
index 2c771d4..0000000
--- a/dwm/dwmbar/modules/uptime
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# Prints the total ram and used ram in Mb
-
-PREFIX=''
-
-get_uptime()
-{
- UPTIME=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
- echo "$PREFIX$UPTIME"
-}
-
-get_uptime
diff --git a/dwm/dwmbar/modules/username b/dwm/dwmbar/modules/username
deleted file mode 100755
index 2527b37..0000000
--- a/dwm/dwmbar/modules/username
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Prints the effective username of the current user
-
-PREFIX=''
-
-get_username()
-{
- USERNAME=$(whoami)
-
- echo "$PREFIX $USERNAME"
-}
-
-get_username
\ No newline at end of file
diff --git a/dwm/dwmbar/modules/voidupdates b/dwm/dwmbar/modules/voidupdates
deleted file mode 100755
index 9411637..0000000
--- a/dwm/dwmbar/modules/voidupdates
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# Prints the number of updates for Void Linux
-
-PREFIX=' Updates: '
-
-get_updates()
-{
- if ! updates=$(xbps-install -Mun 2> /dev/null | wc -l ); then
- updates=0
- fi
-
- echo "$PREFIX$updates"
-}
-
-if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then
- get_updates
-fi
diff --git a/dwm/dwmbar/modules/volume b/dwm/dwmbar/modules/volume
deleted file mode 100755
index 6b5b96e..0000000
--- a/dwm/dwmbar/modules/volume
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Prints out the volume percentage
-
-VOLUME_ON_ICON=''
-VOLUME_MUTED_ICON=''
-
-get_volume(){
- curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
- volume=$(pactl get-sink-volume @DEFAULT_SINK@ | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1)
-
- if [ "${curStatus}" = 'Mute: yes' ]
- then
- echo "$VOLUME_MUTED_ICON $volume%"
- else
- echo "$VOLUME_ON_ICON $volume%"
- fi
-}
-
-get_volume
diff --git a/dwm/dwmbar/modules/volumebar b/dwm/dwmbar/modules/volumebar
deleted file mode 100755
index 219428d..0000000
--- a/dwm/dwmbar/modules/volumebar
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-# Prints out the volume percentage
-
-# Dependencies: bc
-
-VOLUME_WIDTH=9
-VOLUME_SLIDER='⬤'
-VOLUME_RAIL='◯'
-VOLUME_MUTED='muted'
-
-PREFIX=''
-
-# If volume is >100
-ALERT='!!!'
-
-get_volume(){
- active_sink=$(pacmd list-sinks | awk '/* index:/{print $3}')
- curStatus=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | awk '/muted/{ print $2}')
- volume=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | grep 'volume:' | grep -E -v 'base volume:' | awk -F : '{print $3}' | grep -o -P '.{0,3}%'| sed s/.$// | tr -d ' ')
- slider_position=$(python -c "print(($volume / 100) * $VOLUME_WIDTH)")
-
- if [ "${curStatus}" = 'yes' ]
- then
- echo "$VOLUME_MUTED"
- exit 0
- else
- for i in $(seq 1 $VOLUME_WIDTH); do
- [[ $i = $slider_position ]] && BAR=$BAR$VOLUME_SLIDER
- [[ $i < $slider_position ]] && BAR=$BAR$VOLUME_SLIDER
- [[ $i > $slider_position ]] && BAR=$BAR$VOLUME_RAIL
- done
- fi
-
- [[ $volume -gt 100 ]] && PREFIX=$PREFIX$ALERT
-
- echo "$PREFIX$BAR"
-}
-
-get_volume
diff --git a/dwm/dwmbar/modules/weather b/dwm/dwmbar/modules/weather
deleted file mode 100755
index 17d7eec..0000000
--- a/dwm/dwmbar/modules/weather
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# Deps:
-# curl
-
-
-get_weather()
-{
- curl -s v2.wttr.in/tomsk | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//'
-}
-
-
-if [ $(( 10#$(date '+%S') % 30 )) -eq 0 ]; then
- get_weather
-fi
diff --git a/dwm/dwmbar/modules/wifi b/dwm/dwmbar/modules/wifi
deleted file mode 100755
index 65ac03c..0000000
--- a/dwm/dwmbar/modules/wifi
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Gets the wifi status
-
-WIFI_FULL_ICON=' '
-WIFI_MID_ICON=' '
-WIFI_LOW_ICON=' '
-NO_WIFI_ICON=' '
-
-get_wifi()
-{
- if grep -q wl* "/proc/net/wireless"; then
- # Wifi quality percentage
- percentage=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70)}'| xargs)
- case $percentage in
- 0) echo $NO_WIFI_ICON;;
- 100|9[0-9]|8[0-9]|7[0-9]) echo "$WIFI_FULL_ICON" ;;
- 6[0-9]|5[0-9]|4[0-9]|3[0-9]) echo "$WIFI_MID_ICON" ;;
- 2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;;
- esac
- fi
-}
-
-get_wifi
diff --git a/dwm/dwmbar/res/example.png b/dwm/dwmbar/res/example.png
deleted file mode 100644
index 195c3bf..0000000
Binary files a/dwm/dwmbar/res/example.png and /dev/null differ
diff --git a/dwm/dwmbar/restart_dwmbar.sh b/dwm/dwmbar/restart_dwmbar.sh
deleted file mode 100755
index d765cf4..0000000
--- a/dwm/dwmbar/restart_dwmbar.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-sudo killall dwmbar
-dwmbar&
-
diff --git a/dwm/dwmbar/todo.md b/dwm/dwmbar/todo.md
deleted file mode 100644
index 9c04c43..0000000
--- a/dwm/dwmbar/todo.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# TODO
-
-- Separator optional between modules
-- Call all modules once on startup, then deal with delays
-- Different archupdates and arch AUR updates that write to the same file so you can use only 1 of them
diff --git a/dwm/dwmbar/uninstall.sh b/dwm/dwmbar/uninstall.sh
deleted file mode 100755
index 089158b..0000000
--- a/dwm/dwmbar/uninstall.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# Copyright 2019 Archie Hilton
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-if [ "$EUID" -ne 0 ]
- then echo "Please run as root"
- exit 1
-fi
-
-rm -rf "/usr/share/dwmbar"
-rm -f "/usr/bin/dwmbar"
-
-echo "Completed."
-echo "Please delete ~/.config/dwmbar manually, if desired."
diff --git a/dwm/fonts/JetBrainsMono.tar.xz b/dwm/fonts/JetBrainsMono.tar.xz
deleted file mode 100644
index 9fe72b7..0000000
Binary files a/dwm/fonts/JetBrainsMono.tar.xz and /dev/null differ
diff --git a/dwm/install.sh b/dwm/install.sh
deleted file mode 100755
index 820105d..0000000
--- a/dwm/install.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-# ---- colors ----
-RESET='\033[0m'
-GREEN='\033[0;32m'
-YELLOW='\033[0;33m'
-RED='\033[0;31m'
-# ----------------
-
-# -------- dwm ---------
-printf "$GREEN installing dwm...$RESET"
-cd ~/dotfiles/dwm/dwm
-sudo make clean install &> /dev/null
-if [ $? -eq 0 ]; then
- printf "[$GREEN ok $RESET]\n"
-else
- printf "[$RED err $RESET]\n"
-fi
-# ----------------------
-
-# ------- dwmbar -------
-printf "$GREEN installing dwmbar...$RESET"
-cd ~/dotfiles/dwm/dwmbar
-sudo ./install.sh &> /dev/null
-if [ $? -eq 0 ]; then
- printf "[$GREEN ok $RESET]\n"
-else
- printf "[$RED err $RESET]\n"
-fi
-# ----------------------
-
-#--------- slstatus ------------
-printf "$GREEN installing slstatus...$RESET"
-cd ~/dotfiles/dwm/slstatus
-sudo make clean install &> /dev/null
-if [ $? -eq 0 ]; then
- printf "[$GREEN ok $RESET]\n"
-else
- printf "[$RED err $RESET]\n"
-fi
-#-------------------------------
-
-#---------- st ------------------
-printf "$GREEN installing st terminal...$RESET"
-cd ~/dotfiles/dwm/st
-sudo make clean install &> /dev/null
-if [ $? -eq 0 ]; then
- printf "[$GREEN ok $RESET]\n"
-else
- printf "[$RED err $RESET]\n"
-fi
-#--------------------------------
-
-#---------- surf ------------------
-printf "$GREEN installing surf browser...$RESET"
-cd ~/dotfiles/dwm/surf
-sudo make clean install &> /dev/null
-if [ $? -eq 0 ]; then
- printf "[$GREEN ok $RESET]\n"
-else
- printf "[$RED err $RESET]\n"
-fi
-#----------------------------------
-
diff --git a/dwm/picom/.builds/freebsd.yml b/dwm/picom/.builds/freebsd.yml
deleted file mode 100644
index 41c3d92..0000000
--- a/dwm/picom/.builds/freebsd.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-image: freebsd/latest
-packages:
- - libev
- - libXext
- - libxcb
- - meson
- - pkgconf
- - cmake
- - xcb-util-renderutil
- - xcb-util-image
- - pixman
- - uthash
- - libconfig
- - libglvnd
- - dbus
- - pcre
-sources:
- - https://github.com/yshui/picom
-tasks:
- - setup: |
- cd picom
- CPPFLAGS="-I/usr/local/include" meson -Dunittest=true build
- - build: |
- cd picom
- ninja -C build
- - unittest: |
- cd picom
- ninja -C build test
diff --git a/dwm/picom/.circleci/config.yml b/dwm/picom/.circleci/config.yml
deleted file mode 100644
index 6c348fa..0000000
--- a/dwm/picom/.circleci/config.yml
+++ /dev/null
@@ -1,135 +0,0 @@
-executors:
- e:
- docker:
- - image: yshui/comptonci
- working_directory: "/tmp/workspace"
- environment:
- UBSAN_OPTIONS: "halt_on_error=1"
-
-version: 2.1
-commands:
- build:
- parameters:
- build-config:
- type: string
- default: ""
- cc:
- type: string
- default: cc
- steps:
- - restore_cache:
- keys:
- - source-v1-{{ .Branch }}-{{ .Revision }}
- - source-v1-{{ .Branch }}-
- - source-v1-
- - checkout
- - save_cache:
- key: source-v1-{{ .Branch }}-{{ .Revision }}
- paths:
- - ".git"
- - run:
- name: config
- command: CC=<< parameters.cc >> meson << parameters.build-config >> -Dunittest=true --werror . build
- - run:
- name: build
- command: ninja -vC build
-
-jobs:
- basic:
- executor: e
- steps:
- - build:
- build-config: -Dwith_docs=true -Db_coverage=true
- - persist_to_workspace:
- root: .
- paths:
- - .
- test:
- executor: e
- steps:
- - attach_workspace:
- at: /tmp/workspace
- - run:
- name: unit test
- command: ninja -vC build test
- - run:
- name: test config file parsing
- command: xvfb-run -s "-screen 0 640x480x24" build/src/picom --config picom.sample.conf --no-vsync --diagnostics
- - run:
- name: run testsuite
- command: tests/run_tests.sh build/src/picom
- - run:
- name: generate coverage reports
- command: cd build; find -name '*.gcno' -exec gcov -pb {} +
- - run:
- name: download codecov scripts
- command: curl -s https://codecov.io/bash > codecov.sh
- - run:
- name: upload coverage reports
- command: bash ./codecov.sh -X gcov
-
- minimal:
- executor: e
- steps:
- - build:
- build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
- release:
- executor: e
- steps:
- - build:
- build-config: --buildtype=release
- release-clang:
- executor: e
- steps:
- - build:
- cc: clang
- build-config: --buildtype=release
- nogl:
- executor: e
- steps:
- - build:
- build-config: -Dopengl=false
- noregex:
- executor: e
- steps:
- - build:
- build-config: -Dregex=false
- clang_basic:
- executor: e
- steps:
- - build:
- cc: clang
- clang_minimal:
- executor: e
- steps:
- - build:
- cc: clang
- build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
- clang_nogl:
- executor: e
- steps:
- - build:
- cc: clang
- build-config: -Dopengl=false
- clang_noregex:
- executor: e
- steps:
- - build:
- cc: clang
- build-config: -Dregex=false
-
-workflows:
- all_builds:
- jobs:
- - basic
- - clang_basic
- - minimal
- - clang_minimal
- - nogl
- - clang_nogl
- - release
- - release-clang
- - test:
- requires:
- - basic
-# vim: set sw=2 ts=8 et:
diff --git a/dwm/picom/.clang-format b/dwm/picom/.clang-format
deleted file mode 100644
index 82c938a..0000000
--- a/dwm/picom/.clang-format
+++ /dev/null
@@ -1,38 +0,0 @@
-BasedOnStyle: LLVM
-TabWidth: 8
-UseTab: ForIndentation
-BreakBeforeBraces: Attach
-#BreakStringLiterals: true
-IndentWidth: 8
-AlignAfterOpenBracket: Align
-ColumnLimit: 90
-#ExperimentalAutoDetectBinPacking: true
-BinPackArguments: true
-BinPackParameters: true
-#ReflowComments: true
-AlignTrailingComments: true
-SpacesBeforeTrailingComments: 8
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeParens: ControlStatements
-AllowShortIfStatementsOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: true
-AllowShortFunctionsOnASingleLine: false
-IndentCaseLabels: false
-IndentPPDirectives: None
-PenaltyReturnTypeOnItsOwnLine: 0
-PenaltyBreakAssignment: 0
-PenaltyBreakBeforeFirstCallParameter: 1
-PenaltyBreakComment: 1
-PenaltyBreakString: 36
-PenaltyExcessCharacter: 3
-PenaltyBreakFirstLessLess: 0
-PenaltyBreakTemplateDeclaration: 0
-BreakBeforeBinaryOperators: None
-IncludeCategories:
- - Regex: '<.*\.h>'
- Priority: 1
- - Regex: '".*\.h"'
- Priority: 2
-SortIncludes: true
-#ForEachMacros: [ list_for_each_entry, list_for_each_entry_safe, HASH_ITER ]
-#AlignConsecutiveAssignments: true
diff --git a/dwm/picom/.clang-tidy b/dwm/picom/.clang-tidy
deleted file mode 100644
index 7b59c22..0000000
--- a/dwm/picom/.clang-tidy
+++ /dev/null
@@ -1,21 +0,0 @@
-Checks: >
- readability-*,
- performance-*,
- modernize-*,
- google-readability-todo,
- cert-err34-c,
- cert-flp30-c,
- bugprone-*,
- misc-misplaced-const,
- misc-redundant-expression,
- misc-static-assert,
- -clang-analyzer-*,
- -readability-isolate-declaration,
- -readability-magic-numbers
-AnalyzeTemporaryDtors: false
-FormatStyle: file
-CheckOptions:
- - key: readability-magic-numbers.IgnoredIntegerValues
- value: 4;8;16;24;32;1;2;3;4096;65536;
- - key: readability-magic-numbers.IgnoredFloatingPointValues
- value: 255.0;1.0;
diff --git a/dwm/picom/.editorconfig b/dwm/picom/.editorconfig
deleted file mode 100644
index b40d8e8..0000000
--- a/dwm/picom/.editorconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-root = true
-[*.{c,h}]
-indent_style = tab
-indent_size = 8
-max_line_length = 90
diff --git a/dwm/picom/.github/issue_template.md b/dwm/picom/.github/issue_template.md
deleted file mode 100644
index 4aee88a..0000000
--- a/dwm/picom/.github/issue_template.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-### Platform
-
-
-### GPU, drivers, and screen setup
-
-
-### Environment
-
-
-### picom version
-
-
-
-Diagnostics
-
-
-
-
-### Configuration:
-
- Configuration file
-
-```
-// Paste your configuration here
-```
-
-
-### Steps of reproduction
-
-
-1.
-2.
-
-### Expected behavior
-
-### Current Behavior
-
-### Stack trace
-
-
-
-
-### Other details
-
diff --git a/dwm/picom/.github/pull_request_template.md b/dwm/picom/.github/pull_request_template.md
deleted file mode 100644
index 2dd690f..0000000
--- a/dwm/picom/.github/pull_request_template.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/dwm/picom/.github/workflows/codeql-analysis.yml b/dwm/picom/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index 8b65b61..0000000
--- a/dwm/picom/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: "CodeQL"
-
-on:
- push:
- branches: [next]
- pull_request:
- branches: [next]
-
-jobs:
- analyze:
- name: Analyze
- runs-on: ubuntu-latest
-
- strategy:
- fail-fast: false
- matrix:
- language: ['cpp', 'python']
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
- with:
- # We must fetch at least the immediate parents so that if this is
- # a pull request then we can checkout the head.
- fetch-depth: 2
-
- # If this run was triggered by a pull request event, then checkout
- # the head of the pull request instead of the merge commit.
- - run: git checkout HEAD^2
- if: ${{ github.event_name == 'pull_request' }}
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- with:
- languages: ${{ matrix.language }}
-
- # Install dependencies
- - run: sudo apt update && sudo apt install libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev meson ninja-build
- if: ${{ matrix.language == 'cpp' }}
-
- # Autobuild
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
diff --git a/dwm/picom/.github/workflows/coding-style-pr.yml b/dwm/picom/.github/workflows/coding-style-pr.yml
deleted file mode 100644
index e5b40c5..0000000
--- a/dwm/picom/.github/workflows/coding-style-pr.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: coding-style
-on: pull_request
-
-jobs:
- check:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - run: git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
- - uses: yshui/git-clang-format-lint@v1.11
- with:
- base: ${{ github.event.pull_request.base.sha }}
diff --git a/dwm/picom/.github/workflows/coding-style.yml b/dwm/picom/.github/workflows/coding-style.yml
deleted file mode 100644
index 79c7edc..0000000
--- a/dwm/picom/.github/workflows/coding-style.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: coding-style
-on: push
-
-jobs:
- check:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 2
- - uses: yshui/git-clang-format-lint@v1.12
- with:
- base: ${{ github.event.ref }}~1
diff --git a/dwm/picom/.gitignore b/dwm/picom/.gitignore
deleted file mode 100644
index 20b39d0..0000000
--- a/dwm/picom/.gitignore
+++ /dev/null
@@ -1,58 +0,0 @@
-# Build files
-.deps
-aclocal.m4
-autom4te.cache
-config.log
-config.status
-configure
-depcomp
-install-sh
-missing
-stamp-h1
-compton
-*.o
-*.d
-build/
-compile_commands.json
-build.ninja
-
-# language servers
-.ccls-cache
-.clangd
-.cache
-
-# CMake files
-compton-*.deb
-compton-*.rpm
-compton-*.tar.bz2
-release/
-_CPack_Packages/
-CMakeCache.txt
-CMakeFiles/
-cmake_install.cmake
-CPackSourceConfig.cmake
-install_manifest.txt
-
-
-# Vim files
-.sw[a-z]
-.*.sw[a-z]
-*~
-
-# Misc files
-core.*
-.gdb_history
-oprofile_data/
-compton.plist
-callgrind.out.*
-man/*.html
-man/*.1
-doxygen/
-.clang_complete
-.ycm_extra_conf.py
-.ycm_extra_conf.pyc
-/src/backtrace-symbols.[ch]
-/compton*.trace
-*.orig
-/tests/log
-/tests/testcases/__pycache__/
diff --git a/dwm/picom/.gitmodules b/dwm/picom/.gitmodules
deleted file mode 100644
index e69de29..0000000
diff --git a/dwm/picom/CONTRIBUTORS b/dwm/picom/CONTRIBUTORS
deleted file mode 100644
index 9512bf8..0000000
--- a/dwm/picom/CONTRIBUTORS
+++ /dev/null
@@ -1,85 +0,0 @@
-Sorted in alphabetical order
-Open an issue or pull request if you don't want your name listed here.
-
-Adam Jackson
-adelin-b
-Alexander Kapshuna
-Antonin Décimo
-Antonio Vivace
-Avi-D-coder
-Ben Friesen
-Bernd Busse
-Bert Gijsbers
-bhagwan
-Bodhi
-Brottweiler
-Carl Worth
-Christopher Jeffrey
-Corax26
-Dan Elkouby
-Dana Jansens
-Daniel Kwan
-Dave Airlie
-David Schlachter
-dolio
-Duncan
-Dylan Araps
-Einar Lielmanis
-Eric Anholt
-Greg Flynn
-Harish Rajagopal
-hasufell
-Ignacio Taranto
-Istvan Petres
-James Cloos
-Jamey Sharp
-Jan Beich
-Jarrad
-Javeed Shaikh
-Jerónimo Navarro
-jialeens
-Johnny Pribyl
-Keith Packard
-Kevin Kelley
-ktprograms
-Lukas Schmelzeisen
-mæp
-Mark Tiefenbruck
-Matthew Allum
-Maxim Solovyov
-Michael Reed
-Michele Lambertucci
-Namkhai Bourquin
-Nate Hart
-nia
-notfoss
-Omar Polo
-orbea
-@Paradigm0001
-Patrick Collins
-Peter Mattern
-Phil Blundell
-Que Quotion
-Rafael Kitover
-Richard Grenville
-Rytis Karpuska
-Samuel Hand
-Scott Leggett
-scrouthtv
-Sebastien Waegeneire
-Subhaditya Nath
-Tasos Sahanidis
-Thiago Kenji Okada
-Tilman Sauerbeck
-Tim van Dalen
-Tomas Janousek
-Tom Dörr
-Toni Jarjour
-Tuomas Kinnunen
-Uli Schlachter
-Walter Lapchynski
-Will Dietz
-XeCycle
-Yuxuan Shui
-zilrich
-ಠ_ಠ
diff --git a/dwm/picom/COPYING b/dwm/picom/COPYING
deleted file mode 100644
index f13a75b..0000000
--- a/dwm/picom/COPYING
+++ /dev/null
@@ -1,20 +0,0 @@
-picom - a compositor for X11
-
-Based on xcompmgr, originally written by Keith Packard, with modifications
-from several contributors (according to the xcompmgr man page): Matthew Allum,
-Eric Anholt, Dan Doel, Thomas Luebking, Matthew Hawn, Ely Levy, Phil Blundell,
-and Carl Worth. Menu transparency was implemented by Dana Jansens.
-
-Numerous contributions to picom from Richard Grenville.
-
-See the CONTRIBUTORS file for a complete list of contributors
-
-This source code is provided under:
-
- SPDX-License-Identifier: MPL-2.0 AND MIT
-
-And the preferred license for new source files in this project is:
-
- SPDX-License-Identifier: MPL-2.0
-
-You can find the text of the licenses in the LICENSES directory.
diff --git a/dwm/picom/Doxyfile b/dwm/picom/Doxyfile
deleted file mode 100644
index 741325c..0000000
--- a/dwm/picom/Doxyfile
+++ /dev/null
@@ -1,1808 +0,0 @@
-# Doxyfile 1.8.2
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
-
-PROJECT_NAME = "compton"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = doxygen
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip. Note that you specify absolute paths here, but also
-# relative paths, which will be relative from the directory where doxygen is
-# started.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension,
-# and language is one of the parsers supported by doxygen: IDL, Java,
-# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
-# C++. For instance to make doxygen treat .inc files as Fortran files (default
-# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
-# that for custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
-# comments according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you
-# can mix doxygen, HTML, and XML commands with Markdown formatting.
-# Disable only in case of backward compatibilities issues.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented classes,
-# or namespaces to their corresponding documentation. Such a link can be
-# prevented in individual cases by by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penalty.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will roughly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-SYMBOL_CACHE_SIZE = 0
-
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command , where is the value of
-# the FILE_VERSION_FILTER tag, and is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = src
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
-
-FILE_PATTERNS = *.c *.h
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command , where
-# is the value of the INPUT_FILTER tag, and is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
-
-FILTER_SOURCE_PATTERNS =
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C, C++ and Fortran comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If left blank doxygen will
-# generate a default style sheet. Note that it is recommended to use
-# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
-# tag will in the future become obsolete.
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
-# user-defined cascading style sheet that is included after the standard
-# style sheets created by doxygen. Using this option one can overrule
-# certain style aspects. This is preferred over using HTML_STYLESHEET
-# since it does not replace the standard style sheet and is therefor more
-# robust against future updates. Doxygen will copy the style sheet file to
-# the output directory.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
-# entries shown in the various tree structured indices initially; the user
-# can expand and collapse entries dynamically later on. Doxygen will expand
-# the tree to such a level that at most the specified number of entries are
-# visible (unless a fully collapsed tree already exceeds this amount).
-# So setting the number of entries 1 will produce a full collapsed tree by
-# default. 0 is a special value representing an infinite number of entries
-# and will result in a full expanded tree by default.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
-# identify the documentation publisher. This should be a reverse domain-name
-# style string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-#
-# Qt Help Project / Custom Filters.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-#
-# Qt Help Project / Filter Attributes.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
-
-GENERATE_TREEVIEW = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you may also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to
-# the MathJax Content Delivery Network so you can quickly see the result without
-# installing MathJax.
-# However, it is strongly recommended to install a local
-# copy of MathJax from http://www.mathjax.org before deployment.
-
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
-
-MATHJAX_EXTENSIONS =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvantages are that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
-
-LATEX_FOOTER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = YES
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED = __attribute__(x)=
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. For each
-# tag file the location of the external documentation should be added. The
-# format of a tag file without this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths
-# or URLs. Note that each tag file must have a unique name (where the name does
-# NOT include the path). If a tag file is not located in the directory in which
-# doxygen is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS = 0
-
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside
-# the class node. If there are many fields or methods and many nodes the
-# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
-# threshold limits the number of items for each type to make the size more
-# manageable. Set this to 0 for no limit. Note that the threshold may be
-# exceeded by 50% before the limit is enforced.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
-
-INTERACTIVE_SVG = NO
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
-
-MSCFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/dwm/picom/History.md b/dwm/picom/History.md
deleted file mode 100644
index 8e5a9b4..0000000
--- a/dwm/picom/History.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# Picom History
-
-Picom was forked in 2016 from the original Compton because it seemed to have become unmaintained.
-
-The battle plan of the fork was to refactor it to make the code _possible_ to maintain, so potential contributors won't be scared away when they take a look at the code.
-
-And also to try to fix bugs.
-
-## Rename
-
-In 2019 the project name was changed from Compton to picom (git revision 8ddbeb and following).
-
-### Rationale
-
-Since the inception of this fork, the existence of two compton repositories has caused some number of confusions. Mainly, people will report issues of this fork to the original compton, or report issues of the original compton here. Later, when distros started packaging this fork of compton, some wanted to differentiate the newer compton from the older version. They found themselves having no choice but to invent a name for this fork. This is less than ideal since this has the potential to cause more confusions among users.
-
-Therefore, we decided to move this fork to a new name. Personally, I consider this more than justified since this version of compton has gone through significant changes since it was forked.
-
-### The name
-
-The criteria for a good name were
-
-0. Being short, so it's easy to remember.
-1. Pronounceability, again, helps memorability
-2. Searchability, so when people search the name, it's easy for them to find this repository.
-
-Of course, choosing a name is never easy, and there is no apparent way to objectively evaluate the names. Yet, we have to solve the aforementioned problems as soon as possible.
-
-In the end, we picked `picom` (a portmanteau of `pico` and `composite`) as our new name. This name might not be perfect, but is what we will move forward with unless there's a compelling reason not to.
-
-
-# Compton
-
-This is a copy of the README of the [original Compton project](https://github.com/chjj/compton/).
-
-[](https://gitter.im/chjj/compton?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-__Compton__ is a compositor for X, and a fork of __xcompmgr-dana__.
-
-I was frustrated by the low amount of standalone lightweight compositors.
-Compton was forked from Dana Jansens' fork of xcompmgr and refactored. I fixed
-whatever bug I found, and added features I wanted. Things seem stable, but don't
-quote me on it. I will most likely be actively working on this until I get the
-features I want. This is also a learning experience for me. That is, I'm
-partially doing this out of a desire to learn Xlib.
-
-## Changes from xcompmgr:
-
-* OpenGL backend (`--backend glx`), in addition to the old X Render backend.
-* Inactive window transparency (`-i`) / dimming (`--inactive-dim`).
-* Titlebar/frame transparency (`-e`).
-* Menu transparency (`-m`, thanks to Dana).
-* shadows are now enabled for argb windows, e.g. terminals with transparency
-* removed serverside shadows (and simple compositing) to clean the code,
- the only option that remains is clientside shadows
-* configuration files (see the man page for more details)
-* colored shadows (`--shadow-[red/green/blue]`)
-* a new fade system
-* VSync support (not always working)
-* Blur of background of transparent windows, window color inversion (bad in performance)
-* Some more options...
-
-## Fixes from the original xcompmgr:
-
-* fixed a segfault when opening certain window types
-* fixed a memory leak caused by not freeing up shadows (from the freedesktop
- repo)
-* fixed the conflict with chromium and similar windows
-* [many more](https://github.com/chjj/compton/issues)
-
-## Building
-
-### Dependencies:
-
-__B__ for build-time
-
-__R__ for runtime
-
-* libx11 (B,R)
-* libxcomposite (B,R)
-* libxdamage (B,R)
-* libxfixes (B,R)
-* libXext (B,R)
-* libxrender (B,R)
-* libXrandr (B,R)
-* libXinerama (B,R) (Can be disabled with `NO_XINERAMA` at compile time)
-* pkg-config (B)
-* make (B)
-* xproto / x11proto (B)
-* sh (R)
-* xprop,xwininfo / x11-utils (R)
-* libpcre (B,R) (Can be disabled with `NO_REGEX_PCRE` at compile time)
-* libconfig (B,R) (Can be disabled with `NO_LIBCONFIG` at compile time)
-* libdrm (B) (Can be disabled with `NO_VSYNC_DRM` at compile time)
-* libGL (B,R) (Can be disabled with `NO_VSYNC_OPENGL` at compile time)
-* libdbus (B,R) (Can be disabled with `NO_DBUS` at compile time)
-* asciidoc (B) (and docbook-xml-dtd-4.5, libxml-utils, libxslt, xsltproc, xmlto, etc. if your distro doesn't pull them in)
-
-### How to build
-
-To build, make sure you have the dependencies above:
-
-```bash
-# Make the main program
-$ make
-# Make the man pages
-$ make docs
-# Install
-$ make install
-```
-
-(Compton does include a `_CMakeLists.txt` in the tree, but we haven't decided whether we should switch to CMake yet. The `Makefile` is fully usable right now.)
-
-## Known issues
-
-* Our [FAQ](https://github.com/chjj/compton/wiki/faq) covers some known issues.
-
-* VSync does not work too well. You may check the [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide) for how to get (possibly) better effects.
-
-* If `--unredir-if-possible` is enabled, when compton redirects/unredirects windows, the screen may flicker. Using `--paint-on-overlay` minimizes the problem from my observation, yet I do not know if there's a cure.
-
-* compton may not track focus correctly in all situations. The focus tracking code is experimental. `--use-ewmh-active-win` might be helpful.
-
-* The performance of blur under X Render backend might be pretty bad. OpenGL backend could be faster.
-
-* With `--blur-background` you may sometimes see weird lines around damaged area. `--resize-damage YOUR_BLUR_RADIUS` might be helpful in the case.
-
-## Usage
-
-Please refer to the Asciidoc man pages (`man/compton.1.asciidoc` & `man/compton-trans.1.asciidoc`) for more details and examples.
-
-Note a sample configuration file `compton.sample.conf` is included in the repository.
-
-## Support
-
-* Bug reports and feature requests should go to the "Issues" section above.
-
-* Our (semi?) official IRC channel is #compton on FreeNode.
-
-* Some information is available on the wiki, including [FAQ](https://github.com/chjj/compton/wiki/faq), [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide), and [Performance Guide](https://github.com/chjj/compton/wiki/perf-guide).
-
-## License
-
-Although compton has kind of taken on a life of its own, it was originally
-an xcompmgr fork. xcompmgr has gotten around. As far as I can tell, the lineage
-for this particular tree is something like:
-
-* Keith Packard (original author)
-* Matthew Hawn
-* ...
-* Dana Jansens
-* chjj and richardgv
-
-Not counting the tens of people who forked it in between.
-
-Compton is distributed under MIT license, as far as I (richardgv) know. See LICENSE for more info.
diff --git a/dwm/picom/LICENSE.spdx b/dwm/picom/LICENSE.spdx
deleted file mode 100644
index 83aa2da..0000000
--- a/dwm/picom/LICENSE.spdx
+++ /dev/null
@@ -1,4 +0,0 @@
-SPDXVersion: SPDX-2.1
-DataLicense: CC0-1.0
-PackageName: picom
-PackageLicenseDeclared: MPL-2.0 AND MIT
diff --git a/dwm/picom/LICENSES/MIT b/dwm/picom/LICENSES/MIT
deleted file mode 100644
index 1f95d26..0000000
--- a/dwm/picom/LICENSES/MIT
+++ /dev/null
@@ -1,5 +0,0 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/dwm/picom/LICENSES/MPL-2.0 b/dwm/picom/LICENSES/MPL-2.0
deleted file mode 100644
index 14e2f77..0000000
--- a/dwm/picom/LICENSES/MPL-2.0
+++ /dev/null
@@ -1,373 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
- means each individual or legal entity that creates, contributes to
- the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
- means the combination of the Contributions of others (if any) used
- by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
- means Source Code Form to which the initial Contributor has attached
- the notice in Exhibit A, the Executable Form of such Source Code
- Form, and Modifications of such Source Code Form, in each case
- including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- (a) that the initial Contributor has attached the notice described
- in Exhibit B to the Covered Software; or
-
- (b) that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the
- terms of a Secondary License.
-
-1.6. "Executable Form"
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
- means a work that combines Covered Software with other material, in
- a separate file or files, that is not Covered Software.
-
-1.8. "License"
- means this document.
-
-1.9. "Licensable"
- means having the right to grant, to the maximum extent possible,
- whether at the time of the initial grant or subsequently, any and
- all of the rights conveyed by this License.
-
-1.10. "Modifications"
- means any of the following:
-
- (a) any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered
- Software; or
-
- (b) any new file in Source Code Form that contains any Covered
- Software.
-
-1.11. "Patent Claims" of a Contributor
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the
- License, by the making, using, selling, offering for sale, having
- made, import, or transfer of either its Contributions or its
- Contributor Version.
-
-1.12. "Secondary License"
- means either the GNU General Public License, Version 2.0, the GNU
- Lesser General Public License, Version 2.1, the GNU Affero General
- Public License, Version 3.0, or any later versions of those
- licenses.
-
-1.13. "Source Code Form"
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that
- controls, is controlled by, or is under common control with You. For
- purposes of this definition, "control" means (a) the power, direct
- or indirect, to cause the direction or management of such entity,
- whether by contract or otherwise, or (b) ownership of more than
- fifty percent (50%) of the outstanding shares or beneficial
- ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
- for sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
- or
-
-(b) for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
- Form, as described in Section 3.1, and You must inform recipients of
- the Executable Form how they can obtain a copy of such Source Code
- Form by reasonable means in a timely manner, at a charge no more
- than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter
- the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-* *
-* 6. Disclaimer of Warranty *
-* ------------------------- *
-* *
-* Covered Software is provided under this License on an "as is" *
-* basis, without warranty of any kind, either expressed, implied, or *
-* statutory, including, without limitation, warranties that the *
-* Covered Software is free of defects, merchantable, fit for a *
-* particular purpose or non-infringing. The entire risk as to the *
-* quality and performance of the Covered Software is with You. *
-* Should any Covered Software prove defective in any respect, You *
-* (not any Contributor) assume the cost of any necessary servicing, *
-* repair, or correction. This disclaimer of warranty constitutes an *
-* essential part of this License. No use of any Covered Software is *
-* authorized under this License except under this disclaimer. *
-* *
-************************************************************************
-
-************************************************************************
-* *
-* 7. Limitation of Liability *
-* -------------------------- *
-* *
-* Under no circumstances and under no legal theory, whether tort *
-* (including negligence), contract, or otherwise, shall any *
-* Contributor, or anyone who distributes Covered Software as *
-* permitted above, be liable to You for any direct, indirect, *
-* special, incidental, or consequential damages of any character *
-* including, without limitation, damages for lost profits, loss of *
-* goodwill, work stoppage, computer failure or malfunction, or any *
-* and all other commercial damages or losses, even if such party *
-* shall have been informed of the possibility of such damages. This *
-* limitation of liability shall not apply to liability for death or *
-* personal injury resulting from such party's negligence to the *
-* extent applicable law prohibits such limitation. Some *
-* jurisdictions do not allow the exclusion or limitation of *
-* incidental or consequential damages, so this exclusion and *
-* limitation may not apply to You. *
-* *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
- This Source Code Form is "Incompatible With Secondary Licenses", as
- defined by the Mozilla Public License, v. 2.0.
diff --git a/dwm/picom/README.md b/dwm/picom/README.md
deleted file mode 100644
index 58343a5..0000000
--- a/dwm/picom/README.md
+++ /dev/null
@@ -1,136 +0,0 @@
-picom
-=====
-
-__picom__ is a compositor for X, and a [fork of Compton](History.md).
-
-**This is a development branch, bugs to be expected**
-
-You can leave your feedback or thoughts in the [discussion tab](https://github.com/yshui/picom/discussions).
-
-## About this Fork
-
-Extended animation support (auto, fly-in, zoom, squeeze, slide-up, slide-down, slide-left, slide-right) from original [repo](https://github.com/dccsillag/picom) by @dccsillag, added slide-out, slide-in for workspace switching with [Custom Fluxbox](https://github.com/pijulius/fluxbox/commit/83ee4dbee67a68fe38b0f96431473719e165bf1e) , animation on window type basis (for e.g. make transient windows like "about us" slide down and slide backup to the titlebar of the owner window), animation-exclude list for disabling animations on window/program basis and some fixes.
-
-Reason: original picom by @yshui [repo](https://github.com/yshui/picom/) didn't have animation support and @dccsillag implementation was the best could find so building uppon his work this repo was made. FYI: looks like original picom will have animation support starting with version 12 but will keep this repo as atm looks like the animation here are smoother/better (of course everyone's own point of view) and had some trouble with the latest picom so till find out the reasons will use this repo personally and everyone is velcome to do so.
-
-**Would like to thank everyone working on all 3 repos of picom as without their work we (old timers) wouldn't have a good compositor so thank you guys for your hard work/time to keep it updated and maintenanced regularly!**
-
-**IMPORTANT**: always run picom with `--experimental-backends` argument as otherwise animations won't really look good.
-
-## Call for testers
-
-### `--experimental-backends`
-
-This flag enables the refactored/partially rewritten backends.
-
-Currently, new backends feature better vsync with the xrender backend and improved input lag with the glx backend (for non-NVIDIA users). The performance should be on par with the old backends.
-
-New backend features will only be implemented on the new backends from now on, and the old backends will eventually be phased out after the new backends stabilize.
-
-To test the new backends, add the `--experimental-backends` flag to the command you use to run picom. This flag is not available from the configuration file.
-
-To report issues with the new backends, please state explicitly you are using the new backends in your report.
-
-## Change Log
-
-See [Releases](https://github.com/yshui/picom/releases)
-
-## Build
-
-### Dependencies
-
-Assuming you already have all the usual building tools installed (e.g. gcc, python, meson, ninja, etc.), you still need:
-
-* libx11
-* libx11-xcb
-* libXext
-* xproto
-* xcb
-* xcb-damage
-* xcb-xfixes
-* xcb-shape
-* xcb-renderutil
-* xcb-render
-* xcb-randr
-* xcb-composite
-* xcb-image
-* xcb-present
-* xcb-xinerama
-* xcb-glx
-* pixman
-* libdbus (optional, disable with the `-Ddbus=false` meson configure flag)
-* libconfig (optional, disable with the `-Dconfig_file=false` meson configure flag)
-* libGL (optional, disable with the `-Dopengl=false` meson configure flag)
-* libpcre (optional, disable with the `-Dregex=false` meson configure flag)
-* libev
-* uthash
-
-On Debian based distributions (e.g. Ubuntu), the needed packages are
-
-```
-libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev meson
-```
-
-On Fedora, the needed packages are
-
-```
-dbus-devel gcc git libconfig-devel libdrm-devel libev-devel libX11-devel libX11-xcb libXext-devel libxcb-devel mesa-libGL-devel meson pcre-devel pixman-devel uthash-devel xcb-util-image-devel xcb-util-renderutil-devel xorg-x11-proto-devel
-```
-
-To build the documents, you need `asciidoc`
-
-### To build
-
-```bash
-$ git submodule update --init --recursive
-$ meson --buildtype=release . build
-$ ninja -C build
-```
-
-Built binary can be found in `build/src`
-
-If you have libraries and/or headers installed at non-default location (e.g. under `/usr/local/`), you might need to tell meson about them, since meson doesn't look for dependencies there by default.
-
-You can do that by setting the `CPPFLAGS` and `LDFLAGS` environment variables when running `meson`. Like this:
-
-```bash
-$ LDFLAGS="-L/path/to/libraries" CPPFLAGS="-I/path/to/headers" meson --buildtype=release . build
-
-```
-
-As an example, on FreeBSD, you might have to run meson with:
-```bash
-$ LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" meson --buildtype=release . build
-$ ninja -C build
-```
-
-### To install
-
-``` bash
-$ ninja -C build install
-```
-
-Default install prefix is `/usr/local`, you can change it with `meson configure -Dprefix= build`
-
-## How to Contribute
-
-### Code
-
-You can look at the [Projects](https://github.com/yshui/picom/projects) page, and see if there is anything that interests you. Or you can take a look at the [Issues](https://github.com/yshui/picom/issues).
-
-### Non-code
-
-Even if you don't want to contribute code, you can still contribute by compiling and running this branch, and report any issue you can find.
-
-Contributions to the documents and wiki will also be appreciated.
-
-## Contributors
-
-See [CONTRIBUTORS](CONTRIBUTORS)
-
-The README for the [original Compton project](https://github.com/chjj/compton/) can be found [here](History.md#Compton).
-
-## Licensing
-
-picom is free software, made available under the [MIT](LICENSES/MIT) and [MPL-2.0](LICENSES/MPL-2.0) software
-licenses. See the individual source files for details.
diff --git a/dwm/picom/bin/picom-trans b/dwm/picom/bin/picom-trans
deleted file mode 100755
index b686128..0000000
--- a/dwm/picom/bin/picom-trans
+++ /dev/null
@@ -1,407 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: MIT
-
-#
-# picom-trans
-# Copyright (c) 2021, Subhaditya Nath
-# Based on previous works of Christopher Jeffrey
-#
-
-#
-# Conforming to POSIX-1.2007
-# https://pubs.opengroup.org/onlinepubs/9699919799
-#
-
-# Usage:
-# $ picom-trans [options] [+|-]opacity
-# By window id
-# $ picom-trans -w "$WINDOWID" 75
-# By name
-# $ picom-trans -n "urxvt" 75
-# By current window
-# $ picom-trans -c 75
-# By selection
-# $ picom-trans 75
-# $ picom-trans -s 75
-# Increment current window 5%
-# $ picom-trans -c +5
-# Delete current window's opacity
-# $ picom-trans -c --delete
-# Toggle current window's opacity between 90 and unset
-# $ picom-trans -c --toggle 90
-# Reset all windows
-# $ picom-trans --reset
-
-
-# Save $0 now to print correct value while printing from functions.
-# Printing errormsgs from functions using "$0" prints the function name
-# instead of the executable name.
-EXE_NAME="$0"
-
-
-# Instead of printing the full path to this file (e.g. /usr/bin/picom-trans)
-# only print the base name (i.e. picom-trans)
-EXE_NAME="$(basename "$EXE_NAME")"
-
-
-print_usage()
-{ #{{
- echo "Usage: $EXE_NAME [options] [+|-]opacity"
- echo ""
- echo "Options:"
- echo " -h, --help Print this help message."
- echo " -o, --opacity OPACITY Specify the new opacity value in range 0-100 for the window. If"
- echo " prefixed with + or -, increment or decrement from the current"
- echo " opacity of the target window."
- echo ""
- echo "Actions:"
- echo " -g, --get Print current opacity of the target window."
- echo " -d, --delete Delete opacity of the target window."
- echo " -t, --toggle Toggle the target window's opacity, i.e. set if not already set"
- echo " and delete else."
- echo " -r, --reset Reset opacity for all windows."
- echo ""
- echo "Window Selection:"
- echo " -s, --select Select target window with mouse cursor. (DEFAULT)"
- echo " -c, --current Select the currently active window as target."
- echo " -n, --name WINDOW_NAME Specify and try to match a window name."
- echo " -w, --window WINDOW_ID Specify the window id of the target window."
-} #}}
-
-
-parse_args()
-{ #{{
- i=1 # because we start from "$1", not from "$0"
- while [ $i -le $# ]
- do
- #### [START] Convert GNU longopts to POSIX equivalents ####
- if [ "$1" = "--${1##--}" ] # check if $1 is a longopt
- then
- # Catch invalid options
- case "$1" in
- (--opacity=|--name=|--window=)
- echo "$EXE_NAME: option ${1%=} needs a value" >&2
- exit 1;;
- (--opacity|--name|--window)
- test $i -eq $# \
- && echo "$EXE_NAME: option $1 needs a value" >&2 \
- && exit 1;;
- esac
-
- # Separate "--ARG=VAL" into "--ARG" "VAL"
- case "$1" in
- (--opacity=*|--name=*|--window=*)
- ARG="$(echo "$1" | sed -E 's/(--[^=]+)=.*$/\1/')"
- VAL="${1##${ARG}=}"
- shift && set -- "$ARG" "$VAL" "$@"
- esac
-
- # Turn into short form
- case "$1" in
- (--help|--opacity|--get|--delete|--toggle|--reset|--select|--current|--name|--window)
- ARG=${1#-} # remove one '-' from prefix
- ARG="$(echo "$ARG" | cut -c -2)" # get first two characters
- shift && set -- "$ARG" "$@"
- esac
-
- # If the argument still starts with --, it is an invalid argument
- case "$1" in
- (--*)
- echo "$EXE_NAME: illegal option $1" >&2
- exit 1
- esac
- fi
- #### [END] Convert GNU longopts to POSIX equivalents ####
-
-
- #### [START] Prepend '-o' to standalone opacity values ####
- # Iterate over every argument and check if it is an opacity without the -o
- # option in the previous argument. If so, then prepend the -o option.
- # e.g. Turn this -
- # picom-trans -c +10 -s
- # into this -
- # picom-trans -c -o +10 -s
- #
- # NOTE: Don't touch arguments that are preceded by -o, -w, or -n (i.e. the
- # options that take a value.)
- # e.g. This -
- # picom-trans -w 75 -o 90
- # should NOT be turned into this -
- # picom-trans -w -o 75 -o 90
- # We ensure this by checking the "$#"th (i.e. the last) argument. If
- # argument is an option that needs a value, we don't do anything to $1.
- #
- # NOTE: we are using printf because most echo implementations aren't
- # POSIX-compliant. For example, according to POSIX.1-2017, echo doesn't
- # support any options, so,
- # $ echo "-n"
- # should output -
- # -n
- # But it doesn't. It instead interprets the "-n" as the option -n, which,
- # in most implementations, means that the trailing newline should not be
- # printed.
- if echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$' && \
- ! eval "printf '%s' \"\${$#}\"" | grep -q '^-[hdtrgsc]*[own]$'
- # NOTE: eval "printf '%s' \"\${$#}\"" means 'print the last argument'
- # NOTE: The letters inside the first square brackets (ie. hdtrgsc) are
- # the same as those in the getopts argument, minus those that are
- # followed by a ':'
- # NOTE: The letters inside the second square brackets (ie. own) are
- # the same as those in the getopts argument, minus those that are
- # NOT followed by a ':'
- then
- set -- "$@" "-o"
- i=$(( i + 1 ))
- fi
- #### [END] Prepend '-o' to standalone opacity values ####
-
-
- # Prepare for next iteration
- ARG="$1"
- shift && set -- "$@" "$ARG"
- i=$(( i + 1 ))
- done
-
-
- # NOTE: DO NOT ATTEMPT TO USE "$OPTIND" INSIDE THE getopts LOOP
- # - https://github.com/yshui/picom/pull/634#discussion_r654571535
- # - https://www.mail-archive.com/austin-group-l%40opengroup.org/msg04112.html
- OPTIND=1
- while getopts 'ho:dtrgsn:w:c' OPTION
- do
- case "$OPTION" in
- (h) print_usage; exit 0;;
- (o) target_opacity="$OPTARG";;
- (d) action=delete;;
- (t) action=toggle;;
- (r) action=reset;;
- (g) action=get;;
- (s) winidtype=; winid=;;
- (n) winidtype=-name; winid="$OPTARG";;
- (w) winidtype=-id; winid="$OPTARG";;
- (c) winidtype=-id; winid="$(get_focused_window_id)";;
- (\?) exit 1
- esac
- done
-} #}}
-
-
-get_target_window_id()
-{ #{{
-
- # Get the output of xwininfo
- if test -z "$winidtype"
- then xwininfo_output="$(xwininfo -children -frame)"
- elif test "$winidtype" = "-name"
- then xwininfo_output="$(xwininfo -children -name "$winid")"
- elif test "$winidtype" = "-id"
- then
- # First, check if supplied window id is valid
- if ! echo "$winid" | grep -Eiq '^[[:space:]]*(0x[[:xdigit:]]+|[[:digit:]]+)[[:space:]]*$'
- then
- echo "Bad window ID" >&2
- exit 1
- fi
- xwininfo_output="$(xwininfo -children -id "$winid")"
- fi
-
- # Extract window id from xwininfo output
- winid="$(echo "$xwininfo_output" | sed -n 's/^xwininfo:.*: \(0x[[:xdigit:]]*\).*$/\1/p')"
- if test -z "$winid"
- then
- echo "Failed to find window" >&2
- exit 1
- fi
-
- # Make sure it's not root window
- if echo "$xwininfo_output" | grep -Fq "Parent window id: 0x0"
- then
- echo "Cannot set opacity on root window" >&2
- exit 1
- fi
-
- # If it's not the topmost window, get the topmost window
- if ! echo "$xwininfo_output" | grep -q 'Parent window id: 0x[[:xdigit:]]* (the root window)'
- then
- window_tree="$(xwininfo -root -tree)"
- if test -z "$window_tree"
- then
- echo "Failed to get root window tree" >&2
- exit 1
- fi
-
- # Find the highest ancestor of the target window
- winid="$(echo "$window_tree" \
- | sed -n "/^\s*$winid/q;s/^ \(0x[[:xdigit:]]*\).*/\1/p" \
- | tail -n 1)"
- if test -z "$winid"
- then
- echo "Failed to find window in window tree" >&2
- exit 1
- fi
- fi
- if test -z "$winid"
- then
- echo "Failed to find the highest parent window below root of the selected window" >&2
- exit 1
- fi
-
- echo "$winid"
-} #}}
-
-get_focused_window_id()
-{ #{{
- id="$(xprop -root -notype -f _NET_ACTIVE_WINDOW 32x '$0' _NET_ACTIVE_WINDOW)"
- echo "${id#_NET_ACTIVE_WINDOW}"
-} #}}
-
-get_current_opacity()
-{ #{{
- # Gets current opacity in the range 0-100
- # Doesn't output anything if opacity isn't set
- cur="$(xprop -id "$winid" -notype -f _NET_WM_WINDOW_OPACITY 32c '$0' _NET_WM_WINDOW_OPACITY)"
- cur="${cur#_NET_WM_WINDOW_OPACITY}"
- cur="${cur%:*}"
- test -n "$cur" &&
- cur=$(( cur * 100 / 0xffffffff ))
- echo "$cur"
-} #}}
-
-
-get_opacity()
-{ #{{
- cur="$(get_current_opacity)"
- test -z "$cur" && cur=100 # Unset opacity means fully opaque
- echo "$cur"
- exit 0
-} #}}
-
-delete_opacity()
-{ #{{
- xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY
- exit 0
-} #}}
-
-reset_opacity() # Reset opacity of all windows
-{ #{{
- for winid in $(xwininfo -root -tree | sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p')
- do xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY 2>/dev/null
- done
- exit 0
-} #}}
-
-set_opacity()
-{ #{{
- if ! echo "$target_opacity" | grep -qE '^[+-]?[[:digit:]]+%?$'
- then
- if test -z "$target_opacity"
- then echo "No opacity specified" >&2
- else echo "Invalid opacity specified: $target_opacity" >&2
- fi
- exit 1
- fi
-
- # strip trailing '%' sign, if any
- target_opacity="${target_opacity%%%}"
-
- if echo "$target_opacity" | grep -q '^[+-]'
- then
- current_opacity="$(get_current_opacity)"
- test -z "$current_opacity" && current_opacity=100
- target_opacity=$(( current_opacity + target_opacity ))
- fi
-
- test $target_opacity -lt 0 && target_opacity=0
- test $target_opacity -gt 100 && target_opacity=100
-
- target_opacity=$(( target_opacity * 0xffffffff / 100 ))
- xprop -id "$winid" -f _NET_WM_WINDOW_OPACITY 32c \
- -set _NET_WM_WINDOW_OPACITY "$target_opacity"
-
- exit $?
-} #}}
-
-toggle_opacity()
-{ #{{
- # If opacity is currently set, unset it.
- # If opacity is currently unset, set opacity to the supplied value. If no
- # value is supplied, we default to 100%.
- if test -z "$(get_current_opacity)"
- then
- test -n "$target_opacity" || target_opacity=100
- set_opacity
- else
- delete_opacity
- fi
-} #}}
-
-
-# Warn about rename of compton to picom
-case "$0" in
- *compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >&2;;
-esac
-
-
-# Check if both xwininfo and xprop are available
-if ! command -v xprop >/dev/null || ! command -v xwininfo >/dev/null
-then
- echo "The command xwininfo or xprop is not available. They might reside in a package named xwininfo, xprop, x11-utils, xorg-xprop, or xorg-xwininfo" >&2
- exit 1
-fi
-
-
-# No arguments given. Show help.
-if test $# -eq 0
-then
- print_usage >&2
- exit 1
-fi
-
-
-# Variables
-# action is set to 'set' by default
-action=set
-winid=
-winidtype=
-target_opacity=
-
-# If there's only one argument, and it's a valid opacity
-# then take it as target_opacity. Else, parse all arguments.
-if test $# -eq 1 && echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$'
-then
- target_opacity=$1
- shift
-else
- parse_args "$@"
-fi
-
-
-# reset_opacity doesn't need $winid
-case $action in
- (reset) reset_opacity;;
-esac
-
-# Any other action needs $winid
-#
-# NOTE: Do NOT change the order of winid= and winidtype= below
-# the output of get_target_window_id depends on $winidtype
-#
-# NOTE: If get_target_window_id returns with a non-zero $?
-# that must mean that some error occured. So, exit with that same $?
-#
-winid=$(get_target_window_id) || exit $?
-winidtype=-id
-case $action in
- (set) set_opacity;;
- (get) get_opacity;;
- (delete) delete_opacity;;
- (toggle) toggle_opacity;;
-esac
-
-
-# We should never reach this part of the file
-echo "This sentence shouldn't have been printed. Please file a bug report." >&2
-exit 128
-
-
-# vim:ft=sh:ts=4:sts=4:sw=2:et:fdm=marker:fmr=#{{,#}}:nowrap
diff --git a/dwm/picom/compton-default-fshader-win.glsl b/dwm/picom/compton-default-fshader-win.glsl
deleted file mode 100644
index e319523..0000000
--- a/dwm/picom/compton-default-fshader-win.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-uniform float opacity;
-uniform bool invert_color;
-uniform sampler2D tex;
-
-void main() {
- vec4 c = texture2D(tex, gl_TexCoord[0]);
- if (invert_color)
- c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a);
- c *= opacity;
- gl_FragColor = c;
-}
diff --git a/dwm/picom/compton-fake-transparency-fshader-win.glsl b/dwm/picom/compton-fake-transparency-fshader-win.glsl
deleted file mode 100644
index 88e3653..0000000
--- a/dwm/picom/compton-fake-transparency-fshader-win.glsl
+++ /dev/null
@@ -1,19 +0,0 @@
-uniform float opacity;
-uniform bool invert_color;
-uniform sampler2D tex;
-
-void main() {
- vec4 c = texture2D(tex, gl_TexCoord[0]);
- {
- // Change vec4(1.0, 1.0, 1.0, 1.0) to your desired color
- vec4 vdiff = abs(vec4(1.0, 1.0, 1.0, 1.0) - c);
- float diff = max(max(max(vdiff.r, vdiff.g), vdiff.b), vdiff.a);
- // Change 0.8 to your desired opacity
- if (diff < 0.001)
- c *= 0.8;
- }
- if (invert_color)
- c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a);
- c *= opacity;
- gl_FragColor = c;
-}
diff --git a/dwm/picom/compton.desktop b/dwm/picom/compton.desktop
deleted file mode 100644
index 77734f1..0000000
--- a/dwm/picom/compton.desktop
+++ /dev/null
@@ -1,13 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Type=Application
-NoDisplay=true
-Name=compton
-GenericName=X compositor
-Comment=An X compositor
-Categories=Utility;
-Keywords=compositor;composite manager;window effects;transparency;opacity;
-TryExec=compton
-Exec=compton
-Icon=compton
-# Thanks to quequotion for providing this file!
diff --git a/dwm/picom/dbus-examples/cdbus-driver.sh b/dwm/picom/dbus-examples/cdbus-driver.sh
deleted file mode 100755
index 31a9b2f..0000000
--- a/dwm/picom/dbus-examples/cdbus-driver.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-if [ -z "$SED" ]; then
- SED="sed"
- command -v gsed > /dev/null && SED="gsed"
-fi
-
-# === Get connection parameters ===
-
-dpy=$(echo -n "$DISPLAY" | tr -c '[:alnum:]' _)
-
-if [ -z "$dpy" ]; then
- echo "Cannot find display."
- exit 1
-fi
-
-service="com.github.chjj.compton.${dpy}"
-interface='com.github.chjj.compton'
-object='/com/github/chjj/compton'
-type_win='uint32'
-type_enum='uint32'
-
-# === DBus methods ===
-
-# List all window ID compton manages (except destroyed ones)
-dbus-send --print-reply --dest="$service" "$object" "${interface}.list_win"
-
-# Get window ID of currently focused window
-focused=$(dbus-send --print-reply --dest="$service" "$object" "${interface}.find_win" string:focused | $SED -n 's/^[[:space:]]*'${type_win}'[[:space:]]*\([[:digit:]]*\).*/\1/p')
-
-if [ -n "$focused" ]; then
- # Get invert_color_force property of the window
- dbus-send --print-reply --dest="$service" "$object" "${interface}.win_get" "${type_win}:${focused}" string:invert_color_force
-
- # Set the window to have inverted color
- dbus-send --print-reply --dest="$service" "$object" "${interface}.win_set" "${type_win}:${focused}" string:invert_color_force "${type_enum}:1"
-else
- echo "Cannot find focused window."
-fi
-
-# Reset compton
-sleep 3
-dbus-send --print-reply --dest="$service" "$object" "${interface}.reset"
-
-# Undirect window
-sleep 3
-dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_set" string:redirected_force "${type_enum}:0"
-
-# Revert back to auto
-sleep 3
-dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_set" string:redirected_force "${type_enum}:2"
-
-# Force repaint
-dbus-send --print-reply --dest="$service" "$object" "${interface}.repaint"
diff --git a/dwm/picom/dbus-examples/inverter.sh b/dwm/picom/dbus-examples/inverter.sh
deleted file mode 100755
index e13cb2d..0000000
--- a/dwm/picom/dbus-examples/inverter.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-# == Declare stderr function ===
-
-stderr() {
- printf "\033[1;31m%s\n\033[0m" "$@" >&2
-}
-
-# === Verify `picom --dbus` status ===
-
-if [ -z "$(dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep compton)" ]; then
- stderr "picom DBus interface unavailable"
- if [ -n "$(pgrep picom)" ]; then
- stderr "picom running without dbus interface"
- #killall picom & # Causes all windows to flicker away and come back ugly.
- #picom --dbus & # Causes all windows to flicker away and come back beautiful
- else
- stderr "picom not running"
- fi
- exit 1
-fi
-
-# === Setup sed ===
-
-SED="${SED:-$(command -v gsed || printf 'sed')}"
-
-# === Get connection parameters ===
-
-dpy=$(printf "$DISPLAY" | tr -c '[:alnum:]' _)
-
-if [ -z "$dpy" ]; then
- stderr "Cannot find display."
- exit 1
-fi
-
-service="com.github.chjj.compton.${dpy}"
-interface="com.github.chjj.compton"
-picom_dbus="dbus-send --print-reply --dest="${service}" / "${interface}"."
-type_win='uint32'
-type_enum='uint32'
-
-# === Color Inversion ===
-
-# Get window ID of window to invert
-if [ -z "$1" -o "$1" = "selected" ]; then
- window=$(xwininfo -frame | sed -n 's/^xwininfo: Window id: \(0x[[:xdigit:]][[:xdigit:]]*\).*/\1/p') # Select window by mouse
-elif [ "$1" = "focused" ]; then
- # Ensure we are tracking focus
- window=$(${picom_dbus}find_win string:focused | $SED -n 's/^[[:space:]]*'${type_win}'[[:space:]]*\([[:digit:]]*\).*/\1/p') # Query picom for the active window
-elif echo "$1" | grep -Eiq '^([[:digit:]][[:digit:]]*|0x[[:xdigit:]][[:xdigit:]]*)$'; then
- window="$1" # Accept user-specified window-id if the format is correct
-else
- echo "$0" "[ selected | focused | window-id ]"
-fi
-
-# Color invert the selected or focused window
-if [ -n "$window" ]; then
- invert_status="$(${picom_dbus}win_get "${type_win}:${window}" string:invert_color | $SED -n 's/^[[:space:]]*boolean[[:space:]]*\([[:alpha:]]*\).*/\1/p')"
- if [ "$invert_status" = true ]; then
- invert=0 # Set the window to have normal color
- else
- invert=1 # Set the window to have inverted color
- fi
- ${picom_dbus}win_set "${type_win}:${window}" string:invert_color_force "${type_enum}:${invert}" &
-else
- stderr "Cannot find $1 window."
- exit 1
-fi
-exit 0
diff --git a/dwm/picom/desc.txt b/dwm/picom/desc.txt
deleted file mode 100644
index eadc037..0000000
--- a/dwm/picom/desc.txt
+++ /dev/null
@@ -1 +0,0 @@
-Compton is a X compositing window manager, fork of xcompmgr-dana.
diff --git a/dwm/picom/man/meson.build b/dwm/picom/man/meson.build
deleted file mode 100644
index 6324830..0000000
--- a/dwm/picom/man/meson.build
+++ /dev/null
@@ -1,13 +0,0 @@
-mans = ['picom.1', 'picom-trans.1']
-if get_option('with_docs')
- a2x = find_program('a2x')
- foreach m : mans
- custom_target(m, output: [m], input: [m+'.asciidoc'],
- command: [a2x, '-a',
- 'picom-version='+version,
- '--format', 'manpage', '@INPUT@', '-D',
- meson.current_build_dir()],
- install: true,
- install_dir: join_paths(get_option('mandir'), 'man1'))
- endforeach
-endif
diff --git a/dwm/picom/man/picom-trans.1.asciidoc b/dwm/picom/man/picom-trans.1.asciidoc
deleted file mode 100644
index 22b1dd2..0000000
--- a/dwm/picom/man/picom-trans.1.asciidoc
+++ /dev/null
@@ -1,114 +0,0 @@
-picom-trans(1)
-================
-:doctype: manpage
-:man source: picom
-:man version: {picom-version}
-:man manual: User Commands
-
-NAME
-----
-picom-trans - an opacity setter tool
-
-SYNOPSIS
---------
-
-*picom-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY'
-
-DESCRIPTION
------------
-
-*picom-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1).
-
-OPTIONS
--------
-*-w*, *--window*='WINDOW_ID'::
-Specify the window id of the target window.
-
-*-n*, *--name*='WINDOW_NAME'::
-Specify and try to match a window name.
-
-*-c*, *--current*::
-Specify the currently active window as target. Only works if EWMH '_NET_ACTIVE_WINDOW' property exists on root window.
-
-*-s*, *--select*::
-Select target window with mouse cursor. This is the default if no window has been specified.
-
-*-o*, *--opacity*='OPACITY'::
-Specify the new opacity value for the window. This value can be anywhere from 1-100. If it is prefixed with a plus or minus (+/-), this will increment or decrement from the target window's current opacity instead.
-
-*-g*, *--get*::
-Print the target window's opacity instead of setting it.
-
-*-d*, *--delete*::
-Delete opacity of the target window instead of setting it.
-
-*-t*, *--toggle*::
-Toggle the target window's opacity: Set opacity if not already set, and delete if already set.
-
-*-r*, *--reset*::
-Reset opacity for all windows instead of setting it.
-
-EXAMPLES
---------
-
-* Set the opacity of the window with specific window ID to 75%:
-+
-------------
-picom-trans -w "$WINDOWID" 75
-------------
-
-* Set the opacity of the window with the name "urxvt" to 75%:
-+
-------------
-picom-trans -n "urxvt" 75
-------------
-
-* Set current window to opacity of 75%:
-+
-------------
-picom-trans -c 75
-------------
-
-* Select target window and set opacity to 75%:
-+
-------------
-picom-trans -s 75
-------------
-
-* Increment opacity of current active window by 5%:
-+
-------------
-picom-trans -c +5
-------------
-
-* Decrement opacity of current active window by 5%:
-+
-------------
-picom-trans -c -- -5
-------------
-
-* Delete current window's opacity:
-+
-------------
-picom-trans -c --delete
-------------
-
-* Toggle current window's opacity between 90 and unset
-+
-------------
-picom-trans -c --toggle 90
-------------
-
-* Reset all windows:
-+
-------------
-picom-trans --reset
-------------
-
-BUGS
-----
-Please submit bug reports to .
-
-SEE ALSO
---------
-link:picom.1.html[*picom*(1)], *xprop*(1), *xwininfo*(1)
diff --git a/dwm/picom/man/picom.1.asciidoc b/dwm/picom/man/picom.1.asciidoc
deleted file mode 100644
index ccd7e43..0000000
--- a/dwm/picom/man/picom.1.asciidoc
+++ /dev/null
@@ -1,509 +0,0 @@
-picom(1)
-========
-:doctype: manpage
-:man source: picom
-:man version: {picom-version}
-:man manual: User Commands
-
-NAME
-----
-picom - a compositor for X11
-
-SYNOPSIS
---------
-*picom* ['OPTIONS']
-
-DESCRIPTION
------------
-picom is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.
-
-OPTIONS
--------
-*-h*, *--help*::
- Get the usage text embedded in program code, which may be more up-to-date than this man page.
-
-*-r*, *--shadow-radius*='RADIUS'::
- The blur radius for shadows, in pixels. (defaults to 12)
-
-*-o*, *--shadow-opacity*='OPACITY'::
- The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
-
-*-l*, *--shadow-offset-x*='OFFSET'::
- The left offset for shadows, in pixels. (defaults to -15)
-
-*-t*, *--shadow-offset-y*='OFFSET'::
- The top offset for shadows, in pixels. (defaults to -15)
-
-*-I*, *--fade-in-step*='OPACITY_STEP'::
- Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
-
-*-O*, *--fade-out-step*='OPACITY_STEP'::
- Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
-
-*-D*, *--fade-delta*='MILLISECONDS'::
- The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
-
-*-c*, *--shadow*::
- Enabled client-side shadows on windows. Note desktop windows (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, unless explicitly requested using the wintypes option.
-
-*-f*, *--fading*::
- Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used.
-
-*-F*::
- Equals to *-f*. Deprecated.
-
-*--animations*::
- Run animations for window geometry changes (movement and scaling).
- We use spring-based animations, which are parametrized by *--animation-stiffness*, *--animation-dampening*, *--animation-window-mass* and *--animation-clamp*. +
- A useful resource for selecting animation parameters is https://react-spring-visualizer.com/, which allows you to interactively try out various parameters and see the resulting animation curve. Or you can just edit the values in the config file, which is automatically reloaded.
-
-*--animation-for-open-window*::
- Which animation to run when opening a window. Must be one of `none`, `fly-in`, `zoom` (default: `none`).
-
-*--animation-stiffness*::
- Stiffness (a.k.a. tension) parameter for spring-based animation (default: 200.0).
-
-*--animation-dampening*::
- Dampening (a.k.a. friction) parameter for spring-based animation (default: 25.0).
-
-*--animation-window-mass*::
- Mass parameter for spring-based animation (default: 1.0).
-
-*--animation-clamping*::
- Whether to clamp animations (default: true).
-
- **NOTE:** With clamping disabled, on very low performance conditions (e.g., over 100ms to render an animation frame), windows may diverge. If this is your case, it is strongly advised to keep clamping on, as it protects against that.
-
-*-i*, *--inactive-opacity*='OPACITY'::
- Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
-
-*-e*, *--frame-opacity*='OPACITY'::
- Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
-
-*-b*, *--daemon*::
- Daemonize process. Fork to background after initialization. This option can only be set from the command line, setting this in the configuration file will have no effect.
-
-*--log-level*::
- Set the log level. Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using *--log-file*, since it can generate a huge stream of logs.
-
-*--log-file*::
- Set the log file. If *--log-file* is never specified, logs will be written to stderr. Otherwise, logs will to written to the given file, though some of the early logs might still be written to the stderr. When setting this option from the config file, it is recommended to use an absolute path.
-
-*--experimental-backends*::
- Use the new, reimplemented version of the backends. The new backends are HIGHLY UNSTABLE at this point, you have been warned. This option is not available in the config file.
-
-*--show-all-xerrors*::
- Show all X errors (for debugging).
-
-*--config* 'PATH'::
- Look for configuration file at the path. See *CONFIGURATION FILES* section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
-
-*--write-pid-path* 'PATH'::
- Write process ID to a file. it is recommended to use an absolute path.
-
-*--shadow-color* 'STRING'::
- Color of shadow, as a hex string ('#000000')
-
-*--shadow-red* 'VALUE'::
- Red color value of shadow (0.0 - 1.0, defaults to 0).
-
-*--shadow-green* 'VALUE'::
- Green color value of shadow (0.0 - 1.0, defaults to 0).
-
-*--shadow-blue* 'VALUE'::
- Blue color value of shadow (0.0 - 1.0, defaults to 0).
-
-*--inactive-opacity-override*::
- Let inactive opacity set by *-i* override the '_NET_WM_WINDOW_OPACITY' values of windows.
-
-*--active-opacity* 'OPACITY'::
- Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
-
-*--inactive-dim* 'VALUE'::
- Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
-
-*--corner-radius* 'VALUE'::
- Sets the radius of rounded window corners. When > 0, the compositor will round the corners of windows. Does not interact well with *--transparent-clipping*. (defaults to 0).
-
-*--rounded-corners-exclude* 'CONDITION'::
- Exclude conditions for rounded corners.
-
-*--mark-wmwin-focused*::
- Try to detect WM windows (a non-override-redirect window with no child that has 'WM_STATE') and mark them as active.
-
-*--mark-ovredir-focused*::
- Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
-
-*--no-fading-openclose*::
- Do not fade on window open/close.
-
-*--no-fading-destroyed-argb*::
- Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
-
-*--shadow-ignore-shaped*::
- Do not paint shadows on shaped windows. Note shaped windows here means windows setting its shape through X Shape extension. Those using ARGB background is beyond our control. Deprecated, use `--shadow-exclude 'bounding_shaped'` or `--shadow-exclude 'bounding_shaped && !rounded_corners'` instead.
-
-*--detect-rounded-corners*::
- Try to detect windows with rounded corners and don't consider them shaped windows. The accuracy is not very high, unfortunately.
-
-*--detect-client-opacity*::
- Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
-
-*--vsync*, *--no-vsync*::
- Enable/disable VSync.
-
-*--use-ewmh-active-win*::
- Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it.
-
-*--unredir-if-possible*::
- Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows.
-
-*--unredir-if-possible-delay* 'MILLISECONDS'::
- Delay before unredirecting the window, in milliseconds. Defaults to 0.
-
-*--unredir-if-possible-exclude* 'CONDITION'::
- Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
-
-*--shadow-exclude* 'CONDITION'::
- Specify a list of conditions of windows that should have no shadow.
-
-*--clip-shadow-above* 'CONDITION'::
- Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
-
-*--fade-exclude* 'CONDITION'::
- Specify a list of conditions of windows that should not be faded.
-
-*--focus-exclude* 'CONDITION'::
- Specify a list of conditions of windows that should always be considered focused.
-
-*--inactive-dim-fixed*::
- Use fixed inactive dim value, instead of adjusting according to window opacity.
-
-*--detect-transient*::
- Use 'WM_TRANSIENT_FOR' to group windows, and consider windows in the same group focused at the same time.
-
-*--detect-client-leader*::
- Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same group focused at the same time. This usually means windows from the same application will be considered focused or unfocused at the same time.'WM_TRANSIENT_FOR' has higher priority if *--detect-transient* is enabled, too.
-
-*--blur-method*, *--blur-size*, *--blur-deviation*, *--blur-strength*::
- Parameters for background blurring, see the *BLUR* section for more information.
-
-*--blur-background*::
- Blur background of semi-transparent / ARGB windows. Bad in performance, with driver-dependent behavior. The name of the switch may change without prior notifications.
-
-*--blur-background-frame*::
- Blur background of windows when the window frame is not opaque. Implies *--blur-background*. Bad in performance, with driver-dependent behavior. The name may change.
-
-*--blur-background-fixed*::
- Use fixed blur strength rather than adjusting according to window opacity.
-
-*--blur-kern* 'MATRIX'::
- Specify the blur convolution kernel, with the following format:
-+
-----
-WIDTH,HEIGHT,ELE1,ELE2,ELE3,ELE4,ELE5...
-----
-+
-In other words, the matrix is formatted as a list of comma separated numbers. The first two numbers must be integers, which specify the width and height of the matrix. They must be odd numbers. Then, the following 'width * height - 1' numbers specifies the numbers in the matrix, row by row, excluding the center element.
-+
-The elements are finite floating point numbers. The decimal pointer has to be '.' (a period), scientific notation is not supported.
-+
-The element in the center will either be 1.0 or varying based on opacity, depending on whether you have *--blur-background-fixed*. Yet the automatic adjustment of blur factor may not work well with a custom blur kernel.
-+
-A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like:
-+
-----
---blur-kern '7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.001723,0.059106,0.493069,0.493069,0.059106,0.001723,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003'
-----
-+
-May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Gaussian kernels are generated with sigma = 0.84089642 . If you find yourself needing to generate custom blur kernels, you might want to try the new blur configuration supported by the experimental backends (See *BLUR* and *--experimental-backends*).
-
-*--blur-background-exclude* 'CONDITION'::
- Exclude conditions for background blur.
-
-*--resize-damage* 'INTEGER'::
- Resize damaged region by a specific number of pixels. A positive value enlarges it while a negative one shrinks it. If the value is positive, those additional pixels will not be actually painted to screen, only used in blur calculation, and such. (Due to technical limitations, with *--use-damage*, those pixels will still be incorrectly painted to screen.) Primarily used to fix the line corruption issues of blur, in which case you should use the blur radius value here (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, with a 5x5 one you use `--resize-damage 2`, and so on). May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
-
-*--invert-color-include* 'CONDITION'::
- Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.
-
-*--opacity-rule* 'OPACITY':'CONDITION'::
- Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. picom-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
-
-*--shadow-exclude-reg* 'GEOMETRY'::
- Specify a X geometry that describes the region in which shadow should not be painted in, such as a dock window region. Use `--shadow-exclude-reg x10+0-0`, for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
-
-*--xinerama-shadow-crop*::
- Crop shadow of a window fully on a particular Xinerama screen to the screen.
-
-*--backend* 'BACKEND'::
- Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. `xrender` is the default one.
-+
---
-* `xrender` backend performs all rendering operations with X Render extension. It is what `xcompmgr` uses, and is generally a safe fallback when you encounter rendering artifacts or instability.
-* `glx` (OpenGL) backend performs all rendering operations with OpenGL. It is more friendly to some VSync methods, and has significantly superior performance on color inversion (*--invert-color-include*) or blur (*--blur-background*). It requires proper OpenGL 2.0 support from your driver and hardware. You may wish to look at the GLX performance optimization options below. *--xrender-sync-fence* might be needed on some systems to avoid delay in changes of screen contents.
-* `xr_glx_hybrid` backend renders the updated screen contents with X Render and presents it on the screen with GLX. It attempts to address the rendering issues some users encountered with GLX backend and enables the better VSync of GLX backends. *--vsync-use-glfinish* might fix some rendering issues with this backend.
---
-
-*--glx-no-stencil*::
- GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content (but never practically happened) and may not work with *--blur-background*. My tests show a 15% performance boost. Recommended.
-
-*--glx-no-rebind-pixmap*::
- GLX backend: Avoid rebinding pixmap on window damage. Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
-
-*--no-use-damage*::
- Disable the use of damage information. This cause the whole screen to be redrawn everytime, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts.
-
-*--xrender-sync-fence*::
- Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users.
-
-*--glx-fshader-win* 'SHADER'::
- GLX backend: Use specified GLSL fragment shader for rendering window contents. See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` in the source tree for examples.
-
-*--force-win-blend*::
- Force all windows to be painted with blending. Useful if you have a *--glx-fshader-win* that could turn opaque pixels transparent.
-
-*--dbus*::
- Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
-
-*--benchmark* 'CYCLES'::
- Benchmark mode. Repeatedly paint until reaching the specified cycles.
-
-*--benchmark-wid* 'WINDOW_ID'::
- Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole screen is repainted.
-
-*--no-ewmh-fullscreen*::
- Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is fullscreen based only on its size and coordinates.
-
-*--max-brightness*::
- Dimming bright windows so their brightness doesn't exceed this set value. Brightness of a window is estimated by averaging all pixels in the window, so this could comes with a performance hit. Setting this to 1.0 disables this behaviour. Requires *--use-damage* to be disabled. (default: 1.0)
-
-*--transparent-clipping*::
- Make transparent windows clip other windows like non-transparent windows do, instead of blending on top of them.
-
-FORMAT OF CONDITIONS
---------------------
-Some options accept a condition string to match certain windows. A condition string is formed by one or more conditions, joined by logical operators.
-
-A condition with "exists" operator looks like this:
-
- [] :
-
-With equals operator it looks like:
-
- [] : =
-
-With greater-than/less-than operators it looks like:
-
- [] :
-
-'NEGATION' (optional) is one or more exclamation marks;
-
-'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `x`, `y`, `x2` (`x` + `widthb`), `y2` (like `x2`), `width`, `height`, `widthb` (`width` + 2 * `border_width`), `heightb` (like `widthb`), `border_width`, `fullscreen`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `bounding_shaped`, `rounded_corners` (requires *--detect-rounded-corners*), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`.
-
-'CLIENT/FRAME' is a single `@` if the window attribute should be be looked up on client window, nothing if on frame window;
-
-'INDEX' (optional) is the index number of the property to look up. For example, `[2]` means look at the third value in the property. If not specified, the first value (index `[0]`) is used implicitly. Use the special value `[*]` to perform matching against all available property values using logical OR. Do not specify it for predefined targets.
-
-'FORMAT' (optional) specifies the format of the property, 8, 16, or 32. On absence we use format X reports. Do not specify it for predefined or string targets.
-
-'TYPE' is a single character representing the type of the property to match for: `c` for 'CARDINAL', `a` for 'ATOM', `w` for 'WINDOW', `d` for 'DRAWABLE', `s` for 'STRING' (and any other string types, such as 'UTF8_STRING'). Do not specify it for predefined targets.
-
-'OP QUALIFIER' (optional), applicable only for equals operator, could be `?` (ignore-case).
-
-'MATCH TYPE' (optional), applicable only for equals operator, could be nothing (exact match), `*` (match anywhere), `^` (match from start), `%` (wildcard), or `~` (PCRE regular expression).
-
-'OPERATOR' is one of `=` (equals), `<`, `>`, `<=`, `=>`, or nothing (exists). Exists operator checks whether a property exists on a window (but for predefined targets, exists means != 0 then).
-
-'PATTERN' is either an integer or a string enclosed by single or double quotes. Python-3-style escape sequences and raw string are supported in the string format.
-
-Supported logical operators are `&&` (and) and `||` (or). `&&` has higher precedence than `||`, left-to-right associativity. Use parentheses to change precedence.
-
-Examples:
-
- # If the window is focused
- focused
- focused = 1
- # If the window is not override-redirected
- !override_redirect
- override_redirect = false
- override_redirect != true
- override_redirect != 1
- # If the window is a menu
- window_type *= "menu"
- _NET_WM_WINDOW_TYPE@:a *= "MENU"
- # If the window is marked hidden: _NET_WM_STATE contains _NET_WM_STATE_HIDDEN
- _NET_WM_STATE@[*]:a = "_NET_WM_STATE_HIDDEN"
- # If the window is marked sticky: _NET_WM_STATE contains an atom that contains
- # "sticky", ignore case
- _NET_WM_STATE@[*]:a *?= "sticky"
- # If the window name contains "Firefox", ignore case
- name *?= "Firefox"
- _NET_WM_NAME@:s *?= "Firefox"
- # If the window name ends with "Firefox"
- name %= "*Firefox"
- name ~= "Firefox$"
- # If the window has a property _COMPTON_SHADOW with value 0, type CARDINAL,
- # format 32, value 0, on its frame window
- _COMPTON_SHADOW:32c = 0
- # If the third value of _NET_FRAME_EXTENTS is less than 20, or there's no
- # _NET_FRAME_EXTENTS property on client window
- _NET_FRAME_EXTENTS@[2]:32c < 20 || !_NET_FRAME_EXTENTS@:32c
- # The pattern here will be parsed as "dd4"
- name = "\x64\x64\o64"
- # The pattern here will be parsed as "\x64\x64\x64"
- name = r"\x64\x64\o64"
-
-
-LEGACY FORMAT OF CONDITIONS
----------------------------
-
-This is the old condition format we once used. Support of this format might be removed in the future.
-
- condition = TARGET:TYPE[FLAGS]:PATTERN
-
-'TARGET' is one of "n" (window name), "i" (window class instance), "g" (window general class), and "r" (window role).
-
-'TYPE' is one of "e" (exact match), "a" (match anywhere), "s" (match from start), "w" (wildcard), and "p" (PCRE regular expressions, if compiled with the support).
-
-'FLAGS' could be a series of flags. Currently the only defined flag is "i" (ignore case).
-
-'PATTERN' is the actual pattern string.
-
-CONFIGURATION FILES
--------------------
-picom could read from a configuration file if libconfig support is compiled in. If *--config* is not used, picom will seek for a configuration file in `$XDG_CONFIG_HOME/picom.conf` (`~/.config/picom.conf`, usually), then `$XDG_CONFIG_HOME/picom/picom.conf`, then `$XDG_CONFIG_DIRS/picom.conf` (often `/etc/xdg/picom.conf`), then `$XDG_CONFIG_DIRS/picom/picom.conf`.
-
-picom uses general libconfig configuration file format. A sample configuration file is available as `picom.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.
-
-Window-type-specific settings are exposed only in configuration file and has the following format:
-
-------------
-wintypes:
-{
- WINDOW_TYPE = { fade = BOOL; shadow = BOOL; opacity = FLOAT; focus = BOOL; blur-background = BOOL; full-shadow = BOOL; clip-shadow-above = BOOL; redir-ignore = BOOL; };
-};
-------------
-
-'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: "unknown", "desktop", "dock", "toolbar", "menu", "utility", "splash", "dialog", "normal", "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd".
-
-Following per window-type options are available: ::
-
- fade, shadow:::
- Controls window-type-specific shadow and fade settings.
-
- opacity:::
- Controls default opacity of the window type.
-
- focus:::
- Controls whether the window of this type is to be always considered focused. (By default, all window types except "normal" and "dialog" has this on.)
-
- blur-background:::
- Controls wether the window of this type will have its transparent background blurred.
-
- full-shadow:::
- Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas.
-
- clip-shadow-above:::
- Controls wether shadows that would have been drawn above the window should be clipped. Useful for dock windows that should have no shadow painted on top.
-
- redir-ignore:::
- Controls whether this type of windows should cause screen to become redirected again after been unredirected. If you have *--unredir-if-possible* set, and doesn't want certain window to cause unnecessary screen redirection, you can set this to `true`.
-
-BLUR
-----
-You can configure how the window background is blurred using a 'blur' section in your configuration file. Here is an example:
-
---------
-blur:
-{
- method = "gaussian";
- size = 10;
- deviation = 5.0;
-};
---------
-
-Available options of the 'blur' section are: ::
-
- *method*:::
- A string. Controls the blur method. Corresponds to the *--blur-method* command line option. Available choices are:
- 'none' to disable blurring; 'gaussian' for gaussian blur; 'box' for box blur; 'kernel' for convolution blur with a custom kernel; 'dual_kawase' for dual-filter kawase blur.
- Note: 'gaussian', 'box' and 'dual_kawase' blur methods are only supported by the experimental backends.
- (default: none)
-
- *size*:::
- An integer. The size of the blur kernel, required by 'gaussian' and 'box' blur methods. For the 'kernel' method, the size is included in the kernel. Corresponds to the *--blur-size* command line option (default: 3).
-
- *deviation*:::
- A floating point number. The standard deviation for the 'gaussian' blur method. Corresponds to the *--blur-deviation* command line option (default: 0.84089642).
-
- *strength*:::
- An integer in the range 0-20. The strength of the 'dual_kawase' blur method. Corresponds to the *--blur-strength* command line option. If set to zero, the value requested by *--blur-size* is approximated (default: 5).
-
- *kernel*:::
- A string. The kernel to use for the 'kernel' blur method, specified in the same format as the *--blur-kerns* option. Corresponds to the *--blur-kerns* command line option.
-
-SIGNALS
--------
-
-* picom reinitializes itself upon receiving `SIGUSR1`.
-
-D-BUS API
----------
-
-It's possible to control picom via D-Bus messages, by running picom with *--dbus* and send messages to `com.github.chjj.compton.`. `` is the display used by picom, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
-
-The D-Bus methods and signals are not yet stable, thus undocumented right now.
-
-EXAMPLES
---------
-
-* Disable configuration file parsing:
-+
-------------
-$ picom --config /dev/null
-------------
-
-* Run picom with client-side shadow and fading:
-+
-------------
-$ picom -cf
-------------
-
-* Same thing as above, plus making inactive windows 80% transparent, making frame 80% transparent, don't fade on window open/close, and fork to background:
-+
-------------
-$ picom -bcf -i 0.8 -e 0.8 --no-fading-openclose
-------------
-
-* Draw white shadows:
-+
-------------
-$ picom -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
-------------
-
-* Avoid drawing shadows on wbar window:
-+
-------------
-$ picom -c --shadow-exclude 'class_g = "wbar"'
-------------
-
-* Enable VSync with GLX backend:
-+
-------------
-$ picom --backend glx --vsync
-------------
-
-BUGS
-----
-Please submit bug reports to .
-
-Out dated information in this man page is considered a bug.
-
-RESOURCES
----------
-Homepage:
-
-SEE ALSO
---------
-*xcompmgr*(1), link:picom-trans.html[*picom-trans*(1)]
diff --git a/dwm/picom/media/compton.svg b/dwm/picom/media/compton.svg
deleted file mode 100644
index cfe1842..0000000
--- a/dwm/picom/media/compton.svg
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
diff --git a/dwm/picom/media/icons/48x48/compton.png b/dwm/picom/media/icons/48x48/compton.png
deleted file mode 100644
index 8eb6320..0000000
Binary files a/dwm/picom/media/icons/48x48/compton.png and /dev/null differ
diff --git a/dwm/picom/meson.build b/dwm/picom/meson.build
deleted file mode 100644
index 505dba2..0000000
--- a/dwm/picom/meson.build
+++ /dev/null
@@ -1,83 +0,0 @@
-project('picom', 'c', version: '9',
- default_options: ['c_std=c11'])
-
-cc = meson.get_compiler('c')
-
-# use project version by default
-version = 'v'+meson.project_version()
-
-# use git describe if that's available
-git = find_program('git', required: false)
-if git.found()
- gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD')
- if gitv.returncode() == 0
- version = 'vgit-'+gitv.stdout().strip()
- endif
-endif
-
-add_global_arguments('-DCOMPTON_VERSION="'+version+'"', language: 'c')
-
-if get_option('buildtype') == 'release'
- add_global_arguments('-DNDEBUG', language: 'c')
-endif
-
-if get_option('sanitize')
- sanitizers = ['address', 'undefined']
- if cc.has_argument('-fsanitize=integer')
- sanitizers += ['integer']
- endif
- if cc.has_argument('-fsanitize=nullability')
- sanitizers += ['nullability']
- endif
- add_global_arguments('-fsanitize='+','.join(sanitizers), language: 'c')
- add_global_link_arguments('-fsanitize='+','.join(sanitizers), language: 'c')
- if cc.has_argument('-fno-sanitize=unsigned-integer-overflow')
- add_global_arguments('-fno-sanitize=unsigned-integer-overflow', language: 'c')
- endif
-endif
-
-if get_option('modularize')
- if not cc.has_argument('-fmodules')
- error('option \'modularize\' requires clang')
- endif
- add_global_arguments(['-fmodules',
- '-fmodule-map-file='+
- meson.current_source_dir()+
- '/src/picom.modulemap'],
- language: 'c')
-endif
-
-add_global_arguments('-D_GNU_SOURCE', language: 'c')
-
-if cc.has_header('stdc-predef.h')
- add_global_arguments('-DHAS_STDC_PREDEF_H', language: 'c')
-endif
-
-warns = [ 'all', 'cast-function-type', 'ignored-qualifiers', 'missing-parameter-type',
- 'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init',
- 'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value',
- 'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough',
- 'no-unknown-warning-option', 'no-missing-braces', 'conversion', 'empty-body' ]
-foreach w : warns
- if cc.has_argument('-W'+w)
- add_global_arguments('-W'+w, language: 'c')
- endif
-endforeach
-
-test_h_dep = subproject('test.h').get_variable('test_h_dep')
-
-subdir('src')
-subdir('man')
-
-install_data('bin/picom-trans', install_dir: get_option('bindir'))
-install_data('picom.desktop', install_dir: 'share/applications')
-
-if get_option('compton')
- install_data('compton.desktop', install_dir: 'share/applications')
- install_data('media/icons/48x48/compton.png',
- install_dir: 'share/icons/hicolor/48x48/apps')
- install_data('media/compton.svg',
- install_dir: 'share/icons/hicolor/scalable/apps')
-
- meson.add_install_script('meson/install.sh')
-endif
diff --git a/dwm/picom/meson/install.sh b/dwm/picom/meson/install.sh
deleted file mode 100755
index a591c39..0000000
--- a/dwm/picom/meson/install.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" ]; then
- echo "Linking picom to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
- ln -s picom "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
-fi
-
-if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" ]; then
- echo "Linking picom-trans to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
- ln -s picom-trans "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
-fi
diff --git a/dwm/picom/meson_options.txt b/dwm/picom/meson_options.txt
deleted file mode 100644
index 9c3b0da..0000000
--- a/dwm/picom/meson_options.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-option('sanitize', type: 'boolean', value: false, description: 'Build with sanitizers enabled (deprecated)')
-option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
-option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')
-
-option('vsync_drm', type: 'boolean', value: false, description: 'Enable support for using drm for vsync')
-
-option('opengl', type: 'boolean', value: true, description: 'Enable features that require opengl (opengl backend, and opengl vsync methods)')
-option('dbus', type: 'boolean', value: true, description: 'Enable support for D-Bus remote control')
-
-option('xrescheck', type: 'boolean', value: false, description: 'Enable X resource leak checker (for debug only)')
-
-option('compton', type: 'boolean', value: true, description: 'Install backwards compat with compton')
-
-option('with_docs', type: 'boolean', value: false, description: 'Build documentation and man pages')
-
-option('modularize', type: 'boolean', value: false, description: 'Build with clang\'s module system')
-
-option('unittest', type: 'boolean', value: false, description: 'Enable unittests in the code')
diff --git a/dwm/picom/picom-dbus.desktop b/dwm/picom/picom-dbus.desktop
deleted file mode 100644
index 5f35c8e..0000000
--- a/dwm/picom/picom-dbus.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Type=Application
-NoDisplay=true
-Name=picom (dbus)
-GenericName=X compositor (dbus)
-Comment=An X compositor with dbus backend enabled
-Categories=Utility;
-Keywords=compositor;composite manager;window effects;transparency;opacity;
-TryExec=picom
-Exec=picom --dbus
diff --git a/dwm/picom/picom.desktop b/dwm/picom/picom.desktop
deleted file mode 100644
index 9d21f6d..0000000
--- a/dwm/picom/picom.desktop
+++ /dev/null
@@ -1,13 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Type=Application
-NoDisplay=false
-Name=picom
-GenericName=X compositor
-Comment=An X compositor
-Categories=Utility;
-Keywords=compositor;composite manager;window effects;transparency;opacity;
-TryExec=picom
-Exec=picom
-# Thanks to quequotion for providing this file!
-Icon=picom
diff --git a/dwm/picom/picom.sample.conf b/dwm/picom/picom.sample.conf
deleted file mode 100644
index efc04a4..0000000
--- a/dwm/picom/picom.sample.conf
+++ /dev/null
@@ -1,455 +0,0 @@
-#################################
-# Shadows #
-#################################
-
-
-# Enabled client-side shadows on windows. Note desktop windows
-# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
-# unless explicitly requested using the wintypes option.
-#
-# shadow = false
-shadow = true;
-
-# The blur radius for shadows, in pixels. (defaults to 12)
-# shadow-radius = 12
-shadow-radius = 7;
-
-# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
-# shadow-opacity = .75
-
-# The left offset for shadows, in pixels. (defaults to -15)
-# shadow-offset-x = -15
-shadow-offset-x = -7;
-
-# The top offset for shadows, in pixels. (defaults to -15)
-# shadow-offset-y = -15
-shadow-offset-y = -7;
-
-# Red color value of shadow (0.0 - 1.0, defaults to 0).
-# shadow-red = 0
-
-# Green color value of shadow (0.0 - 1.0, defaults to 0).
-# shadow-green = 0
-
-# Blue color value of shadow (0.0 - 1.0, defaults to 0).
-# shadow-blue = 0
-
-# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
-# shadow-color = "#000000"
-
-# Specify a list of conditions of windows that should have no shadow.
-#
-# examples:
-# shadow-exclude = "n:e:Notification";
-#
-# shadow-exclude = []
-shadow-exclude = [
- "name = 'Notification'",
- "class_g = 'Conky'",
- "class_g ?= 'Notify-osd'",
- "class_g = 'Cairo-clock'",
- "_GTK_FRAME_EXTENTS@:c"
-];
-
-# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
-# clip-shadow-above = []
-
-# Specify a X geometry that describes the region in which shadow should not
-# be painted in, such as a dock window region. Use
-# shadow-exclude-reg = "x10+0+0"
-# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
-#
-# shadow-exclude-reg = ""
-
-# Crop shadow of a window fully on a particular Xinerama screen to the screen.
-# xinerama-shadow-crop = false
-
-
-#################################
-# Fading #
-#################################
-
-
-# Fade windows in/out when opening/closing and when opacity changes,
-# unless no-fading-openclose is used.
-# fading = false
-fading = true;
-
-# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
-# fade-in-step = 0.028
-fade-in-step = 0.03;
-
-# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
-# fade-out-step = 0.03
-fade-out-step = 0.03;
-
-# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
-# fade-delta = 10
-
-# Specify a list of conditions of windows that should not be faded.
-# fade-exclude = []
-
-# Do not fade on window open/close.
-# no-fading-openclose = false
-
-# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
-# no-fading-destroyed-argb = false
-
-
-#################################
-# Transparency / Opacity #
-#################################
-
-
-# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
-# inactive-opacity = 1
-inactive-opacity = 0.8;
-
-# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
-# frame-opacity = 1.0
-frame-opacity = 0.7;
-
-# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
-# inactive-opacity-override = true
-inactive-opacity-override = false;
-
-# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
-# active-opacity = 1.0
-
-# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
-# inactive-dim = 0.0
-
-# Specify a list of conditions of windows that should never be considered focused.
-# focus-exclude = []
-focus-exclude = [ "class_g = 'Cairo-clock'" ];
-
-# Use fixed inactive dim value, instead of adjusting according to window opacity.
-# inactive-dim-fixed = 1.0
-
-# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
-# like `50:name *= "Firefox"`. picom-trans is recommended over this.
-# Note we don't make any guarantee about possible conflicts with other
-# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
-# example:
-# opacity-rule = [ "80:class_g = 'URxvt'" ];
-#
-# opacity-rule = []
-
-
-#################################
-# Corners #
-#################################
-
-# Sets the radius of rounded window corners. When > 0, the compositor will
-# round the corners of windows. Does not interact well with
-# `transparent-clipping`.
-corner-radius = 0
-
-# Exclude conditions for rounded corners.
-rounded-corners-exclude = [
- "window_type = 'dock'",
- "window_type = 'desktop'"
-];
-
-
-#################################
-# Background-Blurring #
-#################################
-
-
-# Parameters for background blurring, see the *BLUR* section for more information.
-# blur-method =
-# blur-size = 12
-#
-# blur-deviation = false
-#
-# blur-strength = 5
-
-# Blur background of semi-transparent / ARGB windows.
-# Bad in performance, with driver-dependent behavior.
-# The name of the switch may change without prior notifications.
-#
-# blur-background = false
-
-# Blur background of windows when the window frame is not opaque.
-# Implies:
-# blur-background
-# Bad in performance, with driver-dependent behavior. The name may change.
-#
-# blur-background-frame = false
-
-
-# Use fixed blur strength rather than adjusting according to window opacity.
-# blur-background-fixed = false
-
-
-# Specify the blur convolution kernel, with the following format:
-# example:
-# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
-#
-# blur-kern = ""
-blur-kern = "3x3box";
-
-
-# Exclude conditions for background blur.
-# blur-background-exclude = []
-blur-background-exclude = [
- "window_type = 'dock'",
- "window_type = 'desktop'",
- "_GTK_FRAME_EXTENTS@:c"
-];
-
-#################################
-# General Settings #
-#################################
-
-# Enable remote control via D-Bus. See the man page for more details.
-# dbus = true
-
-# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
-# daemon = false
-
-# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
-# `xrender` is the default one.
-#
-# backend = "glx"
-backend = "xrender";
-
-# Enable/disable VSync.
-# vsync = false
-vsync = true;
-
-# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
-# dbus = false
-
-# Try to detect WM windows (a non-override-redirect window with no
-# child that has 'WM_STATE') and mark them as active.
-#
-# mark-wmwin-focused = false
-mark-wmwin-focused = true;
-
-# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
-# mark-ovredir-focused = false
-mark-ovredir-focused = true;
-
-# Try to detect windows with rounded corners and don't consider them
-# shaped windows. The accuracy is not very high, unfortunately.
-#
-# detect-rounded-corners = false
-detect-rounded-corners = true;
-
-# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
-# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
-#
-# detect-client-opacity = false
-detect-client-opacity = true;
-
-# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
-# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
-# provided that the WM supports it.
-#
-# use-ewmh-active-win = false
-
-# Unredirect all windows if a full-screen opaque window is detected,
-# to maximize performance for full-screen windows. Known to cause flickering
-# when redirecting/unredirecting windows.
-#
-# unredir-if-possible = false
-
-# Delay before unredirecting the window, in milliseconds. Defaults to 0.
-# unredir-if-possible-delay = 0
-
-# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
-# unredir-if-possible-exclude = []
-
-# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
-# in the same group focused at the same time.
-#
-# detect-transient = false
-detect-transient = true;
-
-# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
-# group focused at the same time. This usually means windows from the same application
-# will be considered focused or unfocused at the same time.
-# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
-#
-# detect-client-leader = false
-
-# Resize damaged region by a specific number of pixels.
-# A positive value enlarges it while a negative one shrinks it.
-# If the value is positive, those additional pixels will not be actually painted
-# to screen, only used in blur calculation, and such. (Due to technical limitations,
-# with use-damage, those pixels will still be incorrectly painted to screen.)
-# Primarily used to fix the line corruption issues of blur,
-# in which case you should use the blur radius value here
-# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
-# with a 5x5 one you use `--resize-damage 2`, and so on).
-# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
-#
-# resize-damage = 1
-
-# Specify a list of conditions of windows that should be painted with inverted color.
-# Resource-hogging, and is not well tested.
-#
-# invert-color-include = []
-
-# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
-# Might cause incorrect opacity when rendering transparent content (but never
-# practically happened) and may not work with blur-background.
-# My tests show a 15% performance boost. Recommended.
-#
-# glx-no-stencil = false
-
-# GLX backend: Avoid rebinding pixmap on window damage.
-# Probably could improve performance on rapid window content changes,
-# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
-# Recommended if it works.
-#
-# glx-no-rebind-pixmap = false
-
-# Disable the use of damage information.
-# This cause the whole screen to be redrawn everytime, instead of the part of the screen
-# has actually changed. Potentially degrades the performance, but might fix some artifacts.
-# The opposing option is use-damage
-#
-# no-use-damage = false
-use-damage = true;
-
-# Use X Sync fence to sync clients' draw calls, to make sure all draw
-# calls are finished before picom starts drawing. Needed on nvidia-drivers
-# with GLX backend for some users.
-#
-# xrender-sync-fence = false
-
-# GLX backend: Use specified GLSL fragment shader for rendering window contents.
-# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
-# in the source tree for examples.
-#
-# glx-fshader-win = ""
-
-# Force all windows to be painted with blending. Useful if you
-# have a glx-fshader-win that could turn opaque pixels transparent.
-#
-# force-win-blend = false
-
-# Do not use EWMH to detect fullscreen windows.
-# Reverts to checking if a window is fullscreen based only on its size and coordinates.
-#
-# no-ewmh-fullscreen = false
-
-# Dimming bright windows so their brightness doesn't exceed this set value.
-# Brightness of a window is estimated by averaging all pixels in the window,
-# so this could comes with a performance hit.
-# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
-#
-# max-brightness = 1.0
-
-# Make transparent windows clip other windows like non-transparent windows do,
-# instead of blending on top of them.
-#
-# transparent-clipping = false
-
-# Set the log level. Possible values are:
-# "trace", "debug", "info", "warn", "error"
-# in increasing level of importance. Case doesn't matter.
-# If using the "TRACE" log level, it's better to log into a file
-# using *--log-file*, since it can generate a huge stream of logs.
-#
-# log-level = "debug"
-log-level = "warn";
-
-# Set the log file.
-# If *--log-file* is never specified, logs will be written to stderr.
-# Otherwise, logs will to written to the given file, though some of the early
-# logs might still be written to the stderr.
-# When setting this option from the config file, it is recommended to use an absolute path.
-#
-# log-file = "/path/to/your/log/file"
-
-# Show all X errors (for debugging)
-# show-all-xerrors = false
-
-# Write process ID to a file.
-# write-pid-path = "/path/to/your/log/file"
-
-# Window type settings
-#
-# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
-# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
-# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
-# "tooltip", "notification", "combo", and "dnd".
-#
-# Following per window-type options are available: ::
-#
-# fade, shadow:::
-# Controls window-type-specific shadow and fade settings.
-#
-# opacity:::
-# Controls default opacity of the window type.
-#
-# focus:::
-# Controls whether the window of this type is to be always considered focused.
-# (By default, all window types except "normal" and "dialog" has this on.)
-#
-# full-shadow:::
-# Controls whether shadow is drawn under the parts of the window that you
-# normally won't be able to see. Useful when the window has parts of it
-# transparent, and you want shadows in those areas.
-#
-# clip-shadow-above:::
-# Controls wether shadows that would have been drawn above the window should
-# be clipped. Useful for dock windows that should have no shadow painted on top.
-#
-# redir-ignore:::
-# Controls whether this type of windows should cause screen to become
-# redirected again after been unredirected. If you have unredir-if-possible
-# set, and doesn't want certain window to cause unnecessary screen redirection,
-# you can set this to `true`.
-#
-wintypes:
-{
- tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
- dock = { shadow = false; clip-shadow-above = true; }
- dnd = { shadow = false; }
- menu = { animation = "slide-down"; }
- popup_menu = { animation = "slide-down"; opacity = 0.8; }
- dropdown_menu = { animation = "slide-down"; opacity = 0.8; }
- toolbar = { animation = "none"; }
-};
-
-#################################
-# Animation Settings #
-#################################
-
-animations = true;
-
-# Values can be none, auto, fly-in, zoom, squeeze, slide-up, slide-down, slide-left, slide-right
-animation-for-open-window = "squeeze";
-animation-for-transient-window = "slide-down";
-animation-for-unmap-window = "auto";
-animation-for-workspace-switch-in = "auto";
-animation-for-workspace-switch-out = "auto";
-
-# Stiffness (a.k.a. tension) parameter for spring-based animation (default: 200.0).
-animation-stiffness = 1000;
-
-# Dampening (a.k.a. friction) parameter for spring-based animation (default: 25.0).
-animation-dampening = 50;
-
-# Mass parameter for spring-based animation (default: 1.0).
-animation-window-mass = 1;
-
-# The time between steps in animation, in milliseconds. (> 0, defaults to 10).
-animation-delta = 7;
-
-# Force animations to go step by step even if cpu usage is high
-animation-force-steps = true;
-
-# Whether to clamp animations (default: true).
-#animation-clamping = false;
-
-# Specify a list of conditions of windows that should have no animations.
-animation-exclude = [
- "class_g *= 'flameshot'",
- "class_g *= 'i3lock'"
-];
diff --git a/dwm/picom/src/atom.c b/dwm/picom/src/atom.c
deleted file mode 100644
index 0272dc8..0000000
--- a/dwm/picom/src/atom.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include
-#include
-
-#include "atom.h"
-#include "common.h"
-#include "utils.h"
-#include "log.h"
-
-static inline void *atom_getter(void *ud, const char *atom_name, int *err) {
- xcb_connection_t *c = ud;
- xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(
- c, xcb_intern_atom(c, 0, to_u16_checked(strlen(atom_name)), atom_name), NULL);
-
- xcb_atom_t atom = XCB_NONE;
- if (reply) {
- log_debug("Atom %s is %d", atom_name, reply->atom);
- atom = reply->atom;
- free(reply);
- } else {
- log_error("Failed to intern atoms");
- *err = 1;
- }
- return (void *)(intptr_t)atom;
-}
-
-/**
- * Create a new atom structure and fetch all predefined atoms
- */
-struct atom *init_atoms(xcb_connection_t *c) {
- auto atoms = ccalloc(1, struct atom);
- atoms->c = new_cache((void *)c, atom_getter, NULL);
-#define ATOM_GET(x) atoms->a##x = (xcb_atom_t)(intptr_t)cache_get(atoms->c, #x, NULL)
- LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST1);
- LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST2);
-#undef ATOM_GET
- return atoms;
-}
diff --git a/dwm/picom/src/atom.h b/dwm/picom/src/atom.h
deleted file mode 100644
index baf3360..0000000
--- a/dwm/picom/src/atom.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#pragma once
-#include
-
-#include
-
-#include "meta.h"
-#include "cache.h"
-
-// clang-format off
-// Splitted into 2 lists because of the limitation of our macros
-#define ATOM_LIST1 \
- _NET_WM_WINDOW_OPACITY, \
- _NET_FRAME_EXTENTS, \
- WM_STATE, \
- _NET_WM_NAME, \
- _NET_WM_PID, \
- WM_NAME, \
- WM_CLASS, \
- WM_ICON_NAME, \
- WM_TRANSIENT_FOR, \
- WM_WINDOW_ROLE, \
- WM_CLIENT_LEADER, \
- WM_CLIENT_MACHINE, \
- _NET_ACTIVE_WINDOW, \
- _COMPTON_SHADOW, \
- _NET_WM_WINDOW_TYPE, \
- _NET_CURRENT_DESKTOP
-
-#define ATOM_LIST2 \
- _NET_WM_WINDOW_TYPE_DESKTOP, \
- _NET_WM_WINDOW_TYPE_DOCK, \
- _NET_WM_WINDOW_TYPE_TOOLBAR, \
- _NET_WM_WINDOW_TYPE_MENU, \
- _NET_WM_WINDOW_TYPE_UTILITY, \
- _NET_WM_WINDOW_TYPE_SPLASH, \
- _NET_WM_WINDOW_TYPE_DIALOG, \
- _NET_WM_WINDOW_TYPE_NORMAL, \
- _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, \
- _NET_WM_WINDOW_TYPE_POPUP_MENU, \
- _NET_WM_WINDOW_TYPE_TOOLTIP, \
- _NET_WM_WINDOW_TYPE_NOTIFICATION, \
- _NET_WM_WINDOW_TYPE_COMBO, \
- _NET_WM_WINDOW_TYPE_DND, \
- _NET_WM_STATE, \
- _NET_WM_STATE_FULLSCREEN, \
- _NET_WM_BYPASS_COMPOSITOR, \
- UTF8_STRING, \
- C_STRING
-// clang-format on
-
-#define ATOM_DEF(x) xcb_atom_t a##x
-
-struct atom {
- struct cache *c;
- LIST_APPLY(ATOM_DEF, SEP_COLON, ATOM_LIST1);
- LIST_APPLY(ATOM_DEF, SEP_COLON, ATOM_LIST2);
-};
-
-struct atom *init_atoms(xcb_connection_t *);
-
-static inline xcb_atom_t get_atom(struct atom *a, const char *key) {
- return (xcb_atom_t)(intptr_t)cache_get(a->c, key, NULL);
-}
-
-static inline void destroy_atoms(struct atom *a) {
- cache_free(a->c);
- free(a);
-}
diff --git a/dwm/picom/src/backend/backend.c b/dwm/picom/src/backend/backend.c
deleted file mode 100644
index 2ef5f03..0000000
--- a/dwm/picom/src/backend/backend.c
+++ /dev/null
@@ -1,540 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#include
-#include
-
-#include "backend/backend.h"
-#include "common.h"
-#include "compiler.h"
-#include "config.h"
-#include "log.h"
-#include "region.h"
-#include "types.h"
-#include "win.h"
-#include "x.h"
-
-extern struct backend_operations xrender_ops, dummy_ops;
-#ifdef CONFIG_OPENGL
-extern struct backend_operations glx_ops;
-#endif
-
-struct backend_operations *backend_list[NUM_BKEND] = {
- [BKEND_XRENDER] = &xrender_ops,
- [BKEND_DUMMY] = &dummy_ops,
-#ifdef CONFIG_OPENGL
- [BKEND_GLX] = &glx_ops,
-#endif
-};
-
-/**
- * @param all_damage if true ignore damage and repaint the whole screen
- */
-region_t get_damage(session_t *ps, bool all_damage) {
- region_t region;
- auto buffer_age_fn = ps->backend_data->ops->buffer_age;
- int buffer_age = buffer_age_fn ? buffer_age_fn(ps->backend_data) : -1;
-
- if (all_damage) {
- buffer_age = -1;
- }
-
- pixman_region32_init(®ion);
- if (buffer_age == -1 || buffer_age > ps->ndamage) {
- pixman_region32_copy(®ion, &ps->screen_reg);
- } else {
- for (int i = 0; i < buffer_age; i++) {
- auto curr = ((ps->damage - ps->damage_ring) + i) % ps->ndamage;
- log_trace("damage index: %d, damage ring offset: %td", i, curr);
- dump_region(&ps->damage_ring[curr]);
- pixman_region32_union(®ion, ®ion, &ps->damage_ring[curr]);
- }
- pixman_region32_intersect(®ion, ®ion, &ps->screen_reg);
- }
- return region;
-}
-
-static void process_window_for_painting(session_t *ps, struct managed_win *w,
- void *win_image, double additional_alpha,
- region_t *reg_bound, region_t *reg_visible,
- region_t *reg_paint, region_t *reg_paint_in_bound) {
- // For window image processing, we don't have to limit the process
- // region to damage for correctness. (see for
- // details)
-
- // The visible region, in window local coordinates Although we
- // don't limit process region to damage, we provide that info in
- // reg_visible as a hint. Since window image data outside of the
- // damage region won't be painted onto target
- region_t reg_visible_local;
- {
- // The bounding shape, in window local coordinates
- region_t reg_bound_local;
- pixman_region32_init(®_bound_local);
- pixman_region32_copy(®_bound_local, reg_bound);
- pixman_region32_translate(®_bound_local, -w->g.x, -w->g.y);
-
- pixman_region32_init(®_visible_local);
- pixman_region32_intersect(®_visible_local, reg_visible, reg_paint);
- pixman_region32_translate(®_visible_local, -w->g.x, -w->g.y);
- // Data outside of the bounding shape won't be visible,
- // but it is not necessary to limit the image operations
- // to the bounding shape yet. So pass that as the visible
- // region, not the clip region.
- pixman_region32_intersect(®_visible_local, ®_visible_local,
- ®_bound_local);
- pixman_region32_fini(®_bound_local);
- }
-
- auto new_img = ps->backend_data->ops->clone_image(ps->backend_data, win_image,
- ®_visible_local);
- auto reg_frame = win_get_region_frame_local_by_val(w);
- double alpha = additional_alpha * w->opacity;
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_OPACITY, new_img, &alpha);
- ps->backend_data->ops->image_op(ps->backend_data, IMAGE_OP_APPLY_ALPHA, new_img,
- ®_frame, ®_visible_local,
- (double[]){w->frame_opacity});
- pixman_region32_fini(®_frame);
- ps->backend_data->ops->compose(ps->backend_data, new_img, w->g.x, w->g.y,
- w->g.x + w->widthb, w->g.y + w->heightb,
- reg_paint_in_bound, reg_visible);
- ps->backend_data->ops->release_image(ps->backend_data, new_img);
- pixman_region32_fini(®_visible_local);
-}
-
-void handle_device_reset(session_t *ps) {
- log_error("Device reset detected");
- // Wait for reset to complete
- // Although ideally the backend should return DEVICE_STATUS_NORMAL after a reset
- // is completed, it's not always possible.
- //
- // According to ARB_robustness (emphasis mine):
- //
- // "If a reset status other than NO_ERROR is returned and subsequent
- // calls return NO_ERROR, the context reset was encountered and
- // completed. If a reset status is repeatedly returned, the context **may**
- // be in the process of resetting."
- //
- // Which means it may also not be in the process of resetting. For example on
- // AMDGPU devices, Mesa OpenGL always return CONTEXT_RESET after a reset has
- // started, completed or not.
- //
- // So here we blindly wait 5 seconds and hope ourselves best of the luck.
- sleep(5);
-
- // Reset picom
- log_info("Resetting picom after device reset");
- ev_break(ps->loop, EVBREAK_ALL);
-}
-
-/// paint all windows
-void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
- if (ps->backend_data->ops->device_status &&
- ps->backend_data->ops->device_status(ps->backend_data) != DEVICE_STATUS_NORMAL) {
- return handle_device_reset(ps);
- }
- if (ps->o.xrender_sync_fence) {
- if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) {
- log_error("x_fence_sync failed, xrender-sync-fence will be "
- "disabled from now on.");
- xcb_sync_destroy_fence(ps->c, ps->sync_fence);
- ps->sync_fence = XCB_NONE;
- ps->o.xrender_sync_fence = false;
- ps->xsync_exists = false;
- }
- }
- // All painting will be limited to the damage, if _some_ of
- // the paints bleed out of the damage region, it will destroy
- // part of the image we want to reuse
- region_t reg_damage;
- if (!ignore_damage) {
- reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage);
- } else {
- pixman_region32_init(®_damage);
- pixman_region32_copy(®_damage, &ps->screen_reg);
- }
-
- if (!pixman_region32_not_empty(®_damage)) {
- pixman_region32_fini(®_damage);
- return;
- }
-
-#ifdef DEBUG_REPAINT
- static struct timespec last_paint = {0};
-#endif
-
- //
- // If use_damage is enabled, we MUST make sure only the damaged regions of the
- // screen are ever touched by the compositor. The reason is that at the beginning
- // of each render, we clear the damaged regions with the wallpaper, and nothing
- // else. If later during the render we changed anything outside the damaged
- // region, that won't be cleared by the next render, and will thus accumulate.
- // (e.g. if shadow is drawn outside the damaged region, it will become thicker and
- // thicker over time.)
-
- /// The adjusted damaged regions
- region_t reg_paint;
- assert(ps->o.blur_method != BLUR_METHOD_INVALID);
- if (ps->o.blur_method != BLUR_METHOD_NONE && ps->backend_data->ops->get_blur_size) {
- int blur_width, blur_height;
- ps->backend_data->ops->get_blur_size(ps->backend_blur_context,
- &blur_width, &blur_height);
-
- // The region of screen a given window influences will be smeared
- // out by blur. With more windows on top of the given window, the
- // influences region will be smeared out more.
- //
- // Also, blurring requires data slightly outside the area that needs
- // to be blurred. The more semi-transparent windows are stacked on top
- // of each other, the larger the area will be.
- //
- // Instead of accurately calculate how much bigger the damage
- // region will be because of blur, we assume the worst case here.
- // That is, the damaged window is at the bottom of the stack, and
- // all other windows have semi-transparent background
- int resize_factor = 1;
- if (t) {
- resize_factor = t->stacking_rank;
- }
- resize_region_in_place(®_damage, blur_width * resize_factor,
- blur_height * resize_factor);
- reg_paint = resize_region(®_damage, blur_width * resize_factor,
- blur_height * resize_factor);
- pixman_region32_intersect(®_paint, ®_paint, &ps->screen_reg);
- pixman_region32_intersect(®_damage, ®_damage, &ps->screen_reg);
- } else {
- pixman_region32_init(®_paint);
- pixman_region32_copy(®_paint, ®_damage);
- }
-
- // A hint to backend, the region that will be visible on screen
- // backend can optimize based on this info
- region_t reg_visible;
- pixman_region32_init(®_visible);
- pixman_region32_copy(®_visible, &ps->screen_reg);
- if (t && !ps->o.transparent_clipping) {
- // Calculate the region upon which the root window (wallpaper) is to be
- // painted based on the ignore region of the lowest window, if available
- //
- // NOTE If transparent_clipping is enabled, transparent windows are
- // included in the reg_ignore, but we still want to have the wallpaper
- // beneath them, so we don't use reg_ignore for wallpaper in that case.
- pixman_region32_subtract(®_visible, ®_visible, t->reg_ignore);
- }
-
- // Region on screen we don't want any shadows on
- region_t reg_shadow_clip;
- pixman_region32_init(®_shadow_clip);
-
- if (ps->backend_data->ops->prepare) {
- ps->backend_data->ops->prepare(ps->backend_data, ®_paint);
- }
-
- if (ps->root_image) {
- ps->backend_data->ops->compose(ps->backend_data, ps->root_image, 0, 0,
- ps->root_width, ps->root_height,
- ®_paint, ®_visible);
- } else {
- ps->backend_data->ops->fill(ps->backend_data, (struct color){0, 0, 0, 1},
- ®_paint);
- }
-
- // Windows are sorted from bottom to top
- // Each window has a reg_ignore, which is the region obscured by all the windows
- // on top of that window. This is used to reduce the number of pixels painted.
- //
- // Whether this is beneficial is to be determined XXX
- for (auto w = t; w; w = w->prev_trans) {
- pixman_region32_subtract(®_visible, &ps->screen_reg, w->reg_ignore);
- assert(!(w->flags & WIN_FLAGS_IMAGE_ERROR));
- assert(!(w->flags & WIN_FLAGS_PIXMAP_STALE));
- assert(!(w->flags & WIN_FLAGS_PIXMAP_NONE));
-
- // The bounding shape of the window, in global/target coordinates
- // reminder: bounding shape contains the WM frame
- auto reg_bound = win_get_bounding_shape_global_by_val(w);
- auto reg_bound_no_corner =
- win_get_bounding_shape_global_without_corners_by_val(w);
-
- // The clip region for the current window, in global/target coordinates
- // reg_paint_in_bound \in reg_paint
- region_t reg_paint_in_bound;
- pixman_region32_init(®_paint_in_bound);
- pixman_region32_intersect(®_paint_in_bound, ®_bound, ®_paint);
- if (ps->o.transparent_clipping) {
- //
- // If transparent_clipping is enabled, we need to be SURE that
- // things are not drawn inside reg_ignore, because otherwise they
- // will appear underneath transparent windows.
- // So here we have make sure reg_paint_in_bound \in reg_visible
- // There are a few other places below where this is needed as
- // well.
- pixman_region32_intersect(®_paint_in_bound,
- ®_paint_in_bound, ®_visible);
- }
-
- // Blur window background
- /* TODO(yshui) since the backend might change the content of the window
- * (e.g. with shaders), we should consult the backend whether the window
- * is transparent or not. for now we will just rely on the force_win_blend
- * option */
- auto real_win_mode = w->mode;
-
- if (w->blur_background &&
- (ps->o.force_win_blend || real_win_mode == WMODE_TRANS ||
- (ps->o.blur_background_frame && real_win_mode == WMODE_FRAME_TRANS))) {
- // Minimize the region we try to blur, if the window
- // itself is not opaque, only the frame is.
-
- double blur_opacity = 1;
- if (w->opacity < (1.0 / MAX_ALPHA)) {
- // Hide blur for fully transparent windows.
- blur_opacity = 0;
- } else if (w->state == WSTATE_MAPPING) {
- // Gradually increase the blur intensity during
- // fading in.
- assert(w->opacity <= w->opacity_target);
- blur_opacity = w->opacity / w->opacity_target;
- } else if (w->state == WSTATE_UNMAPPING ||
- w->state == WSTATE_DESTROYING) {
- // Gradually decrease the blur intensity during
- // fading out.
- assert(w->opacity <= w->opacity_target_old);
- blur_opacity = w->opacity / w->opacity_target_old;
- } else if (w->state == WSTATE_FADING) {
- if (w->opacity < w->opacity_target &&
- w->opacity_target_old < (1.0 / MAX_ALPHA)) {
- // Gradually increase the blur intensity during
- // fading in.
- assert(w->opacity <= w->opacity_target);
- blur_opacity = w->opacity / w->opacity_target;
- } else if (w->opacity > w->opacity_target &&
- w->opacity_target < (1.0 / MAX_ALPHA)) {
- // Gradually decrease the blur intensity during
- // fading out.
- assert(w->opacity <= w->opacity_target_old);
- blur_opacity = w->opacity / w->opacity_target_old;
- }
- }
- assert(blur_opacity >= 0 && blur_opacity <= 1);
-
- if (real_win_mode == WMODE_TRANS || ps->o.force_win_blend) {
- // We need to blur the bounding shape of the window
- // (reg_paint_in_bound = reg_bound \cap reg_paint)
- ps->backend_data->ops->blur(
- ps->backend_data, blur_opacity, ps->backend_blur_context,
- ®_paint_in_bound, ®_visible);
- } else {
- // Window itself is solid, we only need to blur the frame
- // region
-
- // Readability assertions
- assert(ps->o.blur_background_frame);
- assert(real_win_mode == WMODE_FRAME_TRANS);
-
- auto reg_blur = win_get_region_frame_local_by_val(w);
- pixman_region32_translate(®_blur, w->g.x, w->g.y);
- // make sure reg_blur \in reg_paint
- pixman_region32_intersect(®_blur, ®_blur, ®_paint);
- if (ps->o.transparent_clipping) {
- // ref:
- pixman_region32_intersect(®_blur, ®_blur,
- ®_visible);
- }
- ps->backend_data->ops->blur(ps->backend_data, blur_opacity,
- ps->backend_blur_context,
- ®_blur, ®_visible);
- pixman_region32_fini(®_blur);
- }
- }
-
- // Draw shadow on target
- if (w->shadow) {
- assert(!(w->flags & WIN_FLAGS_SHADOW_NONE));
- // Clip region for the shadow
- // reg_shadow \in reg_paint
- auto reg_shadow = win_extents_by_val(w);
- pixman_region32_intersect(®_shadow, ®_shadow, ®_paint);
- if (!ps->o.wintype_option[w->window_type].full_shadow) {
- pixman_region32_subtract(®_shadow, ®_shadow,
- ®_bound_no_corner);
- }
-
- // Mask out the region we don't want shadow on
- if (pixman_region32_not_empty(&ps->shadow_exclude_reg)) {
- pixman_region32_subtract(®_shadow, ®_shadow,
- &ps->shadow_exclude_reg);
- }
- if (pixman_region32_not_empty(®_shadow_clip)) {
- pixman_region32_subtract(®_shadow, ®_shadow,
- ®_shadow_clip);
- }
-
- if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 &&
- w->xinerama_scr < ps->xinerama_nscrs) {
- // There can be a window where number of screens is
- // updated, but the screen number attached to the windows
- // have not.
- //
- // Window screen number will be updated eventually, so
- // here we just check to make sure we don't access out of
- // bounds.
- pixman_region32_intersect(
- ®_shadow, ®_shadow,
- &ps->xinerama_scr_regs[w->xinerama_scr]);
- }
-
- if (ps->o.transparent_clipping) {
- // ref:
- pixman_region32_intersect(®_shadow, ®_shadow,
- ®_visible);
- }
-
- assert(w->shadow_image);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_OPACITY, w->shadow_image,
- &w->opacity);
-
- ps->backend_data->ops->compose(
- ps->backend_data, w->shadow_image, w->g.x + w->shadow_dx,
- w->g.y + w->shadow_dy, w->g.x + w->shadow_dx + w->shadow_width,
- w->g.y + w->shadow_dy + w->shadow_height, ®_shadow,
- ®_visible);
- pixman_region32_fini(®_shadow);
- }
-
- // Update image properties
- {
- double dim_opacity = 0.0;
- if (w->dim) {
- dim_opacity = ps->o.inactive_dim;
- if (!ps->o.inactive_dim_fixed) {
- dim_opacity *= w->opacity;
- }
- }
-
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_MAX_BRIGHTNESS, w->win_image,
- &ps->o.max_brightness);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_INVERTED, w->win_image,
- &w->invert_color);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_DIM_LEVEL, w->win_image,
- &dim_opacity);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_OPACITY, w->win_image, &w->opacity);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_CORNER_RADIUS, w->win_image,
- (double[]){w->corner_radius});
- if (w->corner_radius) {
- int border_width = w->g.border_width;
- if (border_width == 0) {
- // Some WM has borders implemented as WM frames
- border_width = min3(w->frame_extents.left,
- w->frame_extents.right,
- w->frame_extents.bottom);
- }
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_BORDER_WIDTH,
- w->win_image, &border_width);
- if (w->old_win_image) {
- // TODO(dccsillag): explain why the following is
- // "necessary"
- double zero = 0.0;
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_BORDER_WIDTH,
- w->old_win_image, &zero);
- ps->backend_data->ops->set_image_property(
- ps->backend_data, IMAGE_PROPERTY_CORNER_RADIUS,
- w->old_win_image, &zero);
- }
- }
- }
-
- if (w->opacity * MAX_ALPHA < 1) {
- // We don't need to paint the window body itself if it's
- // completely transparent.
- goto skip;
- }
-
- if (w->clip_shadow_above) {
- // Add window bounds to shadow-clip region
- pixman_region32_union(®_shadow_clip, ®_shadow_clip, ®_bound);
- } else {
- // Remove overlapping window bounds from shadow-clip region
- pixman_region32_subtract(®_shadow_clip, ®_shadow_clip, ®_bound);
- }
-
- // Draw window on target
- bool is_animating = 0 <= w->animation_progress && w->animation_progress < 1.0;
- if (w->frame_opacity == 1 && !is_animating) {
- ps->backend_data->ops->compose(ps->backend_data, w->win_image,
- w->g.x, w->g.y,
- w->g.x + w->widthb, w->g.y + w->heightb,
- ®_paint_in_bound, ®_visible);
- } else {
- process_window_for_painting(
- ps, w, w->win_image, 1.0, ®_bound, ®_visible,
- ®_paint, ®_paint_in_bound);
-
- if (w->old_win_image) {
- bool resizing =
- w->g.width != w->pending_g.width ||
- w->g.height != w->pending_g.height;
-
- // Only do this if size changes as otherwise moving
- // transparent windows will flicker
- if (resizing) {
- assert(w->old_win_image);
-
- process_window_for_painting(ps, w, w->old_win_image,
- 1.0 - w->animation_progress,
- ®_bound, ®_visible,
- ®_paint, ®_paint_in_bound);
- }
- }
- }
- skip:
- pixman_region32_fini(®_bound);
- pixman_region32_fini(®_bound_no_corner);
- pixman_region32_fini(®_paint_in_bound);
- }
- pixman_region32_fini(®_paint);
- pixman_region32_fini(®_shadow_clip);
-
- if (ps->o.monitor_repaint) {
- const struct color DEBUG_COLOR = {0.5, 0, 0, 0.5};
- auto reg_damage_debug = get_damage(ps, false);
- ps->backend_data->ops->fill(ps->backend_data, DEBUG_COLOR, ®_damage_debug);
- pixman_region32_fini(®_damage_debug);
- }
-
- // Move the head of the damage ring
- ps->damage = ps->damage - 1;
- if (ps->damage < ps->damage_ring) {
- ps->damage = ps->damage_ring + ps->ndamage - 1;
- }
- pixman_region32_clear(ps->damage);
-
- if (ps->backend_data->ops->present) {
- // Present the rendered scene
- // Vsync is done here
- ps->backend_data->ops->present(ps->backend_data, ®_damage);
- }
-
- pixman_region32_fini(®_damage);
-
-#ifdef DEBUG_REPAINT
- struct timespec now = get_time_timespec();
- struct timespec diff = {0};
- timespec_subtract(&diff, &now, &last_paint);
- log_trace("[ %5ld:%09ld ] ", diff.tv_sec, diff.tv_nsec);
- last_paint = now;
- log_trace("paint:");
- for (win *w = t; w; w = w->prev_trans)
- log_trace(" %#010lx", w->id);
-#endif
-}
-
-// vim: set noet sw=8 ts=8 :
diff --git a/dwm/picom/src/backend/backend.h b/dwm/picom/src/backend/backend.h
deleted file mode 100644
index 5652a36..0000000
--- a/dwm/picom/src/backend/backend.h
+++ /dev/null
@@ -1,294 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) 2018, Yuxuan Shui
-
-#pragma once
-
-#include
-
-#include "compiler.h"
-#include "config.h"
-#include "driver.h"
-#include "kernel.h"
-#include "region.h"
-#include "types.h"
-#include "x.h"
-
-typedef struct session session_t;
-struct managed_win;
-
-struct ev_loop;
-struct backend_operations;
-
-typedef struct backend_base {
- struct backend_operations *ops;
- xcb_connection_t *c;
- xcb_window_t root;
- struct ev_loop *loop;
-
- /// Whether the backend can accept new render request at the moment
- bool busy;
- // ...
-} backend_t;
-
-typedef void (*backend_ready_callback_t)(void *);
-
-// This mimics OpenGL's ARB_robustness extension, which enables detection of GPU context
-// resets.
-// See: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness.txt, section
-// 2.6 "Graphics Reset Recovery".
-enum device_status {
- DEVICE_STATUS_NORMAL,
- DEVICE_STATUS_RESETTING,
-};
-
-// When image properties are actually applied to the image, they are applied in a
-// particular order:
-//
-// Color inversion -> Dimming -> Opacity multiply -> Limit maximum brightness
-// (Corner radius could be applied in any order)
-enum image_properties {
- // Whether the color of the image is inverted
- // 1 boolean, default: false
- IMAGE_PROPERTY_INVERTED,
- // How much the image is dimmed
- // 1 double, default: 0
- IMAGE_PROPERTY_DIM_LEVEL,
- // Image opacity, i.e. an alpha value multiplied to the alpha channel
- // 1 double, default: 1
- IMAGE_PROPERTY_OPACITY,
- // The effective size of the image, the image will be tiled to fit.
- // 2 int, default: the actual size of the image
- IMAGE_PROPERTY_EFFECTIVE_SIZE,
- // Limit how bright image can be. The image brightness is estimated by averaging
- // the pixels in the image, and dimming will be applied to scale the average
- // brightness down to the max brightness value.
- // 1 double, default: 1
- IMAGE_PROPERTY_MAX_BRIGHTNESS,
- // Gives the image a rounded corner.
- // 1 double, default: 0
- IMAGE_PROPERTY_CORNER_RADIUS,
- // Border width
- // 1 int, default: 0
- IMAGE_PROPERTY_BORDER_WIDTH,
-};
-
-enum image_operations {
- // Multiply the alpha channel by the argument
- IMAGE_OP_APPLY_ALPHA,
-};
-
-struct gaussian_blur_args {
- int size;
- double deviation;
-};
-
-struct box_blur_args {
- int size;
-};
-
-struct kernel_blur_args {
- struct conv **kernels;
- int kernel_count;
-};
-
-struct dual_kawase_blur_args {
- int size;
- int strength;
-};
-
-struct backend_operations {
- // =========== Initialization ===========
-
- /// Initialize the backend, prepare for rendering to the target window.
- /// Here is how you should choose target window:
- /// 1) if ps->overlay is not XCB_NONE, use that
- /// 2) use ps->root otherwise
- // TODO(yshui) make the target window a parameter
- backend_t *(*init)(session_t *)attr_nonnull(1);
- void (*deinit)(backend_t *backend_data) attr_nonnull(1);
-
- /// Called when rendering will be stopped for an unknown amount of
- /// time (e.g. when screen is unredirected). Free some resources.
- ///
- /// Optional, not yet used
- void (*pause)(backend_t *backend_data, session_t *ps);
-
- /// Called before rendering is resumed
- ///
- /// Optional, not yet used
- void (*resume)(backend_t *backend_data, session_t *ps);
-
- /// Called when root property changed, returns the new
- /// backend_data. Even if the backend_data changed, all
- /// the existing image data returned by this backend should
- /// remain valid.
- ///
- /// Optional
- void *(*root_change)(backend_t *backend_data, session_t *ps);
-
- // =========== Rendering ============
-
- // NOTE: general idea about reg_paint/reg_op vs reg_visible is that reg_visible is
- // merely a hint. Ignoring reg_visible entirely don't affect the correctness of
- // the operation performed. OTOH reg_paint/reg_op is part of the parameters of the
- // operation, and must be honored in order to complete the operation correctly.
-
- // NOTE: due to complications introduced by use-damage and blur, the rendering API
- // is a bit weird. The idea is, `compose` and `blur` have to update a temporary
- // buffer, because `blur` requires data from an area slightly larger than the area
- // that will be visible. So the area outside the visible area has to be rendered,
- // but we have to discard the result (because the result of blurring that area
- // will be wrong). That's why we cannot render into the back buffer directly.
- // After rendering is done, `present` is called to update a portion of the actual
- // back buffer, then present it to the target (or update the target directly,
- // if not back buffered).
-
- /// Called before when a new frame starts.
- ///
- /// Optional
- void (*prepare)(backend_t *backend_data, const region_t *reg_damage);
-
- /**
- * Paint the content of an image onto the rendering buffer
- *
- * @param backend_data the backend data
- * @param image_data the image to paint
- * @param dst_x1, dst_y1 the top left corner of the image in the target
- * @param dst_x2, dst_y2 the top right corner of the image in the target
- * @param reg_paint the clip region, in target coordinates
- * @param reg_visible the visible region, in target coordinates
- */
- void (*compose)(backend_t *backend_data, void *image_data,
- int dst_x1, int dst_y1, int dst_x2, int dst_y2,
- const region_t *reg_paint, const region_t *reg_visible);
-
- /// Fill rectangle of the rendering buffer, mostly for debug purposes, optional.
- void (*fill)(backend_t *backend_data, struct color, const region_t *clip);
-
- /// Blur a given region of the rendering buffer.
- bool (*blur)(backend_t *backend_data, double opacity, void *blur_ctx,
- const region_t *reg_blur, const region_t *reg_visible)
- attr_nonnull(1, 3, 4, 5);
-
- /// Update part of the back buffer with the rendering buffer, then present the
- /// back buffer onto the target window (if not back buffered, update part of the
- /// target window directly).
- ///
- /// Optional, if NULL, indicates the backend doesn't have render output
- ///
- /// @param region part of the target that should be updated
- void (*present)(backend_t *backend_data, const region_t *region) attr_nonnull(1, 2);
-
- /**
- * Bind a X pixmap to the backend's internal image data structure.
- *
- * @param backend_data backend data
- * @param pixmap X pixmap to bind
- * @param fmt information of the pixmap's visual
- * @param owned whether the ownership of the pixmap is transfered to the backend
- * @return backend internal data structure bound with this pixmap
- */
- void *(*bind_pixmap)(backend_t *backend_data, xcb_pixmap_t pixmap,
- struct xvisual_info fmt, bool owned);
-
- /// Create a shadow image based on the parameters
- /// Default implementation: default_backend_render_shadow
- void *(*render_shadow)(backend_t *backend_data, int width, int height,
- const conv *kernel, double r, double g, double b, double a);
-
- // ============ Resource management ===========
-
- /// Free resources associated with an image data structure
- void (*release_image)(backend_t *backend_data, void *img_data) attr_nonnull(1, 2);
-
- // =========== Query ===========
-
- /// Return if image is not completely opaque.
- ///
- /// This function is needed because some backend might change the content of the
- /// window (e.g. when using a custom shader with the glx backend), so only the
- /// backend knows if an image is transparent.
- bool (*is_image_transparent)(backend_t *backend_data, void *image_data)
- attr_nonnull(1, 2);
-
- /// Get the age of the buffer content we are currently rendering ontop
- /// of. The buffer that has just been `present`ed has a buffer age of 1.
- /// Everytime `present` is called, buffers get older. Return -1 if the
- /// buffer is empty.
- ///
- /// Optional
- int (*buffer_age)(backend_t *backend_data);
-
- /// The maximum number buffer_age might return.
- int max_buffer_age;
-
- // =========== Post-processing ============
-
- /* TODO(yshui) Consider preserving the order of image ops.
- * Currently in both backends, the image ops are applied lazily when needed.
- * However neither backends preserve the order of image ops, they just applied all
- * pending lazy ops in a pre-determined fixed order, regardless in which order
- * they were originally applied. This might lead to inconsistencies.*/
-
- /**
- * Change image properties
- *
- * @param backend_data backend data
- * @param prop the property to change
- * @param image_data an image data structure returned by the backend
- * @param args property value
- * @return whether the operation is successful
- */
- bool (*set_image_property)(backend_t *backend_data, enum image_properties prop,
- void *image_data, void *args);
-
- /**
- * Manipulate an image. Image properties are untouched.
- *
- * @param backend_data backend data
- * @param op the operation to perform
- * @param image_data an image data structure returned by the backend
- * @param reg_op the clip region, define the part of the image to be
- * operated on.
- * @param reg_visible define the part of the image that will eventually
- * be visible on target. this is a hint to the backend
- * for optimization purposes.
- * @param args extra arguments, operation specific
- * @return whether the operation is successful
- */
- bool (*image_op)(backend_t *backend_data, enum image_operations op, void *image_data,
- const region_t *reg_op, const region_t *reg_visible, void *args);
-
- /// Create another instance of the `image_data`. All `image_op` and
- /// `set_image_property` calls on the returned image should not affect the
- /// original image
- void *(*clone_image)(backend_t *base, const void *image_data,
- const region_t *reg_visible);
-
- /// Create a blur context that can be used to call `blur`
- void *(*create_blur_context)(backend_t *base, enum blur_method, void *args);
- /// Destroy a blur context
- void (*destroy_blur_context)(backend_t *base, void *ctx);
- /// Get how many pixels outside of the blur area is needed for blur
- void (*get_blur_size)(void *blur_context, int *width, int *height);
-
- // =========== Hooks ============
- /// Let the backend hook into the event handling queue
- /// Not implemented yet
- void (*set_ready_callback)(backend_t *, backend_ready_callback_t cb);
- /// Called right after the core has handled its events.
- /// Not implemented yet
- void (*handle_events)(backend_t *);
- // =========== Misc ============
- /// Return the driver that is been used by the backend
- enum driver (*detect_driver)(backend_t *backend_data);
-
- void (*diagnostics)(backend_t *backend_data);
-
- enum device_status (*device_status)(backend_t *backend_data);
-};
-
-extern struct backend_operations *backend_list[];
-
-void paint_all_new(session_t *ps, struct managed_win *const t, bool ignore_damage)
- attr_nonnull(1);
diff --git a/dwm/picom/src/backend/backend_common.c b/dwm/picom/src/backend/backend_common.c
deleted file mode 100644
index 5bd75e2..0000000
--- a/dwm/picom/src/backend/backend_common.c
+++ /dev/null
@@ -1,483 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#include
-#include
-#include
-#include
-#include
-
-#include "backend/backend.h"
-#include "backend/backend_common.h"
-#include "common.h"
-#include "config.h"
-#include "kernel.h"
-#include "log.h"
-#include "utils.h"
-#include "win.h"
-#include "x.h"
-
-/**
- * Generate a 1x1 Picture of a particular color.
- */
-xcb_render_picture_t solid_picture(xcb_connection_t *c, xcb_drawable_t d, bool argb,
- double a, double r, double g, double b) {
- xcb_pixmap_t pixmap;
- xcb_render_picture_t picture;
- xcb_render_create_picture_value_list_t pa;
- xcb_render_color_t col;
- xcb_rectangle_t rect;
-
- pixmap = x_create_pixmap(c, argb ? 32 : 8, d, 1, 1);
- if (!pixmap)
- return XCB_NONE;
-
- pa.repeat = 1;
- picture = x_create_picture_with_standard_and_pixmap(
- c, argb ? XCB_PICT_STANDARD_ARGB_32 : XCB_PICT_STANDARD_A_8, pixmap,
- XCB_RENDER_CP_REPEAT, &pa);
-
- if (!picture) {
- xcb_free_pixmap(c, pixmap);
- return XCB_NONE;
- }
-
- col.alpha = (uint16_t)(a * 0xffff);
- col.red = (uint16_t)(r * 0xffff);
- col.green = (uint16_t)(g * 0xffff);
- col.blue = (uint16_t)(b * 0xffff);
-
- rect.x = 0;
- rect.y = 0;
- rect.width = 1;
- rect.height = 1;
-
- xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, picture, col, 1, &rect);
- xcb_free_pixmap(c, pixmap);
-
- return picture;
-}
-
-xcb_image_t *
-make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height) {
- /*
- * We classify shadows into 4 kinds of regions
- * r = shadow radius
- * (0, 0) is the top left of the window itself
- * -r r width-r width+r
- * -r +-----+---------+-----+
- * | 1 | 2 | 1 |
- * r +-----+---------+-----+
- * | 2 | 3 | 2 |
- * height-r +-----+---------+-----+
- * | 1 | 2 | 1 |
- * height+r +-----+---------+-----+
- */
- xcb_image_t *ximage;
- const double *shadow_sum = kernel->rsum;
- assert(shadow_sum);
- // We only support square kernels for shadow
- assert(kernel->w == kernel->h);
- int d = kernel->w;
- int r = d / 2;
- int swidth = width + r * 2, sheight = height + r * 2;
-
- assert(d % 2 == 1);
- assert(d > 0);
-
- ximage = xcb_image_create_native(c, to_u16_checked(swidth), to_u16_checked(sheight),
- XCB_IMAGE_FORMAT_Z_PIXMAP, 8, 0, 0, NULL);
- if (!ximage) {
- log_error("failed to create an X image");
- return 0;
- }
-
- unsigned char *data = ximage->data;
- long long sstride = ximage->stride;
-
- // If the window body is smaller than the kernel, we do convolution directly
- if (width < r * 2 && height < r * 2) {
- for (int y = 0; y < sheight; y++) {
- for (int x = 0; x < swidth; x++) {
- double sum = sum_kernel_normalized(
- kernel, d - x - 1, d - y - 1, width, height);
- data[y * sstride + x] = (uint8_t)(sum * 255.0 * opacity);
- }
- }
- return ximage;
- }
-
- if (height < r * 2) {
- // Implies width >= r * 2
- // If the window height is smaller than the kernel, we divide
- // the window like this:
- // -r r width-r width+r
- // +------+-------------+------+
- // | | | |
- // +------+-------------+------+
- for (int y = 0; y < sheight; y++) {
- for (int x = 0; x < r * 2; x++) {
- double sum = sum_kernel_normalized(kernel, d - x - 1,
- d - y - 1, d, height) *
- 255.0 * opacity;
- data[y * sstride + x] = (uint8_t)sum;
- data[y * sstride + swidth - x - 1] = (uint8_t)sum;
- }
- }
- for (int y = 0; y < sheight; y++) {
- double sum = sum_kernel_normalized(kernel, 0, d - y - 1, d, height) *
- 255.0 * opacity;
- memset(&data[y * sstride + r * 2], (uint8_t)sum,
- (size_t)(width - 2 * r));
- }
- return ximage;
- }
- if (width < r * 2) {
- // Similarly, for width smaller than kernel
- for (int y = 0; y < r * 2; y++) {
- for (int x = 0; x < swidth; x++) {
- double sum = sum_kernel_normalized(kernel, d - x - 1,
- d - y - 1, width, d) *
- 255.0 * opacity;
- data[y * sstride + x] = (uint8_t)sum;
- data[(sheight - y - 1) * sstride + x] = (uint8_t)sum;
- }
- }
- for (int x = 0; x < swidth; x++) {
- double sum = sum_kernel_normalized(kernel, d - x - 1, 0, width, d) *
- 255.0 * opacity;
- for (int y = r * 2; y < height; y++) {
- data[y * sstride + x] = (uint8_t)sum;
- }
- }
- return ximage;
- }
-
- // Implies: width >= r * 2 && height >= r * 2
-
- // Fill part 3
- for (int y = r; y < height + r; y++) {
- memset(data + sstride * y + r, (uint8_t)(255 * opacity), (size_t)width);
- }
-
- // Part 1
- for (int y = 0; y < r * 2; y++) {
- for (int x = 0; x < r * 2; x++) {
- double tmpsum = shadow_sum[y * d + x] * opacity * 255.0;
- data[y * sstride + x] = (uint8_t)tmpsum;
- data[(sheight - y - 1) * sstride + x] = (uint8_t)tmpsum;
- data[(sheight - y - 1) * sstride + (swidth - x - 1)] = (uint8_t)tmpsum;
- data[y * sstride + (swidth - x - 1)] = (uint8_t)tmpsum;
- }
- }
-
- // Part 2, top/bottom
- for (int y = 0; y < r * 2; y++) {
- double tmpsum = shadow_sum[d * y + d - 1] * opacity * 255.0;
- memset(&data[y * sstride + r * 2], (uint8_t)tmpsum, (size_t)(width - r * 2));
- memset(&data[(sheight - y - 1) * sstride + r * 2], (uint8_t)tmpsum,
- (size_t)(width - r * 2));
- }
-
- // Part 2, left/right
- for (int x = 0; x < r * 2; x++) {
- double tmpsum = shadow_sum[d * (d - 1) + x] * opacity * 255.0;
- for (int y = r * 2; y < height; y++) {
- data[y * sstride + x] = (uint8_t)tmpsum;
- data[y * sstride + (swidth - x - 1)] = (uint8_t)tmpsum;
- }
- }
-
- return ximage;
-}
-
-/**
- * Generate shadow Picture for a window.
- */
-bool build_shadow(xcb_connection_t *c, xcb_drawable_t d, double opacity, const int width,
- const int height, const conv *kernel, xcb_render_picture_t shadow_pixel,
- xcb_pixmap_t *pixmap, xcb_render_picture_t *pict) {
- xcb_image_t *shadow_image = NULL;
- xcb_pixmap_t shadow_pixmap = XCB_NONE, shadow_pixmap_argb = XCB_NONE;
- xcb_render_picture_t shadow_picture = XCB_NONE, shadow_picture_argb = XCB_NONE;
- xcb_gcontext_t gc = XCB_NONE;
-
- shadow_image = make_shadow(c, kernel, opacity, width, height);
- if (!shadow_image) {
- log_error("Failed to make shadow");
- return false;
- }
-
- shadow_pixmap = x_create_pixmap(c, 8, d, shadow_image->width, shadow_image->height);
- shadow_pixmap_argb =
- x_create_pixmap(c, 32, d, shadow_image->width, shadow_image->height);
-
- if (!shadow_pixmap || !shadow_pixmap_argb) {
- log_error("Failed to create shadow pixmaps");
- goto shadow_picture_err;
- }
-
- shadow_picture = x_create_picture_with_standard_and_pixmap(
- c, XCB_PICT_STANDARD_A_8, shadow_pixmap, 0, NULL);
- shadow_picture_argb = x_create_picture_with_standard_and_pixmap(
- c, XCB_PICT_STANDARD_ARGB_32, shadow_pixmap_argb, 0, NULL);
- if (!shadow_picture || !shadow_picture_argb) {
- goto shadow_picture_err;
- }
-
- gc = x_new_id(c);
- xcb_create_gc(c, gc, shadow_pixmap, 0, NULL);
-
- // We need to make room for protocol metadata in the request. The metadata should
- // be 24 bytes plus padding, let's be generous and give it 1kb
- auto maximum_image_size = xcb_get_maximum_request_length(c) * 4 - 1024;
- auto maximum_row =
- to_u16_checked(clamp(maximum_image_size / shadow_image->stride, 0, UINT16_MAX));
- if (maximum_row <= 0) {
- // TODO(yshui) Upload image with XShm
- log_error("X server request size limit is too restrictive, or the shadow "
- "image is too wide for us to send a single row of the shadow "
- "image. Shadow size: %dx%d",
- width, height);
- goto shadow_picture_err;
- }
-
- for (uint32_t row = 0; row < shadow_image->height; row += maximum_row) {
- auto batch_height = maximum_row;
- if (batch_height > shadow_image->height - row) {
- batch_height = to_u16_checked(shadow_image->height - row);
- }
-
- uint32_t offset = row * shadow_image->stride / sizeof(*shadow_image->data);
- xcb_put_image(c, (uint8_t)shadow_image->format, shadow_pixmap, gc,
- shadow_image->width, batch_height, 0, to_i16_checked(row),
- 0, shadow_image->depth, shadow_image->stride * batch_height,
- shadow_image->data + offset);
- }
-
- xcb_render_composite(c, XCB_RENDER_PICT_OP_SRC, shadow_pixel, shadow_picture,
- shadow_picture_argb, 0, 0, 0, 0, 0, 0, shadow_image->width,
- shadow_image->height);
-
- *pixmap = shadow_pixmap_argb;
- *pict = shadow_picture_argb;
-
- xcb_free_gc(c, gc);
- xcb_image_destroy(shadow_image);
- xcb_free_pixmap(c, shadow_pixmap);
- xcb_render_free_picture(c, shadow_picture);
-
- return true;
-
-shadow_picture_err:
- if (shadow_image) {
- xcb_image_destroy(shadow_image);
- }
- if (shadow_pixmap) {
- xcb_free_pixmap(c, shadow_pixmap);
- }
- if (shadow_pixmap_argb) {
- xcb_free_pixmap(c, shadow_pixmap_argb);
- }
- if (shadow_picture) {
- xcb_render_free_picture(c, shadow_picture);
- }
- if (shadow_picture_argb) {
- xcb_render_free_picture(c, shadow_picture_argb);
- }
- if (gc) {
- xcb_free_gc(c, gc);
- }
-
- return false;
-}
-
-void *
-default_backend_render_shadow(backend_t *backend_data, int width, int height,
- const conv *kernel, double r, double g, double b, double a) {
- xcb_pixmap_t shadow_pixel = solid_picture(backend_data->c, backend_data->root,
- true, 1, r, g, b),
- shadow = XCB_NONE;
- xcb_render_picture_t pict = XCB_NONE;
-
- if (!build_shadow(backend_data->c, backend_data->root, a, width, height, kernel,
- shadow_pixel, &shadow, &pict)) {
- return NULL;
- }
-
- auto visual = x_get_visual_for_standard(backend_data->c, XCB_PICT_STANDARD_ARGB_32);
- void *ret = backend_data->ops->bind_pixmap(
- backend_data, shadow, x_get_visual_info(backend_data->c, visual), true);
- xcb_render_free_picture(backend_data->c, pict);
- return ret;
-}
-
-static struct conv **generate_box_blur_kernel(struct box_blur_args *args, int *kernel_count) {
- int r = args->size * 2 + 1;
- assert(r > 0);
- auto ret = ccalloc(2, struct conv *);
- ret[0] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r);
- ret[1] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r);
- ret[0]->w = r;
- ret[0]->h = 1;
- ret[1]->w = 1;
- ret[1]->h = r;
- for (int i = 0; i < r; i++) {
- ret[0]->data[i] = 1;
- ret[1]->data[i] = 1;
- }
- *kernel_count = 2;
- return ret;
-}
-
-static struct conv **
-generate_gaussian_blur_kernel(struct gaussian_blur_args *args, int *kernel_count) {
- int r = args->size * 2 + 1;
- assert(r > 0);
- auto ret = ccalloc(2, struct conv *);
- ret[0] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r);
- ret[1] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r);
- ret[0]->w = r;
- ret[0]->h = 1;
- ret[1]->w = 1;
- ret[1]->h = r;
- for (int i = 0; i <= args->size; i++) {
- ret[0]->data[i] = ret[0]->data[r - i - 1] =
- 1.0 / (sqrt(2.0 * M_PI) * args->deviation) *
- exp(-(args->size - i) * (args->size - i) /
- (2 * args->deviation * args->deviation));
- ret[1]->data[i] = ret[1]->data[r - i - 1] = ret[0]->data[i];
- }
- *kernel_count = 2;
- return ret;
-}
-
-/// Generate blur kernels for gaussian and box blur methods. Generated kernel is not
-/// normalized, and the center element will always be 1.
-struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count) {
- switch (method) {
- case BLUR_METHOD_BOX: return generate_box_blur_kernel(args, kernel_count);
- case BLUR_METHOD_GAUSSIAN:
- return generate_gaussian_blur_kernel(args, kernel_count);
- default: break;
- }
- return NULL;
-}
-
-/// Generate kernel parameters for dual-kawase blur method. Falls back on approximating
-/// standard gauss radius if strength is zero or below.
-struct dual_kawase_params *generate_dual_kawase_params(void *args) {
- struct dual_kawase_blur_args *blur_args = args;
- static const struct {
- int iterations; /// Number of down- and upsample iterations
- float offset; /// Sample offset in half-pixels
- int min_radius; /// Approximate gauss-blur with at least this
- /// radius and std-deviation
- } strength_levels[20] = {
- {.iterations = 1, .offset = 1.25f, .min_radius = 1}, // LVL 1
- {.iterations = 1, .offset = 2.25f, .min_radius = 6}, // LVL 2
- {.iterations = 2, .offset = 2.00f, .min_radius = 11}, // LVL 3
- {.iterations = 2, .offset = 3.00f, .min_radius = 17}, // LVL 4
- {.iterations = 2, .offset = 4.25f, .min_radius = 24}, // LVL 5
- {.iterations = 3, .offset = 2.50f, .min_radius = 32}, // LVL 6
- {.iterations = 3, .offset = 3.25f, .min_radius = 40}, // LVL 7
- {.iterations = 3, .offset = 4.25f, .min_radius = 51}, // LVL 8
- {.iterations = 3, .offset = 5.50f, .min_radius = 67}, // LVL 9
- {.iterations = 4, .offset = 3.25f, .min_radius = 83}, // LVL 10
- {.iterations = 4, .offset = 4.00f, .min_radius = 101}, // LVL 11
- {.iterations = 4, .offset = 5.00f, .min_radius = 123}, // LVL 12
- {.iterations = 4, .offset = 6.00f, .min_radius = 148}, // LVL 13
- {.iterations = 4, .offset = 7.25f, .min_radius = 178}, // LVL 14
- {.iterations = 4, .offset = 8.25f, .min_radius = 208}, // LVL 15
- {.iterations = 5, .offset = 4.50f, .min_radius = 236}, // LVL 16
- {.iterations = 5, .offset = 5.25f, .min_radius = 269}, // LVL 17
- {.iterations = 5, .offset = 6.25f, .min_radius = 309}, // LVL 18
- {.iterations = 5, .offset = 7.25f, .min_radius = 357}, // LVL 19
- {.iterations = 5, .offset = 8.50f, .min_radius = 417}, // LVL 20
- };
-
- auto params = ccalloc(1, struct dual_kawase_params);
- params->iterations = 0;
- params->offset = 1.0f;
-
- if (blur_args->strength <= 0 && blur_args->size) {
- // find highest level that approximates blur-strength with the selected
- // gaussian blur-radius
- int lvl = 1;
- while (strength_levels[lvl - 1].min_radius < blur_args->size && lvl < 20) {
- ++lvl;
- }
- blur_args->strength = lvl;
- }
- if (blur_args->strength <= 0) {
- // default value
- blur_args->strength = 5;
- }
-
- assert(blur_args->strength > 0 && blur_args->strength <= 20);
- params->iterations = strength_levels[blur_args->strength - 1].iterations;
- params->offset = strength_levels[blur_args->strength - 1].offset;
-
- // Expand sample area to cover the smallest texture / highest selected iteration:
- // - Smallest texture dimensions are halved `iterations`-times
- // - Upsample needs pixels two-times `offset` away from the border
- // - Plus one for interpolation differences
- params->expand = (1 << params->iterations) * 2 * (int)ceil(params->offset) + 1;
-
- return params;
-}
-
-void *default_clone_image(backend_t *base attr_unused, const void *image_data,
- const region_t *reg_visible attr_unused) {
- auto new_img = ccalloc(1, struct backend_image);
- *new_img = *(struct backend_image *)image_data;
- new_img->inner->refcount++;
- return new_img;
-}
-
-bool default_set_image_property(backend_t *base attr_unused, enum image_properties op,
- void *image_data, void *arg) {
- struct backend_image *tex = image_data;
- int *iargs = arg;
- bool *bargs = arg;
- double *dargs = arg;
- switch (op) {
- case IMAGE_PROPERTY_INVERTED: tex->color_inverted = bargs[0]; break;
- case IMAGE_PROPERTY_DIM_LEVEL: tex->dim = dargs[0]; break;
- case IMAGE_PROPERTY_OPACITY: tex->opacity = dargs[0]; break;
- case IMAGE_PROPERTY_EFFECTIVE_SIZE:
- // texture is already set to repeat, so nothing else we need to do
- tex->ewidth = iargs[0];
- tex->eheight = iargs[1];
- break;
- case IMAGE_PROPERTY_CORNER_RADIUS: tex->corner_radius = dargs[0]; break;
- case IMAGE_PROPERTY_MAX_BRIGHTNESS: tex->max_brightness = dargs[0]; break;
- case IMAGE_PROPERTY_BORDER_WIDTH: tex->border_width = *(int *)arg; break;
- }
-
- return true;
-}
-
-bool default_is_image_transparent(backend_t *base attr_unused, void *image_data) {
- struct backend_image *img = image_data;
- return img->opacity < 1 || img->inner->has_alpha;
-}
-
-struct backend_image *default_new_backend_image(int w, int h) {
- auto ret = ccalloc(1, struct backend_image);
- ret->opacity = 1;
- ret->dim = 0;
- ret->max_brightness = 1;
- ret->eheight = h;
- ret->ewidth = w;
- ret->color_inverted = false;
- ret->corner_radius = 0;
- return ret;
-}
-
-void init_backend_base(struct backend_base *base, session_t *ps) {
- base->c = ps->c;
- base->loop = ps->loop;
- base->root = ps->root;
- base->busy = false;
- base->ops = NULL;
-}
diff --git a/dwm/picom/src/backend/backend_common.h b/dwm/picom/src/backend/backend_common.h
deleted file mode 100644
index 53b4a26..0000000
--- a/dwm/picom/src/backend/backend_common.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#pragma once
-
-#include
-#include
-
-#include
-
-#include "backend.h"
-#include "config.h"
-#include "region.h"
-
-typedef struct session session_t;
-typedef struct win win;
-typedef struct conv conv;
-typedef struct backend_base backend_t;
-struct backend_operations;
-
-struct dual_kawase_params {
- /// Number of downsample passes
- int iterations;
- /// Pixel offset for down- and upsample
- float offset;
- /// Save area around blur target (@ref resize_width, @ref resize_height)
- int expand;
-};
-
-struct backend_image_inner_base {
- int refcount;
- bool has_alpha;
-};
-
-struct backend_image {
- // Backend dependent inner image data
- struct backend_image_inner_base *inner;
- double opacity;
- double dim;
- double max_brightness;
- double corner_radius;
- // Effective size of the image
- int ewidth, eheight;
- bool color_inverted;
- int border_width;
-};
-
-bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, int width,
- int height, const conv *kernel, xcb_render_picture_t shadow_pixel,
- xcb_pixmap_t *pixmap, xcb_render_picture_t *pict);
-
-xcb_render_picture_t solid_picture(xcb_connection_t *, xcb_drawable_t, bool argb,
- double a, double r, double g, double b);
-
-xcb_image_t *
-make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height);
-
-/// The default implementation of `is_win_transparent`, it simply looks at win::mode. So
-/// this is not suitable for backends that alter the content of windows
-bool default_is_win_transparent(void *, win *, void *);
-
-/// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same
-/// caveat as `default_is_win_transparent` applies.
-bool default_is_frame_transparent(void *, win *, void *);
-
-void *
-default_backend_render_shadow(backend_t *backend_data, int width, int height,
- const conv *kernel, double r, double g, double b, double a);
-
-void init_backend_base(struct backend_base *base, session_t *ps);
-
-struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count);
-struct dual_kawase_params *generate_dual_kawase_params(void *args);
-
-void *default_clone_image(backend_t *base, const void *image_data, const region_t *reg);
-void *default_resize_image(backend_t *base, const void *image_data, uint16_t desired_width,
- uint16_t desired_height, const region_t *reg);
-bool default_is_image_transparent(backend_t *base attr_unused, void *image_data);
-bool default_set_image_property(backend_t *base attr_unused, enum image_properties op,
- void *image_data, void *arg);
-struct backend_image *default_new_backend_image(int w, int h);
diff --git a/dwm/picom/src/backend/driver.c b/dwm/picom/src/backend/driver.c
deleted file mode 100644
index a41d2fd..0000000
--- a/dwm/picom/src/backend/driver.c
+++ /dev/null
@@ -1,82 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#include
-#include
-
-#include
-#include
-
-#include "backend/backend.h"
-#include "backend/driver.h"
-#include "common.h"
-#include "compiler.h"
-#include "log.h"
-
-/// Apply driver specified global workarounds. It's safe to call this multiple times.
-void apply_driver_workarounds(struct session *ps, enum driver driver) {
- if (driver & DRIVER_NVIDIA) {
- // setenv("__GL_YIELD", "usleep", true);
- setenv("__GL_MaxFramesAllowed", "1", true);
- ps->o.xrender_sync_fence = true;
- }
-}
-
-enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_window_t window) {
- enum driver ret = 0;
- // First we try doing backend agnostic detection using RANDR
- // There's no way to query the X server about what driver is loaded, so RANDR is
- // our best shot.
- auto randr_version = xcb_randr_query_version_reply(
- c, xcb_randr_query_version(c, XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION),
- NULL);
- if (randr_version &&
- (randr_version->major_version > 1 || randr_version->minor_version >= 4)) {
- auto r = xcb_randr_get_providers_reply(
- c, xcb_randr_get_providers(c, window), NULL);
- if (r == NULL) {
- log_warn("Failed to get RANDR providers");
- free(randr_version);
- return 0;
- }
-
- auto providers = xcb_randr_get_providers_providers(r);
- for (auto i = 0; i < xcb_randr_get_providers_providers_length(r); i++) {
- auto r2 = xcb_randr_get_provider_info_reply(
- c, xcb_randr_get_provider_info(c, providers[i], r->timestamp), NULL);
- if (r2 == NULL) {
- continue;
- }
- if (r2->num_outputs == 0) {
- free(r2);
- continue;
- }
-
- auto name_len = xcb_randr_get_provider_info_name_length(r2);
- assert(name_len >= 0);
- auto name =
- strndup(xcb_randr_get_provider_info_name(r2), (size_t)name_len);
- if (strcasestr(name, "modesetting") != NULL) {
- ret |= DRIVER_MODESETTING;
- } else if (strcasestr(name, "Radeon") != NULL) {
- // Be conservative, add both radeon drivers
- ret |= DRIVER_AMDGPU | DRIVER_RADEON;
- } else if (strcasestr(name, "NVIDIA") != NULL) {
- ret |= DRIVER_NVIDIA;
- } else if (strcasestr(name, "nouveau") != NULL) {
- ret |= DRIVER_NOUVEAU;
- } else if (strcasestr(name, "Intel") != NULL) {
- ret |= DRIVER_INTEL;
- }
- free(name);
- free(r2);
- }
- free(r);
- }
- free(randr_version);
-
- // If the backend supports driver detection, use that as well
- if (backend_data && backend_data->ops->detect_driver) {
- ret |= backend_data->ops->detect_driver(backend_data);
- }
- return ret;
-}
diff --git a/dwm/picom/src/backend/driver.h b/dwm/picom/src/backend/driver.h
deleted file mode 100644
index a37cda3..0000000
--- a/dwm/picom/src/backend/driver.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-
-#pragma once
-
-#include
-#include
-#include
-
-#include "utils.h"
-
-struct session;
-struct backend_base;
-
-// A list of known driver quirks:
-// * NVIDIA driver doesn't like seeing the same pixmap under different
-// ids, so avoid naming the pixmap again when it didn't actually change.
-
-/// A list of possible drivers.
-/// The driver situation is a bit complicated. There are two drivers we care about: the
-/// DDX, and the OpenGL driver. They are usually paired, but not always, since there is
-/// also the generic modesetting driver.
-/// This enum represents _both_ drivers.
-enum driver {
- DRIVER_AMDGPU = 1, // AMDGPU for DDX, radeonsi for OpenGL
- DRIVER_RADEON = 2, // ATI for DDX, mesa r600 for OpenGL
- DRIVER_FGLRX = 4,
- DRIVER_NVIDIA = 8,
- DRIVER_NOUVEAU = 16,
- DRIVER_INTEL = 32,
- DRIVER_MODESETTING = 64,
-};
-
-static const char *driver_names[] = {
- "AMDGPU", "Radeon", "fglrx", "NVIDIA", "nouveau", "Intel", "modesetting",
-};
-
-/// Return a list of all drivers currently in use by the X server.
-/// Note, this is a best-effort test, so no guarantee all drivers will be detected.
-enum driver detect_driver(xcb_connection_t *, struct backend_base *, xcb_window_t);
-
-/// Apply driver specified global workarounds. It's safe to call this multiple times.
-void apply_driver_workarounds(struct session *ps, enum driver);
-
-// Print driver names to stdout, for diagnostics
-static inline void print_drivers(enum driver drivers) {
- const char *seen_drivers[ARR_SIZE(driver_names)];
- int driver_count = 0;
- for (size_t i = 0; i < ARR_SIZE(driver_names); i++) {
- if (drivers & (1ul << i)) {
- seen_drivers[driver_count++] = driver_names[i];
- }
- }
-
- if (driver_count > 0) {
- printf("%s", seen_drivers[0]);
- for (int i = 1; i < driver_count; i++) {
- printf(", %s", seen_drivers[i]);
- }
- }
- printf("\n");
-}
diff --git a/dwm/picom/src/backend/dummy/dummy.c b/dwm/picom/src/backend/dummy/dummy.c
deleted file mode 100644
index a057b97..0000000
--- a/dwm/picom/src/backend/dummy/dummy.c
+++ /dev/null
@@ -1,174 +0,0 @@
-#include
-#include
-
-#include "backend/backend.h"
-#include "backend/backend_common.h"
-#include "common.h"
-#include "compiler.h"
-#include "config.h"
-#include "log.h"
-#include "region.h"
-#include "types.h"
-#include "uthash_extra.h"
-#include "utils.h"
-#include "x.h"
-
-struct dummy_image {
- xcb_pixmap_t pixmap;
- bool transparent;
- int *refcount;
- UT_hash_handle hh;
-};
-
-struct dummy_data {
- struct backend_base base;
- struct dummy_image *images;
-};
-
-struct backend_base *dummy_init(struct session *ps attr_unused) {
- auto ret = (struct backend_base *)ccalloc(1, struct dummy_data);
- ret->c = ps->c;
- ret->loop = ps->loop;
- ret->root = ps->root;
- ret->busy = false;
- return ret;
-}
-
-void dummy_deinit(struct backend_base *data) {
- auto dummy = (struct dummy_data *)data;
- HASH_ITER2(dummy->images, img) {
- log_warn("Backend image for pixmap %#010x is not freed", img->pixmap);
- HASH_DEL(dummy->images, img);
- free(img->refcount);
- free(img);
- }
- free(dummy);
-}
-
-static void dummy_check_image(struct backend_base *base, const struct dummy_image *img) {
- auto dummy = (struct dummy_data *)base;
- struct dummy_image *tmp = NULL;
- HASH_FIND_INT(dummy->images, &img->pixmap, tmp);
- if (!tmp) {
- log_warn("Using an invalid (possibly freed) image");
- assert(false);
- }
- assert(*tmp->refcount > 0);
-}
-
-void dummy_compose(struct backend_base *base, void *image, int dst_x1 attr_unused,
- int dst_y1 attr_unused, int dst_x2 attr_unused, int dst_y2 attr_unused,
- const region_t *reg_paint attr_unused, const region_t *reg_visible attr_unused) {
- dummy_check_image(base, image);
-}
-
-void dummy_fill(struct backend_base *backend_data attr_unused, struct color c attr_unused,
- const region_t *clip attr_unused) {
-}
-
-bool dummy_blur(struct backend_base *backend_data attr_unused, double opacity attr_unused,
- void *blur_ctx attr_unused, const region_t *reg_blur attr_unused,
- const region_t *reg_visible attr_unused) {
- return true;
-}
-
-void *dummy_bind_pixmap(struct backend_base *base, xcb_pixmap_t pixmap,
- struct xvisual_info fmt, bool owned attr_unused) {
- auto dummy = (struct dummy_data *)base;
- struct dummy_image *img = NULL;
- HASH_FIND_INT(dummy->images, &pixmap, img);
- if (img) {
- (*img->refcount)++;
- return img;
- }
-
- img = ccalloc(1, struct dummy_image);
- img->pixmap = pixmap;
- img->transparent = fmt.alpha_size != 0;
- img->refcount = ccalloc(1, int);
- *img->refcount = 1;
-
- HASH_ADD_INT(dummy->images, pixmap, img);
- return (void *)img;
-}
-
-void dummy_release_image(backend_t *base, void *image) {
- auto dummy = (struct dummy_data *)base;
- auto img = (struct dummy_image *)image;
- assert(*img->refcount > 0);
- (*img->refcount)--;
- if (*img->refcount == 0) {
- HASH_DEL(dummy->images, img);
- free(img->refcount);
- free(img);
- }
-}
-
-bool dummy_is_image_transparent(struct backend_base *base, void *image) {
- auto img = (struct dummy_image *)image;
- dummy_check_image(base, img);
- return img->transparent;
-}
-
-int dummy_buffer_age(struct backend_base *base attr_unused) {
- return 2;
-}
-
-bool dummy_image_op(struct backend_base *base, enum image_operations op attr_unused,
- void *image, const region_t *reg_op attr_unused,
- const region_t *reg_visible attr_unused, void *args attr_unused) {
- dummy_check_image(base, image);
- return true;
-}
-
-bool dummy_set_image_property(struct backend_base *base, enum image_properties prop attr_unused,
- void *image, void *arg attr_unused) {
- dummy_check_image(base, image);
- return true;
-}
-
-void *dummy_clone_image(struct backend_base *base, const void *image,
- const region_t *reg_visible attr_unused) {
- auto img = (const struct dummy_image *)image;
- dummy_check_image(base, img);
- (*img->refcount)++;
- return (void *)img;
-}
-
-void *dummy_create_blur_context(struct backend_base *base attr_unused,
- enum blur_method method attr_unused, void *args attr_unused) {
- static int dummy_context;
- return &dummy_context;
-}
-
-void dummy_destroy_blur_context(struct backend_base *base attr_unused, void *ctx attr_unused) {
-}
-
-void dummy_get_blur_size(void *ctx attr_unused, int *width, int *height) {
- // These numbers are arbitrary, to make sure the reisze_region code path is
- // covered.
- *width = 5;
- *height = 5;
-}
-
-struct backend_operations dummy_ops = {
- .init = dummy_init,
- .deinit = dummy_deinit,
- .compose = dummy_compose,
- .fill = dummy_fill,
- .blur = dummy_blur,
- .bind_pixmap = dummy_bind_pixmap,
- .render_shadow = default_backend_render_shadow,
- .release_image = dummy_release_image,
- .is_image_transparent = dummy_is_image_transparent,
- .buffer_age = dummy_buffer_age,
- .max_buffer_age = 5,
-
- .image_op = dummy_image_op,
- .clone_image = dummy_clone_image,
- .set_image_property = dummy_set_image_property,
- .create_blur_context = dummy_create_blur_context,
- .destroy_blur_context = dummy_destroy_blur_context,
- .get_blur_size = dummy_get_blur_size,
-
-};
diff --git a/dwm/picom/src/backend/gl/gl_common.c b/dwm/picom/src/backend/gl/gl_common.c
deleted file mode 100644
index bf00e74..0000000
--- a/dwm/picom/src/backend/gl/gl_common.c
+++ /dev/null
@@ -1,1946 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#include
-#include
-#include
-#include
-#include
-#include
-#include // for xcb_render_fixed_t, XXX
-
-#include "backend/backend.h"
-#include "common.h"
-#include "compiler.h"
-#include "config.h"
-#include "kernel.h"
-#include "log.h"
-#include "region.h"
-#include "string_utils.h"
-#include "types.h"
-#include "utils.h"
-
-#include "backend/backend_common.h"
-#include "backend/gl/gl_common.h"
-
-#define GLSL(version, ...) "#version " #version "\n" #__VA_ARGS__
-#define QUOTE(...) #__VA_ARGS__
-
-static const GLuint vert_coord_loc = 0;
-static const GLuint vert_in_texcoord_loc = 1;
-
-struct gl_blur_context {
- enum blur_method method;
- gl_blur_shader_t *blur_shader;
-
- /// Temporary textures used for blurring
- GLuint *blur_textures;
- int blur_texture_count;
- /// Temporary fbos used for blurring
- GLuint *blur_fbos;
- int blur_fbo_count;
-
- /// Cached dimensions of each blur_texture. They are the same size as the target,
- /// so they are always big enough without resizing.
- /// Turns out calling glTexImage to resize is expensive, so we avoid that.
- struct texture_size {
- int width;
- int height;
- } * texture_sizes;
-
- /// Cached dimensions of the offscreen framebuffer. It's the same size as the
- /// target but is expanded in either direction by resize_width / resize_height.
- int fb_width, fb_height;
-
- /// How much do we need to resize the damaged region for blurring.
- int resize_width, resize_height;
-
- int npasses;
-};
-
-GLuint gl_create_shader(GLenum shader_type, const char *shader_str) {
- log_trace("===\n%s\n===", shader_str);
-
- bool success = false;
- GLuint shader = glCreateShader(shader_type);
- if (!shader) {
- log_error("Failed to create shader with type %#x.", shader_type);
- goto end;
- }
- glShaderSource(shader, 1, &shader_str, NULL);
- glCompileShader(shader);
-
- // Get shader status
- {
- GLint status = GL_FALSE;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
- if (GL_FALSE == status) {
- GLint log_len = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_len);
- if (log_len) {
- char log[log_len + 1];
- glGetShaderInfoLog(shader, log_len, NULL, log);
- log_error("Failed to compile shader with type %d: %s",
- shader_type, log);
- }
- goto end;
- }
- }
-
- success = true;
-
-end:
- if (shader && !success) {
- glDeleteShader(shader);
- shader = 0;
- }
-
- return shader;
-}
-
-GLuint gl_create_program(const GLuint *const shaders, int nshaders) {
- bool success = false;
- GLuint program = glCreateProgram();
- if (!program) {
- log_error("Failed to create program.");
- goto end;
- }
-
- for (int i = 0; i < nshaders; ++i)
- glAttachShader(program, shaders[i]);
- glLinkProgram(program);
-
- // Get program status
- {
- GLint status = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &status);
- if (GL_FALSE == status) {
- GLint log_len = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_len);
- if (log_len) {
- char log[log_len + 1];
- glGetProgramInfoLog(program, log_len, NULL, log);
- log_error("Failed to link program: %s", log);
- }
- goto end;
- }
- }
- success = true;
-
-end:
- if (program) {
- for (int i = 0; i < nshaders; ++i)
- glDetachShader(program, shaders[i]);
- }
- if (program && !success) {
- glDeleteProgram(program);
- program = 0;
- }
-
- return program;
-}
-
-/**
- * @brief Create a program from vertex and fragment shader strings.
- */
-GLuint gl_create_program_from_str(const char *vert_shader_str, const char *frag_shader_str) {
- GLuint vert_shader = 0;
- GLuint frag_shader = 0;
- GLuint prog = 0;
-
- if (vert_shader_str)
- vert_shader = gl_create_shader(GL_VERTEX_SHADER, vert_shader_str);
- if (frag_shader_str)
- frag_shader = gl_create_shader(GL_FRAGMENT_SHADER, frag_shader_str);
-
- {
- GLuint shaders[2];
- int count = 0;
- if (vert_shader) {
- shaders[count++] = vert_shader;
- }
- if (frag_shader) {
- shaders[count++] = frag_shader;
- }
- if (count) {
- prog = gl_create_program(shaders, count);
- }
- }
-
- if (vert_shader)
- glDeleteShader(vert_shader);
- if (frag_shader)
- glDeleteShader(frag_shader);
-
- return prog;
-}
-
-static void gl_free_prog_main(gl_win_shader_t *pprogram) {
- if (!pprogram)
- return;
- if (pprogram->prog) {
- glDeleteProgram(pprogram->prog);
- pprogram->prog = 0;
- }
-}
-
-/*
- * @brief Implements recursive part of gl_average_texture_color.
- *
- * @note In order to reduce number of textures which needs to be
- * allocated and deleted during this recursive render
- * we reuse the same two textures for render source and
- * destination simply by alterating between them.
- * Unfortunately on first iteration source_texture might
- * be read-only. In this case we will select auxiliary_texture as
- * destination_texture in order not to touch that read-only source
- * texture in following render iteration.
- * Otherwise we simply will switch source and destination textures
- * between each other on each render iteration.
- */
-static GLuint
-_gl_average_texture_color(backend_t *base, GLuint source_texture, GLuint destination_texture,
- GLuint auxiliary_texture, GLuint fbo, int width, int height) {
- const int max_width = 1;
- const int max_height = 1;
- const int from_width = next_power_of_two(width);
- const int from_height = next_power_of_two(height);
- const int to_width = from_width > max_width ? from_width / 2 : from_width;
- const int to_height = from_height > max_height ? from_height / 2 : from_height;
-
- // Prepare coordinates
- GLint coord[] = {
- // top left
- 0, 0, // vertex coord
- 0, 0, // texture coord
-
- // top right
- to_width, 0, // vertex coord
- width, 0, // texture coord
-
- // bottom right
- to_width, to_height, // vertex coord
- width, height, // texture coord
-
- // bottom left
- 0, to_height, // vertex coord
- 0, height, // texture coord
- };
- glBufferSubData(GL_ARRAY_BUFFER, 0, (long)sizeof(*coord) * 16, coord);
-
- // Prepare framebuffer for new render iteration
- glBindTexture(GL_TEXTURE_2D, destination_texture);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- destination_texture, 0);
- gl_check_fb_complete(GL_FRAMEBUFFER);
-
- // Bind source texture as downscaling shader uniform input
- glBindTexture(GL_TEXTURE_2D, source_texture);
-
- // Render into framebuffer
- glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL);
-
- // Have we downscaled enough?
- GLuint result;
- if (to_width > max_width || to_height > max_height) {
- GLuint new_source_texture = destination_texture;
- GLuint new_destination_texture =
- auxiliary_texture != 0 ? auxiliary_texture : source_texture;
- result = _gl_average_texture_color(base, new_source_texture,
- new_destination_texture, 0, fbo,
- to_width, to_height);
- } else {
- result = destination_texture;
- }
-
- return result;
-}
-
-/*
- * @brief Builds a 1x1 texture which has color corresponding to the average of all
- * pixels of img by recursively rendering into texture of quorter the size (half
- * width and half height).
- * Returned texture must not be deleted, since it's owned by the gl_image. It will be
- * deleted when the gl_image is released.
- */
-static GLuint gl_average_texture_color(backend_t *base, struct backend_image *img) {
- auto gd = (struct gl_data *)base;
- auto inner = (struct gl_texture *)img->inner;
-
- // Prepare textures which will be used for destination and source of rendering
- // during downscaling.
- const int texture_count = ARR_SIZE(inner->auxiliary_texture);
- if (!inner->auxiliary_texture[0]) {
- assert(!inner->auxiliary_texture[1]);
- glGenTextures(texture_count, inner->auxiliary_texture);
- glActiveTexture(GL_TEXTURE0);
- for (int i = 0; i < texture_count; i++) {
- glBindTexture(GL_TEXTURE_2D, inner->auxiliary_texture[i]);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR,
- (GLint[]){0, 0, 0, 0});
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, inner->width,
- inner->height, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL);
- }
- }
-
- // Prepare framebuffer used for rendering and bind it
- GLuint fbo;
- glGenFramebuffers(1, &fbo);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
-
- // Enable shaders
- glUseProgram(gd->brightness_shader.prog);
- glUniform2f(glGetUniformLocationChecked(gd->brightness_shader.prog, "texsize"),
- (GLfloat)inner->width, (GLfloat)inner->height);
-
- // Prepare vertex attributes
- GLuint vao;
- glGenVertexArrays(1, &vao);
- glBindVertexArray(vao);
- GLuint bo[2];
- glGenBuffers(2, bo);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
- glEnableVertexAttribArray(vert_coord_loc);
- glEnableVertexAttribArray(vert_in_texcoord_loc);
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL);
- glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE,
- sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2));
-
- // Allocate buffers for render input
- GLint coord[16] = {0};
- GLuint indices[] = {0, 1, 2, 2, 3, 0};
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * 16, coord, GL_DYNAMIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * 6, indices,
- GL_STATIC_DRAW);
-
- // Do actual recursive render to 1x1 texture
- GLuint result_texture = _gl_average_texture_color(
- base, inner->texture, inner->auxiliary_texture[0],
- inner->auxiliary_texture[1], fbo, inner->width, inner->height);
-
- // Cleanup vertex attributes
- glDisableVertexAttribArray(vert_coord_loc);
- glDisableVertexAttribArray(vert_in_texcoord_loc);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(2, bo);
- glBindVertexArray(0);
- glDeleteVertexArrays(1, &vao);
-
- // Cleanup shaders
- glUseProgram(0);
-
- // Cleanup framebuffers
- glDeleteFramebuffers(1, &fbo);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- glDrawBuffer(GL_BACK);
-
- // Cleanup render textures
- glBindTexture(GL_TEXTURE_2D, 0);
-
- gl_check_err();
-
- return result_texture;
-}
-
-/**
- * Render a region with texture data.
- *
- * @param ptex the texture
- * @param target the framebuffer to render into
- * @param dst_x,dst_y the top left corner of region where this texture
- * should go. In OpenGL coordinate system (important!).
- * @param reg_tgt the clip region, in Xorg coordinate system
- * @param reg_visible ignored
- */
-static void _gl_compose(backend_t *base, struct backend_image *img, GLuint target,
- GLint *coord, GLuint *indices, int nrects) {
- auto gd = (struct gl_data *)base;
- auto inner = (struct gl_texture *)img->inner;
- if (!img || !inner->texture) {
- log_error("Missing texture.");
- return;
- }
-
- GLuint brightness = 0;
- if (img->max_brightness < 1.0) {
- brightness = gl_average_texture_color(base, img);
- }
-
- assert(gd->win_shader.prog);
- glUseProgram(gd->win_shader.prog);
- if (gd->win_shader.uniform_opacity >= 0) {
- glUniform1f(gd->win_shader.uniform_opacity, (float)img->opacity);
- }
- if (gd->win_shader.uniform_invert_color >= 0) {
- glUniform1i(gd->win_shader.uniform_invert_color, img->color_inverted);
- }
- if (gd->win_shader.uniform_tex >= 0) {
- glUniform1i(gd->win_shader.uniform_tex, 0);
- }
- if (gd->win_shader.uniform_dim >= 0) {
- glUniform1f(gd->win_shader.uniform_dim, (float)img->dim);
- }
- if (gd->win_shader.uniform_brightness >= 0) {
- glUniform1i(gd->win_shader.uniform_brightness, 1);
- }
- if (gd->win_shader.uniform_max_brightness >= 0) {
- glUniform1f(gd->win_shader.uniform_max_brightness, (float)img->max_brightness);
- }
- if (gd->win_shader.uniform_corner_radius >= 0) {
- glUniform1f(gd->win_shader.uniform_corner_radius, (float)img->corner_radius);
- }
- if (gd->win_shader.uniform_border_width >= 0) {
- auto border_width = img->border_width;
- if (border_width > img->corner_radius) {
- border_width = 0;
- }
- glUniform1f(gd->win_shader.uniform_border_width, (float)border_width);
- }
-
- // log_trace("Draw: %d, %d, %d, %d -> %d, %d (%d, %d) z %d\n",
- // x, y, width, height, dx, dy, ptex->width, ptex->height, z);
-
- // Bind texture
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, brightness);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, inner->texture);
-
- GLuint vao;
- glGenVertexArrays(1, &vao);
- glBindVertexArray(vao);
-
- GLuint bo[2];
- glGenBuffers(2, bo);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * nrects * 16, coord, GL_STATIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * nrects * 6,
- indices, GL_STATIC_DRAW);
-
- glEnableVertexAttribArray(vert_coord_loc);
- glEnableVertexAttribArray(vert_in_texcoord_loc);
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL);
- glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE,
- sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2));
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target);
- glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL);
-
- glDisableVertexAttribArray(vert_coord_loc);
- glDisableVertexAttribArray(vert_in_texcoord_loc);
- glBindVertexArray(0);
- glDeleteVertexArrays(1, &vao);
-
- // Cleanup
- glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- glDrawBuffer(GL_BACK);
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(2, bo);
-
- glUseProgram(0);
-
- gl_check_err();
-
- return;
-}
-
-/// Convert rectangles in X coordinates to OpenGL vertex and texture coordinates
-/// @param[in] nrects, rects rectangles
-/// @param[in] dst_x, dst_y origin of the OpenGL texture, affect the calculated texture
-/// coordinates
-/// @param[in] texture_height height of the OpenGL texture
-/// @param[in] root_height height of the back buffer
-/// @param[in] y_inverted whether the texture is y inverted
-/// @param[out] coord, indices output
-static void
-x_rect_to_coords(int nrects, const rect_t *rects, int dst_x, int dst_y, int texture_height,
- int root_height, bool y_inverted, GLint *coord, GLuint *indices) {
- dst_y = root_height - dst_y;
- if (y_inverted) {
- dst_y -= texture_height;
- }
-
- for (int i = 0; i < nrects; i++) {
- // Y-flip. Note after this, crect.y1 > crect.y2
- rect_t crect = rects[i];
- crect.y1 = root_height - crect.y1;
- crect.y2 = root_height - crect.y2;
-
- // Calculate texture coordinates
- // (texture_x1, texture_y1), texture coord for the _bottom left_ corner
- GLint texture_x1 = crect.x1 - dst_x, texture_y1 = crect.y2 - dst_y,
- texture_x2 = texture_x1 + (crect.x2 - crect.x1),
- texture_y2 = texture_y1 + (crect.y1 - crect.y2);
-
- // X pixmaps might be Y inverted, invert the texture coordinates
- if (y_inverted) {
- texture_y1 = texture_height - texture_y1;
- texture_y2 = texture_height - texture_y2;
- }
-
- // Vertex coordinates
- auto vx1 = crect.x1;
- auto vy1 = crect.y2;
- auto vx2 = crect.x2;
- auto vy2 = crect.y1;
-
- // log_trace("Rect %d: %f, %f, %f, %f -> %d, %d, %d, %d",
- // ri, rx, ry, rxe, rye, rdx, rdy, rdxe, rdye);
-
- memcpy(&coord[i * 16],
- ((GLint[][2]){
- {vx1, vy1},
- {texture_x1, texture_y1},
- {vx2, vy1},
- {texture_x2, texture_y1},
- {vx2, vy2},
- {texture_x2, texture_y2},
- {vx1, vy2},
- {texture_x1, texture_y2},
- }),
- sizeof(GLint[2]) * 8);
-
- GLuint u = (GLuint)(i * 4);
- memcpy(&indices[i * 6],
- ((GLuint[]){u + 0, u + 1, u + 2, u + 2, u + 3, u + 0}),
- sizeof(GLuint) * 6);
- }
-}
-
-// TODO(yshui) make use of reg_visible
-void gl_compose(backend_t *base, void *image_data,
- int dst_x1, int dst_y1, int dst_x2, int dst_y2,
- const region_t *reg_tgt, const region_t *reg_visible attr_unused) {
- auto gd = (struct gl_data *)base;
- struct backend_image *img = image_data;
- auto inner = (struct gl_texture *)img->inner;
-
- // Painting
- int nrects;
- const rect_t *rects;
- rects = pixman_region32_rectangles((region_t *)reg_tgt, &nrects);
- if (!nrects) {
- // Nothing to paint
- return;
- }
-
- // Until we start to use glClipControl, reg_tgt, dst_x and dst_y and
- // in a different coordinate system than the one OpenGL uses.
- // OpenGL window coordinate (or NDC) has the origin at the lower left of the
- // screen, with y axis pointing up; Xorg has the origin at the upper left of the
- // screen, with y axis pointing down. We have to do some coordinate conversion in
- // this function
-
- auto coord = ccalloc(nrects * 16, GLint);
- auto indices = ccalloc(nrects * 6, GLuint);
- x_rect_to_coords(nrects, rects, dst_x1, dst_y1, inner->height, gd->height,
- inner->y_inverted, coord, indices);
-
- // Interpolate the texture coordinates into the specified range
- for (unsigned int i = 2; i < 16; i+=4) {
- coord[i+0] = lerp_range(0, dst_x2 - dst_x1, 0, inner->width, coord[i+0]);
- coord[i+1] = lerp_range(0, dst_y2 - dst_y1, 0, inner->height, coord[i+1]);
- }
-
- _gl_compose(base, img, gd->back_fbo, coord, indices, nrects);
-
- free(indices);
- free(coord);
-}
-
-/**
- * Blur contents in a particular region.
- */
-bool gl_kernel_blur(backend_t *base, double opacity, void *ctx, const rect_t *extent,
- const GLuint vao[2], const int vao_nelems[2]) {
- auto bctx = (struct gl_blur_context *)ctx;
- auto gd = (struct gl_data *)base;
-
- int dst_y_fb_coord = bctx->fb_height - extent->y2;
-
- int curr = 0;
- for (int i = 0; i < bctx->npasses; ++i) {
- const gl_blur_shader_t *p = &bctx->blur_shader[i];
- assert(p->prog);
-
- assert(bctx->blur_textures[curr]);
-
- // The origin to use when sampling from the source texture
- GLint texorig_x = extent->x1, texorig_y = dst_y_fb_coord;
- GLint tex_width, tex_height;
- GLuint src_texture;
-
- if (i == 0) {
- src_texture = gd->back_texture;
- tex_width = gd->width;
- tex_height = gd->height;
- } else {
- src_texture = bctx->blur_textures[curr];
- auto src_size = bctx->texture_sizes[curr];
- tex_width = src_size.width;
- tex_height = src_size.height;
- }
-
- glBindTexture(GL_TEXTURE_2D, src_texture);
- glUseProgram(p->prog);
- glUniform2f(p->uniform_pixel_norm, 1.0f / (GLfloat)tex_width,
- 1.0f / (GLfloat)tex_height);
-
- // The number of indices in the selected vertex array
- GLsizei nelems;
-
- if (i < bctx->npasses - 1) {
- assert(bctx->blur_fbos[0]);
- assert(bctx->blur_textures[!curr]);
-
- // not last pass, draw into framebuffer, with resized regions
- glBindVertexArray(vao[1]);
- nelems = vao_nelems[1];
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[0]);
-
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, bctx->blur_textures[!curr], 0);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
- if (!gl_check_fb_complete(GL_FRAMEBUFFER)) {
- return false;
- }
-
- glUniform1f(p->uniform_opacity, 1.0);
- } else {
- // last pass, draw directly into the back buffer, with origin
- // regions
- glBindVertexArray(vao[0]);
- nelems = vao_nelems[0];
- glBindFramebuffer(GL_FRAMEBUFFER, gd->back_fbo);
-
- glUniform1f(p->uniform_opacity, (float)opacity);
- }
-
- glUniform2f(p->texorig_loc, (GLfloat)texorig_x, (GLfloat)texorig_y);
- glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL);
-
- // XXX use multiple draw calls is probably going to be slow than
- // just simply blur the whole area.
-
- curr = !curr;
- }
-
- return true;
-}
-
-bool gl_dual_kawase_blur(backend_t *base, double opacity, void *ctx, const rect_t *extent,
- const GLuint vao[2], const int vao_nelems[2]) {
- auto bctx = (struct gl_blur_context *)ctx;
- auto gd = (struct gl_data *)base;
-
- int dst_y_fb_coord = bctx->fb_height - extent->y2;
-
- int iterations = bctx->blur_texture_count;
- int scale_factor = 1;
-
- // Kawase downsample pass
- const gl_blur_shader_t *down_pass = &bctx->blur_shader[0];
- assert(down_pass->prog);
- glUseProgram(down_pass->prog);
-
- glUniform2f(down_pass->texorig_loc, (GLfloat)extent->x1, (GLfloat)dst_y_fb_coord);
-
- for (int i = 0; i < iterations; ++i) {
- // Scale output width / height by half in each iteration
- scale_factor <<= 1;
-
- GLuint src_texture;
- int tex_width, tex_height;
-
- if (i == 0) {
- // first pass: copy from back buffer
- src_texture = gd->back_texture;
- tex_width = gd->width;
- tex_height = gd->height;
- } else {
- // copy from previous pass
- src_texture = bctx->blur_textures[i - 1];
- auto src_size = bctx->texture_sizes[i - 1];
- tex_width = src_size.width;
- tex_height = src_size.height;
- }
-
- assert(src_texture);
- assert(bctx->blur_fbos[i]);
-
- glBindTexture(GL_TEXTURE_2D, src_texture);
- glBindVertexArray(vao[1]);
- auto nelems = vao_nelems[1];
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i]);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
-
- glUniform1f(down_pass->scale_loc, (GLfloat)scale_factor);
-
- glUniform2f(down_pass->uniform_pixel_norm, 1.0f / (GLfloat)tex_width,
- 1.0f / (GLfloat)tex_height);
-
- glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL);
- }
-
- // Kawase upsample pass
- const gl_blur_shader_t *up_pass = &bctx->blur_shader[1];
- assert(up_pass->prog);
- glUseProgram(up_pass->prog);
-
- glUniform2f(up_pass->texorig_loc, (GLfloat)extent->x1, (GLfloat)dst_y_fb_coord);
-
- for (int i = iterations - 1; i >= 0; --i) {
- // Scale output width / height back by two in each iteration
- scale_factor >>= 1;
-
- const GLuint src_texture = bctx->blur_textures[i];
- assert(src_texture);
-
- // Calculate normalized half-width/-height of a src pixel
- auto src_size = bctx->texture_sizes[i];
- int tex_width = src_size.width;
- int tex_height = src_size.height;
-
- // The number of indices in the selected vertex array
- GLsizei nelems;
-
- glBindTexture(GL_TEXTURE_2D, src_texture);
- if (i > 0) {
- assert(bctx->blur_fbos[i - 1]);
-
- // not last pass, draw into next framebuffer
- glBindVertexArray(vao[1]);
- nelems = vao_nelems[1];
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i - 1]);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
-
- glUniform1f(up_pass->uniform_opacity, (GLfloat)1);
- } else {
- // last pass, draw directly into the back buffer
- glBindVertexArray(vao[0]);
- nelems = vao_nelems[0];
- glBindFramebuffer(GL_FRAMEBUFFER, gd->back_fbo);
-
- glUniform1f(up_pass->uniform_opacity, (GLfloat)opacity);
- }
-
- glUniform1f(up_pass->scale_loc, (GLfloat)scale_factor);
- glUniform2f(up_pass->uniform_pixel_norm, 1.0f / (GLfloat)tex_width,
- 1.0f / (GLfloat)tex_height);
-
- glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL);
- }
-
- return true;
-}
-
-bool gl_blur(backend_t *base, double opacity, void *ctx, const region_t *reg_blur,
- const region_t *reg_visible attr_unused) {
- auto bctx = (struct gl_blur_context *)ctx;
- auto gd = (struct gl_data *)base;
-
- bool ret = false;
-
- if (gd->width != bctx->fb_width || gd->height != bctx->fb_height) {
- // Resize the temporary textures used for blur in case the root
- // size changed
- bctx->fb_width = gd->width;
- bctx->fb_height = gd->height;
-
- for (int i = 0; i < bctx->blur_texture_count; ++i) {
- auto tex_size = bctx->texture_sizes + i;
- if (bctx->method == BLUR_METHOD_DUAL_KAWASE) {
- // Use smaller textures for each iteration (quarter of the
- // previous texture)
- tex_size->width = 1 + ((bctx->fb_width - 1) >> (i + 1));
- tex_size->height = 1 + ((bctx->fb_height - 1) >> (i + 1));
- } else {
- tex_size->width = bctx->fb_width;
- tex_size->height = bctx->fb_height;
- }
-
- glBindTexture(GL_TEXTURE_2D, bctx->blur_textures[i]);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_size->width,
- tex_size->height, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
-
- if (bctx->method == BLUR_METHOD_DUAL_KAWASE) {
- // Attach texture to FBO target
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i]);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- bctx->blur_textures[i], 0);
- if (!gl_check_fb_complete(GL_FRAMEBUFFER)) {
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- return false;
- }
- }
- }
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- }
-
- // Remainder: regions are in Xorg coordinates
- auto reg_blur_resized =
- resize_region(reg_blur, bctx->resize_width, bctx->resize_height);
- const rect_t *extent = pixman_region32_extents((region_t *)reg_blur),
- *extent_resized = pixman_region32_extents(®_blur_resized);
- int width = extent->x2 - extent->x1, height = extent->y2 - extent->y1;
- if (width == 0 || height == 0) {
- return true;
- }
-
- int nrects, nrects_resized;
- const rect_t *rects = pixman_region32_rectangles((region_t *)reg_blur, &nrects),
- *rects_resized =
- pixman_region32_rectangles(®_blur_resized, &nrects_resized);
- if (!nrects || !nrects_resized) {
- return true;
- }
-
- auto coord = ccalloc(nrects * 16, GLint);
- auto indices = ccalloc(nrects * 6, GLuint);
- x_rect_to_coords(nrects, rects, extent_resized->x1, extent_resized->y2,
- bctx->fb_height, gd->height, false, coord, indices);
-
- auto coord_resized = ccalloc(nrects_resized * 16, GLint);
- auto indices_resized = ccalloc(nrects_resized * 6, GLuint);
- x_rect_to_coords(nrects_resized, rects_resized, extent_resized->x1,
- extent_resized->y2, bctx->fb_height, bctx->fb_height, false,
- coord_resized, indices_resized);
- pixman_region32_fini(®_blur_resized);
-
- GLuint vao[2];
- glGenVertexArrays(2, vao);
- GLuint bo[4];
- glGenBuffers(4, bo);
-
- glBindVertexArray(vao[0]);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * nrects * 16, coord, GL_STATIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * nrects * 6,
- indices, GL_STATIC_DRAW);
- glEnableVertexAttribArray(vert_coord_loc);
- glEnableVertexAttribArray(vert_in_texcoord_loc);
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL);
- glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE,
- sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2));
-
- glBindVertexArray(vao[1]);
- glBindBuffer(GL_ARRAY_BUFFER, bo[2]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[3]);
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord_resized) * nrects_resized * 16,
- coord_resized, GL_STATIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER,
- (long)sizeof(*indices_resized) * nrects_resized * 6, indices_resized,
- GL_STATIC_DRAW);
- glEnableVertexAttribArray(vert_coord_loc);
- glEnableVertexAttribArray(vert_in_texcoord_loc);
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL);
- glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE,
- sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2));
-
- int vao_nelems[2] = {nrects * 6, nrects_resized * 6};
-
- if (bctx->method == BLUR_METHOD_DUAL_KAWASE) {
- ret = gl_dual_kawase_blur(base, opacity, ctx, extent_resized, vao, vao_nelems);
- } else {
- ret = gl_kernel_blur(base, opacity, ctx, extent_resized, vao, vao_nelems);
- }
-
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- glBindTexture(GL_TEXTURE_2D, 0);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(4, bo);
- glBindVertexArray(0);
- glDeleteVertexArrays(2, vao);
- glUseProgram(0);
-
- free(indices);
- free(coord);
- free(indices_resized);
- free(coord_resized);
-
- gl_check_err();
- return ret;
-}
-
-// clang-format off
-const char *vertex_shader = GLSL(330,
- uniform mat4 projection;
- uniform float scale = 1.0;
- uniform vec2 texorig;
- layout(location = 0) in vec2 coord;
- layout(location = 1) in vec2 in_texcoord;
- out vec2 texcoord;
- void main() {
- gl_Position = projection * vec4(coord, 0, scale);
- texcoord = in_texcoord + texorig;
- }
-);
-// clang-format on
-
-/**
- * Load a GLSL main program from shader strings.
- */
-static int gl_win_shader_from_string(const char *vshader_str, const char *fshader_str,
- gl_win_shader_t *ret) {
- // Build program
- ret->prog = gl_create_program_from_str(vshader_str, fshader_str);
- if (!ret->prog) {
- log_error("Failed to create GLSL program.");
- return -1;
- }
-
- // Get uniform addresses
- bind_uniform(ret, opacity);
- bind_uniform(ret, invert_color);
- bind_uniform(ret, tex);
- bind_uniform(ret, dim);
- bind_uniform(ret, brightness);
- bind_uniform(ret, max_brightness);
- bind_uniform(ret, corner_radius);
- bind_uniform(ret, border_width);
-
- gl_check_err();
-
- return true;
-}
-
-/**
- * Callback to run on root window size change.
- */
-void gl_resize(struct gl_data *gd, int width, int height) {
- GLint viewport_dimensions[2];
- glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions);
-
- gd->height = height;
- gd->width = width;
-
- assert(viewport_dimensions[0] >= gd->width);
- assert(viewport_dimensions[1] >= gd->height);
-
- glBindTexture(GL_TEXTURE_2D, gd->back_texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0, GL_BGR,
- GL_UNSIGNED_BYTE, NULL);
-
- gl_check_err();
-}
-
-// clang-format off
-static const char dummy_frag[] = GLSL(330,
- uniform sampler2D tex;
- in vec2 texcoord;
- void main() {
- gl_FragColor = texelFetch(tex, ivec2(texcoord.xy), 0);
- }
-);
-
-static const char fill_frag[] = GLSL(330,
- uniform vec4 color;
- void main() {
- gl_FragColor = color;
- }
-);
-
-static const char fill_vert[] = GLSL(330,
- layout(location = 0) in vec2 in_coord;
- uniform mat4 projection;
- void main() {
- gl_Position = projection * vec4(in_coord, 0, 1);
- }
-);
-
-static const char interpolating_frag[] = GLSL(330,
- uniform sampler2D tex;
- in vec2 texcoord;
- void main() {
- gl_FragColor = vec4(texture2D(tex, vec2(texcoord.xy), 0).rgb, 1);
- }
-);
-
-static const char interpolating_vert[] = GLSL(330,
- uniform mat4 projection;
- uniform vec2 texsize;
- layout(location = 0) in vec2 in_coord;
- layout(location = 1) in vec2 in_texcoord;
- out vec2 texcoord;
- void main() {
- gl_Position = projection * vec4(in_coord, 0, 1);
- texcoord = in_texcoord / texsize;
- }
-);
-// clang-format on
-
-/// Fill a given region in bound framebuffer.
-/// @param[in] y_inverted whether the y coordinates in `clip` should be inverted
-static void _gl_fill(backend_t *base, struct color c, const region_t *clip, GLuint target,
- int height, bool y_inverted) {
- static const GLuint fill_vert_in_coord_loc = 0;
- int nrects;
- const rect_t *rect = pixman_region32_rectangles((region_t *)clip, &nrects);
- auto gd = (struct gl_data *)base;
-
- GLuint vao;
- glGenVertexArrays(1, &vao);
- glBindVertexArray(vao);
-
- GLuint bo[2];
- glGenBuffers(2, bo);
- glUseProgram(gd->fill_shader.prog);
- glUniform4f(gd->fill_shader.color_loc, (GLfloat)c.red, (GLfloat)c.green,
- (GLfloat)c.blue, (GLfloat)c.alpha);
- glEnableVertexAttribArray(fill_vert_in_coord_loc);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
-
- auto coord = ccalloc(nrects * 8, GLint);
- auto indices = ccalloc(nrects * 6, GLuint);
- for (int i = 0; i < nrects; i++) {
- GLint y1 = y_inverted ? height - rect[i].y2 : rect[i].y1,
- y2 = y_inverted ? height - rect[i].y1 : rect[i].y2;
- // clang-format off
- memcpy(&coord[i * 8],
- ((GLint[][2]){
- {rect[i].x1, y1}, {rect[i].x2, y1},
- {rect[i].x2, y2}, {rect[i].x1, y2}}),
- sizeof(GLint[2]) * 4);
- // clang-format on
- indices[i * 6 + 0] = (GLuint)i * 4 + 0;
- indices[i * 6 + 1] = (GLuint)i * 4 + 1;
- indices[i * 6 + 2] = (GLuint)i * 4 + 2;
- indices[i * 6 + 3] = (GLuint)i * 4 + 2;
- indices[i * 6 + 4] = (GLuint)i * 4 + 3;
- indices[i * 6 + 5] = (GLuint)i * 4 + 0;
- }
- glBufferData(GL_ARRAY_BUFFER, nrects * 8 * (long)sizeof(*coord), coord, GL_STREAM_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, nrects * 6 * (long)sizeof(*indices),
- indices, GL_STREAM_DRAW);
-
- glVertexAttribPointer(fill_vert_in_coord_loc, 2, GL_INT, GL_FALSE,
- sizeof(*coord) * 2, (void *)0);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target);
- glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL);
-
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDisableVertexAttribArray(fill_vert_in_coord_loc);
- glBindVertexArray(0);
- glDeleteVertexArrays(1, &vao);
-
- glDeleteBuffers(2, bo);
- free(indices);
- free(coord);
-
- gl_check_err();
-}
-
-void gl_fill(backend_t *base, struct color c, const region_t *clip) {
- auto gd = (struct gl_data *)base;
- return _gl_fill(base, c, clip, gd->back_fbo, gd->height, true);
-}
-
-static void gl_release_image_inner(backend_t *base, struct gl_texture *inner) {
- auto gd = (struct gl_data *)base;
- if (inner->user_data) {
- gd->release_user_data(base, inner);
- }
- assert(inner->user_data == NULL);
-
- glDeleteTextures(1, &inner->texture);
- glDeleteTextures(2, inner->auxiliary_texture);
- free(inner);
- gl_check_err();
-}
-
-void gl_release_image(backend_t *base, void *image_data) {
- struct backend_image *wd = image_data;
- auto inner = (struct gl_texture *)wd->inner;
- inner->refcount--;
- assert(inner->refcount >= 0);
- if (inner->refcount == 0) {
- gl_release_image_inner(base, inner);
- }
- free(wd);
-}
-
-static inline void gl_free_blur_shader(gl_blur_shader_t *shader) {
- if (shader->prog) {
- glDeleteProgram(shader->prog);
- }
-
- shader->prog = 0;
-}
-
-void gl_destroy_blur_context(backend_t *base attr_unused, void *ctx) {
- auto bctx = (struct gl_blur_context *)ctx;
- // Free GLSL shaders/programs
- for (int i = 0; i < bctx->npasses; ++i) {
- gl_free_blur_shader(&bctx->blur_shader[i]);
- }
- free(bctx->blur_shader);
-
- if (bctx->blur_texture_count && bctx->blur_textures) {
- glDeleteTextures(bctx->blur_texture_count, bctx->blur_textures);
- free(bctx->blur_textures);
- }
- if (bctx->blur_texture_count && bctx->texture_sizes) {
- free(bctx->texture_sizes);
- }
- if (bctx->blur_fbo_count && bctx->blur_fbos) {
- glDeleteFramebuffers(bctx->blur_fbo_count, bctx->blur_fbos);
- free(bctx->blur_fbos);
- }
-
- bctx->blur_texture_count = 0;
- bctx->blur_fbo_count = 0;
-
- free(bctx);
-
- gl_check_err();
-}
-
-/**
- * Initialize GL blur filters.
- */
-bool gl_create_kernel_blur_context(void *blur_context, GLfloat *projection,
- enum blur_method method, void *args) {
- bool success = false;
- auto ctx = (struct gl_blur_context *)blur_context;
-
- struct conv **kernels;
-
- int nkernels;
- ctx->method = BLUR_METHOD_KERNEL;
- if (method == BLUR_METHOD_KERNEL) {
- nkernels = ((struct kernel_blur_args *)args)->kernel_count;
- kernels = ((struct kernel_blur_args *)args)->kernels;
- } else {
- kernels = generate_blur_kernel(method, args, &nkernels);
- }
-
- if (!nkernels) {
- ctx->method = BLUR_METHOD_NONE;
- return true;
- }
-
- // Specify required textures and FBOs
- ctx->blur_texture_count = 2;
- ctx->blur_fbo_count = 1;
-
- ctx->blur_shader = ccalloc(max2(2, nkernels), gl_blur_shader_t);
-
- char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL));
- // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane
- // Thanks to hiciu for reporting.
- setlocale(LC_NUMERIC, "C");
-
- // clang-format off
- static const char *FRAG_SHADER_BLUR = GLSL(330,
- %s\n // other extension pragmas
- uniform sampler2D tex_src;
- uniform vec2 pixel_norm;
- uniform float opacity;
- in vec2 texcoord;
- out vec4 out_color;
- void main() {
- vec2 uv = texcoord * pixel_norm;
- vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
- %s //body of the convolution
- out_color = sum / float(%.7g) * opacity;
- }
- );
- static const char *FRAG_SHADER_BLUR_ADD = QUOTE(
- sum += float(%.7g) * texture2D(tex_src, uv + pixel_norm * vec2(%.7g, %.7g));
- );
- // clang-format on
-
- const char *shader_add = FRAG_SHADER_BLUR_ADD;
- char *extension = strdup("");
-
- for (int i = 0; i < nkernels; i++) {
- auto kern = kernels[i];
- // Build shader
- int width = kern->w, height = kern->h;
- int nele = width * height;
- // '%.7g' is at most 14 characters, inserted 3 times
- size_t body_len = (strlen(shader_add) + 42) * (uint)nele;
- char *shader_body = ccalloc(body_len, char);
- char *pc = shader_body;
-
- // Make use of the linear interpolation hardware by sampling 2 pixels with
- // one texture access by sampling between both pixels based on their
- // relative weight. Easiest done in a single dimension as 2D bilinear
- // filtering would raise additional constraints on the kernels. Therefore
- // only use interpolation along the larger dimension.
- double sum = 0.0;
- if (width > height) {
- // use interpolation in x dimension (width)
- for (int j = 0; j < height; ++j) {
- for (int k = 0; k < width; k += 2) {
- double val1, val2;
- val1 = kern->data[j * width + k];
- val2 = (k + 1 < width)
- ? kern->data[j * width + k + 1]
- : 0;
-
- double combined_weight = val1 + val2;
- if (combined_weight == 0) {
- continue;
- }
- sum += combined_weight;
-
- double offset_x =
- k + (val2 / combined_weight) - (width / 2);
- double offset_y = j - (height / 2);
- pc += snprintf(
- pc, body_len - (ulong)(pc - shader_body),
- shader_add, combined_weight, offset_x, offset_y);
- assert(pc < shader_body + body_len);
- }
- }
- } else {
- // use interpolation in y dimension (height)
- for (int j = 0; j < height; j += 2) {
- for (int k = 0; k < width; ++k) {
- double val1, val2;
- val1 = kern->data[j * width + k];
- val2 = (j + 1 < height)
- ? kern->data[(j + 1) * width + k]
- : 0;
-
- double combined_weight = val1 + val2;
- if (combined_weight == 0) {
- continue;
- }
- sum += combined_weight;
-
- double offset_x = k - (width / 2);
- double offset_y =
- j + (val2 / combined_weight) - (height / 2);
- pc += snprintf(
- pc, body_len - (ulong)(pc - shader_body),
- shader_add, combined_weight, offset_x, offset_y);
- assert(pc < shader_body + body_len);
- }
- }
- }
-
- auto pass = ctx->blur_shader + i;
- size_t shader_len = strlen(FRAG_SHADER_BLUR) + strlen(extension) +
- strlen(shader_body) + 10 /* sum */ +
- 1 /* null terminator */;
- char *shader_str = ccalloc(shader_len, char);
- auto real_shader_len = snprintf(shader_str, shader_len, FRAG_SHADER_BLUR,
- extension, shader_body, sum);
- CHECK(real_shader_len >= 0);
- CHECK((size_t)real_shader_len < shader_len);
- free(shader_body);
-
- // Build program
- pass->prog = gl_create_program_from_str(vertex_shader, shader_str);
- free(shader_str);
- if (!pass->prog) {
- log_error("Failed to create GLSL program.");
- success = false;
- goto out;
- }
- glBindFragDataLocation(pass->prog, 0, "out_color");
-
- // Get uniform addresses
- bind_uniform(pass, pixel_norm);
- bind_uniform(pass, opacity);
- pass->texorig_loc = glGetUniformLocationChecked(pass->prog, "texorig");
-
- // Setup projection matrix
- glUseProgram(pass->prog);
- int pml = glGetUniformLocationChecked(pass->prog, "projection");
- glUniformMatrix4fv(pml, 1, false, projection);
- glUseProgram(0);
-
- ctx->resize_width += kern->w / 2;
- ctx->resize_height += kern->h / 2;
- }
-
- if (nkernels == 1) {
- // Generate an extra null pass so we don't need special code path for
- // the single pass case
- auto pass = &ctx->blur_shader[1];
- pass->prog = gl_create_program_from_str(vertex_shader, dummy_frag);
- pass->uniform_pixel_norm = -1;
- pass->uniform_opacity = -1;
- pass->texorig_loc = glGetUniformLocationChecked(pass->prog, "texorig");
-
- // Setup projection matrix
- glUseProgram(pass->prog);
- int pml = glGetUniformLocationChecked(pass->prog, "projection");
- glUniformMatrix4fv(pml, 1, false, projection);
- glUseProgram(0);
-
- ctx->npasses = 2;
- } else {
- ctx->npasses = nkernels;
- }
-
- success = true;
-out:
- if (method != BLUR_METHOD_KERNEL) {
- // We generated the blur kernels, so we need to free them
- for (int i = 0; i < nkernels; i++) {
- free(kernels[i]);
- }
- free(kernels);
- }
-
- free(extension);
- // Restore LC_NUMERIC
- setlocale(LC_NUMERIC, lc_numeric_old);
- free(lc_numeric_old);
-
- return success;
-}
-
-bool gl_create_dual_kawase_blur_context(void *blur_context, GLfloat *projection,
- enum blur_method method, void *args) {
- bool success = false;
- auto ctx = (struct gl_blur_context *)blur_context;
-
- ctx->method = method;
-
- auto blur_params = generate_dual_kawase_params(args);
-
- // Specify required textures and FBOs
- ctx->blur_texture_count = blur_params->iterations;
- ctx->blur_fbo_count = blur_params->iterations;
-
- ctx->resize_width += blur_params->expand;
- ctx->resize_height += blur_params->expand;
-
- ctx->npasses = 2;
- ctx->blur_shader = ccalloc(ctx->npasses, gl_blur_shader_t);
-
- char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL));
- // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane
- // Thanks to hiciu for reporting.
- setlocale(LC_NUMERIC, "C");
-
- // Dual-kawase downsample shader / program
- auto down_pass = ctx->blur_shader;
- {
- // clang-format off
- static const char *FRAG_SHADER_DOWN = GLSL(330,
- uniform sampler2D tex_src;
- uniform float scale = 1.0;
- uniform vec2 pixel_norm;
- in vec2 texcoord;
- out vec4 out_color;
- void main() {
- vec2 offset = %.7g * pixel_norm;
- vec2 uv = texcoord * pixel_norm * (2.0 / scale);
- vec4 sum = texture2D(tex_src, uv) * 4.0;
- sum += texture2D(tex_src, uv - vec2(0.5, 0.5) * offset);
- sum += texture2D(tex_src, uv + vec2(0.5, 0.5) * offset);
- sum += texture2D(tex_src, uv + vec2(0.5, -0.5) * offset);
- sum += texture2D(tex_src, uv - vec2(0.5, -0.5) * offset);
- out_color = sum / 8.0;
- }
- );
- // clang-format on
-
- // Build shader
- size_t shader_len =
- strlen(FRAG_SHADER_DOWN) + 10 /* offset */ + 1 /* null terminator */;
- char *shader_str = ccalloc(shader_len, char);
- auto real_shader_len =
- snprintf(shader_str, shader_len, FRAG_SHADER_DOWN, blur_params->offset);
- CHECK(real_shader_len >= 0);
- CHECK((size_t)real_shader_len < shader_len);
-
- // Build program
- down_pass->prog = gl_create_program_from_str(vertex_shader, shader_str);
- free(shader_str);
- if (!down_pass->prog) {
- log_error("Failed to create GLSL program.");
- success = false;
- goto out;
- }
- glBindFragDataLocation(down_pass->prog, 0, "out_color");
-
- // Get uniform addresses
- bind_uniform(down_pass, pixel_norm);
- down_pass->texorig_loc =
- glGetUniformLocationChecked(down_pass->prog, "texorig");
- down_pass->scale_loc =
- glGetUniformLocationChecked(down_pass->prog, "scale");
-
- // Setup projection matrix
- glUseProgram(down_pass->prog);
- int pml = glGetUniformLocationChecked(down_pass->prog, "projection");
- glUniformMatrix4fv(pml, 1, false, projection);
- glUseProgram(0);
- }
-
- // Dual-kawase upsample shader / program
- auto up_pass = ctx->blur_shader + 1;
- {
- // clang-format off
- static const char *FRAG_SHADER_UP = GLSL(330,
- uniform sampler2D tex_src;
- uniform float scale = 1.0;
- uniform vec2 pixel_norm;
- uniform float opacity;
- in vec2 texcoord;
- out vec4 out_color;
- void main() {
- vec2 offset = %.7g * pixel_norm;
- vec2 uv = texcoord * pixel_norm / (2 * scale);
- vec4 sum = texture2D(tex_src, uv + vec2(-1.0, 0.0) * offset);
- sum += texture2D(tex_src, uv + vec2(-0.5, 0.5) * offset) * 2.0;
- sum += texture2D(tex_src, uv + vec2(0.0, 1.0) * offset);
- sum += texture2D(tex_src, uv + vec2(0.5, 0.5) * offset) * 2.0;
- sum += texture2D(tex_src, uv + vec2(1.0, 0.0) * offset);
- sum += texture2D(tex_src, uv + vec2(0.5, -0.5) * offset) * 2.0;
- sum += texture2D(tex_src, uv + vec2(0.0, -1.0) * offset);
- sum += texture2D(tex_src, uv + vec2(-0.5, -0.5) * offset) * 2.0;
- out_color = sum / 12.0 * opacity;
- }
- );
- // clang-format on
-
- // Build shader
- size_t shader_len =
- strlen(FRAG_SHADER_UP) + 10 /* offset */ + 1 /* null terminator */;
- char *shader_str = ccalloc(shader_len, char);
- auto real_shader_len =
- snprintf(shader_str, shader_len, FRAG_SHADER_UP, blur_params->offset);
- CHECK(real_shader_len >= 0);
- CHECK((size_t)real_shader_len < shader_len);
-
- // Build program
- up_pass->prog = gl_create_program_from_str(vertex_shader, shader_str);
- free(shader_str);
- if (!up_pass->prog) {
- log_error("Failed to create GLSL program.");
- success = false;
- goto out;
- }
- glBindFragDataLocation(up_pass->prog, 0, "out_color");
-
- // Get uniform addresses
- bind_uniform(up_pass, pixel_norm);
- bind_uniform(up_pass, opacity);
- up_pass->texorig_loc =
- glGetUniformLocationChecked(up_pass->prog, "texorig");
- up_pass->scale_loc = glGetUniformLocationChecked(up_pass->prog, "scale");
-
- // Setup projection matrix
- glUseProgram(up_pass->prog);
- int pml = glGetUniformLocationChecked(up_pass->prog, "projection");
- glUniformMatrix4fv(pml, 1, false, projection);
- glUseProgram(0);
- }
-
- success = true;
-out:
- free(blur_params);
-
- if (!success) {
- ctx = NULL;
- }
-
- // Restore LC_NUMERIC
- setlocale(LC_NUMERIC, lc_numeric_old);
- free(lc_numeric_old);
-
- return success;
-}
-
-void *gl_create_blur_context(backend_t *base, enum blur_method method, void *args) {
- bool success;
- auto gd = (struct gl_data *)base;
-
- auto ctx = ccalloc(1, struct gl_blur_context);
-
- if (!method || method >= BLUR_METHOD_INVALID) {
- ctx->method = BLUR_METHOD_NONE;
- return ctx;
- }
-
- // Set projection matrix to gl viewport dimensions so we can use screen
- // coordinates for all vertices
- // Note: OpenGL matrices are column major
- GLint viewport_dimensions[2];
- glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions);
- GLfloat projection_matrix[4][4] = {{2.0f / (GLfloat)viewport_dimensions[0], 0, 0, 0},
- {0, 2.0f / (GLfloat)viewport_dimensions[1], 0, 0},
- {0, 0, 0, 0},
- {-1, -1, 0, 1}};
-
- if (method == BLUR_METHOD_DUAL_KAWASE) {
- success = gl_create_dual_kawase_blur_context(ctx, projection_matrix[0],
- method, args);
- } else {
- success =
- gl_create_kernel_blur_context(ctx, projection_matrix[0], method, args);
- }
- if (!success || ctx->method == BLUR_METHOD_NONE) {
- goto out;
- }
-
- // Texture size will be defined by gl_blur
- ctx->blur_textures = ccalloc(ctx->blur_texture_count, GLuint);
- ctx->texture_sizes = ccalloc(ctx->blur_texture_count, struct texture_size);
- glGenTextures(ctx->blur_texture_count, ctx->blur_textures);
-
- for (int i = 0; i < ctx->blur_texture_count; ++i) {
- glBindTexture(GL_TEXTURE_2D, ctx->blur_textures[i]);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
-
- // Generate FBO and textures when needed
- ctx->blur_fbos = ccalloc(ctx->blur_fbo_count, GLuint);
- glGenFramebuffers(ctx->blur_fbo_count, ctx->blur_fbos);
-
- for (int i = 0; i < ctx->blur_fbo_count; ++i) {
- if (!ctx->blur_fbos[i]) {
- log_error("Failed to generate framebuffer objects for blur");
- success = false;
- goto out;
- }
- }
-
-out:
- if (!success) {
- gl_destroy_blur_context(&gd->base, ctx);
- ctx = NULL;
- }
-
- gl_check_err();
- return ctx;
-}
-
-void gl_get_blur_size(void *blur_context, int *width, int *height) {
- auto ctx = (struct gl_blur_context *)blur_context;
- *width = ctx->resize_width;
- *height = ctx->resize_height;
-}
-
-// clang-format off
-const char *win_shader_glsl = GLSL(330,
- uniform float opacity;
- uniform float dim;
- uniform float corner_radius;
- uniform float border_width;
- uniform bool invert_color;
- in vec2 texcoord;
- uniform sampler2D tex;
- uniform sampler2D brightness;
- uniform float max_brightness;
- // Signed distance field for rectangle center at (0, 0), with size of
- // half_size * 2
- float rectangle_sdf(vec2 point, vec2 half_size) {
- vec2 d = abs(point) - half_size;
- return length(max(d, 0.0));
- }
-
- void main() {
- vec4 c = texelFetch(tex, ivec2(texcoord), 0);
- vec4 border_color = texture(tex, vec2(0.0, 0.5));
- if (invert_color) {
- c = vec4(c.aaa - c.rgb, c.a);
- border_color = vec4(border_color.aaa - border_color.rgb, border_color.a);
- }
- c = vec4(c.rgb * (1.0 - dim), c.a) * opacity;
- border_color = vec4(border_color.rgb * (1.0 - dim), border_color.a) * opacity;
-
- vec3 rgb_brightness = texelFetch(brightness, ivec2(0, 0), 0).rgb;
- // Ref: https://en.wikipedia.org/wiki/Relative_luminance
- float brightness = rgb_brightness.r * 0.21 +
- rgb_brightness.g * 0.72 +
- rgb_brightness.b * 0.07;
- if (brightness > max_brightness) {
- c.rgb = c.rgb * (max_brightness / brightness);
- border_color.rgb = border_color.rgb * (max_brightness / brightness);
- }
-
- // Rim color is the color of the outer rim of the window, if there is no
- // border, it's the color of the window itself, otherwise it's the border.
- // Using mix() to avoid a branch here.
- vec4 rim_color = mix(c, border_color, clamp(border_width, 0.0f, 1.0f));
-
- vec2 outer_size = vec2(textureSize(tex, 0));
- vec2 inner_size = outer_size - vec2(corner_radius) * 2.0f - 1;
- float rect_distance = rectangle_sdf(texcoord - outer_size / 2.0f,
- inner_size / 2.0f) - corner_radius;
- if (rect_distance > 0.0f) {
- c = (1.0f - clamp(rect_distance, 0.0f, 1.0f)) * rim_color;
- } else {
- float factor = clamp(rect_distance + border_width, 0.0f, 1.0f);
- c = (1.0f - factor) * c + factor * border_color;
- }
-
- gl_FragColor = c;
- }
-);
-
-const char *present_vertex_shader = GLSL(330,
- uniform mat4 projection;
- layout(location = 0) in vec2 coord;
- out vec2 texcoord;
- void main() {
- gl_Position = projection * vec4(coord, 0, 1);
- texcoord = coord;
- }
-);
-// clang-format on
-
-bool gl_init(struct gl_data *gd, session_t *ps) {
- // Initialize GLX data structure
- glDisable(GL_DEPTH_TEST);
- glDepthMask(GL_FALSE);
-
- glEnable(GL_BLEND);
- // X pixmap is in premultiplied alpha, so we might just as well use it too.
- // Thanks to derhass for help.
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
- // Initialize stencil buffer
- glDisable(GL_STENCIL_TEST);
- glStencilMask(0x1);
- glStencilFunc(GL_EQUAL, 0x1, 0x1);
-
- // Set gl viewport to the maximum supported size so we won't have to worry about
- // it later on when the screen is resized. The corresponding projection matrix can
- // be set now and won't have to be updated. Since fragments outside the target
- // buffer are skipped anyways, this should have no impact on performance.
- GLint viewport_dimensions[2];
- glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions);
- glViewport(0, 0, viewport_dimensions[0], viewport_dimensions[1]);
-
- // Clear screen
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
-
- glGenFramebuffers(1, &gd->back_fbo);
- glGenTextures(1, &gd->back_texture);
- if (!gd->back_fbo || !gd->back_texture) {
- log_error("Failed to generate a framebuffer object");
- return false;
- }
-
- glBindTexture(GL_TEXTURE_2D, gd->back_texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glBindTexture(GL_TEXTURE_2D, 0);
-
- // Set projection matrix to gl viewport dimensions so we can use screen
- // coordinates for all vertices
- // Note: OpenGL matrices are column major
- GLfloat projection_matrix[4][4] = {{2.0f / (GLfloat)viewport_dimensions[0], 0, 0, 0},
- {0, 2.0f / (GLfloat)viewport_dimensions[1], 0, 0},
- {0, 0, 0, 0},
- {-1, -1, 0, 1}};
-
- // Initialize shaders
- gl_win_shader_from_string(vertex_shader, win_shader_glsl, &gd->win_shader);
- int pml = glGetUniformLocationChecked(gd->win_shader.prog, "projection");
- glUseProgram(gd->win_shader.prog);
- glUniformMatrix4fv(pml, 1, false, projection_matrix[0]);
- glUseProgram(0);
-
- gd->fill_shader.prog = gl_create_program_from_str(fill_vert, fill_frag);
- gd->fill_shader.color_loc = glGetUniformLocation(gd->fill_shader.prog, "color");
- pml = glGetUniformLocationChecked(gd->fill_shader.prog, "projection");
- glUseProgram(gd->fill_shader.prog);
- glUniformMatrix4fv(pml, 1, false, projection_matrix[0]);
- glUseProgram(0);
-
- gd->present_prog = gl_create_program_from_str(present_vertex_shader, dummy_frag);
- if (!gd->present_prog) {
- log_error("Failed to create the present shader");
- return false;
- }
- pml = glGetUniformLocationChecked(gd->present_prog, "projection");
- glUseProgram(gd->present_prog);
- glUniform1i(glGetUniformLocationChecked(gd->present_prog, "tex"), 0);
- glUniformMatrix4fv(pml, 1, false, projection_matrix[0]);
- glUseProgram(0);
-
- gd->brightness_shader.prog =
- gl_create_program_from_str(interpolating_vert, interpolating_frag);
- if (!gd->brightness_shader.prog) {
- log_error("Failed to create the brightness shader");
- return false;
- }
- pml = glGetUniformLocationChecked(gd->brightness_shader.prog, "projection");
- glUseProgram(gd->brightness_shader.prog);
- glUniform1i(glGetUniformLocationChecked(gd->brightness_shader.prog, "tex"), 0);
- glUniformMatrix4fv(pml, 1, false, projection_matrix[0]);
- glUseProgram(0);
-
- // Set up the size of the back texture
- gl_resize(gd, ps->root_width, ps->root_height);
-
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, gd->back_fbo);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- gd->back_texture, 0);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
- if (!gl_check_fb_complete(GL_FRAMEBUFFER)) {
- return false;
- }
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
-
- gd->logger = gl_string_marker_logger_new();
- if (gd->logger) {
- log_add_target_tls(gd->logger);
- }
-
- const char *vendor = (const char *)glGetString(GL_VENDOR);
- log_debug("GL_VENDOR = %s", vendor);
- if (strcmp(vendor, "NVIDIA Corporation") == 0) {
- log_info("GL vendor is NVIDIA, don't use glFinish");
- gd->is_nvidia = true;
- } else {
- gd->is_nvidia = false;
- }
- gd->has_robustness = gl_has_extension("GL_ARB_robustness");
-
- return true;
-}
-
-void gl_deinit(struct gl_data *gd) {
- gl_free_prog_main(&gd->win_shader);
-
- if (gd->logger) {
- log_remove_target_tls(gd->logger);
- gd->logger = NULL;
- }
-
- gl_check_err();
-}
-
-GLuint gl_new_texture(GLenum target) {
- GLuint texture;
- glGenTextures(1, &texture);
- if (!texture) {
- log_error("Failed to generate texture");
- return 0;
- }
-
- glBindTexture(target, texture);
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glBindTexture(target, 0);
-
- return texture;
-}
-
-/// Actually duplicate a texture into a new one, if this texture is shared
-static inline void gl_image_decouple(backend_t *base, struct backend_image *img) {
- if (img->inner->refcount == 1) {
- return;
- }
- auto gd = (struct gl_data *)base;
- auto inner = (struct gl_texture *)img->inner;
- auto new_tex = ccalloc(1, struct gl_texture);
-
- new_tex->texture = gl_new_texture(GL_TEXTURE_2D);
- new_tex->y_inverted = true;
- new_tex->height = inner->height;
- new_tex->width = inner->width;
- new_tex->refcount = 1;
- new_tex->user_data = gd->decouple_texture_user_data(base, inner->user_data);
-
- glBindTexture(GL_TEXTURE_2D, new_tex->texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, new_tex->width, new_tex->height, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, NULL);
- glBindTexture(GL_TEXTURE_2D, 0);
-
- assert(gd->present_prog);
- glUseProgram(gd->present_prog);
- glBindTexture(GL_TEXTURE_2D, inner->texture);
-
- GLuint fbo;
- glGenFramebuffers(1, &fbo);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- new_tex->texture, 0);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
- gl_check_fb_complete(GL_DRAW_FRAMEBUFFER);
-
- glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- // clang-format off
- GLint coord[] = {
- // top left
- 0, 0, // vertex coord
- 0, 0, // texture coord
-
- // top right
- new_tex->width, 0, // vertex coord
- new_tex->width, 0, // texture coord
-
- // bottom right
- new_tex->width, new_tex->height,
- new_tex->width, new_tex->height,
-
- // bottom left
- 0, new_tex->height,
- 0, new_tex->height,
- };
- // clang-format on
- GLuint indices[] = {0, 1, 2, 2, 3, 0};
-
- GLuint vao;
- glGenVertexArrays(1, &vao);
- glBindVertexArray(vao);
-
- GLuint bo[2];
- glGenBuffers(2, bo);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * 16, coord, GL_STATIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * 6, indices,
- GL_STATIC_DRAW);
-
- glEnableVertexAttribArray(vert_coord_loc);
- glEnableVertexAttribArray(vert_in_texcoord_loc);
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL);
- glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE,
- sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2));
-
- glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL);
-
- glDisableVertexAttribArray(vert_coord_loc);
- glDisableVertexAttribArray(vert_in_texcoord_loc);
- glBindVertexArray(0);
- glDeleteVertexArrays(1, &vao);
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(2, bo);
-
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- glDeleteFramebuffers(1, &fbo);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glUseProgram(0);
-
- gl_check_err();
-
- img->inner = (struct backend_image_inner_base *)new_tex;
- inner->refcount--;
-}
-
-static void gl_image_apply_alpha(backend_t *base, struct backend_image *img,
- const region_t *reg_op, double alpha) {
- // Result color = 0 (GL_ZERO) + alpha (GL_CONSTANT_ALPHA) * original color
- auto inner = (struct gl_texture *)img->inner;
- glBlendFunc(GL_ZERO, GL_CONSTANT_ALPHA);
- glBlendColor(0, 0, 0, (GLclampf)alpha);
- GLuint fbo;
- glGenFramebuffers(1, &fbo);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- inner->texture, 0);
- glDrawBuffer(GL_COLOR_ATTACHMENT0);
- _gl_fill(base, (struct color){0, 0, 0, 0}, reg_op, fbo, 0, false);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- glDeleteFramebuffers(1, &fbo);
-}
-
-void gl_present(backend_t *base, const region_t *region) {
- auto gd = (struct gl_data *)base;
-
- int nrects;
- const rect_t *rect = pixman_region32_rectangles((region_t *)region, &nrects);
- auto coord = ccalloc(nrects * 8, GLint);
- auto indices = ccalloc(nrects * 6, GLuint);
- for (int i = 0; i < nrects; i++) {
- // clang-format off
- memcpy(&coord[i * 8],
- ((GLint[]){rect[i].x1, gd->height - rect[i].y2,
- rect[i].x2, gd->height - rect[i].y2,
- rect[i].x2, gd->height - rect[i].y1,
- rect[i].x1, gd->height - rect[i].y1}),
- sizeof(GLint) * 8);
- // clang-format on
-
- GLuint u = (GLuint)(i * 4);
- memcpy(&indices[i * 6],
- ((GLuint[]){u + 0, u + 1, u + 2, u + 2, u + 3, u + 0}),
- sizeof(GLuint) * 6);
- }
-
- glUseProgram(gd->present_prog);
- glBindTexture(GL_TEXTURE_2D, gd->back_texture);
-
- GLuint vao;
- glGenVertexArrays(1, &vao);
- glBindVertexArray(vao);
-
- GLuint bo[2];
- glGenBuffers(2, bo);
- glEnableVertexAttribArray(vert_coord_loc);
- glBindBuffer(GL_ARRAY_BUFFER, bo[0]);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]);
- glBufferData(GL_ARRAY_BUFFER, (long)sizeof(GLint) * nrects * 8, coord, GL_STREAM_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(GLuint) * nrects * 6, indices,
- GL_STREAM_DRAW);
-
- glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 2, NULL);
- glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL);
-
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glBindVertexArray(0);
- glDeleteBuffers(2, bo);
- glDeleteVertexArrays(1, &vao);
-
- free(coord);
- free(indices);
-}
-
-bool gl_image_op(backend_t *base, enum image_operations op, void *image_data,
- const region_t *reg_op, const region_t *reg_visible attr_unused, void *arg) {
- struct backend_image *tex = image_data;
- switch (op) {
- case IMAGE_OP_APPLY_ALPHA:
- gl_image_decouple(base, tex);
- assert(tex->inner->refcount == 1);
- gl_image_apply_alpha(base, tex, reg_op, *(double *)arg);
- break;
- }
-
- return true;
-}
-
-enum device_status gl_device_status(backend_t *base) {
- auto gd = (struct gl_data *)base;
- if (!gd->has_robustness) {
- return DEVICE_STATUS_NORMAL;
- }
- if (glGetGraphicsResetStatusARB() == GL_NO_ERROR) {
- return DEVICE_STATUS_NORMAL;
- } else {
- return DEVICE_STATUS_RESETTING;
- }
-}
diff --git a/dwm/picom/src/backend/gl/gl_common.h b/dwm/picom/src/backend/gl/gl_common.h
deleted file mode 100644
index 8bbbabb..0000000
--- a/dwm/picom/src/backend/gl/gl_common.h
+++ /dev/null
@@ -1,238 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#pragma once
-#include
-#include
-#include
-#include
-
-#include "backend/backend.h"
-#include "log.h"
-#include "region.h"
-
-#define CASESTRRET(s) \
- case s: return #s
-
-static inline GLint glGetUniformLocationChecked(GLuint p, const char *name) {
- auto ret = glGetUniformLocation(p, name);
- if (ret < 0) {
- log_info("Failed to get location of uniform '%s'. This is normal when "
- "using custom shaders.",
- name);
- }
- return ret;
-}
-
-#define bind_uniform(shader, uniform) \
- (shader)->uniform_##uniform = glGetUniformLocationChecked((shader)->prog, #uniform)
-
-// Program and uniforms for window shader
-typedef struct {
- GLuint prog;
- GLint uniform_opacity;
- GLint uniform_invert_color;
- GLint uniform_tex;
- GLint uniform_dim;
- GLint uniform_brightness;
- GLint uniform_max_brightness;
- GLint uniform_corner_radius;
- GLint uniform_border_width;
-} gl_win_shader_t;
-
-// Program and uniforms for brightness shader
-typedef struct {
- GLuint prog;
-} gl_brightness_shader_t;
-
-// Program and uniforms for blur shader
-typedef struct {
- GLuint prog;
- GLint uniform_pixel_norm;
- GLint uniform_opacity;
- GLint texorig_loc;
- GLint scale_loc;
-} gl_blur_shader_t;
-
-typedef struct {
- GLuint prog;
- GLint color_loc;
-} gl_fill_shader_t;
-
-/// @brief Wrapper of a binded GLX texture.
-struct gl_texture {
- int refcount;
- bool has_alpha;
- GLuint texture;
- int width, height;
- bool y_inverted;
-
- // Textures for auxiliary uses.
- GLuint auxiliary_texture[2];
- void *user_data;
-};
-
-struct gl_data {
- backend_t base;
- // If we are using proprietary NVIDIA driver
- bool is_nvidia;
- // If ARB_robustness extension is present
- bool has_robustness;
- // Height and width of the root window
- int height, width;
- gl_win_shader_t win_shader;
- gl_brightness_shader_t brightness_shader;
- gl_fill_shader_t fill_shader;
- GLuint back_texture, back_fbo;
- GLuint present_prog;
-
- /// Called when an gl_texture is decoupled from the texture it refers. Returns
- /// the decoupled user_data
- void *(*decouple_texture_user_data)(backend_t *base, void *user_data);
-
- /// Release the user data attached to a gl_texture
- void (*release_user_data)(backend_t *base, struct gl_texture *);
-
- struct log_target *logger;
-};
-
-typedef struct session session_t;
-
-#define GL_PROG_MAIN_INIT \
- { .prog = 0, .unifm_opacity = -1, .unifm_invert_color = -1, .unifm_tex = -1, }
-
-GLuint gl_create_shader(GLenum shader_type, const char *shader_str);
-GLuint gl_create_program(const GLuint *const shaders, int nshaders);
-GLuint gl_create_program_from_str(const char *vert_shader_str, const char *frag_shader_str);
-
-/**
- * @brief Render a region with texture data.
- */
-void gl_compose(backend_t *, void *ptex,
- int dst_x1, int dst_y1, int dst_x2, int dst_y2,
- const region_t *reg_tgt, const region_t *reg_visible);
-
-void gl_resize(struct gl_data *, int width, int height);
-
-bool gl_init(struct gl_data *gd, session_t *);
-void gl_deinit(struct gl_data *gd);
-
-GLuint gl_new_texture(GLenum target);
-
-bool gl_image_op(backend_t *base, enum image_operations op, void *image_data,
- const region_t *reg_op, const region_t *reg_visible, void *arg);
-
-void gl_release_image(backend_t *base, void *image_data);
-
-void *gl_clone(backend_t *base, const void *image_data, const region_t *reg_visible);
-
-bool gl_blur(backend_t *base, double opacity, void *, const region_t *reg_blur,
- const region_t *reg_visible);
-void *gl_create_blur_context(backend_t *base, enum blur_method, void *args);
-void gl_destroy_blur_context(backend_t *base, void *ctx);
-void gl_get_blur_size(void *blur_context, int *width, int *height);
-
-void gl_fill(backend_t *base, struct color, const region_t *clip);
-
-void gl_present(backend_t *base, const region_t *);
-bool gl_read_pixel(backend_t *base, void *image_data, int x, int y, struct color *output);
-enum device_status gl_device_status(backend_t *base);
-
-static inline void gl_delete_texture(GLuint texture) {
- glDeleteTextures(1, &texture);
-}
-
-/**
- * Get a textual representation of an OpenGL error.
- */
-static inline const char *gl_get_err_str(GLenum err) {
- switch (err) {
- CASESTRRET(GL_NO_ERROR);
- CASESTRRET(GL_INVALID_ENUM);
- CASESTRRET(GL_INVALID_VALUE);
- CASESTRRET(GL_INVALID_OPERATION);
- CASESTRRET(GL_INVALID_FRAMEBUFFER_OPERATION);
- CASESTRRET(GL_OUT_OF_MEMORY);
- CASESTRRET(GL_STACK_UNDERFLOW);
- CASESTRRET(GL_STACK_OVERFLOW);
- CASESTRRET(GL_FRAMEBUFFER_UNDEFINED);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER);
- CASESTRRET(GL_FRAMEBUFFER_UNSUPPORTED);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE);
- CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS);
- }
- return NULL;
-}
-
-/**
- * Check for GLX error.
- *
- * http://blog.nobel-joergensen.com/2013/01/29/debugging-opengl-using-glgeterror/
- */
-static inline void gl_check_err_(const char *func, int line) {
- GLenum err = GL_NO_ERROR;
-
- while (GL_NO_ERROR != (err = glGetError())) {
- const char *errtext = gl_get_err_str(err);
- if (errtext) {
- log_printf(tls_logger, LOG_LEVEL_ERROR, func,
- "GLX error at line %d: %s", line, errtext);
- } else {
- log_printf(tls_logger, LOG_LEVEL_ERROR, func,
- "GLX error at line %d: %d", line, err);
- }
- }
-}
-
-static inline void gl_clear_err(void) {
- while (glGetError() != GL_NO_ERROR)
- ;
-}
-
-#define gl_check_err() gl_check_err_(__func__, __LINE__)
-
-/**
- * Check for GL framebuffer completeness.
- */
-static inline bool gl_check_fb_complete_(const char *func, int line, GLenum fb) {
- GLenum status = glCheckFramebufferStatus(fb);
-
- if (status == GL_FRAMEBUFFER_COMPLETE) {
- return true;
- }
-
- const char *stattext = gl_get_err_str(status);
- if (stattext) {
- log_printf(tls_logger, LOG_LEVEL_ERROR, func,
- "Framebuffer attachment failed at line %d: %s", line, stattext);
- } else {
- log_printf(tls_logger, LOG_LEVEL_ERROR, func,
- "Framebuffer attachment failed at line %d: %d", line, status);
- }
-
- return false;
-}
-
-#define gl_check_fb_complete(fb) gl_check_fb_complete_(__func__, __LINE__, (fb))
-
-/**
- * Check if a GLX extension exists.
- */
-static inline bool gl_has_extension(const char *ext) {
- int nexts = 0;
- glGetIntegerv(GL_NUM_EXTENSIONS, &nexts);
- for (int i = 0; i < nexts || !nexts; i++) {
- const char *exti = (const char *)glGetStringi(GL_EXTENSIONS, (GLuint)i);
- if (exti == NULL) {
- break;
- }
- if (strcmp(ext, exti) == 0) {
- return true;
- }
- }
- gl_clear_err();
- log_info("Missing GL extension %s.", ext);
- return false;
-}
diff --git a/dwm/picom/src/backend/gl/glx.c b/dwm/picom/src/backend/gl/glx.c
deleted file mode 100644
index 3af7c1b..0000000
--- a/dwm/picom/src/backend/gl/glx.c
+++ /dev/null
@@ -1,654 +0,0 @@
-// SPDX-License-Identifier: MIT
-/*
- * Compton - a compositor for X11
- *
- * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard
- *
- * Copyright (c) 2011-2013, Christopher Jeffrey
- * Copyright (c) 2019 Yuxuan Shui
- * See LICENSE-mit for more information.
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "backend/backend.h"
-#include "backend/backend_common.h"
-#include "backend/gl/gl_common.h"
-#include "backend/gl/glx.h"
-#include "common.h"
-#include "compiler.h"
-#include "config.h"
-#include "log.h"
-#include "picom.h"
-#include "region.h"
-#include "utils.h"
-#include "win.h"
-#include "x.h"
-
-struct _glx_pixmap {
- GLXPixmap glpixmap;
- xcb_pixmap_t pixmap;
- bool owned;
-};
-
-struct _glx_data {
- struct gl_data gl;
- Display *display;
- int screen;
- xcb_window_t target_win;
- GLXContext ctx;
-};
-
-#define glXGetFBConfigAttribChecked(a, b, attr, c) \
- do { \
- if (glXGetFBConfigAttrib(a, b, attr, c)) { \
- log_info("Cannot get FBConfig attribute " #attr); \
- continue; \
- } \
- } while (0)
-
-struct glx_fbconfig_info *glx_find_fbconfig(Display *dpy, int screen, struct xvisual_info m) {
- log_debug("Looking for FBConfig for RGBA%d%d%d%d, depth %d", m.red_size,
- m.blue_size, m.green_size, m.alpha_size, m.visual_depth);
-
- int ncfg;
- // clang-format off
- GLXFBConfig *cfg =
- glXChooseFBConfig(dpy, screen, (int[]){
- GLX_RENDER_TYPE, GLX_RGBA_BIT,
- GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
- GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
- GLX_X_RENDERABLE, true,
- GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, (GLint)GLX_DONT_CARE,
- GLX_BUFFER_SIZE, m.red_size + m.green_size +
- m.blue_size + m.alpha_size,
- GLX_RED_SIZE, m.red_size,
- GLX_BLUE_SIZE, m.blue_size,
- GLX_GREEN_SIZE, m.green_size,
- GLX_ALPHA_SIZE, m.alpha_size,
- GLX_STENCIL_SIZE, 0,
- GLX_DEPTH_SIZE, 0,
- 0
- }, &ncfg);
- // clang-format on
-
- int texture_tgts, y_inverted, texture_fmt;
- bool found = false;
- int min_cost = INT_MAX;
- GLXFBConfig ret;
- for (int i = 0; i < ncfg; i++) {
- int depthbuf, stencil, doublebuf, bufsize;
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BUFFER_SIZE, &bufsize);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_DEPTH_SIZE, &depthbuf);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_STENCIL_SIZE, &stencil);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_DOUBLEBUFFER, &doublebuf);
- if (depthbuf + stencil + bufsize * (doublebuf + 1) >= min_cost) {
- continue;
- }
- int red, green, blue;
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_RED_SIZE, &red);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BLUE_SIZE, &blue);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_GREEN_SIZE, &green);
- if (red != m.red_size || green != m.green_size || blue != m.blue_size) {
- // Color size doesn't match, this cannot work
- continue;
- }
-
- int rgb, rgba;
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGB_EXT, &rgb);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGBA_EXT, &rgba);
- if (!rgb && !rgba) {
- log_info("FBConfig is neither RGBA nor RGB, we cannot "
- "handle this setup.");
- continue;
- }
-
- int visual;
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_VISUAL_ID, &visual);
- if (m.visual_depth != -1 &&
- x_get_visual_depth(XGetXCBConnection(dpy), (xcb_visualid_t)visual) !=
- m.visual_depth) {
- // FBConfig and the correspondent X Visual might not have the same
- // depth. (e.g. 32 bit FBConfig with a 24 bit Visual). This is
- // quite common, seen in both open source and proprietary drivers.
- //
- // If the FBConfig has a matching depth but its visual doesn't, we
- // still cannot use it.
- continue;
- }
-
- // All check passed, we are using this one.
- found = true;
- ret = cfg[i];
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_TARGETS_EXT,
- &texture_tgts);
- glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_Y_INVERTED_EXT, &y_inverted);
-
- // Prefer the texture format with matching alpha, with the other one as
- // fallback
- if (m.alpha_size) {
- texture_fmt = rgba ? GLX_TEXTURE_FORMAT_RGBA_EXT
- : GLX_TEXTURE_FORMAT_RGB_EXT;
- } else {
- texture_fmt =
- rgb ? GLX_TEXTURE_FORMAT_RGB_EXT : GLX_TEXTURE_FORMAT_RGBA_EXT;
- }
- min_cost = depthbuf + stencil + bufsize * (doublebuf + 1);
- }
- free(cfg);
- if (!found) {
- return NULL;
- }
-
- auto info = cmalloc(struct glx_fbconfig_info);
- info->cfg = ret;
- info->texture_tgts = texture_tgts;
- info->texture_fmt = texture_fmt;
- info->y_inverted = y_inverted;
- return info;
-}
-
-/**
- * Free a glx_texture_t.
- */
-static void glx_release_image(backend_t *base, struct gl_texture *tex) {
- struct _glx_data *gd = (void *)base;
-
- struct _glx_pixmap *p = tex->user_data;
- // Release binding
- if (p->glpixmap && tex->texture) {
- glBindTexture(GL_TEXTURE_2D, tex->texture);
- glXReleaseTexImageEXT(gd->display, p->glpixmap, GLX_FRONT_LEFT_EXT);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
-
- // Free GLX Pixmap
- if (p->glpixmap) {
- glXDestroyPixmap(gd->display, p->glpixmap);
- p->glpixmap = 0;
- }
-
- if (p->owned) {
- xcb_free_pixmap(base->c, p->pixmap);
- p->pixmap = XCB_NONE;
- }
-
- free(p);
- tex->user_data = NULL;
-}
-
-/**
- * Destroy GLX related resources.
- */
-void glx_deinit(backend_t *base) {
- struct _glx_data *gd = (void *)base;
-
- gl_deinit(&gd->gl);
-
- // Destroy GLX context
- if (gd->ctx) {
- glXMakeCurrent(gd->display, None, NULL);
- glXDestroyContext(gd->display, gd->ctx);
- gd->ctx = 0;
- }
-
- free(gd);
-}
-
-static void *glx_decouple_user_data(backend_t *base attr_unused, void *ud attr_unused) {
- auto ret = cmalloc(struct _glx_pixmap);
- ret->owned = false;
- ret->glpixmap = 0;
- ret->pixmap = 0;
- return ret;
-}
-
-static bool glx_set_swap_interval(int interval, Display *dpy, GLXDrawable drawable) {
- bool vsync_enabled = false;
- if (glxext.has_GLX_MESA_swap_control) {
- vsync_enabled = (glXSwapIntervalMESA((uint)interval) == 0);
- }
- if (!vsync_enabled && glxext.has_GLX_SGI_swap_control) {
- vsync_enabled = (glXSwapIntervalSGI(interval) == 0);
- }
- if (!vsync_enabled && glxext.has_GLX_EXT_swap_control) {
- // glXSwapIntervalEXT doesn't return if it's successful
- glXSwapIntervalEXT(dpy, drawable, interval);
- vsync_enabled = true;
- }
- return vsync_enabled;
-}
-
-/**
- * Initialize OpenGL.
- */
-static backend_t *glx_init(session_t *ps) {
- bool success = false;
- glxext_init(ps->dpy, ps->scr);
- auto gd = ccalloc(1, struct _glx_data);
- init_backend_base(&gd->gl.base, ps);
-
- gd->display = ps->dpy;
- gd->screen = ps->scr;
- gd->target_win = session_get_target_window(ps);
-
- XVisualInfo *pvis = NULL;
-
- // Check for GLX extension
- if (!ps->glx_exists) {
- log_error("No GLX extension.");
- goto end;
- }
-
- // Get XVisualInfo
- int nitems = 0;
- XVisualInfo vreq = {.visualid = ps->vis};
- pvis = XGetVisualInfo(ps->dpy, VisualIDMask, &vreq, &nitems);
- if (!pvis) {
- log_error("Failed to acquire XVisualInfo for current visual.");
- goto end;
- }
-
- // Ensure the visual is double-buffered
- int value = 0;
- if (glXGetConfig(ps->dpy, pvis, GLX_USE_GL, &value) || !value) {
- log_error("Root visual is not a GL visual.");
- goto end;
- }
-
- if (glXGetConfig(ps->dpy, pvis, GLX_STENCIL_SIZE, &value) || !value) {
- log_error("Root visual lacks stencil buffer.");
- goto end;
- }
-
- if (glXGetConfig(ps->dpy, pvis, GLX_DOUBLEBUFFER, &value) || !value) {
- log_error("Root visual is not a double buffered GL visual.");
- goto end;
- }
-
- if (glXGetConfig(ps->dpy, pvis, GLX_RGBA, &value) || !value) {
- log_error("Root visual is a color index visual, not supported");
- goto end;
- }
-
- if (!glxext.has_GLX_EXT_texture_from_pixmap) {
- log_error("GLX_EXT_texture_from_pixmap is not supported by your driver");
- goto end;
- }
-
- if (!glxext.has_GLX_ARB_create_context) {
- log_error("GLX_ARB_create_context is not supported by your driver");
- goto end;
- }
-
- // Find a fbconfig with visualid matching the one from the target win, so we can
- // be sure that the fbconfig is compatible with our target window.
- int ncfgs;
- GLXFBConfig *cfg = glXGetFBConfigs(gd->display, gd->screen, &ncfgs);
- bool found = false;
- for (int i = 0; i < ncfgs; i++) {
- int visualid;
- glXGetFBConfigAttribChecked(gd->display, cfg[i], GLX_VISUAL_ID, &visualid);
- if ((VisualID)visualid != pvis->visualid) {
- continue;
- }
-
- int *attributes = (int[]){GLX_CONTEXT_MAJOR_VERSION_ARB,
- 3,
- GLX_CONTEXT_MINOR_VERSION_ARB,
- 3,
- GLX_CONTEXT_PROFILE_MASK_ARB,
- GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
- 0,
- 0,
- 0};
- if (glxext.has_GLX_ARB_create_context_robustness) {
- attributes[6] = GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB;
- attributes[7] = GLX_LOSE_CONTEXT_ON_RESET_ARB;
- }
-
- gd->ctx = glXCreateContextAttribsARB(ps->dpy, cfg[i], 0, true, attributes);
- free(cfg);
-
- if (!gd->ctx) {
- log_error("Failed to get GLX context.");
- goto end;
- }
- found = true;
- break;
- }
-
- if (!found) {
- log_error("Couldn't find a suitable fbconfig for the target window");
- goto end;
- }
-
- // Attach GLX context
- GLXDrawable tgt = gd->target_win;
- if (!glXMakeCurrent(ps->dpy, tgt, gd->ctx)) {
- log_error("Failed to attach GLX context.");
- goto end;
- }
-
- if (!gl_init(&gd->gl, ps)) {
- log_error("Failed to setup OpenGL");
- goto end;
- }
-
- gd->gl.decouple_texture_user_data = glx_decouple_user_data;
- gd->gl.release_user_data = glx_release_image;
-
- if (ps->o.vsync) {
- if (!glx_set_swap_interval(1, ps->dpy, tgt)) {
- log_error("Failed to enable vsync.");
- }
- } else {
- glx_set_swap_interval(0, ps->dpy, tgt);
- }
-
- success = true;
-
-end:
- if (pvis) {
- XFree(pvis);
- }
-
- if (!success) {
- glx_deinit(&gd->gl.base);
- return NULL;
- }
-
- return &gd->gl.base;
-}
-
-static void *
-glx_bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, bool owned) {
- struct _glx_data *gd = (void *)base;
- struct _glx_pixmap *glxpixmap = NULL;
- // Retrieve pixmap parameters, if they aren't provided
- if (fmt.visual_depth > OPENGL_MAX_DEPTH) {
- log_error("Requested depth %d higher than max possible depth %d.",
- fmt.visual_depth, OPENGL_MAX_DEPTH);
- return false;
- }
-
- if (fmt.visual_depth < 0) {
- log_error("Pixmap %#010x with invalid depth %d", pixmap, fmt.visual_depth);
- return false;
- }
-
- auto r = xcb_get_geometry_reply(base->c, xcb_get_geometry(base->c, pixmap), NULL);
- if (!r) {
- log_error("Invalid pixmap %#010x", pixmap);
- return NULL;
- }
-
- log_trace("Binding pixmap %#010x", pixmap);
- auto wd = ccalloc(1, struct backend_image);
- wd->max_brightness = 1;
- auto inner = ccalloc(1, struct gl_texture);
- inner->width = wd->ewidth = r->width;
- inner->height = wd->eheight = r->height;
- wd->inner = (struct backend_image_inner_base *)inner;
- free(r);
-
- auto fbcfg = glx_find_fbconfig(gd->display, gd->screen, fmt);
- if (!fbcfg) {
- log_error("Couldn't find FBConfig with requested visual %x", fmt.visual);
- goto err;
- }
-
- // Choose a suitable texture target for our pixmap.
- // Refer to GLX_EXT_texture_om_pixmap spec to see what are the mean
- // of the bits in texture_tgts
- if (!(fbcfg->texture_tgts & GLX_TEXTURE_2D_BIT_EXT)) {
- log_error("Cannot bind pixmap to GL_TEXTURE_2D, giving up");
- goto err;
- }
-
- log_debug("depth %d, rgba %d", fmt.visual_depth,
- (fbcfg->texture_fmt == GLX_TEXTURE_FORMAT_RGBA_EXT));
-
- GLint attrs[] = {
- GLX_TEXTURE_FORMAT_EXT,
- fbcfg->texture_fmt,
- GLX_TEXTURE_TARGET_EXT,
- GLX_TEXTURE_2D_EXT,
- 0,
- };
-
- inner->y_inverted = fbcfg->y_inverted;
-
- glxpixmap = cmalloc(struct _glx_pixmap);
- glxpixmap->pixmap = pixmap;
- glxpixmap->glpixmap = glXCreatePixmap(gd->display, fbcfg->cfg, pixmap, attrs);
- glxpixmap->owned = owned;
- free(fbcfg);
-
- if (!glxpixmap->glpixmap) {
- log_error("Failed to create glpixmap for pixmap %#010x", pixmap);
- goto err;
- }
-
- log_trace("GLXPixmap %#010lx", glxpixmap->glpixmap);
-
- // Create texture
- inner->user_data = glxpixmap;
- inner->texture = gl_new_texture(GL_TEXTURE_2D);
- inner->has_alpha = fmt.alpha_size != 0;
- wd->opacity = 1;
- wd->color_inverted = false;
- wd->dim = 0;
- wd->inner->refcount = 1;
- glBindTexture(GL_TEXTURE_2D, inner->texture);
- glXBindTexImageEXT(gd->display, glxpixmap->glpixmap, GLX_FRONT_LEFT_EXT, NULL);
- glBindTexture(GL_TEXTURE_2D, 0);
-
- gl_check_err();
- return wd;
-err:
- if (glxpixmap && glxpixmap->glpixmap) {
- glXDestroyPixmap(gd->display, glxpixmap->glpixmap);
- }
- free(glxpixmap);
-
- if (owned) {
- xcb_free_pixmap(base->c, pixmap);
- }
- free(wd);
- return NULL;
-}
-
-static void glx_present(backend_t *base, const region_t *region attr_unused) {
- struct _glx_data *gd = (void *)base;
- gl_present(base, region);
- glXSwapBuffers(gd->display, gd->target_win);
- if (!gd->gl.is_nvidia) {
- glFinish();
- }
-}
-
-static int glx_buffer_age(backend_t *base) {
- if (!glxext.has_GLX_EXT_buffer_age) {
- return -1;
- }
-
- struct _glx_data *gd = (void *)base;
- unsigned int val;
- glXQueryDrawable(gd->display, gd->target_win, GLX_BACK_BUFFER_AGE_EXT, &val);
- return (int)val ?: -1;
-}
-
-static void glx_diagnostics(backend_t *base) {
- struct _glx_data *gd = (void *)base;
- bool warn_software_rendering = false;
- const char *software_renderer_names[] = {"llvmpipe", "SWR", "softpipe"};
- auto glx_vendor = glXGetClientString(gd->display, GLX_VENDOR);
- printf("* Driver vendors:\n");
- printf(" * GLX: %s\n", glx_vendor);
- printf(" * GL: %s\n", glGetString(GL_VENDOR));
-
- auto gl_renderer = (const char *)glGetString(GL_RENDERER);
- printf("* GL renderer: %s\n", gl_renderer);
- if (strcmp(glx_vendor, "Mesa Project and SGI")) {
- for (size_t i = 0; i < ARR_SIZE(software_renderer_names); i++) {
- if (strstr(gl_renderer, software_renderer_names[i]) != NULL) {
- warn_software_rendering = true;
- break;
- }
- }
- }
-
-#ifdef GLX_MESA_query_renderer
- if (glxext.has_GLX_MESA_query_renderer) {
- unsigned int accelerated = 0;
- glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_ACCELERATED_MESA, &accelerated);
- printf("* Accelerated: %d\n", accelerated);
-
- // Trust GLX_MESA_query_renderer when it's available
- warn_software_rendering = (accelerated == 0);
- }
-#endif
-
- if (warn_software_rendering) {
- printf("\n(You are using a software renderer. Unless you are doing this\n"
- "intentionally, this means you don't have a graphics driver\n"
- "properly installed. Performance will suffer. Please fix this\n"
- "before reporting your issue.)\n");
- }
-}
-
-struct backend_operations glx_ops = {
- .init = glx_init,
- .deinit = glx_deinit,
- .bind_pixmap = glx_bind_pixmap,
- .release_image = gl_release_image,
- .compose = gl_compose,
- .image_op = gl_image_op,
- .set_image_property = default_set_image_property,
- .clone_image = default_clone_image,
- .blur = gl_blur,
- .is_image_transparent = default_is_image_transparent,
- .present = glx_present,
- .buffer_age = glx_buffer_age,
- .render_shadow = default_backend_render_shadow,
- .fill = gl_fill,
- .create_blur_context = gl_create_blur_context,
- .destroy_blur_context = gl_destroy_blur_context,
- .get_blur_size = gl_get_blur_size,
- .diagnostics = glx_diagnostics,
- .device_status = gl_device_status,
- .max_buffer_age = 5, // Why?
-};
-
-/**
- * Check if a GLX extension exists.
- */
-static inline bool glx_has_extension(Display *dpy, int screen, const char *ext) {
- const char *glx_exts = glXQueryExtensionsString(dpy, screen);
- if (!glx_exts) {
- log_error("Failed get GLX extension list.");
- return false;
- }
-
- auto inlen = strlen(ext);
- const char *curr = glx_exts;
- bool match = false;
- while (curr && !match) {
- const char *end = strchr(curr, ' ');
- if (!end) {
- // Last extension string
- match = strcmp(ext, curr) == 0;
- } else if (curr + inlen == end) {
- // Length match, do match string
- match = strncmp(ext, curr, (unsigned long)(end - curr)) == 0;
- }
- curr = end ? end + 1 : NULL;
- }
-
- if (!match) {
- log_info("Missing GLX extension %s.", ext);
- } else {
- log_info("Found GLX extension %s.", ext);
- }
-
- return match;
-}
-
-struct glxext_info glxext = {0};
-PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI;
-PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI;
-PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML;
-PFNGLXWAITFORMSCOMLPROC glXWaitForMscOML;
-PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
-PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI;
-PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA;
-PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT;
-PFNGLXRELEASETEXIMAGEEXTPROC glXReleaseTexImageEXT;
-PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB;
-
-#ifdef GLX_MESA_query_renderer
-PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA;
-#endif
-
-void glxext_init(Display *dpy, int screen) {
- if (glxext.initialized) {
- return;
- }
- glxext.initialized = true;
-#define check_ext(name) glxext.has_##name = glx_has_extension(dpy, screen, #name)
- check_ext(GLX_SGI_video_sync);
- check_ext(GLX_SGI_swap_control);
- check_ext(GLX_OML_sync_control);
- check_ext(GLX_MESA_swap_control);
- check_ext(GLX_EXT_swap_control);
- check_ext(GLX_EXT_texture_from_pixmap);
- check_ext(GLX_ARB_create_context);
- check_ext(GLX_EXT_buffer_age);
- check_ext(GLX_ARB_create_context_robustness);
-#ifdef GLX_MESA_query_renderer
- check_ext(GLX_MESA_query_renderer);
-#endif
-#undef check_ext
-
-#define lookup(name) (name = (__typeof__(name))glXGetProcAddress((GLubyte *)#name))
- // Checking if the returned function pointer is NULL is not really necessary,
- // or maybe not even useful, since glXGetProcAddress might always return
- // something. We are doing it just for completeness' sake.
- if (!lookup(glXGetVideoSyncSGI) || !lookup(glXWaitVideoSyncSGI)) {
- glxext.has_GLX_SGI_video_sync = false;
- }
- if (!lookup(glXSwapIntervalEXT)) {
- glxext.has_GLX_EXT_swap_control = false;
- }
- if (!lookup(glXSwapIntervalMESA)) {
- glxext.has_GLX_MESA_swap_control = false;
- }
- if (!lookup(glXSwapIntervalSGI)) {
- glxext.has_GLX_SGI_swap_control = false;
- }
- if (!lookup(glXWaitForMscOML) || !lookup(glXGetSyncValuesOML)) {
- glxext.has_GLX_OML_sync_control = false;
- }
- if (!lookup(glXBindTexImageEXT) || !lookup(glXReleaseTexImageEXT)) {
- glxext.has_GLX_EXT_texture_from_pixmap = false;
- }
- if (!lookup(glXCreateContextAttribsARB)) {
- glxext.has_GLX_ARB_create_context = false;
- }
-#ifdef GLX_MESA_query_renderer
- if (!lookup(glXQueryCurrentRendererIntegerMESA)) {
- glxext.has_GLX_MESA_query_renderer = false;
- }
-#endif
-#undef lookup
-}
diff --git a/dwm/picom/src/backend/gl/glx.h b/dwm/picom/src/backend/gl/glx.h
deleted file mode 100644
index 44b4da0..0000000
--- a/dwm/picom/src/backend/gl/glx.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#pragma once
-#include
-// Older version of glx.h defines function prototypes for these extensions...
-// Rename them to avoid conflicts
-#define glXSwapIntervalMESA glXSwapIntervalMESA_
-#define glXBindTexImageEXT glXBindTexImageEXT_
-#define glXReleaseTexImageEXT glXReleaseTexImageEXT
-#include
-#undef glXSwapIntervalMESA
-#undef glXBindTexImageEXT
-#undef glXReleaseTexImageEXT
-#include
-#include
-#include
-
-#include "log.h"
-#include "compiler.h"
-#include "utils.h"
-#include "x.h"
-
-struct glx_fbconfig_info {
- GLXFBConfig cfg;
- int texture_tgts;
- int texture_fmt;
- int y_inverted;
-};
-
-/// The search criteria for glx_find_fbconfig
-struct glx_fbconfig_criteria {
- /// Bit width of the red component
- int red_size;
- /// Bit width of the green component
- int green_size;
- /// Bit width of the blue component
- int blue_size;
- /// Bit width of the alpha component
- int alpha_size;
- /// The depth of X visual
- int visual_depth;
-};
-
-struct glx_fbconfig_info *glx_find_fbconfig(Display *, int screen, struct xvisual_info);
-
-
-struct glxext_info {
- bool initialized;
- bool has_GLX_SGI_video_sync;
- bool has_GLX_SGI_swap_control;
- bool has_GLX_OML_sync_control;
- bool has_GLX_MESA_swap_control;
- bool has_GLX_EXT_swap_control;
- bool has_GLX_EXT_texture_from_pixmap;
- bool has_GLX_ARB_create_context;
- bool has_GLX_EXT_buffer_age;
- bool has_GLX_MESA_query_renderer;
- bool has_GLX_ARB_create_context_robustness;
-};
-
-extern struct glxext_info glxext;
-
-extern PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI;
-extern PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI;
-extern PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML;
-extern PFNGLXWAITFORMSCOMLPROC glXWaitForMscOML;
-extern PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
-extern PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI;
-extern PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA;
-extern PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT;
-extern PFNGLXRELEASETEXIMAGEEXTPROC glXReleaseTexImageEXT;
-extern PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB;
-
-#ifdef GLX_MESA_query_renderer
-extern PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA;
-#endif
-
-void glxext_init(Display *, int screen);
diff --git a/dwm/picom/src/backend/meson.build b/dwm/picom/src/backend/meson.build
deleted file mode 100644
index b8f0ad9..0000000
--- a/dwm/picom/src/backend/meson.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# enable xrender
-srcs += [ files('backend_common.c', 'xrender/xrender.c', 'dummy/dummy.c', 'backend.c', 'driver.c') ]
-
-# enable opengl
-if get_option('opengl')
- srcs += [ files('gl/gl_common.c', 'gl/glx.c') ]
-endif
diff --git a/dwm/picom/src/backend/xrender/xrender.c b/dwm/picom/src/backend/xrender/xrender.c
deleted file mode 100644
index 6e661e8..0000000
--- a/dwm/picom/src/backend/xrender/xrender.c
+++ /dev/null
@@ -1,889 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui
-#include
-#include
-#include
-#include
-
-#include
-#include