summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/compiler1
-rwxr-xr-x.local/bin/cron/checkup2
-rwxr-xr-x.local/bin/shortcuts6
-rwxr-xr-x.local/bin/sysact4
-rwxr-xr-x.local/bin/tag8
5 files changed, 16 insertions, 5 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler
index 1892d5f..c56a25a 100755
--- 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
index bf7f85d..4cfb856 100755
--- 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
index ed4f89f..ea463d7 100755
--- 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
index 0a7cdd0..e73981f 100755
--- 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
index c23be4e..8462b99 100755
--- 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