dotfiles/homedir/.config/zxinit/common
fbt c78cb78ff0 init
Signed-off-by: fbt <fbt@fleshless.org>
2017-05-03 16:10:13 +03:00

71 lines
1.4 KiB
Bash

#!/bin/bash
# Resources
resources=( '/etc/X11/xinit/.Xresources' "$HOME/.Xresources" )
modmaps=( '/etc/X11/xinit/.Xmodmap' "$HOME/.Xmodmap" )
# Set DPI
xrandr --dpi 95
for r in "${resources[@]}"; do
if [[ -f "$r" ]]; then
xrdb -merge "$r"
fi
done
for m in modmaps; do
if [[ -f "$m" ]]; then
xmodmap "$m"
fi
done
# Common services
common_services+=( pulseaudio lockd )
for i in "${common_services[@]}"; do
service "$i" start
done
# Fonts
xset +fp /usr/share/fonts/local
# Screensaver settings
xset -dpms
xset s 300
xset s noblank
xset s noexpose
# Solid black root window
# chameleon is available at https://github.com/fbt/misc
chameleon -C '#151515'
# Set a wallpaper if it exists
if [[ -f "$HOME/wallpaper.png" ]]; then
chameleon "$HOME/wallpaper.png"
fi
# Input settings
setxkbmap "min(us),min(ru)" -option "lv3:rwin_switch,grp:caps_toggle,grp_led:caps,compose:ralt,terminate:ctrl_alt_bksp"
xmodmap -e 'remove lock = Caps_Lock' \
-e 'keycode 135 = KP_Insert' \
-e 'keycode 49 = Escape asciitilde'
# Start a dbus session
if ! [[ "$DBUS_SESSION_BUS_ADDRESS" ]]; then
export $(dbus-launch)
fi
# Some nvidia tweaks
export VDPAU_NVIDIA_NO_OVERLAY=1
#export __GL_THREADED_OPTIMIZATIONS=1
nvidia-settings -l
nvidia-settings -a InitialPixmapPlacement=2
# Custom functions
services() {
for i in "${session_services[@]}"; do
service "$i" "$1"
done
}
return 0