~ben/bin

a7187b84d01ec97cd68ead3394af54a970387967 — Ben Sima 11 months ago 6649bdf
add n, sysinfo, wal, weater
4 files changed, 31 insertions(+), 0 deletions(-)

A n
A sysinfo
A wal
A weather
A n => n +2 -0
@@ 0,0 1,2 @@
#!/usr/bin/env bash
notify-send $1 "$("$@")"

A sysinfo => sysinfo +24 -0
@@ 0,0 1,24 @@
#!/usr/bin/env bash
#A simple popup showing system information

HOST=$(uname -n)
KERNEL=$(uname -r)
UPTIME=$( uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, /d /'\
         | sed 's/ days, /d /' | sed 's/:/h /' | sed 's/ min//'\
           |  sed 's/,/m/' | sed 's/  / /')
PACKAGES=$(nix-env -q | wc -l)
#UPDATED=$(awk '/upgraded/ {line=$0;} END { $0=line; gsub(/[\[\]]/,"",$0); \
#         printf "%s %s",$1,$2;}' /var/log/pacman.log)

(
echo "System Information" # Fist line goes to title
# The following lines go to slave window
echo "host: $HOST "
echo "kernel: $KERNEL"
echo "uptime: $UPTIME "
echo "$PACKAGES packages"
#echo "Last updated on: $UPDATED"
) | dzen2 -p -x "500" -y "30" -w "220" -l "5" -sa 'l' -ta 'c'\
   -title-name 'popup_sysinfo' -e 'onstart=uncollapse;button1=exit;button3=exit'

# "onstart=uncollapse" ensures that slave window is visible from start.
\ No newline at end of file

A wal => wal +3 -0
@@ 0,0 1,3 @@
#!/usr/bin/env bash
file=$(ls ~/wallpaper | sort -R | tail -1)
feh --bg-fill ~/wallpaper/$file
\ No newline at end of file

A weather => weather +2 -0
@@ 0,0 1,2 @@
#!/usr/bin/env bash
curl wttr.in/92101