X11: Move pieces from i3 and zshenv into xinitrc

Move everything that is desirable independent of the WM or shell into
xinitrc.
Move .Xresources and .Xmodmap into .config/X11.
Remove all unneeded GNOME bits from i3 config.
Make compositor launch script portable.
Add locker symlink and launch.sh similar to the compositor.
This commit is contained in:
2020-10-31 22:33:26 +01:00
parent feec02e267
commit 08c5c66e1e
9 changed files with 67 additions and 66 deletions

View File

@@ -1,7 +1,10 @@
#!/bin/sh #!/bin/sh
basedir="$(cd "$(dirname "$0")" && pwd -P)"
compositor="$(basename "$basedir")"
if [ "$1" = "-k" ]; then if [ "$1" = "-k" ]; then
killall -q compton killall -q "$compositor"
elif ! pgrep -ax compton >/dev/null 2>&1; then elif ! pgrep -ax "$compositor" >/dev/null 2>&1; then
compton --config "${XDG_CONFIG_HOME:-$HOME/.config}/compton/compton.conf" -b "$compositor" --config "$basedir/$compositor".conf -b
fi fi

View File

@@ -13,6 +13,14 @@ hide_edge_borders smart
set $TERMINAL st set $TERMINAL st
# Focus should not follow mouse
# focus_follows_mouse no
# Execs ########################################################################
# Multi monitor support
exec_always --no-startup-id ~/.config/i3/monitor-setup.sh &
# Keybindins ################################################################### # Keybindins ###################################################################
# Terminal # Terminal
@@ -181,51 +189,4 @@ bindsym --release $mod+Print exec gnome-screenshot -a
# Zoom links in private browser # Zoom links in private browser
bindsym $mod+z exec ~/.local/bin/zoom-links bindsym $mod+z exec ~/.local/bin/zoom-links
# Setup different stuff ########################################################
# Multi monitor support
exec_always --no-startup-id ~/.config/i3/monitor-setup.sh &
# Start locker
exec --no-startup-id xss-lock -l ~/.config/xsecurelock/transfer-sleep-lock.sh &
# Compositor for transparency and blur
exec --no-startup-id ~/.config/compositor/launch.sh
# Touchpad configuration
# Find touchpad: `xinput list`
# Find options: `xinput list-props $touchpad`
set $touchpad DLL082A:01 06CB:76AF Touchpad
exec xinput set-prop "$touchpad" "libinput Tapping Enabled" 1
exec xinput set-prop "$touchpad" "libinput Natural Scrolling Enabled" 1
exec xinput set-prop "$touchpad" "libinput Accel Speed" 0.45
# Keyboard Setup
# German layout without dead keys
exec setxkbmap de nodeadkeys -option
# Custom keymap (switches escape, control_r and caps_lock around)
exec xmodmap ~/.Xmodmap
# Control_R act as Escape when pressed alone and shortly
exec xcape -t 250 -e 'Control_R=Escape'
# Faster key repeat rate
exec xset r rate 500 25
# Muted at startup
exec amixer -q -D pulse sset Master mute
# Wallpaper
exec_always feh --bg-scale --no-fehbg ~/Pictures/Wallpapers/wallpaper
# Restore GNOME's settings
exec --no-startup-id /usr/libexec/gnome-settings-daemon-localeexec
# Fix a bug in gnome-settings-daemon: http://feeding.cloud.geek.nz/posts/creating-a-modern-tiling-desktop-environment-using-i3/
exec --no-startup-id dconf write /org/gnome/settings-daemon/plugins/cursor/active false
# Launch gnome-keyring
exec --no-startup-id gnome-keyring-daemon --start
# Focus should not follow mouse
# This is sometimes useful when picking colors on the screen in combination with deactivated dim
# focus_follows_mouse no
# vim: ft=i3 # vim: ft=i3

1
.config/locker Symbolic link
View File

@@ -0,0 +1 @@
xsecurelock

