diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-12 18:34:28 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-12 18:34:28 +0100 |
commit | 54dbc966d6a911dbb7bbd059f94f7e30c16e47bf (patch) | |
tree | c6a068dad02d0aac9de6f8540c1bfba7a52d0d6a | |
parent | Notifications update (diff) | |
download | dotfiles-bsd-54dbc966d6a911dbb7bbd059f94f7e30c16e47bf.tar.gz dotfiles-bsd-54dbc966d6a911dbb7bbd059f94f7e30c16e47bf.tar.bz2 dotfiles-bsd-54dbc966d6a911dbb7bbd059f94f7e30c16e47bf.tar.xz dotfiles-bsd-54dbc966d6a911dbb7bbd059f94f7e30c16e47bf.tar.zst dotfiles-bsd-54dbc966d6a911dbb7bbd059f94f7e30c16e47bf.zip |
New espeak script for dunst
-rw-r--r-- | .config/dunst/dunstrc | 6 | ||||
-rwxr-xr-x | .local/bin/dunst_espeak.sh | 7 | ||||
-rwxr-xr-x | .local/bin/install-port | 52 | ||||
-rwxr-xr-x | .local/bin/kb | 1 | ||||
-rwxr-xr-x | .local/bin/linkview | 2 | ||||
-rwxr-xr-x | .local/bin/setwp | 11 | ||||
-rwxr-xr-x | .local/bin/tsm-done.sh | 4 |
7 files changed, 24 insertions, 59 deletions
diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index ff41d57..6917eff 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -112,9 +112,9 @@ # NOTE: It might be helpful to run dunst -print in a terminal in order # to find fitting options for rules. -#[espeak] -# summary = "*" -# script = dunst_espeak.sh +[espeak] + summary = "*" + script = /home/jozan/.local/bin/dunst_espeak.sh #[script-test] # summary = "*script*" diff --git a/.local/bin/dunst_espeak.sh b/.local/bin/dunst_espeak.sh new file mode 100755 index 0000000..3d1aee1 --- /dev/null +++ b/.local/bin/dunst_espeak.sh @@ -0,0 +1,7 @@ +#!/usr/local/bin/dash + +[ "$5" = "LOW" ] && exit +echo $3 > $HOME/file +[ "$3" ] || exit +words=$(printf "$3" | sed 's/<b>//g' | sed 's/<\/b>//g' | sed 's/[^a-zA-Z0-9?!., ]//g') +espeak "$words" diff --git a/.local/bin/install-port b/.local/bin/install-port index 8b99de3..ca1f071 100755 --- a/.local/bin/install-port +++ b/.local/bin/install-port @@ -49,16 +49,6 @@ sub upgrdports { system('/usr/local/bin/dash', '-c', '/usr/local/bin/notify-send "Initiating upgrade" "Ports upgrade has started\nTotal: ' . $upgrd_nbr . ' to be updated" >/dev/null 2>&1'); - if ($upgrd_nbr == 1) { - system('/usr/local/bin/dash', - '-c', - '/usr/local/bin/espeak "Initiating ' . $upgrd_nbr . ' port upgrade" & >/dev/null 2>&1'); - } - else { - system('/usr/local/bin/dash', - '-c', - '/usr/local/bin/espeak "Initiating ' . $upgrd_nbr . ' ports upgrade" & >/dev/null 2>&1'); - } if (system('/usr/local/bin/dash', '-c', '/usr/local/bin/doas /usr/local/sbin/portmaster -dya --no-confirm') == 0) { @@ -68,9 +58,6 @@ sub upgrdports { system('/usr/local/bin/dash', '-c', '/usr/local/bin/notify-send "Upgrade complete!" "Ports upgrade installed successfully\nTotal: ' . $diff_nbr . ' installed" >/dev/null 2>&1'); - system('/usr/local/bin/dash', - '-c', - '/usr/local/bin/espeak "Success: $upnbr ports upgrade installed successfully" & >/dev/null 2>&1'); } else { my $failed_nbr = `$upgrd_nbr_cmd`; @@ -79,9 +66,6 @@ sub upgrdports { system('/usr/local/bin/dash', '-c', '/usr/local/bin/notify-send -u critical -t 10000 "Upgrade failed!" "Some ports failed to compile\nTotal: ' . $diff_nbr . ' installed - ' . $failed_nbr . ' failed" >/dev/null 2>&1'); - system('/usr/local/bin/dash', - '-c', - '/usr/local/bin/espeak "Failure: not all ports were upgraded - $diffnbr installed - $failednbr failed" & >/dev/null 2>&1'); } exit; } @@ -107,15 +91,6 @@ sub configport { 'Configuration success!', 'Ports config - ' . $port . ' - configured successfully', ); - my $pid; - $pid = fork(); - if (not $pid) { - exec( - '/usr/local/bin/espeak', - 'Success: ' . $port_basename . ' configured successfully. Initiating compilation.' - ); - exit; - } } } else { @@ -128,15 +103,6 @@ sub configport { 'Configuration failure!', 'Ports config - ' . $port . ' - failed to configure' ); - my $pid; - $pid = fork(); - if (not $pid) { - exec( - '/usr/local/bin/espeak', - 'Failure: failed to configure ' . $port_basename - ); - exit; - } } } @@ -154,15 +120,6 @@ sub installport { 'Compilation success!', 'Ports - ' . $port . ' - installed successfully' ); - my $pid; - $pid = fork(); - if (not $pid) { - exec( - '/usr/local/bin/espeak', - 'Success: ' . $port_basename . ' installed successfully' - ); - exit; - } } else { system( @@ -174,15 +131,6 @@ sub installport { 'Compilation failure!', 'Ports - ' . $port . ' - failed to install' ); - my $pid; - $pid = fork(); - if (not $pid) { - exec( - '/usr/local/bin/espeak', - 'Failure: failed to install ' . $port_basename - ); - exit; - } } } diff --git a/.local/bin/kb b/.local/bin/kb index 41d3fda..1b7a4ea 100755 --- a/.local/bin/kb +++ b/.local/bin/kb @@ -14,3 +14,4 @@ if ! xrandr | grep 'HDMI-1 connected' >/dev/null 2>&1; then xmodmap -e "add Control = Control_L" fi fi +notify-send -u low -t 2000 'kb' ' Keyboard set' diff --git a/.local/bin/linkview b/.local/bin/linkview index 704e42a..c14dbc9 100755 --- a/.local/bin/linkview +++ b/.local/bin/linkview @@ -76,7 +76,7 @@ sub open_link 'normal', '-t', '10000', - ' download complete', + 'download complete', ' <b>' . $file_name . '</b> downloaded successfully to ' . '<b>' . $pwd . '</b>' ); diff --git a/.local/bin/setwp b/.local/bin/setwp index a2689ff..54d6375 100755 --- a/.local/bin/setwp +++ b/.local/bin/setwp @@ -48,7 +48,16 @@ sub set_wp WP_FILE, '--bg-fill', WP_FILE - ); + ); + system( + 'notify-send', + '-u', + 'low', + '-t', + '2000', + 'setwp', + ' Wallpaper set' + ); return; } diff --git a/.local/bin/tsm-done.sh b/.local/bin/tsm-done.sh index 1f595ea..c95f71c 100755 --- a/.local/bin/tsm-done.sh +++ b/.local/bin/tsm-done.sh @@ -3,5 +3,5 @@ notify-send \ -u normal \ -t 10000 \ - ' Transmission' \ - 'Torrent downloaded' + 'Transmission' \ + ' Torrent downloaded' |