/ startup.sh ➔ startup_auto.sh
and, now using startup.sh for manually executing programs
This commit is contained in:
@@ -1,133 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# : klevstul : start miscellanous application : 24.11.17
|
||||
# : klevstul : start miscellanous application : 25.12.28
|
||||
# -----
|
||||
|
||||
# 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}
|
||||
}
|
||||
notify-send "<< startup.sh >>"
|
||||
|
||||
ds-t470p-2() {
|
||||
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
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
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
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ds-tuxwarrior-2() {
|
||||
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"
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ds-tuxwarrior-3() {
|
||||
info="1 laptop + 2 monitors for tuxwarrior"
|
||||
echo "${info}"
|
||||
|
||||
# without scaling:
|
||||
# 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
|
||||
# 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
|
||||
|
||||
# with laptop display scaling of < 1 (reduce resolution):
|
||||
#xrandr --output DP-2 --scale 0.5
|
||||
# with benq display scaling of > 1 (increase resolution):
|
||||
#xrandr --output HDMI-0 --scale 1.5
|
||||
#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
|
||||
i3-msg "rename workspace 2 to 10"
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
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"
|
||||
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# do the choka choka
|
||||
|
||||
if [[ "${XWM}" == "hyprland" ]]; then
|
||||
|
||||
echo "<< hyprland >>"
|
||||
#hyprpaper &
|
||||
#waybar &
|
||||
#hypridle &
|
||||
#hyprdim --strength 0.1 --dialog-dim 0.1 --duration 500 --no-dim-when-only &
|
||||
|
||||
elif [[ "${XWM}" == "i3" ]]; then
|
||||
|
||||
echo "<< i3wm >>"
|
||||
|
||||
# display setup
|
||||
display_setup=$(getDisplaySetupFunction)
|
||||
|
||||
${display_setup}
|
||||
|
||||
# populate keyring, and sleep to make sure it takes effect before apps start
|
||||
lordOfTheRing.sh
|
||||
sleep 3.5
|
||||
|
||||
notify-send "<< i3wm >>"
|
||||
notify-send "[ display_setup = ${display_setup} ]"
|
||||
notify-send "[ HOSTNAME = ${HOSTNAME} ]"
|
||||
|
||||
# set up screen locking and monitor/display power management
|
||||
xset dpms 0 0 599 # screen off after X seconds
|
||||
xautolock -time 20 -locker i3lock_fk.sh # lock after X minutes
|
||||
|
||||
# sleep 5
|
||||
|
||||
|
||||
# start miscellanous programs
|
||||
#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 &
|
||||
|
||||
#/usr/bin/pcloud &
|
||||
|
||||
# i3-msg "exec --no-startup-id pcloud" &
|
||||
|
||||
#/usr/bin/pcloud
|
||||
#pcloud &
|
||||
|
||||
|
||||
#pcloud &
|
||||
|
||||
|
||||
#if [[ "${HOSTNAME}" == "tuxwarrior" ]] ; then
|
||||
# synology-drive &
|
||||
#fi
|
||||
megasync & # mega sync service
|
||||
nextcloud & # nextcloud file sync
|
||||
pcloud & # pcloud service
|
||||
|
||||
if [[ "${HOSTNAME}" == "tuxwarrior" ]] ; then
|
||||
synology-drive &
|
||||
fi
|
||||
|
||||
108
dots/bin/startup_auto.sh
Executable file
108
dots/bin/startup_auto.sh
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# : klevstul : start miscellanous application : 24.11.17
|
||||
# -----
|
||||
|
||||
# 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}
|
||||
}
|
||||
|
||||
ds-t470p-2() {
|
||||
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
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
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
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ds-tuxwarrior-2() {
|
||||
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"
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ds-tuxwarrior-3() {
|
||||
info="1 laptop + 2 monitors for tuxwarrior"
|
||||
echo "${info}"
|
||||
|
||||
# without scaling:
|
||||
# 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
|
||||
# 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
|
||||
|
||||
# with laptop display scaling of < 1 (reduce resolution):
|
||||
#xrandr --output DP-2 --scale 0.5
|
||||
# with benq display scaling of > 1 (increase resolution):
|
||||
#xrandr --output HDMI-0 --scale 1.5
|
||||
#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
|
||||
i3-msg "rename workspace 2 to 10"
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
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"
|
||||
|
||||
#nr > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# do the choka choka
|
||||
|
||||
if [[ "${XWM}" == "hyprland" ]]; then
|
||||
|
||||
echo "<< hyprland >>"
|
||||
#hyprpaper &
|
||||
#waybar &
|
||||
#hypridle &
|
||||
#hyprdim --strength 0.1 --dialog-dim 0.1 --duration 500 --no-dim-when-only &
|
||||
|
||||
elif [[ "${XWM}" == "i3" ]]; then
|
||||
|
||||
echo "<< i3wm >>"
|
||||
|
||||
# display setup
|
||||
display_setup=$(getDisplaySetupFunction)
|
||||
|
||||
${display_setup}
|
||||
|
||||
# populate keyring, and sleep to make sure it takes effect before apps start
|
||||
lordOfTheRing.sh
|
||||
sleep 3.5
|
||||
|
||||
notify-send "<< i3wm >>"
|
||||
notify-send "[ display_setup = ${display_setup} ]"
|
||||
notify-send "[ HOSTNAME = ${HOSTNAME} ]"
|
||||
|
||||
# set up screen locking and monitor/display power management
|
||||
xset dpms 0 0 599 # screen off after X seconds
|
||||
xautolock -time 20 -locker i3lock_fk.sh # lock after X minutes
|
||||
|
||||
notify-send "[ execute startup.sh to start programs ]"
|
||||
|
||||
fi
|
||||
@@ -401,7 +401,7 @@ for_window [class="SpeedCrunch"] floating enable border normal
|
||||
# ---
|
||||
exec_always --no-startup-id setxkbmap -model pc105 -layout us,no -option grp:caps_toggle,grp_led:scroll; # keyboard layout switch
|
||||
exec --no-startup-id pasystray
|
||||
exec --no-startup-id sleep 5; startup.sh
|
||||
exec --no-startup-id sleep 5; startup_auto.sh
|
||||
#exec --no-startup-id pcloud # unable to execute this from startup.sh, by some weird reason (it used to work)
|
||||
|
||||
# ---
|
||||
|
||||
Reference in New Issue
Block a user