usr

Modulate your userpace into POSIX-compliant shell scripts!
git clone git://clone.theohenson.com/usr.git
Log | Files | Refs | README

commit 5a3505eb4d7a3310a15c1b39becc83a6f4e9110b
parent 878418cd4024f8492be6155a358c971361b7234e
Author: Theo Henson <[email protected]>
Date:   Wed, 18 Aug 2021 11:11:20 -0400

Split rco module, create spotify module

Diffstat:
Mmodules/mod.list | 5++++-
Amodules/rco.mod.sh | 26++++++++++++++++++++++++++
Dmodules/rco_arch.mod.sh | 28----------------------------
Mmodules/theo_apt.mod.sh | 2+-
Mmodules/theo_dotfiles.mod.sh | 6+++---
Mmodules/theo_pacman.mod.sh | 2+-
Amodules/theo_spotify.mod.sh | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 93 insertions(+), 34 deletions(-)

diff --git a/modules/mod.list b/modules/mod.list @@ -1,7 +1,10 @@ -rco_arch +mint_y_dark +rco test +theo_apt theo_dirs theo_dotfiles theo_pacman theo_scripts +theo_spotify theo_suk diff --git a/modules/rco.mod.sh b/modules/rco.mod.sh @@ -0,0 +1,26 @@ +rco_add() { + printf "rco: cloning git repo\n" + mkdir -p "$HOME"/src/git + git clone https://github.com/tteeoo/rco "$HOME"/src/git/rco + printf "rco: compiling and installing software\n" + cargo install --path "$HOME"/src/git/rco +} + +rco_remove() { + printf "rco: uninstalling binary\n" + cargo uninstall --bin rco + printf "rco: removing repo\n" + rm -rf "$HOME"/src/git/rco +} + +rco_info() { + printf "Installs the program 'rco' (https://github.com/tteeoo/rco)" +} + +rco_dirs() { + printf "" +} + +rco_files() { + printf "" +} diff --git a/modules/rco_arch.mod.sh b/modules/rco_arch.mod.sh @@ -1,28 +0,0 @@ -rco_arch_add() { - printf "rco_arch: installing packages\n" - sudo pacman -S --needed --noconfirm --quiet rust git - printf "rco_arch: cloning git repo\n" - mkdir -p "$HOME"/src/git - git clone https://github.com/tteeoo/rco "$HOME"/src/git/rco - printf "rco_arch: compiling and installing software\n" - cargo install --path "$HOME"/src/git/rco -} - -rco_arch_remove() { - printf "rco_arch: uninstalling binary\n" - cargo uninstall --bin rco - printf "rco_arch: removing repo\n" - rm -rf "$HOME"/src/git/rco -} - -rco_arch_info() { - printf "Installs the program 'rco' (https://github.com/tteeoo/rco)" -} - -rco_arch_dirs() { - printf "" -} - -rco_arch_files() { - printf "" -} diff --git a/modules/theo_apt.mod.sh b/modules/theo_apt.mod.sh @@ -3,7 +3,7 @@ theo_pacman_add() { sudo pacman -S --needed --noconfirm --quiet libxinerama-dev libxft-dev libfontconfig-dev make gcc \ neovim vim curl wget git dunst npm sxiv lxpolkit fish xwallpaper picom sxhkd maim \ xinit fzf pcmanfm zathura tmux newsboat mpv pulseaudio pulsemixer gpgconf gpg-agent \ - alsa-utils papirus-icon-theme ipython3 firefox-esr fonts-firacode + alsa-utils papirus-icon-theme ipython3 firefox-esr fonts-firacode cargo } theo_pacman_remove() { diff --git a/modules/theo_dotfiles.mod.sh b/modules/theo_dotfiles.mod.sh @@ -36,7 +36,7 @@ theo_dotfiles_info() { theo_dotfiles_dirs() { printf "$DATA_DIR/wineprefixes $CONFIG_DIR/discocss $CONFIG_DIR/fish - $CONFIG_DIR/spotify-tui $CONFIG_DIR/newsboat $CONFIG_DIR/gtk-3.0 + $CONFIG_DIR/newsboat $CONFIG_DIR/gtk-3.0 $CONFIG_DIR/gtk-2.0 $CONFIG_DIR/python $CONFIG_DIR/picom $CONFIG_DIR/sxhkd $CONFIG_DIR/dunst $CONFIG_DIR/nvim $CONFIG_DIR/rco $CONFIG_DIR/git $CONFIG_DIR/mpv $CONFIG_DIR/npm $CONFIG_DIR/X11 $CONFIG_DIR/tmux .vim @@ -51,7 +51,7 @@ theo_dotfiles_files() { $CONFIG_DIR/newsboat/config $CONFIG_DIR/rco/config.csv $CONFIG_DIR/rco/objects.csv $CONFIG_DIR/picom/picom.conf $CONFIG_DIR/fish/config.fish $CONFIG_DIR/gtk-2.0/gtkrc-2.0 $CONFIG_DIR/fish/fish_variables $CONFIG_DIR/gtk-3.0/settings.ini - $CONFIG_DIR/spotify-tui/config.yml $CONFIG_DIR/nvim/coc-settings.json - $CONFIG_DIR/discocss/custom.css $CONFIG_DIR/user-dirs.dirs $CONFIG_DIR/tmux/tmux.conf + $CONFIG_DIR/nvim/coc-settings.json $CONFIG_DIR/discocss/custom.css + $CONFIG_DIR/user-dirs.dirs $CONFIG_DIR/tmux/tmux.conf $DATA_DIR/gnupg/sshcontrol $DATA_DIR/gnupg/gpg-agent.conf $CONFIG_DIR/newsboat/urls" } diff --git a/modules/theo_pacman.mod.sh b/modules/theo_pacman.mod.sh @@ -3,7 +3,7 @@ theo_pacman_add() { sudo pacman -S --needed --noconfirm --quiet libxinerama libxft libx11 freetype2 make gcc \ neovim vim curl wget git dunst npm sxiv lxpolkit xorg fish xwallpaper picom sxhkd \ xorg-xinit fzf pcmanfm zathura zathura-pdf-mupdf tmux newsboat mpv pulsemixer \ - alsa-utils papirus-icon-theme ipython3 maim firefox ttf-fira-code + alsa-utils papirus-icon-theme ipython3 maim firefox ttf-fira-code rust } theo_pacman_remove() { diff --git a/modules/theo_spotify.mod.sh b/modules/theo_spotify.mod.sh @@ -0,0 +1,58 @@ +: "${XDG_CONFIG_HOME:=$HOME/.config}" +CONFIG_DIR="${XDG_CONFIG_HOME#$HOME/}" + +spotifyd_ver="v0.3.2" +spotify_tui_ver="v0.24.0" + +theo_spotify_add() { + for DIR in $(theo_spotify_dirs) ; do + if ! [ -d "$HOME/$DIR" ] ; then + mkdir -p "$HOME/$DIR" + printf "theo_spotify: making directory %s/%s\n" "$HOME" "$DIR" + fi + done + + for FILE in $(theo_spotify_files) ; do + [ -f "$HOME/$FILE" ] && mv "$HOME/$FILE" "$HOME/$FILE".orig && \ + printf "theo_spotify: moving %s/%s to %s/%s.orig\n" "$HOME" "$FILE" "$HOME" "$FILE" + ln -sf "$USR_DIR/home/$FILE" "$HOME/$FILE" && \ + printf "theo_spotify: linking %s/home/%s to %s/%s\n" "$USR_DIR" "$FILE" "$HOME" "$FILE" + done + + printf "theo_spotify: downloading tarballs\n" + wget "https://github.com/Spotifyd/spotifyd/releases/download/$spotifyd_ver/spotifyd-linux-default.tar.gz" \ + "https://github.com/Rigellute/spotify-tui/releases/download/$spotify_tui_ver/spotify-tui-linux.tar.gz" + printf "theo_spotify: extracting tarballs\n" + tar xf spotifyd-linux-default.tar.gz + tar xf spotify-tui-linux.tar.gz + printf "theo_spotify: installing binaries\n" + mkdir -p "$HOME/.local/bin" + mv spotifyd "$HOME/.local/bin/" + mv spt "$HOME/.local/bin/" + rm spotifyd-linux-default.tar.gz + rm spotify-tui-linux.tar.gz +} + +theo_spotify_remove() { + for FILE in $(theo_spotify_files) ; do + rm "$HOME/$FILE" && \ + printf "theo_spotify: removing %s/%s\n" "$HOME" "$FILE" + [ -f "$HOME/$FILE".orig ] && mv "$HOME/$FILE".orig "$HOME/$FILE" && \ + printf "theo_spotify: moving %s/%s.orig to %s/%s\n" "$HOME" "$FILE" "$HOME" "$FILE" + done + rm "$HOME/.local/bin/spotifyd" + rm "$HOME/.local/bin/spt" +} + +theo_spotify_info() { + printf "This module contains my (theo's) spotifyd and spotify-tui configs and installs the programs.\n" +} + +theo_spotify_dirs() { + printf "$CONFIG_DIR/spotifyd $CONFIG_DIR/spotify-tui" +} + +theo_spotify_files() { + printf "$CONFIG_DIR/spotifyd/spotifyd.conf + $CONFIG_DIR/spotify-tui/config.yml" +}