Debian Codegraph @

marco-xr_glx_hybrid

raw
1 #!/usr/bin/env bash
2
3 readonly WM="marco"
4 if ! command -v "${WM}" &>/dev/null; then
5 echo "ERROR! Can't find ${WM}."
6 exit 1
7 fi
8
9 UNAME="$(id -un)"
10 killall --user "${UNAME}" "${WM}" 2>/dev/null
11
12 BACKEND=$(echo "${0}" | cut -d'-' -f2-)
13 echo "${BACKEND}"
14
15 # Handle mutliple personalities.
16 case ${BACKEND} in
17 no-composite)
18 COMP=""
19 ;;
20 xrender|glx|xr_glx_hybrid)
21 COMP="picom"
22 ;;
23 *)
24 COMP="picom"
25 BACKEND="xrender"
26 ;;
27 esac
28
29 VSYNC="--vsync"
30 # Disable vsync if the NVIDIA compositor is enabled.
31 if command -v nvidia-settings &>/dev/null; then
32 if nvidia-settings -q CurrentMetaMode -t | grep ForceCompositionPipeline=On; then
33 VSYNC="--no-vsync"
34 fi
35 fi
36
37 killall --user "${UNAME}" compton 2>/dev/null
38 killall --user "${UNAME}" picom 2>/dev/null
39
40 if [ -n "${COMP}" ]; then
41 # Allow users to override the defaults by creating their own config
42 # for this wrapper.
43 if [ -f "${HOME}/.config/${WM}-${COMP}.conf" ]; then
44 ${COMP} \
45 --daemon \
46 --config "${HOME}/.config/${WM}-${COMP}.conf"
47 else
48 ${COMP} \
49 --daemon \
50 --config /dev/null \
51 --backend ${BACKEND} ${VSYNC} \
52 --detect-rounded-corners \
53 --detect-client-leader \
54 --detect-transient \
55 --detect-client-opacity \
56 --glx-no-stencil \
57 --no-use-damage \
58 --mark-wmwin-focused \
59 --mark-ovredir-focused \
60 --shadow \
61 --shadow-radius=12 \
62 --shadow-opacity=0.125 \
63 --shadow-offset-x=-12 \
64 --shadow-offset-y=-12 \
65 --fading \
66 --fade-delta=8 \
67 --no-fading-destroyed-argb \
68 --xinerama-shadow-crop \
69 --use-ewmh-active-win \
70 --unredir-if-possible \
71 --unredir-if-possible-exclude "class_g = 'Mate-screensaver'" \
72 --fade-exclude "window_type *= 'menu'" \
73 --shadow-exclude "window_type *= 'dnd'" \
74 --shadow-exclude "window_type *= 'dock'" \
75 --shadow-exclude "window_type *= 'notification'" \
76 --shadow-exclude "class_g = 'albert'" \
77 --shadow-exclude "class_g = 'Cairo-clock'" \
78 --shadow-exclude "class_g = 'Conky'" \
79 --shadow-exclude "class_g ?= 'Firefox' && argb" \
80 --shadow-exclude "class_g ?= 'Notify-osd'" \
81 --shadow-exclude "class_g = 'Synapse'" \
82 --shadow-exclude "class_g = 'Ulauncher'" \
83 --shadow-exclude "_GTK_FRAME_EXTENTS@:c" \
84 --shadow-exclude "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" \
85 --shadow-exclude "_NET_WM_STATE@:32a *= '_NET_WM_STATE_MAXIMIZED'"
86 fi
87 fi
88
89 # Replace window manager and force compositing off.
90 ${WM} --no-composite --replace &