From cf6ef78b67f66c2969b883f1f9649986d48c6d34 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Fri, 16 Dec 2022 21:46:19 +0100 Subject: [PATCH] Improve autostart-manage script --- .bin/autostart-manage | 12 ++++++++---- .bin/menu-shutdown | 2 +- .config/spotifyd/spotifyd.conf | 14 ++++++++++++++ .xprofile | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 .config/spotifyd/spotifyd.conf diff --git a/.bin/autostart-manage b/.bin/autostart-manage index a571007..c4cf1ff 100755 --- a/.bin/autostart-manage +++ b/.bin/autostart-manage @@ -18,13 +18,14 @@ _list () { } _echo_table () { - printf "Unit\tFilename\tStatus\n" + printf "Unit\tFilename\tEnabled\tActive\n" for unit in "$@" do - printf "%s\t%s\t%s\n" \ + printf "%s\t%s\t%s\t%s\n" \ "$unit" \ "$(_filename "$unit")" \ - "$(_systemctl "$unit" is-enabled)" + "$(_systemctl "$unit" is-enabled)" \ + "$(_systemctl "$unit" is-active)" done } @@ -79,7 +80,10 @@ case $1 in edit) _systemctl "$2" edit --full ;; enable) _systemctl "$2" add-wants autostart.target ;; disable) _systemctl "$2" disable ;; + restart) _systemctl "${2:-*}" restart;; + start) _systemctl "${2:-*}" start;; status) _systemctl "${2:-*}" status ;; - start) systemctl --user start autostart.target ;; + stop) _systemctl "${2:-*}" stop ;; + run) systemctl --user start autostart.target ;; *) echo "'$1' is not valid" ;; esac diff --git a/.bin/menu-shutdown b/.bin/menu-shutdown index 19f6ba5..713e091 100755 --- a/.bin/menu-shutdown +++ b/.bin/menu-shutdown @@ -6,5 +6,5 @@ case "$action" in shutdown) systemctl poweroff -i ;; reboot) systemctl reboot ;; logout) systemctl --user exit ;; - autostart) autostart-manage start ;; + autostart) autostart-manage run ;; *) ;; esac diff --git a/.config/spotifyd/spotifyd.conf b/.config/spotifyd/spotifyd.conf new file mode 100644 index 0000000..888443a --- /dev/null +++ b/.config/spotifyd/spotifyd.conf @@ -0,0 +1,14 @@ +[global] +# Your Spotify account name. +username = "serguzim" +password_cmd = "pass spotifyd" + +use_mpris = true + +backend = "pulseaudio" + +volume_controller = "softvol" + +device_name = "portalo" +#device_type = "computer" # correct but no shared sessions +device_type = "speaker" # allows shared sessions diff --git a/.xprofile b/.xprofile index 7f7585e..e67d69e 100644 --- a/.xprofile +++ b/.xprofile @@ -21,7 +21,7 @@ _autostart() pass x && sleep 5 autoinstall graphical - autostart-manage start + autostart-manage run } _autostart &