From 097cbd1c6da73c06bc9bd4cc3178026b9e890bde Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Fri, 25 Feb 2022 16:22:57 +0100 Subject: [PATCH] Stow restructuring --- .gitignore | 6 +- LICENSE | 2 +- .../{ => .config/alacritty}/alacritty.yml | 0 shells/bashrc => bash/.bashrc | 0 bspwm/{ => .config/bspwm}/bspwmrc | 0 bspwm/{ => .config/sxhkd}/sxhkdrc | 0 debian/{dquilt => .dquiltrc-dpkg} | 0 debian/{git-buildpackage.conf => .gbp.conf} | 0 debian/{pbuilder => .pbuilderrc} | 0 debian/{sbuild => .sbuildrc} | 0 dirs.list | 13 ---- dunst/{ => .config/dunst}/dunstrc | 0 .../.config}/fish/conf.d/00-emacs.fish | 0 .../.config}/fish/conf.d/00-env.fish | 0 .../.config}/fish/conf.d/10-abbr.fish | 0 .../.config}/fish/conf.d/10-alias.fish | 0 .../.config}/fish/conf.d/40-nix.fish | 0 .../.config}/fish/conf.d/60-debian.fish | 0 .../.config}/fish/conf.d/90-emacs-vterm.fish | 0 .../.config}/fish/conf.d/99-x.fish | 0 .../.config}/fish/conf.d/nix-env.fish | 0 .../.config}/fish/functions/add_to_path.fish | 0 .../.config}/fish/functions/cdl.fish | 0 .../.config}/fish/functions/diff.fish | 0 .../.config}/fish/functions/sbcl.fish | 0 .../{ => .config/herbstluftwm}/autostart | 0 .../{ => .config/herbstluftwm}/panel.sh | 0 install.fish | 19 ------ links.list | 31 ---------- neovim/{ => .config/nvim}/init.vim | 0 picom/{ => .config}/picom.conf | 0 polybar/{ => .config/polybar}/config | 0 qtile/{ => .config/qtile}/config.py | 0 qtile/{ => .config/qtile}/startup.sh | 0 .../{ => .config/qutebrowser}/config.py | 0 redshift/{redshift => .config/redshift.conf} | 0 rofi/{ => .config/rofi}/config.rasi | 0 screen/{screenrc => .screenrc} | 0 shells/fish/conf.d/.gitignore | 3 - shells/fish/functions/.gitignore | 36 ----------- .../functions/gitignore_fisher_functions.fish | 11 ---- shells/zprofile | 10 ---- stow.sh | 60 +++++++++++++++++++ stumpwm/{stumpwmrc => .stumpwmrc} | 0 .../{ => .config/systemd/user}/mbsync.service | 0 .../{ => .config/systemd/user}/mbsync.timer | 0 x/{Xmodmap => .Xmodmap} | 0 x/{Xresources => .Xresources} | 0 x/{xinitrc => .xinitrc} | 0 x/Xresources-UHD | 57 ------------------ x/Xresources-hidpi | 1 - x/xprofile | 18 ------ shells/zshrc => zsh/.zshrc | 0 53 files changed, 62 insertions(+), 205 deletions(-) rename alacritty/{ => .config/alacritty}/alacritty.yml (100%) rename shells/bashrc => bash/.bashrc (100%) rename bspwm/{ => .config/bspwm}/bspwmrc (100%) rename bspwm/{ => .config/sxhkd}/sxhkdrc (100%) rename debian/{dquilt => .dquiltrc-dpkg} (100%) rename debian/{git-buildpackage.conf => .gbp.conf} (100%) rename debian/{pbuilder => .pbuilderrc} (100%) rename debian/{sbuild => .sbuildrc} (100%) delete mode 100644 dirs.list rename dunst/{ => .config/dunst}/dunstrc (100%) rename {shells => fish/.config}/fish/conf.d/00-emacs.fish (100%) rename {shells => fish/.config}/fish/conf.d/00-env.fish (100%) rename {shells => fish/.config}/fish/conf.d/10-abbr.fish (100%) rename {shells => fish/.config}/fish/conf.d/10-alias.fish (100%) rename {shells => fish/.config}/fish/conf.d/40-nix.fish (100%) rename {shells => fish/.config}/fish/conf.d/60-debian.fish (100%) rename {shells => fish/.config}/fish/conf.d/90-emacs-vterm.fish (100%) rename {shells => fish/.config}/fish/conf.d/99-x.fish (100%) rename {shells => fish/.config}/fish/conf.d/nix-env.fish (100%) rename {shells => fish/.config}/fish/functions/add_to_path.fish (100%) rename {shells => fish/.config}/fish/functions/cdl.fish (100%) rename {shells => fish/.config}/fish/functions/diff.fish (100%) rename {shells => fish/.config}/fish/functions/sbcl.fish (100%) rename herbstluftwm/{ => .config/herbstluftwm}/autostart (100%) rename herbstluftwm/{ => .config/herbstluftwm}/panel.sh (100%) delete mode 100755 install.fish delete mode 100644 links.list rename neovim/{ => .config/nvim}/init.vim (100%) rename picom/{ => .config}/picom.conf (100%) rename polybar/{ => .config/polybar}/config (100%) rename qtile/{ => .config/qtile}/config.py (100%) rename qtile/{ => .config/qtile}/startup.sh (100%) rename qutebrowser/{ => .config/qutebrowser}/config.py (100%) rename redshift/{redshift => .config/redshift.conf} (100%) rename rofi/{ => .config/rofi}/config.rasi (100%) rename screen/{screenrc => .screenrc} (100%) delete mode 100644 shells/fish/conf.d/.gitignore delete mode 100644 shells/fish/functions/.gitignore delete mode 100644 shells/fish/functions/gitignore_fisher_functions.fish delete mode 100644 shells/zprofile create mode 100755 stow.sh rename stumpwm/{stumpwmrc => .stumpwmrc} (100%) rename systemd/{ => .config/systemd/user}/mbsync.service (100%) rename systemd/{ => .config/systemd/user}/mbsync.timer (100%) rename x/{Xmodmap => .Xmodmap} (100%) rename x/{Xresources => .Xresources} (100%) rename x/{xinitrc => .xinitrc} (100%) delete mode 100644 x/Xresources-UHD delete mode 100644 x/Xresources-hidpi delete mode 100755 x/xprofile rename shells/zshrc => zsh/.zshrc (100%) diff --git a/.gitignore b/.gitignore index 7ccc6ac..0ba2fe9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ -/fish/fishd.* *~ -dotdotfiles/ +dot-private/ dot-work/ -/shells/fish/functions/tide/ -/shells/fish/functions/tide.fish -/shells/fish/conf.d/_tide_init.fish diff --git a/LICENSE b/LICENSE index ddd66df..8f23bb3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Marcel Kapfer +Copyright (c) 2015-2022 Marcel Kapfer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml similarity index 100% rename from alacritty/alacritty.yml rename to alacritty/.config/alacritty/alacritty.yml diff --git a/shells/bashrc b/bash/.bashrc similarity index 100% rename from shells/bashrc rename to bash/.bashrc diff --git a/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc similarity index 100% rename from bspwm/bspwmrc rename to bspwm/.config/bspwm/bspwmrc diff --git a/bspwm/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc similarity index 100% rename from bspwm/sxhkdrc rename to bspwm/.config/sxhkd/sxhkdrc diff --git a/debian/dquilt b/debian/.dquiltrc-dpkg similarity index 100% rename from debian/dquilt rename to debian/.dquiltrc-dpkg diff --git a/debian/git-buildpackage.conf b/debian/.gbp.conf similarity index 100% rename from debian/git-buildpackage.conf rename to debian/.gbp.conf diff --git a/debian/pbuilder b/debian/.pbuilderrc similarity index 100% rename from debian/pbuilder rename to debian/.pbuilderrc diff --git a/debian/sbuild b/debian/.sbuildrc similarity index 100% rename from debian/sbuild rename to debian/.sbuildrc diff --git a/dirs.list b/dirs.list deleted file mode 100644 index 5a99606..0000000 --- a/dirs.list +++ /dev/null @@ -1,13 +0,0 @@ -.config/alacritty -.config/bspwm -.config/dunst -.config/fish -.config/kitty -.config/nvim -.config/polybar -.config/qtile -.config/qutebrowser -.config/redshift -.config/rofi -.config/sxhkd -.config/systemd/user diff --git a/dunst/dunstrc b/dunst/.config/dunst/dunstrc similarity index 100% rename from dunst/dunstrc rename to dunst/.config/dunst/dunstrc diff --git a/shells/fish/conf.d/00-emacs.fish b/fish/.config/fish/conf.d/00-emacs.fish similarity index 100% rename from shells/fish/conf.d/00-emacs.fish rename to fish/.config/fish/conf.d/00-emacs.fish diff --git a/shells/fish/conf.d/00-env.fish b/fish/.config/fish/conf.d/00-env.fish similarity index 100% rename from shells/fish/conf.d/00-env.fish rename to fish/.config/fish/conf.d/00-env.fish diff --git a/shells/fish/conf.d/10-abbr.fish b/fish/.config/fish/conf.d/10-abbr.fish similarity index 100% rename from shells/fish/conf.d/10-abbr.fish rename to fish/.config/fish/conf.d/10-abbr.fish diff --git a/shells/fish/conf.d/10-alias.fish b/fish/.config/fish/conf.d/10-alias.fish similarity index 100% rename from shells/fish/conf.d/10-alias.fish rename to fish/.config/fish/conf.d/10-alias.fish diff --git a/shells/fish/conf.d/40-nix.fish b/fish/.config/fish/conf.d/40-nix.fish similarity index 100% rename from shells/fish/conf.d/40-nix.fish rename to fish/.config/fish/conf.d/40-nix.fish diff --git a/shells/fish/conf.d/60-debian.fish b/fish/.config/fish/conf.d/60-debian.fish similarity index 100% rename from shells/fish/conf.d/60-debian.fish rename to fish/.config/fish/conf.d/60-debian.fish diff --git a/shells/fish/conf.d/90-emacs-vterm.fish b/fish/.config/fish/conf.d/90-emacs-vterm.fish similarity index 100% rename from shells/fish/conf.d/90-emacs-vterm.fish rename to fish/.config/fish/conf.d/90-emacs-vterm.fish diff --git a/shells/fish/conf.d/99-x.fish b/fish/.config/fish/conf.d/99-x.fish similarity index 100% rename from shells/fish/conf.d/99-x.fish rename to fish/.config/fish/conf.d/99-x.fish diff --git a/shells/fish/conf.d/nix-env.fish b/fish/.config/fish/conf.d/nix-env.fish similarity index 100% rename from shells/fish/conf.d/nix-env.fish rename to fish/.config/fish/conf.d/nix-env.fish diff --git a/shells/fish/functions/add_to_path.fish b/fish/.config/fish/functions/add_to_path.fish similarity index 100% rename from shells/fish/functions/add_to_path.fish rename to fish/.config/fish/functions/add_to_path.fish diff --git a/shells/fish/functions/cdl.fish b/fish/.config/fish/functions/cdl.fish similarity index 100% rename from shells/fish/functions/cdl.fish rename to fish/.config/fish/functions/cdl.fish diff --git a/shells/fish/functions/diff.fish b/fish/.config/fish/functions/diff.fish similarity index 100% rename from shells/fish/functions/diff.fish rename to fish/.config/fish/functions/diff.fish diff --git a/shells/fish/functions/sbcl.fish b/fish/.config/fish/functions/sbcl.fish similarity index 100% rename from shells/fish/functions/sbcl.fish rename to fish/.config/fish/functions/sbcl.fish diff --git a/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart similarity index 100% rename from herbstluftwm/autostart rename to herbstluftwm/.config/herbstluftwm/autostart diff --git a/herbstluftwm/panel.sh b/herbstluftwm/.config/herbstluftwm/panel.sh similarity index 100% rename from herbstluftwm/panel.sh rename to herbstluftwm/.config/herbstluftwm/panel.sh diff --git a/install.fish b/install.fish deleted file mode 100755 index d847919..0000000 --- a/install.fish +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/fish -# Script for linking the dotfiles - -echo "Creating necessary directories" - -for dir in (cat dirs.list) - echo "Creating directory:" ~/$dir - mkdir -p ~/$dir -end - -echo "Linking the dotfiles" - -for link in (cat links.list) - set link (string split " " $link) - echo "creating symlink from" ~/dotfiles/$link[1] "to" ~/$link[2] - ln -s ~/dotfiles/$link[1] ~/$link[2] -end - -echo "done" diff --git a/links.list b/links.list deleted file mode 100644 index 1daa52d..0000000 --- a/links.list +++ /dev/null @@ -1,31 +0,0 @@ -alacritty/alacritty.yml .config/alacritty/alacritty.yml -bspwm/bspwmrc .config/bspwm/bspwmrc -bspwm/sxhkdrc .config/sxhkd/sxhkdrc -debian/dquilt .quiltrc-dpkg -debian/git-buildpackage.conf .gbp.conf -debian/pbuilder .pbuilderrc -debian/sbuild .sbuildrc -dotdotfiles/git/gitconfig .gitconfig -dotdotfiles/mbsync/mbsyncrc .mbsyncrc -dotdotfiles/msmtp/msmtprc .msmtprc -dunst/dunstrc .config/dunst/dunstrc -herbstluftwm .config/herbstluftwm -kitty/kitty.conf .config/kitty/kitty.conf -neovim/init.vim .config/nvim/init.vim -picom/picom.conf .config/picom.conf -polybar/config .config/polybar/config -qtile/config.py .config/qtile/config.py -qtile/startup.sh .config/qtile/startup.sh -qutebrowser/config.py .config/qutebrowser/config.py -redshift/redshift .config/redshift.conf -rofi/config.rasi .config/rofi/config.rasi -screen/screenrc .screenrc -shells/bashrc .bashrc -shells/fish/conf.d .config/fish/ -shells/fish/functions .config/fish/ -shells/zshrc .zshrc -stumpwm/stumpwmrc .stumpwmrc -systemd/* .config/systemd/user/ -x/Xmodmap .Xmodmap -x/Xresources .Xresources -x/xinitrc .xinitrc diff --git a/neovim/init.vim b/neovim/.config/nvim/init.vim similarity index 100% rename from neovim/init.vim rename to neovim/.config/nvim/init.vim diff --git a/picom/picom.conf b/picom/.config/picom.conf similarity index 100% rename from picom/picom.conf rename to picom/.config/picom.conf diff --git a/polybar/config b/polybar/.config/polybar/config similarity index 100% rename from polybar/config rename to polybar/.config/polybar/config diff --git a/qtile/config.py b/qtile/.config/qtile/config.py similarity index 100% rename from qtile/config.py rename to qtile/.config/qtile/config.py diff --git a/qtile/startup.sh b/qtile/.config/qtile/startup.sh similarity index 100% rename from qtile/startup.sh rename to qtile/.config/qtile/startup.sh diff --git a/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py similarity index 100% rename from qutebrowser/config.py rename to qutebrowser/.config/qutebrowser/config.py diff --git a/redshift/redshift b/redshift/.config/redshift.conf similarity index 100% rename from redshift/redshift rename to redshift/.config/redshift.conf diff --git a/rofi/config.rasi b/rofi/.config/rofi/config.rasi similarity index 100% rename from rofi/config.rasi rename to rofi/.config/rofi/config.rasi diff --git a/screen/screenrc b/screen/.screenrc similarity index 100% rename from screen/screenrc rename to screen/.screenrc diff --git a/shells/fish/conf.d/.gitignore b/shells/fish/conf.d/.gitignore deleted file mode 100644 index 599148c..0000000 --- a/shells/fish/conf.d/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -90-pure.fish -_pure_init.fish -pure.fish diff --git a/shells/fish/functions/.gitignore b/shells/fish/functions/.gitignore deleted file mode 100644 index 745f7a3..0000000 --- a/shells/fish/functions/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -__bass.py -bass.fish -fish_prompt.fish -fish_right_prompt.fish -git_ahead.fish -git_branch_name.fish -git_is_detached_head.fish -git_is_dirty.fish -git_is_empty.fish -git_is_repo.fish -git_is_staged.fish -git_is_stashed.fish -git_is_tag.fish -git_is_touched.fish -git_repository_root.fish -git_untracked_files.fish -humanize_duration.fish -segment.fish -segment_close.fish -segment_right.fish -set_color_custom.fish -vcs.name.fish -vcs.present.fish -fisher.fish -fin.fish -fish_greeting.fish -fish_mode_prompt.fish -host_info.fish -last_job_id.fish -pwd_info.fish -pwd_is_home.fish -_* -fish_prompt.fish -fish_title.fish -agnoster.fish -bobthefish_display_colors.fish diff --git a/shells/fish/functions/gitignore_fisher_functions.fish b/shells/fish/functions/gitignore_fisher_functions.fish deleted file mode 100644 index a9df736..0000000 --- a/shells/fish/functions/gitignore_fisher_functions.fish +++ /dev/null @@ -1,11 +0,0 @@ -function gitignore_fisher_functions - set functions_path ~/.config/fish/functions/ - if not test -e $functions_path - echo "Functions directory not found" - else - cd $functions_path - find * -type l > .gitignore - echo "fisher.fish" >> .gitignore - cd - - end -end diff --git a/shells/zprofile b/shells/zprofile deleted file mode 100644 index 42c24ab..0000000 --- a/shells/zprofile +++ /dev/null @@ -1,10 +0,0 @@ -# -# /etc/zprofile and ~/.zprofile are run for login shells -# - -# Add ~/.local/bin to path -PATH="$PATH:$HOME/.local/bin" -# Add ~/.npm-global/bin/ to path -PATH="$PATH:$HOME/.npm-global/bin" -export PATH - diff --git a/stow.sh b/stow.sh new file mode 100755 index 0000000..6d4b887 --- /dev/null +++ b/stow.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -euo pipefail + +PRIMARY="\033[0;35m" +LOG="\033[0;36m" +SUCCESS="\033[0;32m" +NC="\033[0m" +BRAND="[stow]" + +function log { + echo -e "${PRIMARY}${BRAND} ${LOG}$1${NC}" +} + +function success { + echo -e "${PRIMARY}${BRAND} ${SUCCESS}$1${NC}" +} + +DEFAULT_STOW_PKGS="alacritty systemd picom bash fish zsh stumpwm qutebrowser redshift neovim dunst x" +STOW_PKGS=${STOW_PKGS:=$DEFAULT_STOW_PKGS} + +WORK_DOTFILES="${WORK_DOTFILES:=$HOME/.dotfiles/dot-work}" +DEFAULT_WORK_STOW_PKGS="mbsync msmtp ssh passwords" +WORK_STOW_PKGS="${WORK_STOW_PKGS:=$DEFAULT_WORK_STOW_PKGS}" + +PRIVATE_DOTFILES="${PRIVATE_DOTFILES:=$HOME/.dotfiles/dot-private}" +DEFAULT_PRIVATE_STOW_PKGS="mbsync msmtp ssh git" +PRIVATE_STOW_PKGS="${PRIVATE_STOW_PKGS:=$DEFAULT_PRIVATE_STOW_PKGS}" + +WORK_MACHINE="knuth" +CURRENT_MACHINE="$(hostname)" + +log "Stowing general packages." +for pkg in $STOW_PKGS +do + log "Stowing $pkg package." + stow $@ "$pkg" +done +log "Finished stowing general packages." + +if [[ "$WORK_MACHINE" == "$CURRENT_MACHINE" ]] +then + log "Detected work system. Stowing relevant files." + for pkg in $WORK_STOW_PKGS + do + log "Stowing $pkg package." + stow $@ -d "$WORK_DOTFILES" -t "$HOME" "$pkg" + done + log "Finished stowing work packages." +else + log "Detected personal system. Stowing relevant packages." + for pkg in $PRIVATE_STOW_PKGS + do + log "Stowing $pkg package." + stow $@ -d "$PRIVATE_DOTFILES" -t "$HOME" "$pkg" + done + log "Finished stowing private packages." +fi + +success "Finished stowing files." diff --git a/stumpwm/stumpwmrc b/stumpwm/.stumpwmrc similarity index 100% rename from stumpwm/stumpwmrc rename to stumpwm/.stumpwmrc diff --git a/systemd/mbsync.service b/systemd/.config/systemd/user/mbsync.service similarity index 100% rename from systemd/mbsync.service rename to systemd/.config/systemd/user/mbsync.service diff --git a/systemd/mbsync.timer b/systemd/.config/systemd/user/mbsync.timer similarity index 100% rename from systemd/mbsync.timer rename to systemd/.config/systemd/user/mbsync.timer diff --git a/x/Xmodmap b/x/.Xmodmap similarity index 100% rename from x/Xmodmap rename to x/.Xmodmap diff --git a/x/Xresources b/x/.Xresources similarity index 100% rename from x/Xresources rename to x/.Xresources diff --git a/x/xinitrc b/x/.xinitrc similarity index 100% rename from x/xinitrc rename to x/.xinitrc diff --git a/x/Xresources-UHD b/x/Xresources-UHD deleted file mode 100644 index 830d65a..0000000 --- a/x/Xresources-UHD +++ /dev/null @@ -1,57 +0,0 @@ -! terminal colors ------------------------------------------------------------- -*background: #282828 -*foreground: #ebdbb2 -*color0: #282828 -*color8: #928374 -*color1: #cc241d -*color9: #fb4934 -*color2: #98971a -*color10: #b8bb26 -*color3: #d79921 -*color11: #fabd2f -*color4: #458588 -*color12: #83a598 -*color5: #b16286 -*color13: #d3869b -*color6: #689d6a -*color14: #8ec07c -*color7: #a89984 -*color15: #ebdbb2 - -! Xcursor --------------------------------------------------------------------- -Xcursor.theme: Vanilla-DMZ-AA -Xcursor.size: 24 - -! Xft setttings --------------------------------------------------------------- -Xft.dpi: 192 -Xft.antialias: true -Xft.rgba: rgb -Xft.hinting: true -Xft.hintstyle: hintslight - -! xterm ---------------------------------------------------------------------- -xterm*termName: xterm-256color -xterm*locale: true -xterm*metaSendsEscape: true -xterm*faceName: Hermit:style=Medium:size=11 -xterm*dymanicColors: true -xtem*utf8: 2 -xterm*eightBitInput: true -xterm*saveLines: 4096 -xterm*scrollKey: true -xterm*scrollTtyOutput: false -xterm*scrollBar: true -xterm*rightScrollBar: true -xterm*jumpScroll: true -xterm*multiScroll: true -xterm*fastScroll: true -xterm*toolBar: false -xterm*VT100.translations: #override : select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0) - -! xpdf ------------------------------------------------------------------------ -xpdf*enableFreetype: yes -xpdf*antialias: yes -xpdf*foreground: black: -xpdf*background: white -xpdf*urlCommand: /usr/bin/iceweasel %s - diff --git a/x/Xresources-hidpi b/x/Xresources-hidpi deleted file mode 100644 index 72a4471..0000000 --- a/x/Xresources-hidpi +++ /dev/null @@ -1 +0,0 @@ -Xft.dpi: 192 diff --git a/x/xprofile b/x/xprofile deleted file mode 100755 index cdf44f8..0000000 --- a/x/xprofile +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -###################################### -### Additional X Environment variables -###################################### - -export QT_QPA_PLATFORMTHEME=qt5ct - -################################## -### Adjust for multi-monitor setup -################################## - -extern="HDMI-1" -intern="eDP-1" - -if xrandr | grep "$extern connected"; then - xrandr --output "$extern" --auto --primary --left-of "$intern" -fi diff --git a/shells/zshrc b/zsh/.zshrc similarity index 100% rename from shells/zshrc rename to zsh/.zshrc