From 4222ec125caf3f54f20cf63085fca9ab42a4f4a8 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 2 Sep 2020 15:58:19 -0400 Subject: [PATCH] update scripts --- .../user/default.target.wants/spotifyd.service | 1 + files/.config/systemd/user/spotifyd.service | 15 +++++++++++++++ files/.config/zsh/custom/100-alias.zsh | 1 + files/.config/zsh/custom/101-function.zsh | 11 ++++++----- files/.config/zsh/custom/300-tmux.zsh | 1 - files/.tmux/plugins/tpm | 2 +- files/bin/__on-gamemode | 2 +- files/bin/auto-restart | 16 ++++++++++++++++ 8 files changed, 41 insertions(+), 8 deletions(-) create mode 120000 files/.config/systemd/user/default.target.wants/spotifyd.service create mode 100644 files/.config/systemd/user/spotifyd.service create mode 100755 files/bin/auto-restart diff --git a/files/.config/systemd/user/default.target.wants/spotifyd.service b/files/.config/systemd/user/default.target.wants/spotifyd.service new file mode 120000 index 0000000..324b522 --- /dev/null +++ b/files/.config/systemd/user/default.target.wants/spotifyd.service @@ -0,0 +1 @@ +/home/marchambault/.config/systemd/user/spotifyd.service \ No newline at end of file diff --git a/files/.config/systemd/user/spotifyd.service b/files/.config/systemd/user/spotifyd.service new file mode 100644 index 0000000..5857b89 --- /dev/null +++ b/files/.config/systemd/user/spotifyd.service @@ -0,0 +1,15 @@ +[Unit] +Description=A spotify playing daemon +Documentation=https://github.com/Spotifyd/spotifyd +Wants=sound.target +After=sound.target +Wants=network-online.target +After=network-online.target + +[Service] +ExecStart=/usr/bin/spotifyd --no-daemon +Restart=always +RestartSec=12 + +[Install] +WantedBy=default.target diff --git a/files/.config/zsh/custom/100-alias.zsh b/files/.config/zsh/custom/100-alias.zsh index d68c67a..296733f 100644 --- a/files/.config/zsh/custom/100-alias.zsh +++ b/files/.config/zsh/custom/100-alias.zsh @@ -7,6 +7,7 @@ alias top="htop" alias http-server="python -m http.server" alias rename="perl-rename" alias userctl="systemctl --user" +alias lock="swaylock" # ls alias ls='lsd --group-dirs=first' diff --git a/files/.config/zsh/custom/101-function.zsh b/files/.config/zsh/custom/101-function.zsh index 204297c..66fa345 100644 --- a/files/.config/zsh/custom/101-function.zsh +++ b/files/.config/zsh/custom/101-function.zsh @@ -45,9 +45,9 @@ __nmap_iface() { # start game mode gamemode() { - if ! [ -S /tmp/win10.sock ]; then - echo "Cannot find spice socket! Is the vm started?" - else + #if ! [ -S /tmp/win10.sock ]; then + #echo "Cannot find spice socket! Is the vm started?" + #else echo "Setup cpuset cgroup for host" sudo cset set -c 0,4 -s system sudo cset proc -m -f root -t system @@ -63,7 +63,8 @@ gamemode() { sudo sh -c "echo 0,4 > /proc/irq/$i/smp_affinity_list" done - LD_PRELOAD="/usr/\$LIB/libgamemodeauto.so" looking-glass-wrapper + #LD_PRELOAD="/usr/\$LIB/libgamemodeauto.so" auto-restart looking-glass-client -p 0 -c /tmp/win10.sock app:renderer=opengl egl:vsync=yes win:fullScreen=yes -k $@ + gamemoderun auto-restart looking-glass-client echo "Restore system" # irq @@ -76,6 +77,6 @@ gamemode() { done; # cpuset sudo cset set -d system &>/dev/null - fi + #fi } diff --git a/files/.config/zsh/custom/300-tmux.zsh b/files/.config/zsh/custom/300-tmux.zsh index 846dc86..f4a994d 100644 --- a/files/.config/zsh/custom/300-tmux.zsh +++ b/files/.config/zsh/custom/300-tmux.zsh @@ -1,2 +1 @@ -export ZSH_TMUX_AUTOSTART=true export ZSH_TMUX_FIXTERM_WITH_256COLOR=true diff --git a/files/.tmux/plugins/tpm b/files/.tmux/plugins/tpm index 476f6ca..42bb2bf 160000 --- a/files/.tmux/plugins/tpm +++ b/files/.tmux/plugins/tpm @@ -1 +1 @@ -Subproject commit 476f6ca69922c9e67c408ae92dff0eb0ccb8ee51 +Subproject commit 42bb2bf48bef881be504278cf5156371b542cf81 diff --git a/files/bin/__on-gamemode b/files/bin/__on-gamemode index cfb0f87..9b38a0a 100755 --- a/files/bin/__on-gamemode +++ b/files/bin/__on-gamemode @@ -2,7 +2,7 @@ exec 1<&- system_services="cronie" -user_services="compton redshift mpv" +user_services="redshift swayidle" if [[ "$1" == "start" ]]; then for service in $system_services; do diff --git a/files/bin/auto-restart b/files/bin/auto-restart new file mode 100755 index 0000000..db09a68 --- /dev/null +++ b/files/bin/auto-restart @@ -0,0 +1,16 @@ +#!/bin/bash + +function stop() { + echo "Stopping" + exit 0 +} + +while true; do + echo "Starting $1" + trap - SIGINT + $@ + trap stop SIGINT + echo -e "\nPress enter to restart $1..." + read +done +