(Scripts)~Prefix every notify-send with script creating it
This commit is contained in:
@@ -23,4 +23,4 @@ end = current + duration
|
||||
while (time() <= end):
|
||||
sleep(1)
|
||||
|
||||
run(["notify-send", f"Alarm {name} complete"])
|
||||
run(["notify-send", f"alarm: Alarm {name} complete"])
|
||||
|
||||
@@ -7,9 +7,11 @@ folders="$HOME/Code $HOME/Dotfiles $HOME/Downloads $HOME/Media $HOME/Pictures $H
|
||||
|
||||
mkdir -p $dir
|
||||
|
||||
notify-send "do_backup: Starting backup (stored at $dir)"
|
||||
for name in $folders
|
||||
do
|
||||
out_name=$dir/$(basename $name).tar.xz
|
||||
XZ_OPT='-T0 -9' tar -Jcvf $out_name -C $name .
|
||||
done
|
||||
notify-send "do_backup: Finished backup"
|
||||
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
case "$(printf "new\nstop\nrestart\neshell\nmail" | dmenu -p "eserver: ")" in
|
||||
"restart")
|
||||
systemctl --user restart emacs;
|
||||
notify-send "Restarted Emacs server";;
|
||||
notify-send "eselect: Restarted Emacs server";;
|
||||
"stop")
|
||||
systemctl --user stop emacs;
|
||||
notify-send "Halted Emacs server";;
|
||||
notify-send "eselect: Halted Emacs server";;
|
||||
"new")
|
||||
notify-send "Launching Emacs";
|
||||
notify-send "eselect: Launching Emacs";
|
||||
emacsclient -c;;
|
||||
"eshell")
|
||||
notify-send "Launching Eshell";
|
||||
notify-send "eselect: Launching Eshell";
|
||||
emacsclient -c --eval '(let ((b (or (get-buffer "*eshell*") (eshell)))) (switch-to-buffer b))';;
|
||||
"mail")
|
||||
notify-send "Launching notmuch";
|
||||
notify-send "eselect: Launching notmuch";
|
||||
emacsclient -c --eval '(let ((b (or (get-buffer "*notmuch-hello*") (progn (notmuch) (get-buffer "*notmuch-hello*"))))) (switch-to-buffer b))';;
|
||||
esac
|
||||
|
||||
@@ -8,7 +8,7 @@ def speak(text: str, volume=100, word_gap=20):
|
||||
system(f'espeak -a {volume} -g {word_gap} -k 20 "{text}"')
|
||||
|
||||
def alert(text:str):
|
||||
run(["notify-send", text])
|
||||
run(["notify-send", "timer: " + text])
|
||||
|
||||
def beep(time):
|
||||
system(f"play -q -n synth {time} sin 880")
|
||||
|
||||
Reference in New Issue
Block a user