summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-09-06 08:26:26 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-09-06 08:26:26 -0400
commit8633c82378ab9b3a88b956def1a05cb76b4c11fd (patch)
tree94cefff77aa6f681d5ceba4bd64013965a2ec468
parentc8856a355b777156ccad4fd1f01d32e10684b0b4 (diff)
downloadscripts-8633c82378ab9b3a88b956def1a05cb76b4c11fd.tar.xz
scripts-8633c82378ab9b3a88b956def1a05cb76b4c11fd.zip
added freebsd US FTP mirror ranker
-rwxr-xr-xi3blocks-disk.sh2
-rwxr-xr-xi3blocks-net.sh4
-rwxr-xr-ximager.sh9
-rwxr-xr-xrank-mirrors.sh9
-rwxr-xr-xthemer.sh15
-rwxr-xr-xtoggle-screencast.sh2
6 files changed, 21 insertions, 20 deletions
diff --git a/i3blocks-disk.sh b/i3blocks-disk.sh
index c1ad745..704e03e 100755
--- a/i3blocks-disk.sh
+++ b/i3blocks-disk.sh
@@ -1,4 +1,4 @@
#!/bin/sh
icon=󰋊
-printf "$icon%s\n" $(df -h | awk '$6=="/" { print $5 }')
+printf "$icon%s\n" $(df -h | awk '$6=="/usr/home" { print $5 }')
diff --git a/i3blocks-net.sh b/i3blocks-net.sh
index abb241f..396faa6 100755
--- a/i3blocks-net.sh
+++ b/i3blocks-net.sh
@@ -8,8 +8,8 @@ if [ "$is_ethernet" = " active" ]; then
inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3)
printf "%s%s\n" $icon_ethernet $inet
elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then
- ssid=$(ifconfig wlan0 | grep ssid\ | cut -d'"' -f2)
- [ -n "$ssid" ] && printf "%s\"%s\"" $icon_wireless "$ssid"
+ ssid=$(ifconfig wlan0 | sed -n 's/^.*ssid \(.*\) channel.*$/\1/p')
+ [ -n "$ssid" ] && printf "%s%s" $icon_wireless "$ssid"
else
printf "%sNo connection" $icon_down
fi
diff --git a/imager.sh b/imager.sh
index 42e13f0..ef36b1c 100755
--- a/imager.sh
+++ b/imager.sh
@@ -1,9 +1,2 @@
#!/bin/sh
-ls *.bmp \
- *.jpg \
- *.jpeg \
- *.JPG \
- *.png \
- *.gif \
- *.webp \
- | xargs sxiv -a "$1"
+find . -type f -exec sxiv "$1" "{}" +
diff --git a/rank-mirrors.sh b/rank-mirrors.sh
new file mode 100755
index 0000000..ae9cf7d
--- /dev/null
+++ b/rank-mirrors.sh
@@ -0,0 +1,9 @@
+#!/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/themer.sh b/themer.sh
index b36c444..f195d1a 100755
--- a/themer.sh
+++ b/themer.sh
@@ -1,23 +1,23 @@
#!/bin/sh
add_theme() {
- indir="$1"
- [ -z "$indir" ] && indir=$HOME/downloads
- outdir=$HOME/.local/share/wallpapers
+ indir=$1
+ [ -z "$indir" ] && indir=~/downloads
+ outdir=~/.local/share/wallpapers
[ ! -d "$indir" ] && exit 1
[ ! -d "$outdir" ] && mkdir -p "$outdir"
sxiv -rot "$indir" | while read infile; do
- outfile="$outdir"/$(basename "$infile")
+ outfile=$outdir/$(basename "$infile" | tr ' ' '_' | tr '[:upper:]' '[:lower:]')
convert "$infile" -geometry '1920x1080^' -gravity center -crop 1920x1080+0+0 "$outfile"
wpg -a "$outfile"
done
}
set_theme() {
- theme=$(sxiv -rot $HOME/.config/wpg/wallpapers)
+ theme=$(sxiv -rot ~/.config/wpg/wallpapers)
[ -z "$theme" ] && exit 4
- wpg -s "$theme" &
- convert -verbose -background black -vignette 100x65000 "$theme" $HOME/.local/share/wallpapers/lock.png &
+ wpg -s "$theme"
+ #convert -verbose -background black -vignette 100x65000 "$theme" ~/.local/share/wallpapers/lock.png &
}
reapply_theme() {
@@ -27,4 +27,3 @@ reapply_theme() {
[ "$1" = "-r" ] && reapply_theme && exit
[ "$1" = "-a" ] && add_theme "$2"
[ "$1" = "-s" ] && set_theme
-wait
diff --git a/toggle-screencast.sh b/toggle-screencast.sh
index dc26d63..0a23d41 100755
--- a/toggle-screencast.sh
+++ b/toggle-screencast.sh
@@ -2,7 +2,7 @@
## Config
output_dir=~/videos/screencasts
-sound_device=/dev/dsp6
+sound_device=/dev/dsp5
## Start recording