From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Wed, 11 Nov 2020 18:22:30 +0000 (-0500) Subject: cleanup, add 2 more scripts X-Git-Tag: v0.0.1~91 X-Git-Url: https://git.armaanb.net/?p=bin.git;a=commitdiff_plain;h=a81b29d421e62966c6710115522b323a13ce7afd cleanup, add 2 more scripts 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 --- diff --git a/fix-flatpak-theme b/fix-flatpak-theme new file mode 100755 index 0000000..f42623a --- /dev/null +++ b/fix-flatpak-theme @@ -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 diff --git a/git-check b/git-check index 7e85792..0efbe2e 100755 --- 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 292d714..0b0b695 100755 --- 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)" diff --git a/system-setup b/system-setup index 2ba2dd3..62fe642 100755 --- a/system-setup +++ b/system-setup @@ -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 diff --git a/tweet-grab b/tweet-grab index 8e94dc8..fa6faef 100755 --- a/tweet-grab +++ b/tweet-grab @@ -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 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. + +## 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}"