~charles/dotfiles

b83f3b9ef9ba9b7c4a3cd5069e9e965add785c54 — Charles Daniels 3 years ago c54ce80
various OpenBSD-related tweaks
3 files changed, 53 insertions(+), 3 deletions(-)

M install.sh
M overlay/.config/i3/config
A overlay/bin/system-launch-compositor
M install.sh => install.sh +0 -1
@@ 1,6 1,5 @@
#!/bin/sh

set -e
set -u

# install overlay

M overlay/.config/i3/config => overlay/.config/i3/config +2 -2
@@ 70,7 70,7 @@ bindsym $mod+a focus parent
bindsym $mod+c focus child

# lock the screen
bindsym $mod+m exec "~/bin/system-lock"
bindsym $mod+m exec "~/bin/screenlock"

# switch to workspace
bindsym $mod+1 workspace 1


@@ 146,7 146,7 @@ bindsym $mod+Tab exec "rofi -show window"
bindsym Print exec "~/bin/system-screenshot &"

# i3lock
exec "xautolock -time 5 -locker ~/bin/system-lock &"
exec "xautolock -time 5 -locker ~/bin/screenlock &"

# borders
for_window [class="^.*"] border pixel 3

A overlay/bin/system-launch-compositor => overlay/bin/system-launch-compositor +51 -0
@@ 0,0 1,51 @@
#!/bin/sh

# .SCRIPTDOC

# Launch compton. My preferred settings are baked into this file. The purpose
# of this script is to try launch compton with different acceleration modes,
# which is necessary since different modes are available on different systems.

# .ENDOC


# kill any existing instances
pkill compton

# vsync methods in order of preference
VSYNC_METHODS="drm:opengl:opengl-oml:opengl-swc:opengl-mswc:none"

SHADOW_OPACITY=0
INACTIVE_OPACITY=1.0
INACTIVE_DIM=0.2
TITLEBAR_OPACITY=1.0
DROPDOWN_OPACITY=1.0
FADE_DURATION=2

COMPTON_OPTS="--shadow-opacity=$SHADOW_OPACITY "
COMPTON_OPTS="$COMPTON_OPTS -i $INACTIVE_OPACITY "
COMPTON_OPTS="$COMPTON_OPTS -e $TITLEBAR_OPACITY "
COMPTON_OPTS="$COMPTON_OPTS -m $DROPDOWN_OPACITY "
COMPTON_OPTS="$COMPTON_OPTS -D $FADE_DURATION "
COMPTON_OPTS="$COMPTON_OPTS --inactive-dim $INACTIVE_DIM "

# enable fade in / fade out
COMPTON_OPTS="$COMPTON_OPTS -f"

# run in background
COMPTON_OPTS="$COMPTON_OPTS -b"

# blur background for transparent windows
# COMPTON_OPTS="$COMPTON_OPTS --blur-background "

# exempted windows for shadow effects et al.
COMPTON_OPTS="$COMPTON_OPTS --focus-exclude name='rofi'"

echo "INFO: executing compton with options: $COMPTON_OPTS"

echo "$VSYNC_METHODS" | tr ':' '\n' | while read -r method ; do
	if compton $COMPTON_OPTS --vsync $method ; then
		echo "INFO: Launched compton successfully"
		exit 0
	fi
done