Speedup startup routine

This commit is contained in:
Tobias Reisinger 2021-07-10 01:08:18 +02:00
parent d419ca351c
commit f40596434d
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 41 additions and 31 deletions

View file

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
until systemctl is-active --quiet --user pulseaudio.socket
do
sleep 0.5
done
systemctl --user stop pulseaudio.service systemctl --user stop pulseaudio.service
systemctl --user stop pulseaudio.socket systemctl --user stop pulseaudio.socket

View file

@ -13,6 +13,9 @@ then
gpg2 --card-status > /dev/null gpg2 --card-status > /dev/null
fi fi
network_wait_pid=1
audio_wait_pid=1
#_autostart_portalo() #_autostart_portalo()
#{ #{
# #xrandr --output DVI-D-0 --left-of HDMI-A-0 # #xrandr --output DVI-D-0 --left-of HDMI-A-0
@ -52,24 +55,7 @@ _autostart_workspace_messenger()
thunderbird & thunderbird &
} }
_autostart_webapps() _autostart_apps()
{
syncthing -no-browser &
/usr/lib/kdeconnectd &
#transmission-gtk --minimized &
qbittorrent &
}
_autostart_audioapps()
{
#steam-runtime -silent -tcp &
flatpak run com.valvesoftware.Steam -silent &
qutebrowser &
mopidy &
}
_autostart_defaults()
{ {
dunst & dunst &
ckb-next --background & ckb-next --background &
@ -84,32 +70,51 @@ _autostart_defaults()
feh --bg-fill $XDG_PICTURES_DIR/wallpaper/active_wallpaper feh --bg-fill $XDG_PICTURES_DIR/wallpaper/active_wallpaper
#actkbd --grab --config ~/.config/actkbd/actkbd.conf --device /dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd & #actkbd --grab --config ~/.config/actkbd/actkbd.conf --device /dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd &
wait $network_wait_pid
syncthing -no-browser &
/usr/lib/kdeconnectd &
#transmission-gtk --minimized &
qbittorrent &
wait $audio_wait_pid
#steam-runtime -silent -tcp &
flatpak run com.valvesoftware.Steam -silent &
qutebrowser &
mopidy &
} }
_autostart() _autostart()
{ {
_autostart_defaults &
### wait for internet ### wait for internet
wait_for_service "network-online.target" wait_for_service "network-online.target" &
_autostart_webapps & network_wait_pid=$!
### wait for audio ### wait for audio
wait_for_service "--user pulseaudio.socket" start_jack &
start_jack audio_wait_pid=$!
_autostart_audioapps & echo $audio_wait_pid
echo $network_wait_pid
_autostart_apps &
wait $network_wait_pid
wait $audio_wait_pid
_autostart_workspace_voip & _autostart_workspace_voip &
_autostart_workspace_messenger & _autostart_workspace_messenger &
} }
host_name=$(cat /proc/sys/kernel/hostname) #host_name=$(cat /proc/sys/kernel/hostname)
if [[ $host_name == "portalo" ]]; then #if [[ $host_name == "portalo" ]]; then
_autostart_portalo & # _autostart_portalo &
elif [[ $host_name == *"laptop"* ]]; then #elif [[ $host_name == *"laptop"* ]]; then
_autostart_laptop & # _autostart_laptop &
fi #fi
_autostart & _autostart &