From eff2e95c5577591eb140cfd024c4c9801cd9774b Mon Sep 17 00:00:00 2001
From: Luca Bilke <bilke@tralios.de>
Date: Wed, 31 May 2023 11:27:31 +0200
Subject: [PATCH] small updates

small updates
---
 .config/lf/lfrc                   |  6 ++---
 .config/{ranger => lf}/rifle.conf |  1 -
 .local/bin/dotsync                |  2 +-
 .local/bin/setbg                  |  2 +-
 .local/bin/statusbar/sb-cpu       |  3 ---
 .local/bin/statusbar/sb-cpubars   |  4 +--
 .local/bin/trash/openfile         | 10 -------
 .local/bin/trash/remaps           | 45 -------------------------------
 .local/bin/upgrades               |  2 +-
 README.md                         |  4 +--
 TODO.md                           |  3 ---
 11 files changed, 10 insertions(+), 72 deletions(-)
 rename .config/{ranger => lf}/rifle.conf (99%)
 delete mode 100755 .local/bin/statusbar/sb-cpu
 delete mode 100755 .local/bin/trash/openfile
 delete mode 100755 .local/bin/trash/remaps

diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index ffb2035e..d5ac7d12 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 672299a4..c5b5247e 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/.local/bin/dotsync b/.local/bin/dotsync
index 0318b877..486b7083 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 83070327..6f85e5fd 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/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu
deleted file mode 100755
index 0e9e3e80..00000000
--- a/.local/bin/statusbar/sb-cpu
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-# TODO: Add color
-sensors | awk '/Core 0/ {print "\033[11m🌡\033[10m" $3}'
diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars
index 342b6710..fc648c34 100755
--- a/.local/bin/statusbar/sb-cpubars
+++ b/.local/bin/statusbar/sb-cpubars
@@ -8,10 +8,11 @@ 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 "  
+printf "%b" "$big﬙$normal $temp "  
 echo "$stats" | while read -r row; do
 	id=${row%% *}
 	rest=${row#* }
@@ -27,7 +28,6 @@ echo "$stats" | while read -r row; do
 	"4") printf "%b" "$orangeâ–…" ;;
 	"5") printf "%b" "$orangeâ–†" ;;
 	"6" | "7" | "8") printf "%b" "$redâ–‡" ;;
-
 	esac
 done
 printf "%b" "$reset\n"
diff --git a/.local/bin/trash/openfile b/.local/bin/trash/openfile
deleted file mode 100755
index 1c957898..00000000
--- 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 eb4c69fc..00000000
--- 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 <layout>:<variant>
-# 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 734fbdee..1c9a0181 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 <Enter> to exit window.\n"
 read -r _
diff --git a/README.md b/README.md
index df3655f2..21cd854d 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 4d1db52b..b253c74b 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