Files
lnx-arch/dots/bin/startup.sh

117 lines
4.6 KiB
Bash
Raw Normal View History

2024-04-30 21:26:27 -05:00
#!/usr/bin/env bash
2024-11-17 08:31:43 -05:00
# : klevstul : start miscellanous application : 24.11.17
# -----
2024-11-17 06:49:42 -05:00
# finds the correct display setup function to use
getDisplaySetupFunction() {
numberOfDisplays=$(xrandr --query | grep -o " connected " | wc -l)
display_function=ds-${HOSTNAME}-${numberOfDisplays}
echo ${display_function}
}
2024-11-17 06:49:42 -05:00
ds-t470p-2() {
2024-11-17 06:49:42 -05:00
info="1 laptop + 1 monitor for t470p"
echo "${info}"
xrandr --output eDP-1 --mode 1920x1080 --pos 0x1080 --rotate normal --output DP-1 --off --output HDMI-1 --primary --mode 3840x2160 --pos 1920x0 --rotate normal --output DP-2 --off --output HDMI-2 --off --output DP-3 --off --output HDMI-3 --off > /dev/null 2>&1
xrdb ~/.Xresources
2025-12-28 12:46:30 -05:00
#nr > /dev/null 2>&1
2024-11-17 06:49:42 -05:00
}
2025-04-12 09:21:26 -05:00
ds-tuxwarrior-1() {
info="1 laptop monitor for tuxwarrior"
echo "${info}"
xrandr --output DP-0 --off --output DP-1 --off --output HDMI-0 --off --output DP-2 --primary --mode 3840x2160 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off --output DP-6 --off
xrdb ~/.Xresources
2025-12-28 12:46:30 -05:00
#nr > /dev/null 2>&1
2025-04-12 09:21:26 -05:00
}
ds-tuxwarrior-2() {
2024-11-17 06:49:42 -05:00
info="1 laptop + 1 monitor for tuxwarrior"
echo "${info}"
xrandr --output DP-0 --off --output DP-1 --off --output HDMI-0 --primary --mode 3840x2160 --pos 3840x0 --rotate normal --output DP-2 --mode 3840x2160 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off --output DP-6 --off > /dev/null 2>&1
xrdb ~/.Xresources
i3-msg "rename workspace 1 to 10"
i3-msg "rename workspace 2 to 1"
2025-12-28 12:46:30 -05:00
#nr > /dev/null 2>&1
2024-11-17 06:49:42 -05:00
}
2024-04-30 21:26:27 -05:00
ds-tuxwarrior-3() {
info="1 laptop + 2 monitors for tuxwarrior"
echo "${info}"
# without scaling:
2025-05-29 12:11:30 -05:00
# w/ benq vertical
# xrandr --output DP-0 --primary --mode 3840x2160 --pos 3840x0 --rotate normal --output DP-1 --off --output HDMI-0 --mode 1920x1080 --pos 7680x240 --rotate left --output DP-2 --mode 3840x2160 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off --output DP-6 --off
2025-05-29 12:11:30 -05:00
# w/ 4k horizontal
xrandr --output DP-0 --primary --mode 3840x2160 --pos 3840x0 --rotate normal --output DP-1 --off --output HDMI-0 --mode 3840x2160 --pos 7680x0 --rotate normal --output DP-2 --mode 3840x2160 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off --output DP-6 --off
2025-04-15 08:25:36 -05:00
# with laptop display scaling of < 1 (reduce resolution):
#xrandr --output DP-2 --scale 0.5
2025-04-15 08:25:36 -05:00
# with benq display scaling of > 1 (increase resolution):
#xrandr --output HDMI-0 --scale 1.5
2025-05-29 12:11:30 -05:00
#xrandr --output DP-0 --primary --mode 3840x2160 --pos 1920x0 --rotate normal --output DP-1 --off --output HDMI-0 --scale 1.5 --mode 1920x1080 --pos 5760x0 --rotate left --output DP-2 --scale 0.5 --mode 3840x2160 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off --output DP-6 --off
xrdb ~/.Xresources
2025-04-14 07:41:39 -05:00
i3-msg "rename workspace 2 to 10"
2025-12-28 12:46:30 -05:00
#nr > /dev/null 2>&1
}
2025-11-20 14:04:31 -05:00
ds-tuxwarrior-4() {
info="1 laptop + 3 monitors for tuxwarrior"
echo "${info}"
xrandr --output DP-0 --off --output DP-1 --primary --mode 3840x2160 --pos 6000x1680 --rotate normal --output HDMI-0 --mode 2560x1600 --pos 9840x1280 --rotate left --output DP-2 --mode 3840x2160 --pos 0x1680 --rotate normal --output DP-3 --mode 3840x2160 --pos 3840x0 --rotate right --output DP-4 --off --output DP-5 --off --output DP-6 --off
xrdb ~/.Xresources
i3-msg "rename workspace 1 to 10"
i3-msg "rename workspace 2 to 1"
i3-msg "rename workspace 4 to 2"
2025-12-28 12:46:30 -05:00
#nr > /dev/null 2>&1
2025-11-20 14:04:31 -05:00
}
2024-11-17 08:31:43 -05:00
# do the choka choka
2024-11-16 22:46:58 -05:00
if [[ "${XWM}" == "hyprland" ]]; then
2024-05-11 20:47:15 -05:00
2024-11-16 22:49:00 -05:00
echo "<< hyprland >>"
2024-11-16 22:46:58 -05:00
#hyprpaper &
#waybar &
#hypridle &
#hyprdim --strength 0.1 --dialog-dim 0.1 --duration 500 --no-dim-when-only &
2024-05-01 11:15:00 -05:00
2024-11-16 22:46:58 -05:00
elif [[ "${XWM}" == "i3" ]]; then
2024-11-16 22:49:00 -05:00
echo "<< i3wm >>"
2024-11-17 06:49:42 -05:00
# display setup
display_setup=$(getDisplaySetupFunction)
2024-11-17 06:49:42 -05:00
${display_setup}
# populate keyring, and sleep to make sure it takes effect before apps start
lordOfTheRing.sh
sleep 3.5
2024-11-17 06:49:42 -05:00
# set up screen locking and monitor/display power management
xset dpms 0 0 599 # screen off after X seconds
2025-10-20 05:57:11 -05:00
xautolock -time 20 -locker i3lock_fk.sh # lock after X minutes
# start miscellanous programs
2025-12-28 12:46:30 -05:00
#megasync & # mega sync service
#nextcloud & # nextcloud file sync
#pcloud & # pcloud service | unable to start pcloud from startup.sh, so moved exec to i3wm cfg instead (strange, as it used to work starting it here)
#protonvpn-app & # vpn
#/usr/bin/pcloud &
#/usr/bin/nextcloud &
#/usr/bin/megasync &
i3-msg "exec --no-startup-id pcloud"
2024-11-16 22:46:58 -05:00
#if [[ "${HOSTNAME}" == "tuxwarrior" ]] ; then
# synology-drive &
#fi
2025-04-20 20:26:07 -05:00
2024-11-16 22:49:35 -05:00
fi