neodotfiles/source/dwm/scripts/autostart

61 lines
2.8 KiB
Text
Raw Normal View History

2024-03-28 21:00:58 +00:00
#!/bin/sh
## ____ __ ##
## / __ \_________ _/ /_____ ##
## / / / / ___/ __ `/ //_/ _ \ ##
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) ##
## /_____/_/ \__,_/_/|_|\___/ My custom dwm build ##
2024-08-05 19:19:42 +00:00
# activate neccesary env variables for ssh-agent and other stuff
2024-07-14 11:38:44 +00:00
dbus-update-activation-environment DISPLAY XAUTHORITY &
2024-08-05 19:19:42 +00:00
# autostart programs, use pidof <program> || program, to prevent relaunching stuff if dwm is restarted
2024-08-03 06:35:58 +00:00
pidof pipewire || pipewire &
pidof polkit-gnome-authentication-agent-1 || /usr/libexec/polkit-gnome-authentication-agent-1 &
pidof dwmblocks || dwmblocks &
pidof unclutter || unclutter --hide-on-touch &
2024-08-03 07:06:52 +00:00
pidof dunst || dunst --config $HOME/.config/dunst/dunstrc &
2024-08-03 06:35:58 +00:00
pidof picom || picom &
2024-08-03 11:27:29 +00:00
pidof xss-lock || xss-lock $HOME/.config/suckless/dwm/scripts/lock &
2024-08-05 19:19:42 +00:00
pidof emacs || /usr/bin/emacs --daemon &
2024-08-03 06:35:58 +00:00
2024-08-05 19:19:42 +00:00
# set theming and font thingy
gsettings set org.gnome.desktop.interface cursor-theme 'Simp1e-Gruvbox-Dark' &
gsettings set org.gnome.desktop.interface cursor-size 16 &
gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' &
gsettings set org.gnome.desktop.interface gtk-theme 'Gruvbox-Dark' &
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' &
gsettings set org.gnome.desktop.interface font-name 'Inter 10' &
gsettings set org.gnome.desktop.interface document-font-name 'Liberation Sans 10' &
gsettings set org.gnome.desktop.interface monospace-font-name 'Mononoki Nerd Font 10' &
gsettings set org.gnome.desktop.interface font-antialiasing 'rgba' &
gsettings set org.gnome.desktop.interface font-hinting 'full' &
2024-08-03 06:35:58 +00:00
2024-08-05 19:19:42 +00:00
# grab monitor status (varies with the machine)
### T480 monitors
2024-08-03 06:35:58 +00:00
monitor1=$(cat /sys/class/drm/card0-DP-1/status)
monitor2=$(cat /sys/class/drm/card0-HDMI-A-2/status)
2024-08-05 19:19:42 +00:00
# if monitors are connected, then use xrandr to set desired settings
2024-08-03 06:35:58 +00:00
if [ "$monitor1" = "connected" ] && [ "$monitor2" = "connected" ]; then
xrandr --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal \
--output DP1 --primary --mode 1920x1080 --rate 100.00 --pos 1924x0 --rotate normal \
2024-08-05 19:19:42 +00:00
--output HDMI2 --mode 1280x1024 --rate 75.00 --pos 3844x0 --rotate normal &
elif [ "$monitor1" = "connected" ]; then
xrandr --output eDP1 --primary --auto \
--output DP1 --auto --scale-from 1920x1080 --same-as eDP1 &
elif [ "$monitor2" = "connected" ]; then
xrandr --output eDP1 --primary --auto \
--output HDMI2 --auto --scale-from 1920x1080 --same-as eDP1 &
else
xrandr --output eDP1 --primary --auto \
--output DP1 --off \
--output HDMI2 --off &
2024-08-03 06:35:58 +00:00
fi
2024-08-05 19:19:42 +00:00
# set wallpaper
2024-08-03 06:35:58 +00:00
sh "$HOME"/.fehbg &
2024-08-05 19:19:42 +00:00
# bind gnome secrets component to currently running gnome-keyring instance launched with PAM on login (this unlocks the keyring)
2024-08-03 06:35:58 +00:00
gnome-keyring-daemon --start --components=secrets &