]> git.armaanb.net Git - bin.git/commitdiff
cleanup, add 2 more scripts
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 11 Nov 2020 18:22:30 +0000 (13:22 -0500)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 11 Nov 2020 18:22:30 +0000 (13:22 -0500)
Ran shellcheck through everything and cleaned up lots of code.
Also added two new scripts, fix-flatpak-them, which copies your
theme settings into all of your flatpaks, and a customized version
of ufetch

fix-flatpak-theme [new file with mode: 0755]
git-check
status
system-setup
tweet-grab
ufetch [new file with mode: 0755]

diff --git a/fix-flatpak-theme b/fix-flatpak-theme
new file mode 100755 (executable)
index 0000000..f42623a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# From https://github.com/abiosoft/dotfiles/blob/master/flatpak/fixflatpaktheme.sh
+
+for dir in "$HOME"/.var/app/*/
+do
+    confdir="${dir}config/gtk-3.0"
+    mkdir -p "$confdir"
+    cp "$HOME/.config/gtk-3.0/settings.ini" "$confdir/settings.ini"
+done
index 7e85792ed5d95751bd4e252577b5e5a74d19383c..0efbe2efdb031228065ec412faa926e900c6bf99 100755 (executable)
--- a/git-check
+++ b/git-check
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 for i in $(ls); do
-  cd $i
-  if [[ ! ($(git diff --stat) == "") ]]; then
+  cd $i || exit
+  if [[ -d .git ]]; then
     echo $i
     chars=${#i}
     for (( i = 1; i < $chars; i++ )); do
diff --git a/status b/status
index 292d714ecf49afd90b20ba21c0085c7bb9eaa1e3..0b0b6952557d197809d2ba1c24ff0f3d347010ef 100755 (executable)
--- a/status
+++ b/status
@@ -8,10 +8,10 @@ function power_set() {
   upower -d | grep percentage | tail -c 5
   if [[ $(upower -d | grep "discharging") ]]; then
     echo " battery,"
-    echo $(upower -d | grep "time to empty" | tail -c 15) remaining
+    echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
   else
     echo " battery"
   fi
 }
 
-notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set)`"
+notify-send -i "clock" "echo $(time_set)" "echo $(power_set)"
index 2ba2dd32d7289f86470c534d151097dfb7ff677f..62fe6427a46801a32929a244c7dd6985e8471da0 100755 (executable)
@@ -7,7 +7,7 @@ ${update}
 ${autoremove}
 
 for i in neovim nvim firefox-esr flatpak quassel-client virtualbox htop bleachbit timeshift flatpak bat batcat exa zsh git gnupg pinentry-console alacritty taskwarrior tasks task fzf yadu chromium vlc zathura libreoffice-writer libreoffice-calc bpytop xcape docker ufw syncthing synaptic virtualbox-ext-pack; do
-  sudo ${install} $i
+  sudo "${install}" $i
 done
 
 flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
index 8e94dc8daaf50f10058c2a26367f96f9bf6c42ee..fa6faefb37f2e00eb18f2695458d726f765c6dcb 100755 (executable)
@@ -3,5 +3,5 @@ FILE=/root/tweets/index.html
 LOGFILE=/root/tweets/cron.log
 > $FILE
 curl https://nitter.net/keshinko | grep tweet-content | head -n 1 | sed -e 's/<[^>]*>//g' -e 's/^[ \t]*\(.*$\)/\1/' >> $FILE
-echo "$(tail -n 1000 $LOGFILE)" > $LOGFILE
+tail -n 1000 $LOGFILE > $LOGFILE
 date -R >> $LOGFILE
diff --git a/ufetch b/ufetch
new file mode 100755 (executable)
index 0000000..d5075ff
--- /dev/null
+++ b/ufetch
@@ -0,0 +1,40 @@
+#!/bin/sh
+# ufetch-armaan. My customized version of ufetch that doesn't print the ascii art, and doesn't spend time looking things up like the DE. Full credit goes to jschx (Joe Schillinger), the author of ufetch. <https://gitlab.com/jschx/ufetch>
+
+## INFO
+
+# user is already defined
+host="frost.bhojwani.org"
+os='Debian unstable'
+kernel="$(uname -sr)"
+uptime="$(uptime | awk -F, '{sub(".*up ",x,$1);print $1}' | sed -e 's/^[ \t]*//')"
+packages="$(dpkg -l | grep -c ^i)"
+shell="zsh"
+ui="KDE Plasma"
+
+## DEFINE COLORS
+bold='\033[1m'
+# black='\033[0;30m'
+# red='\033[0;31m'
+# green='\033[0;32m'
+# yellow='\033[0;33m'
+# blue='\033[0;34m'
+# magenta='\033[0;35m'
+# cyan='\033[0;36m'
+white='\033[0;37m'
+reset='\033[0m'
+
+# you can change these
+lc="${reset}${bold}${white}"         # labels
+nc="${reset}${bold}${white}"         # user and hostname
+ic="${reset}"                       # info
+
+## OUTPUT
+
+printf "${nc}${USER}${ic}@${nc}${host}${reset}
+${lc}OS        ${ic}${os}${reset}
+${lc}KERNEL    ${ic}${kernel}${reset}
+${lc}UPTIME    ${ic}${uptime}${reset}
+${lc}PACKAGES  ${ic}${packages}${reset}
+${lc}SHELL     ${ic}${shell}${reset}
+${lc}DE        ${ic}${ui}${reset}"