diff --git a/.config/X11/realinit b/.config/X11/realinit index c435cf0ca..1abd35bf6 100755 --- a/.config/X11/realinit +++ b/.config/X11/realinit @@ -1,7 +1,8 @@ -#!/bin/sh -x +#!/bin/sh + +X11_CONFIG="$XDG_CONFIG_HOME/X11" +SESSIONFILES=$(run-parts --list "$X11_CONFIG/xsession.d") -SESSIONDIR="$XDG_CONFIG_HOME/X11/xsession.d" -SESSIONFILES=$(run-parts --list $SESSIONDIR) if [ -n "$SESSIONFILES" ]; then set +e for SESSIONFILE in $SESSIONFILES; do @@ -11,6 +12,6 @@ if [ -n "$SESSIONFILES" ]; then set -e fi -. "$XDG_CONFIG_HOME/X11/xprofile" +. "$X11_CONFIG/xprofile" exec dwm diff --git a/.config/lf/lfrc b/.config/lf/lfrc index ffb2035e2..d5ac7d124 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -51,14 +51,14 @@ set promptfmt "\033[34;1m%u\033[36m@\033[34m%h \033[35m[\033[0;1m%d\033[33m%f\03 # esac # }} -cmd open $set -f; rifle -p 0 $fx; clear +cmd open $set -f; rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p 0 $fx; clear cmd open-with ${{ clear set -f - rifle -l $fx + rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -l $fx read -p "Open with: " method - rifle -p $method $fx + rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p $method $fx clear }} diff --git a/.config/ranger/rifle.conf b/.config/lf/rifle.conf similarity index 99% rename from .config/ranger/rifle.conf rename to .config/lf/rifle.conf index 672299a4c..c5b5247ed 100644 --- a/.config/ranger/rifle.conf +++ b/.config/lf/rifle.conf @@ -1,4 +1,3 @@ - # vim: ft=cfg # # This is the configuration file of "rifle", ranger's file executor/opener. diff --git a/.config/zsh/profile b/.config/zsh/profile index 9ee95fbde..efd048e16 100644 --- a/.config/zsh/profile +++ b/.config/zsh/profile @@ -94,5 +94,5 @@ export NVM_DIR="$HOME/.config/nvm" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then - exec startx + exec startx $XINITRC fi diff --git a/.local/bin/dotsync b/.local/bin/dotsync index 0318b877d..486b7083a 100755 --- a/.local/bin/dotsync +++ b/.local/bin/dotsync @@ -22,7 +22,7 @@ fi printf "\n" printf "%b" "$BOLD${BLUE}Pulling updates from dotfiles repo...$NC\n" -git pull origin main +git pull origin main --recurse-submodules=yes printf "\n" if [ $needs_pop -eq 1 ]; then diff --git a/.local/bin/setbg b/.local/bin/setbg index 83070327d..6f85e5fd2 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -5,7 +5,7 @@ # If given a file, set that as the new wallpaper. # If given a directory, choose random file in it. -bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" +bgloc="$XDG_DATA_HOME/bg" trueloc="$(readlink -f "$1")" && case "$(file --mime-type -b "$trueloc")" in diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 638052fd0..61cfd0a3f 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -17,7 +17,7 @@ printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. eval "echo \"$(cat "$bmdirs")\"" | awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42cd %s && tput cuu1;tput el\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"%s=\42cd %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"map g%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; printf(\"%s\n\",\$2) >> \"$lf_dirs\" }" diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu index 0e9e3e80d..fc648c348 100755 --- a/.local/bin/statusbar/sb-cpu +++ b/.local/bin/statusbar/sb-cpu @@ -1,3 +1,34 @@ #!/bin/sh -# TODO: Add color -sensors | awk '/Core 0/ {print "\033[11mšŸŒ”\033[10m" $3}' + +reset="\033[0m" +normal="\033[10m" +big="\033[11m" +red="\033[31m" +green="\033[32m" +orange="\033[33m" + +cache=/tmp/cpubarscache +temp=$(sensors | awk '/CPU/ {print $2}' | tr -d "+") +stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) +[ ! -f $cache ] && echo "$stats" >"$cache" +old=$(cat "$cache") +printf "%b" "$bigļ¬™$normal $temp " +echo "$stats" | while read -r row; do + id=${row%% *} + rest=${row#* } + total=${rest%% *} + idle=${rest##* } + case "$(echo "$old" | awk '{if ($1 == id) + printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ + id="$id" total="$total" idle="$idle")" in + "0") printf "%b" "$greenā–" ;; + "1") printf "%b" "$greenā–‚" ;; + "2") printf "%b" "$greenā–ƒ" ;; + "3") printf "%b" "$orangeā–„" ;; + "4") printf "%b" "$orangeā–…" ;; + "5") printf "%b" "$orangeā–†" ;; + "6" | "7" | "8") printf "%b" "$redā–‡" ;; + esac +done +printf "%b" "$reset\n" +echo "$stats" >"$cache" diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars deleted file mode 100755 index 342b6710f..000000000 --- a/.local/bin/statusbar/sb-cpubars +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -reset="\033[0m" -normal="\033[10m" -big="\033[11m" -red="\033[31m" -green="\033[32m" -orange="\033[33m" - -cache=/tmp/cpubarscache -stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) -[ ! -f $cache ] && echo "$stats" >"$cache" -old=$(cat "$cache") -printf "%b" "$bigļ¬™$normal " -echo "$stats" | while read -r row; do - id=${row%% *} - rest=${row#* } - total=${rest%% *} - idle=${rest##* } - case "$(echo "$old" | awk '{if ($1 == id) - printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ - id="$id" total="$total" idle="$idle")" in - "0") printf "%b" "$greenā–" ;; - "1") printf "%b" "$greenā–‚" ;; - "2") printf "%b" "$greenā–ƒ" ;; - "3") printf "%b" "$orangeā–„" ;; - "4") printf "%b" "$orangeā–…" ;; - "5") printf "%b" "$orangeā–†" ;; - "6" | "7" | "8") printf "%b" "$redā–‡" ;; - - esac -done -printf "%b" "$reset\n" -echo "$stats" >"$cache" diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent index a1d8e383e..53fdd12c2 100755 --- a/.local/bin/statusbar/sb-torrent +++ b/.local/bin/statusbar/sb-torrent @@ -1,10 +1,11 @@ #!/bin/sh -transmission-remote "$1" -l | grep % | - sed " # The letters are for sorting and will not appear. - s/.*Stopped.*/A ļ£„/; +transmission-remote $@ -l -N "$XDG_CONFIG_HOME/netrc" | grep % | + # The letters are for sorting and will not appear. \ + sed " + s/.*Stopped.*/A ļ£„/; s/.*Seeding.*/Z ļ« ļ™¦/; s/.*100%.*/N ļ« /; s/.*Idle.*/B ļ­¦/; s/.*Uploading.*/L ļ™¦/; - s/.*%.*/M ļ™”/" | - sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' - + s/.*%.*/M ļ™”/ + " | sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' - diff --git a/.local/bin/trash/openfile b/.local/bin/trash/openfile deleted file mode 100755 index 1c957898b..000000000 --- a/.local/bin/trash/openfile +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Helps open a file with xdg-open from mutt in a external program without weird side effects. -tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard/files" -file="$tempdir/$(basename "$1")" -opener="setsid -f xdg-open" -mkdir -p "$tempdir" -cp -f "$1" "$file" -$opener "$file" >/dev/null 2>&1 -find "${tempdir:?}" -mtime +1 -type f -delete diff --git a/.local/bin/trash/remaps b/.local/bin/trash/remaps deleted file mode 100755 index eb4c69fc5..000000000 --- a/.local/bin/trash/remaps +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# These are the groups that will be toggled between. They take the format : -# If you want the default US layout, use us:basic -groups="us:dvorak de:nodeadkeys" - -index() { - echo "$groups" | cut -d ' ' -f "$1" -} - -if [ "$1" = "-n" ]; then - newgroup="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" -elif [ "$1" = "" ]; then - current="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" - i=1 - while [ ! "$found" ]; do - group=$(index $i) - if [ "$group" = "$current" ]; then - newgroup=$(index $((i + 1))) - [ -z "$newgroup" ] && newgroup=$(index 1) - found=true - elif [ -z "$group" ]; then - newgroup=$(index 1) - found=true - fi - i=$((i + 1)) - done -else - newgroup="$1" -fi - -setxkbmap \ - -layout "$(echo "$newgroup" | cut -d ':' -f1)" \ - -variant "$(echo "$newgroup" | cut -d ':' -f2)" \ - -option caps:super \ - 1>/dev/null 2>&1 || - echo "Unkown keyboard layout" >&2 - -xset r rate 300 50 -xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock - -killall xcape 2>/dev/null -xcape -e 'Super_L=Escape' - -sleep 0.03 -[ "$1" != "-n" ] && pkill -RTMIN+15 dwmblocks diff --git a/.local/bin/upgrades b/.local/bin/upgrades index 734fbdee5..1c9a01819 100755 --- a/.local/bin/upgrades +++ b/.local/bin/upgrades @@ -43,7 +43,7 @@ command -v apt 1>/dev/null 2>&1 && sudo apt upgrade command -v xbps-install 1>/dev/null 2>&1 && sudo xbps-install -Syu && pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" printf "%b" "$BOLD${BLUE}Updating arkenfox...$NC\n" -"$DOTFILES_DIR/.local/share/firefox/updater.sh" -s +"$DOTFILES_DIR/.local/share/firefox/updater.sh" -sb printf "%b" "$BOLD${BLUE}Upgrade complete.\nPress to exit window.\n" read -r _ diff --git a/README.md b/README.md index df3655f21..21cd854d9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -These are the dotfiles that I use on an Ubuntu and an Arch machine. +These are the dotfiles that I use on an Ubuntu, Arch and Void machine. I keep them on a selfhosted git server for easy synchronization, and mirror them to github so that others can use parts of them as well. ## Installation? -I'd advise against using my setup currently. I am currently in the process of writing a script that will automatically install the various software dependencies of my setup, which will be usable on Arch and Ubuntu systems. Once that is finished it might actually make sense to install them. +I'd advise against using my setup currently. I am currently in the process of writing a script that will automatically install the various software dependencies of my setup, which will be usable on Void Linux systems. Once that is finished it might actually make sense to install them. Theoretically they could be installed by cloning this repo to ~/.dotfiles and running ~/.dotfiles/.local/bin/dotsync. This script requires gnu stow to be installed, which symlinks the dotfiles to the correct locations. diff --git a/TODO.md b/TODO.md index 4d1db52ba..b253c74bd 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,8 @@ # TODO - [ ] Create a better bitwarden integration - [ ] Remove username from ssh completion -- [ ] Look into rifle.py for LF -- [ ] rework shift-o function of LF to detach opening program from terminal - [ ] add a messaging function to dotsync to warn for breaking changes - [ ] check font names for void, adjust fontconfig -- [ ] integrate sb-cpu into sb-cpubars # FIX - [ ] sb-playerctl trailing dash when no artist