diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-19 10:09:47 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-19 10:09:47 +0200 |
| commit | c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf (patch) | |
| tree | 1286eccbd051723e443c26b43e739007ee53dc06 | |
| parent | 2c065927ff405b2d8b2eec6fc1fbee9c4f93e0a8 (diff) | |
| download | scripts-c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf.tar.gz scripts-c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf.zip | |
Added notify
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 1 | ||||
| -rwxr-xr-x | battery-checknow | 2 | ||||
| -rwxr-xr-x | config-backup | 2 | ||||
| -rwxr-xr-x | dmenu-unmount | 3 | ||||
| -rwxr-xr-x | notify | 36 | ||||
| -rwxr-xr-x | status | 10 | ||||
| -rwxr-xr-x | xwallpaper-random-notify | 2 |
7 files changed, 48 insertions, 8 deletions
| @@ -18,6 +18,7 @@ SCRIPTS = addressgrep \ | |||
| 18 | ffmpeg-facecam \ | 18 | ffmpeg-facecam \ |
| 19 | mail-compose \ | 19 | mail-compose \ |
| 20 | mergepdf \ | 20 | mergepdf \ |
| 21 | notify \ | ||
| 21 | open-file \ | 22 | open-file \ |
| 22 | open-stdin \ | 23 | open-stdin \ |
| 23 | open-url \ | 24 | open-url \ |
diff --git a/battery-checknow b/battery-checknow index eb6335e..bde1ae2 100755 --- a/battery-checknow +++ b/battery-checknow | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | # Requires: battery-status, notify-battery | 4 | # Requires: battery-status, notify-battery |
| 5 | 5 | ||
| 6 | file="${XDG_DATA_HOME:-$HOME/.local/share}/batterystatus" | 6 | file="${XDG_DATA_HOME:-$HOME/.local/share}/batterystatus" |
| 7 | notify=herbe | 7 | notify="notify push" |
| 8 | low=20 | 8 | low=20 |
| 9 | crit=15 | 9 | crit=15 |
| 10 | 10 | ||
diff --git a/config-backup b/config-backup index ef25940..8d38791 100755 --- a/config-backup +++ b/config-backup | |||
| @@ -6,7 +6,7 @@ folder=$HOME/box/configbackups | |||
| 6 | 6 | ||
| 7 | dotfiles=".bash_profile .bashrc .profile .inputrc .mblaze .nexrc .tmux.conf .xinitrc" | 7 | dotfiles=".bash_profile .bashrc .profile .inputrc .mblaze .nexrc .tmux.conf .xinitrc" |
| 8 | config="colors fontconfig git imv msmtp zathura" | 8 | config="colors fontconfig git imv msmtp zathura" |
| 9 | src="dmenu dwm herbe st" | 9 | src="dmenu dwm st st-lightbg" |
| 10 | share="gmni" | 10 | share="gmni" |
| 11 | 11 | ||
| 12 | mkdir -p $folder/config $folder/home $folder/share $folder/src | 12 | mkdir -p $folder/config $folder/home $folder/share $folder/src |
diff --git a/dmenu-unmount b/dmenu-unmount index 57f0c41..2771ecc 100755 --- a/dmenu-unmount +++ b/dmenu-unmount | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | # Requires: udevil, dmenu (or similar), notify-send or similar (optional) | 6 | # Requires: udevil, dmenu (or similar), notify-send or similar (optional) |
| 7 | 7 | ||
| 8 | menu=dmenu | 8 | menu=dmenu |
| 9 | writeout=herbe | 9 | #writeout=notify-send |
| 10 | writeout="notify push" | ||
| 10 | 11 | ||
| 11 | while getopts "m:w:" opt; do | 12 | while getopts "m:w:" opt; do |
| 12 | case "$opt" in | 13 | case "$opt" in |
| @@ -0,0 +1,36 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Simple notification manager. | ||
| 4 | # Notifications are sent to a log file together with a time stamp. | ||
| 5 | # Requires: xroot-update (optional) | ||
| 6 | |||
| 7 | # Usage: notify [push MESSAGE | clean | edit | show] | ||
| 8 | |||
| 9 | update=xroot-update | ||
| 10 | file="${XDG_DATA_HOME:-.local/share}/notify" | ||
| 11 | date=$(date +'%H:%M') | ||
| 12 | |||
| 13 | usage() { | ||
| 14 | echo "Usage: notify [push MESSAGE | clean | edit | show]" | ||
| 15 | } | ||
| 16 | |||
| 17 | touch "$file" | ||
| 18 | case "$1" in | ||
| 19 | push) | ||
| 20 | echo "(Notified $date) $2" >> "$file" | ||
| 21 | $update | ||
| 22 | ;; | ||
| 23 | clean) | ||
| 24 | printf "" > "$file" | ||
| 25 | $update | ||
| 26 | ;; | ||
| 27 | edit) | ||
| 28 | $EDITOR "$file" | ||
| 29 | ;; | ||
| 30 | show) | ||
| 31 | cat "$file" | ||
| 32 | ;; | ||
| 33 | *) | ||
| 34 | usage | ||
| 35 | ;; | ||
| 36 | esac | ||
| @@ -26,14 +26,16 @@ else | |||
| 26 | battery="No battery" | 26 | battery="No battery" |
| 27 | fi | 27 | fi |
| 28 | 28 | ||
| 29 | #network=$(nmcli device status | head -n 2 | tail -n 1 | awk '{print "Network: " $4}') | ||
| 30 | # NetworkManager has a dreadful command line interface | 29 | # NetworkManager has a dreadful command line interface |
| 31 | # It makes cry every time | 30 | # It makes cry every time |
| 32 | # pls help | 31 | # pls help |
| 33 | network="Network: $(nmcli device status | head -n 2 | tail -n 1 | sed 's/ *$//' | sed 's/.* //')" | 32 | nwline="$(nmcli device status | head -n 2 | tail -n 1)" |
| 33 | nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')" | ||
| 34 | network="Network: $nwclean" | ||
| 34 | 35 | ||
| 35 | events=$(sdep-list past | wc -l) | 36 | noticount=$(notify show | wc -l) |
| 36 | 37 | ||
| 37 | printf "$network$sep$volume$sep$battery$sep$date$sep$time" | 38 | printf "$network$sep$volume$sep$battery$sep$date$sep$time" |
| 38 | [ "$events" != "0" ] && printf "$sep$events TODO task(s)" | 39 | [ "$noticount" = "1" ] && printf "$sep$(notify show)" |
| 40 | [ "$noticount" -gt "1" ] && printf "${sep}Unread notifications: $noticount" | ||
| 39 | printf "\n" | 41 | printf "\n" |
diff --git a/xwallpaper-random-notify b/xwallpaper-random-notify index b59a59f..6ab3d56 100755 --- a/xwallpaper-random-notify +++ b/xwallpaper-random-notify | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | # Requires: xwallpaper (or feh), notify-send or similar (optional) | 4 | # Requires: xwallpaper (or feh), notify-send or similar (optional) |
| 5 | 5 | ||
| 6 | #notify=notify-send | 6 | #notify=notify-send |
| 7 | notify=herbe | 7 | notify="notify push" |
| 8 | 8 | ||
| 9 | folder=~/pictures/wallpapers | 9 | folder=~/pictures/wallpapers |
| 10 | pic=$(ls $folder | sort -R | head -1) | 10 | pic=$(ls $folder | sort -R | head -1) |
