diff --git a/.local/bin/start_jack b/.local/bin/start_jack index e4c2957..1f1db1d 100755 --- a/.local/bin/start_jack +++ b/.local/bin/start_jack @@ -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 diff --git a/.xprofile b/.xprofile index 4f8453b..2e1d21d 100644 --- a/.xprofile +++ b/.xprofile @@ -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 &