3
.config/xsecurelock/launch.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
xss-lock -l "$(cd "$(dirname "$0")" && pwd -P)"/transfer-sleep-lock.sh &

View File

@@ -1,23 +1,64 @@
#!/bin/sh #!/bin/sh
sysresources=/etc/X11/xinit/.Xresources sysresources=/etc/X11/xinit/.Xresources
userresources="${XDG_CONFIG_HOME:-$HOME/.config}"/X11/xresources
sysmodmap=/etc/X11/xinit/.Xmodmap sysmodmap=/etc/X11/xinit/.Xmodmap
userresources="$HOME"/.Xresources usermodmap="${XDG_CONFIG_HOME:-$HOME/.config}"/X11/xmodmap
usermodmap="$HOME"/.Xmodmap sysxinitrcd=/etc/X11/xinit/xinitrc.d
userxinitrcd="${XDG_CONFIG_HOME:-$HOME/.config}"/X11/xinitrc.d
[ ! -f "$sysresources" ] || xrdb -merge "$sysresources" [ ! -f "$sysresources" ] || xrdb -merge "$sysresources"
[ ! -f "$sysmodmap" ] || xmodmap "$sysmodmap"
[ ! -f "$userresources" ] || xrdb -merge "$userresources" [ ! -f "$userresources" ] || xrdb -merge "$userresources"
[ ! -f "$sysmodmap" ] || xmodmap "$sysmodmap"
[ ! -f "$usermodmap" ] || xmodmap "$usermodmap" [ ! -f "$usermodmap" ] || xmodmap "$usermodmap"
unset {sys,user}{resources,modmap} if [ -d "$sysxinitrcd" ] ; then
for f in "$sysxinitrcd"/?*.sh ; do
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ ! -x "$f" ] || . "$f" [ ! -x "$f" ] || . "$f"
done done
unset f unset f
fi fi
if [ -d "$userxinitrcd" ] ; then
for f in "$userxinitrcd"/?*.sh ; do
[ ! -x "$f" ] || . "$f"
done
unset f
fi
unset {sys,user}{resources,modmap,xinitrcd}
# <right-CTRL> acts as <ESC> when pressed alone and shortly.
xcape -t 250 -e 'Control_R=Escape'
# Key repeat rate
xset r rate 500 25
touchpad="DLL082A:01 06CB:76AF Touchpad"
xinput set-prop "$touchpad" "libinput Tapping Enabled" 1
xinput set-prop "$touchpad" "libinput Natural Scrolling Enabled" 1
xinput set-prop "$touchpad" "libinput Accel Speed" 0.45
unset touchpad
# Muted at startup
amixer -q -D pulse sset Master mute
# SSH
eval $(ssh-agent)
# Compositor
compositor="${XDG_CONFIG_HOME:-$HOME/.config}"/compositor/launch.sh
[ ! -x "$compositor" ] || "$compositor"
unset compositor
# Wallpaper
wallpaper="$HOME"/pics/wallpapers/wallpaper
feh --bg-scale --no-fehbg "$wallpaper"
unset wallpaper
# Locker
locker="${XDG_CONFIG_HOME:-$HOME/.config}"/locker/launch.sh
[ ! -x "$locker" ] || "$locker"
unset locker
exec i3 exec i3

View File

@@ -3,10 +3,6 @@
setopt NO_GLOBAL_RCS setopt NO_GLOBAL_RCS
if [ -n "$DESKTOP_SESSION" ] && [ -e /run/user/1000/keyring/ssh ]; then
export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
fi
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"

View File

@@ -20,10 +20,6 @@
stdout: true stdout: true
stderr: true stderr: true
- link: - link:
~/.Xmodmap:
path: .Xmodmap
~/.Xresources:
path: .Xresources
~/.xinitrc: ~/.xinitrc:
path: .xinitrc path: .xinitrc
~/.zshenv: ~/.zshenv: