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