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
until systemctl is-active --quiet --user pulseaudio.socket
do
sleep 0.5
done
systemctl --user stop pulseaudio.service
systemctl --user stop pulseaudio.socket

View file

@ -13,6 +13,9 @@ then
gpg2 --card-status > /dev/null
fi
network_wait_pid=1
audio_wait_pid=1
#_autostart_portalo()
#{
# #xrandr --output DVI-D-0 --left-of HDMI-A-0
@ -52,24 +55,7 @@ _autostart_workspace_messenger()
thunderbird &
}
_autostart_webapps()
{
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()
_autostart_apps()
{
dunst &
ckb-next --background &
@ -84,32 +70,51 @@ _autostart_defaults()
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 &
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_defaults &
### wait for internet
wait_for_service "network-online.target"
_autostart_webapps &
wait_for_service "network-online.target" &
network_wait_pid=$!
### 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_messenger &
}
host_name=$(cat /proc/sys/kernel/hostname)
if [[ $host_name == "portalo" ]]; then
_autostart_portalo &
elif [[ $host_name == *"laptop"* ]]; then
_autostart_laptop &
fi
#host_name=$(cat /proc/sys/kernel/hostname)
#if [[ $host_name == "portalo" ]]; then
# _autostart_portalo &
#elif [[ $host_name == *"laptop"* ]]; then
# _autostart_laptop &
#fi
_autostart &