From 186125d7512bd4dd095cd7b60bc648eb603c2290 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 28 Feb 2021 08:15:17 -0500 Subject: moved all i3-related scripts into i3 or i3blocks config --- findport.sh | 5 ----- funia.sh | 20 -------------------- gen_base64key.sh | 6 ------ git-create | 32 -------------------------------- github-mirror.sh | 3 --- i3-filescmd.sh | 3 --- i3-mailcmd.sh | 4 ---- i3-mixercmd.sh | 3 --- i3-newsboatcmd.sh | 3 --- i3-screenie_regioncmd.sh | 2 -- i3-screeniecmd.sh | 2 -- i3blocks-audio.sh | 16 ---------------- i3blocks-battery.sh | 15 --------------- i3blocks-cpuload.sh | 19 ------------------- i3blocks-cputemp.sh | 18 ------------------ i3blocks-date.sh | 4 ---- i3blocks-disk.sh | 4 ---- i3blocks-mail.sh | 6 ------ i3blocks-memory.sh | 4 ---- i3blocks-net.sh | 17 ----------------- i3blocks-news.sh | 6 ------ i3blocks-packages.sh | 7 ------- i3blocks-screencast.sh | 3 --- i3blocks-up.sh | 3 --- i3blocks-updates.sh | 5 ----- i3blocks-uptime.sh | 4 ---- i3blocks-weather.sh | 3 --- innernet.sh | 24 ------------------------ radar.sh | 2 +- rank-mirrors.sh | 9 --------- slock-fortune.sh | 3 --- toggle-compositing.sh | 3 --- toggle-webcam.sh | 3 --- 33 files changed, 1 insertion(+), 260 deletions(-) delete mode 100755 findport.sh delete mode 100755 funia.sh delete mode 100755 gen_base64key.sh delete mode 100755 git-create delete mode 100644 github-mirror.sh delete mode 100755 i3-filescmd.sh delete mode 100755 i3-mailcmd.sh delete mode 100755 i3-mixercmd.sh delete mode 100755 i3-newsboatcmd.sh delete mode 100755 i3-screenie_regioncmd.sh delete mode 100755 i3-screeniecmd.sh delete mode 100755 i3blocks-audio.sh delete mode 100755 i3blocks-battery.sh delete mode 100755 i3blocks-cpuload.sh delete mode 100755 i3blocks-cputemp.sh delete mode 100755 i3blocks-date.sh delete mode 100755 i3blocks-disk.sh delete mode 100755 i3blocks-mail.sh delete mode 100755 i3blocks-memory.sh delete mode 100755 i3blocks-net.sh delete mode 100755 i3blocks-news.sh delete mode 100755 i3blocks-packages.sh delete mode 100755 i3blocks-screencast.sh delete mode 100755 i3blocks-up.sh delete mode 100755 i3blocks-updates.sh delete mode 100755 i3blocks-uptime.sh delete mode 100755 i3blocks-weather.sh delete mode 100755 innernet.sh delete mode 100755 rank-mirrors.sh delete mode 100755 slock-fortune.sh delete mode 100755 toggle-compositing.sh delete mode 100755 toggle-webcam.sh diff --git a/findport.sh b/findport.sh deleted file mode 100755 index 9aaf349..0000000 --- a/findport.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cwd="$(pwd)" -cd /usr/local/poudriere/ports/default -printf "%s\n" */* | grep "$1" | sort diff --git a/funia.sh b/funia.sh deleted file mode 100755 index c758f58..0000000 --- a/funia.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -base_url=https://basic.photofunia.com - -tmpfile=$(mktemp /tmp/funia.XXXXXX) - -category=$( -curl -s "$base_url/categories" \ - | sed -n -e 's/[[:blank:]]//g' -e '/all_effects/d' -e 's|^.*href="/categories/\(.*\)".*$|\1|p' \ - | sort \ - | dmenu -) - -page=1 -while curl -so "$tmpfile" "$base_url/categories/$category?page=$page" -do - echo ----- $page ----- - page="$(($page + 1))" -done - -cat "$tmpfile" diff --git a/gen_base64key.sh b/gen_base64key.sh deleted file mode 100755 index fd4eab5..0000000 --- a/gen_base64key.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -#$key=$(dd status=none if=/dev/urandom bs=512 count=4) -# base64 -w 0 -#echo "$key" | xclip -o -dd status=none if=/dev/urandom bs=512 count=4 | base64 -w 0 | xclip -i -echo Copied. diff --git a/git-create b/git-create deleted file mode 100755 index 48fa1d7..0000000 --- a/git-create +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -# TODO: update this for gitea, insta-creation of repo - -# create a repo of provided name on macon and make it the upstream -name=$1 -[ ! $(echo "$name" | grep ".git" -) ] && name="$1.git" - -description=$2 - -echo "'$name': '$description'" -echo "Create repo?" -read choice -[ ! $choice == "y" ] && exit 1 - -ssh git@53hor.net << EOF - cd /srv/git - git init --bare /srv/git/"$name" - cd "$name" - rm description - echo "$description" > description -EOF - -echo "Mark for export (make clone-able)?" -read choice -[[ $choice == "y" ]] && ssh git@53hor.net touch /srv/git/"$name"/git-daemon-export-ok - -echo "Clone repo locally?" -read choice -[[ ! $choice == "y" ]] && exit 1 - -git clone git@53hor.net:/srv/git/"$name" diff --git a/github-mirror.sh b/github-mirror.sh deleted file mode 100644 index 5d9cb00..0000000 --- a/github-mirror.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -# Should mirror a gitea repo into github using the public API diff --git a/i3-filescmd.sh b/i3-filescmd.sh deleted file mode 100755 index ac47cdf..0000000 --- a/i3-filescmd.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -alacritty -e zsh -c "cat ~/.config/wpg/sequences && vifm ~/downloads ~" - diff --git a/i3-mailcmd.sh b/i3-mailcmd.sh deleted file mode 100755 index 3d253fc..0000000 --- a/i3-mailcmd.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -alacritty -t "Reading Email" -e zsh -c "cat ~/.config/wpg/sequences && mutt" -mbsync -c ~/.config/mbsync/mbsyncrc -a -pkill -77 i3blocks diff --git a/i3-mixercmd.sh b/i3-mixercmd.sh deleted file mode 100755 index 6eef2a1..0000000 --- a/i3-mixercmd.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -alacritty -e zsh -c "cat ~/.config/wpg/sequences && mixertui" -pkill -75 i3blocks diff --git a/i3-newsboatcmd.sh b/i3-newsboatcmd.sh deleted file mode 100755 index c95063c..0000000 --- a/i3-newsboatcmd.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -alacritty -t "Reading News" -e zsh -c "cat ~/.config/wpg/sequences && newsboat" -pkill -78 i3blocks diff --git a/i3-screenie_regioncmd.sh b/i3-screenie_regioncmd.sh deleted file mode 100755 index 1b2ce32..0000000 --- a/i3-screenie_regioncmd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -scrot -sfz -e 'mkdir -p ~/pictures/screenshots && mv $f ~/pictures/screenshots/' diff --git a/i3-screeniecmd.sh b/i3-screeniecmd.sh deleted file mode 100755 index 4f62401..0000000 --- a/i3-screeniecmd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -scrot -z -e 'mkdir -p ~/pictures/screenshots && mv $f ~/pictures/screenshots/' diff --git a/i3blocks-audio.sh b/i3blocks-audio.sh deleted file mode 100755 index 1a54199..0000000 --- a/i3blocks-audio.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -low=25 -mid=50 -high=75 -icon_low=󰕿 -icon_mid=󰖀 -icon_high=󰕾 -icon_mute=󰝟 - -volume=$(mixer vol | cut -d':' -f2) -icon= -[ $volume -eq 0 ] && icon=$icon_mute -[ $volume -gt 0 ] && [ $volume -lt $low ] && icon=$icon_low -[ $volume -ge $low ] && [ $volume -lt $high ] && icon=$icon_mid -[ $volume -ge $high ] && icon=$icon_high -printf "%s%s%%\n" $icon $volume diff --git a/i3blocks-battery.sh b/i3blocks-battery.sh deleted file mode 100755 index c37c7a2..0000000 --- a/i3blocks-battery.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -icon_high=󰁹 -icon_low=󰁾 -icon_crit=󱃍 -icon_charging=󰂄 - -status=$(apm -b) -level=$(apm -l) - -[ $status -eq 0 ] && printf "%s" $icon_high -[ $status -eq 1 ] && printf "%s" $icon_low -[ $status -eq 2 ] && printf "%s" $icon_crit && notify-send "Battery critically low" -[ $status -eq 3 ] && printf "%s" $icon_charging - -printf "%s%%\n" $level diff --git a/i3blocks-cpuload.sh b/i3blocks-cpuload.sh deleted file mode 100755 index 226e224..0000000 --- a/i3blocks-cpuload.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -low=50 -high=90 -icon_low=󰒲 -icon_mid=󰜎 -icon_high=󱅝 - -cpu_count=$(sysctl -n hw.ncpu) -avg_load=$(sysctl vm.loadavg | cut -w -f3) -percent=$(echo "result = $avg_load / $cpu_count * 100; scale=0; result / 1" | bc -l) - -#mhz=$(sysctl -n dev.cpu.0.freq) -#ghz=$(echo "result = $mhz / 1000; scale=1; result / 1" | bc -l) - -[ $percent -lt $low ] && printf $icon_low -[ $percent -ge $low ] && [ $percent -lt $high ] && printf $icon_mid -[ $percent -ge $high ] && printf $icon_high -#printf "%s%% %s GHz\n" $percent $ghz -printf "%s%%\n" $percent diff --git a/i3blocks-cputemp.sh b/i3blocks-cputemp.sh deleted file mode 100755 index faac2de..0000000 --- a/i3blocks-cputemp.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -#low=122 # 50C -high=176 # 80C -#icon_low=󱃃 -#icon_mid=󰔏 -#icon_high=󱃂 -icon=󰔏 - -celcius=$(sysctl -n dev.cpu.0.temperature | cut -d'.' -f1) -#[ $celcius -lt $low ] && printf $icon_low -#[ $celcius -ge $low ] && [ $fahrenheit -lt $high ] && printf $icon_mid -#[ $celcius -ge $high ] && printf $icon_high -[ $celcius -ge $high ] && notify-send "CPU temperature hit 176F (80C)" - -#printf " %s C\n" $celcius - -# 'Murica -printf "$icon%s ℉\n" $(echo "scale=1; $celcius * 9 / 5 + 32" | bc -l) diff --git a/i3blocks-date.sh b/i3blocks-date.sh deleted file mode 100755 index 2c71451..0000000 --- a/i3blocks-date.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -icon=󰃰 - -printf "$icon%s\n" "$(date '+%a %b %e %l:%M %p')" diff --git a/i3blocks-disk.sh b/i3blocks-disk.sh deleted file mode 100755 index 704e03e..0000000 --- a/i3blocks-disk.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -icon=󰋊 - -printf "$icon%s\n" $(df -h | awk '$6=="/usr/home" { print $5 }') diff --git a/i3blocks-mail.sh b/i3blocks-mail.sh deleted file mode 100755 index 82e9582..0000000 --- a/i3blocks-mail.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -icon=󰶋 - -unread=$(ls ~/.mail/gmail/Inbox/new/ | wc -l | cut -w -f2) -[ $unread -gt 0 ] && printf "%s%s" $icon $unread -printf "\n" diff --git a/i3blocks-memory.sh b/i3blocks-memory.sh deleted file mode 100755 index dde8470..0000000 --- a/i3blocks-memory.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -icon=󰍛 - -printf "$icon%s\n" $(top -d 1 | grep Mem | cut -w -f2) diff --git a/i3blocks-net.sh b/i3blocks-net.sh deleted file mode 100755 index d0a87a4..0000000 --- a/i3blocks-net.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -icon_ethernet=󰈁 -icon_down=󰈂 -icon_wireless=󰖩 - -is_ethernet=$(ifconfig em0 | grep status | cut -d\: -f2) -inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3 | tr '\n' ' ') -if [ "$is_ethernet" = " active" ]; then - printf "%s%s" $icon_ethernet "$inet" -elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then - ssid=$(ifconfig wlan0 | sed -n 's/^.*ssid \(.*\) channel.*$/\1/p') - [ -n "$ssid" ] && printf "%s%s %s" $icon_wireless "$ssid" "$inet" -else - printf "%sOffline" $icon_down -fi - -printf "\n" diff --git a/i3blocks-news.sh b/i3blocks-news.sh deleted file mode 100755 index 5d64a47..0000000 --- a/i3blocks-news.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -icon=󰎕 - -unread=$(newsboat -x print-unread | cut -d' ' -f1) -[ $unread -gt 0 ] && printf "%s%s" $icon $unread -printf "\n" diff --git a/i3blocks-packages.sh b/i3blocks-packages.sh deleted file mode 100755 index f139e28..0000000 --- a/i3blocks-packages.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -icon=󰏖 - -doas pkg update 2>/dev/null >/dev/null -count=$(pkg upgrade -n | sed -n 's/^Number of packages to be upgraded:\(.*\)/\1/p') -[ -n "$count" ] && [ "$count" -gt 0 ] && printf "%s%s" $icon $count && notify-send "$count package upgrade(s) available" -printf "\n" diff --git a/i3blocks-screencast.sh b/i3blocks-screencast.sh deleted file mode 100755 index c9b7d21..0000000 --- a/i3blocks-screencast.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -icon=󰻂 -[ -f /tmp/cast.mkv ] && printf "$icon\n" || printf "\n" diff --git a/i3blocks-up.sh b/i3blocks-up.sh deleted file mode 100755 index 24db497..0000000 --- a/i3blocks-up.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -doas freebsd-update updatesready > /dev/null -[ $? -ne 2 ] && printf "󰣠Updates are available" $icon diff --git a/i3blocks-updates.sh b/i3blocks-updates.sh deleted file mode 100755 index 1da50ca..0000000 --- a/i3blocks-updates.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -icon=󰣠 - -doas freebsd-update updatesready > /dev/null -[ $? -eq 2 ] || printf "%sUpdates are available" $icon && notify-send "Updates are ready to install" diff --git a/i3blocks-uptime.sh b/i3blocks-uptime.sh deleted file mode 100755 index 778b71f..0000000 --- a/i3blocks-uptime.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -icon=󰣠 - -printf "$icon%s\n" "$(uptime | grep -o 'up[^,]*' )" diff --git a/i3blocks-weather.sh b/i3blocks-weather.sh deleted file mode 100755 index 40b186f..0000000 --- a/i3blocks-weather.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -curl "https://wttr.in/?format=2" diff --git a/innernet.sh b/innernet.sh deleted file mode 100755 index 38e1310..0000000 --- a/innernet.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Destroy existing interfaces -ifconfig lagg0 destroy -ifconfig wlan0 destroy - -# Ethernet up -ifconfig em0 up - -# Wireless create, up -# Note: use your ethernet device's MAC addr -ifconfig wlan0 create wlandev iwn0 wlanaddr 5c:26:0a:06:c1:d6 -ifconfig wlan0 up - -# Link aggregate create, up -# Creates a failover lagg that prefers em0 but uses wlan0 if em0 is unavailable -ifconfig lagg0 create laggproto failover laggport em0 laggport wlan0 -ifconfig lagg0 up - -# Use WPA supplicant to handle SSID/password wireless connection -wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf - -# Grab an IP for lagg device -dhclient lagg0 diff --git a/radar.sh b/radar.sh index 1b93f71..38fbfb2 100755 --- a/radar.sh +++ b/radar.sh @@ -1,4 +1,4 @@ #!/bin/sh -curl -o /tmp/radar.gif "https://radar.weather.gov/lite/N0R/AKQ_loop.gif" && sxiv -a -s f -b /tmp/radar.gif +fetch -o /tmp/radar.gif "https://radar.weather.gov/lite/N0R/AKQ_loop.gif" && sxiv -a -s f -b /tmp/radar.gif diff --git a/rank-mirrors.sh b/rank-mirrors.sh deleted file mode 100755 index ae9cf7d..0000000 --- a/rank-mirrors.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# https://adufray.com/blog/2016/10/24/finding-the-fastest-freebsd-mirror - -for i in {1..15}; do - echo -n "ftp${i}.us.freebsd.org: "; - curl -o /dev/null -m 30 ftp://ftp${i}.us.freebsd.org/pub/FreeBSD/development/CVS-archive/projcvs-projects-archive.tar.gz 2>&1 | \ - tail -1 | \ - egrep -o '[^[:cntrl:]]+$'; -done diff --git a/slock-fortune.sh b/slock-fortune.sh deleted file mode 100755 index 3b93b50..0000000 --- a/slock-fortune.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -slock -m "$(fortune /usr/share/games/fortune/)" diff --git a/toggle-compositing.sh b/toggle-compositing.sh deleted file mode 100755 index b183284..0000000 --- a/toggle-compositing.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -killall picom || exec picom & diff --git a/toggle-webcam.sh b/toggle-webcam.sh deleted file mode 100755 index ea543bb..0000000 --- a/toggle-webcam.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -#mpv --no-terminal --geometry=25%-10-40 --title="Live Webcam" -pkill pwcview || pwcview -f 30 -s sif & -- cgit v1.2.3