dotfiles

My dotfiles: zsh, lf, sxiv, i3, ranger, mpd and more
Log | Files | Refs | Submodules | README | LICENSE

commit a801ddcbfcf1c0fd01a0c06975571e56c51b077b
parent f770ac9df144ff24f7790aa23087abf000d656ff
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun,  1 Nov 2020 20:39:02 -0500

Merge branch 'master' of github.com:LukeSmithxyz/voidrice

Diffstat:
M.local/bin/compiler | 1+
M.local/bin/cron/checkup | 2+-
M.local/bin/shortcuts | 6++++--
M.local/bin/sysact | 4++--
M.local/bin/tag | 8++++++++
M.zprofile | 4++--
6 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/.local/bin/compiler b/.local/bin/compiler @@ -30,6 +30,7 @@ case "$ext" in [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; c) cc "$file" -o "$base" && "$base" ;; go) go run "$file" ;; + cpp) g++ "$file" -o "$base" && "$base" ;; h) sudo make install ;; m) octave "$file" ;; md) if [ -x "$(command -v lowdown)" ]; then diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup @@ -2,7 +2,7 @@ # Syncs repositories and downloads updates, meant to be run as a cronjob. -ping -q -c example.org > /dev/null || exit +ping -q -c 1 example.org > /dev/null || exit notify-send "📦 Repository Sync" "Checking for package updates..." diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts @@ -15,17 +15,19 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. +eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/directories")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -a\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; - printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" + printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. +eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/files")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; - printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" + printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" diff --git a/.local/bin/sysact b/.local/bin/sysact @@ -10,8 +10,8 @@ esac cmds="\ 🔒 lock slock -🚪 leave dwm kill -TERM $(pidof -s dwm) -♻ renew dwm kill -HUP $(pidof -s dwm) +🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$") +♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") 🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} 🔃 reboot ${reb:-sudo -A reboot} 🖥 shutdown ${shut:-sudo -A shutdown -h now}" diff --git a/.local/bin/tag b/.local/bin/tag @@ -55,5 +55,13 @@ Date=$date Genre=$genre Comment=$comment" | opustags -i -S "$file" ;; *.mp3) eyeD3 -Q --remove-all -a "$artist" -A "$album" -t "$title" -n "$track" -N "$total" -Y "$date" "$file" ;; + *.flac) echo "TITLE=$title +ARTIST=$artist +ALBUM=$album +TRACKNUMBER=$track +TOTALTRACKS=$total +DATE=$date +GENRE=$genre +DESCRIPTION=$comment" | metaflac --remove-all-tags --import-tags-from=- "$file" ;; *) echo "File type not implemented yet." ;; esac diff --git a/.zprofile b/.zprofile @@ -132,8 +132,8 @@ ex=🎯:\ [ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 & if pacman -Qs libxft-bgra >/dev/null 2>&1; then - # Start graphical server on tty1 if not already running. - [ "$(tty)" = "/dev/tty1" ] && ! pidof Xorg >/dev/null 2>&1 && exec startx + # Start graphical server on user's current tty if not already running. + [[ -n "$(tty)" && -z $(pgrep -u $USER "\bXorg$") ]] && exec startx else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: