summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-10-01 18:04:18 +0200
committerjoe <rbo@gmx.us>2025-10-01 18:04:18 +0200
commit74ecc98e528eac979e0820c9fa48955a186c0cc1 (patch)
treebe754babad6341d504daa4fe8c8433ca428fa595 /.local/bin
parentup (diff)
downloaddotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.gz
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.bz2
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.xz
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.tar.zst
dotfiles-bsd-74ecc98e528eac979e0820c9fa48955a186c0cc1.zip
up
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/dmscrot9
-rwxr-xr-x.local/bin/dtinit22
-rwxr-xr-x.local/bin/hddumnt12
-rwxr-xr-x.local/bin/kb2
-rwxr-xr-x.local/bin/linkview84
-rwxr-xr-x.local/bin/mic34
-rwxr-xr-x.local/bin/mixer-set35
-rwxr-xr-x.local/bin/powercmd49
-rwxr-xr-x.local/bin/ref-newsboat9
-rwxr-xr-x.local/bin/startemacs7
-rwxr-xr-x.local/bin/stopemacs4
-rwxr-xr-x.local/bin/swsnd7
12 files changed, 45 insertions, 229 deletions
diff --git a/.local/bin/dmscrot b/.local/bin/dmscrot
index dcefb70..6560d79 100755
--- a/.local/bin/dmscrot
+++ b/.local/bin/dmscrot
@@ -8,7 +8,7 @@ use constant {
SCREENSHOT_PATH => 'scrot',
IMGVIEW_PATH => 'nsxiv',
XCLIP_PATH => 'xclip',
- NOTIFY_PATH => 'notify-send'
+ NOTIFY_PATH => 'herbe'
};
use constant LIST => [
'select region',
@@ -36,11 +36,8 @@ sub notify_img
system(
NOTIFY_PATH,
- '-u', 'low',
- '-t', '2000',
- 'scrot',
- ' screenshot captured to ' . "\n" .
- '<b>' . $file . '</b>'
+ ' screenshot captured to ' . "\n" .
+ $file
);
return;
}
diff --git a/.local/bin/dtinit b/.local/bin/dtinit
deleted file mode 100755
index b583bb5..0000000
--- a/.local/bin/dtinit
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-startif() {
- pgrep "$1" >/dev/null || "$@" >/dev/null 2>&1 &
-}
-
-sysctl hw.snd.default_unit=4
-pgrep musicpd >/dev/null || musicpd >/dev/null 2>&1
-# "$HOME"/.local/bin/setwp
-"$HOME"/.local/bin/kb
-xset s off
-xset -dpms
-startif dunst
-startif picom
-startif lowbat
-startif mpd-notification
-startif xscreensaver --no-splash
-# ekb
-cd "$HOME"
-xrdb "$HOME"/.config/x11/xresources
-notify-send -u normal 'Welcome' " Welcome back, partner\!"
-# dbus-launch dwm
diff --git a/.local/bin/hddumnt b/.local/bin/hddumnt
index 9a5319b..deba4ed 100755
--- a/.local/bin/hddumnt
+++ b/.local/bin/hddumnt
@@ -6,25 +6,25 @@ mountpoint="$HOME/$devname"
case "$(hostname -s)" in
mother|po-rbo)
if ! doas umount "$mountpoint"; then
- notify-send -u critical 'exthdd' " failed to dismount <b>$mountpoint</b>"
+ herbe " failed to dismount $mountpoint"
fi
if ! doas cryptsetup close "$devname"; then
- notify-send -u critical 'exthdd' " failed to close crypt dev <b>$devname</b>"
+ herbe " failed to close crypt dev $devname"
fi
rmdir "$mountpoint"
- notify-send -t 5000 'exthdd' " crypt dev dismounted from <b>$mountpoint</b>"
+ herbe " crypt dev dismounted from $mountpoint"
;;
mars)
if ! mount | grep -F /dev/da0p1; then
- notify-send -u critical 'fathdd' ' HDD not mounted'
+ herbe ' HDD not mounted'
exit 1
fi
if ! umount /dev/da0p1.eli; then
- notify-send -u critical 'fathdd' ' Failed to dismount HDD'
+ herbe ' failed to dismount hdd'
exit 1
fi
geli detach da0p1.eli
rmdir "$HOME"/hdd
- notify-send -t 5000 'fathdd' ' HDD dismounted from <b>~/hdd</b>'
+ herbe ' hdd dismounted from ~/hdd'
;;
esac
diff --git a/.local/bin/kb b/.local/bin/kb
index c7d9bcf..24f7285 100755
--- a/.local/bin/kb
+++ b/.local/bin/kb
@@ -57,7 +57,7 @@ config_keyboard() {
xmodmap -e 'keycode 23 = Escape'
xmodmap -e 'keycode 37 ='
fi
- notify-send -u low -t 2000 'kb' ' kb set'
+ herbe ' kb set'
}
config_keyboard
diff --git a/.local/bin/linkview b/.local/bin/linkview
index ba671e3..a4183c3 100755
--- a/.local/bin/linkview
+++ b/.local/bin/linkview
@@ -23,7 +23,7 @@ use constant {
W3M_PATH => 'w3m',
BROWSER_PATH => $BROWSER,
ALT_BROWSER_PATH => 'surf',
- NOTIFYSEND_PATH => 'notify-send',
+ NOTIFYSEND_PATH => 'herbe',
COPYQ_PATH => 'copyq',
HOSTNAME => (split /\./, hostname())[0]
};
@@ -60,17 +60,12 @@ sub vid
close_io();
system(
NOTIFYSEND_PATH,
- '-t', '2000',
- 'playing media',
- ' playing <b>' . $article_name . '</b>'
+ ' playing ' . $article_name
);
if (system(MPV_PATH, "--force-window=yes", $url) != 0) {
exec(
NOTIFYSEND_PATH,
- '-u', 'critical',
- '-t', '10000',
- 'playback failed',
- ' failed to open <b>' . $url . '</b>'
+ ' failed to open ' . $url
);
}
return;
@@ -100,9 +95,7 @@ sub img_pdf
if (is_yt($url) != 0) {
system(
NOTIFYSEND_PATH,
- '-t', '5000',
- 'fetching thumbnail',
- ' fetching thumbnail for <b>' . $article_name . '</b>'
+ ' fetching thumbnail for ' . $article_name
);
($tmp, undef, $ret) = capture {
system(YTDL_PATH, '--get-thumbnail', $url);
@@ -111,9 +104,7 @@ sub img_pdf
if ($ret != 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- 'failed to get thumbnail',
- ' failed to get thumbail for <b>' . $article_name . '</b>'
+ ' failed to get thumbail for ' . $article_name
);
return;
}
@@ -122,9 +113,7 @@ sub img_pdf
else {
system(
NOTIFYSEND_PATH,
- '-t', '5000',
- 'download started',
- ' fetching <b>'. $file_name . '</b> to <b>/tmp</b>'
+ ' fetching ' . $file_name . ' to /tmp'
);
}
$file_name = $url;
@@ -149,9 +138,7 @@ sub img_pdf
if ($ret != 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- 'failed to open image',
- ' failed to open file <b>/tmp/'. $new_file_name . '</b>'
+ ' failed to open file /tmp/'. $new_file_name
);
}
unlink($new_file_name);
@@ -219,9 +206,7 @@ sub dl
$file_name =~ s/^[0-9]+/\[\.\.\.\]/;
system(
NOTIFYSEND_PATH,
- '-t', '2000',
- 'download starting',
- ' downloading <b>' . $file_name . '</b>'
+ ' downloading ' . $file_name
);
if (is_yt($url) != 0) {
$tmpfile = `mktemp`;
@@ -248,18 +233,13 @@ sub dl
if ($ret == 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'normal',
- 'download complete',
- ' <b>' . $file_name . '</b> downloaded successfully to ' .
- '<b>' . $pwd . '</b>'
+ ' ' . $file_name . ' downloaded successfully to ' . $pwd
);
}
else {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- 'download failed',
- ' failed to download <b>' . $file_name . '</b>'
+ ' failed to download ' . $file_name
);
}
return;
@@ -267,9 +247,7 @@ sub dl
elsif ($pid2 < 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- 'download failed',
- ' failed to <b>fork(2)</b>'
+ ' failed to fork(2)'
);
return;
}
@@ -280,12 +258,8 @@ sub dl
if (looks_like_number($val) != 0) {
system(
NOTIFYSEND_PATH,
- '-h',
- 'int:value:' . $val,
- '-u', 'low',
- '-t', '5000',
- 'downloading',
- ' downloading <b>' . $file_name . '</b>'
+ ' downloading ' . $file_name . ':
+ ' . $val
);
if ($val == 100 || system('pgrep yt-dlp >/dev/null 2>&1') != 0) {
last;
@@ -314,18 +288,13 @@ sub dl
if ($ret == 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'normal',
- 'download complete',
- ' <b>' . $file_name . '</b> downloaded successfully to ' .
- '<b>' . $pwd . '</b>'
+ ' ' . $file_name . ' downloaded successfully to ' . $pwd
);
}
else {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- 'download failed',
- ' failed to download <b>' . $file_name . '</b>'
+ ' failed to download ' . $file_name
);
}
}
@@ -334,10 +303,7 @@ sub dl
elsif ($pid < 0) {
system(
NOTIFYSEND_PATH,
- '-u', 'critical',
- '-t', '10000',
- 'download failed',
- ' failed to <b>fork(2)</b>'
+ ' failed to fork(2)'
);
return;
}
@@ -355,9 +321,7 @@ sub audio
close_io();
system(
NOTIFYSEND_PATH,
- '-t', '2000',
- 'playing media',
- ' playing <b>' . $article_name . '</b>'
+ ' playing ' . $article_name
);
if (system(
TERMINAL_PATH,
@@ -370,10 +334,7 @@ sub audio
) != 0) {
exec(
NOTIFYSEND_PATH,
- '-u', 'critical',
- '-t', '10000',
- 'playback failed',
- ' failed to open <b>' . $url . '</b>'
+ ' failed to open ' . $url
);
}
return;
@@ -393,10 +354,7 @@ sub w3m
if (system(TERMINAL_PATH, '-e', W3M_PATH, $url) != 0) {
exec(
NOTIFYSEND_PATH,
- '-u', 'critical',
- '-t', '10000',
- 'w3m failed',
- ' failed to open <b>' . $url . '</b>'
+ ' failed to open ' . $url
);
}
return;
@@ -451,8 +409,6 @@ sub clip
}
system(
NOTIFYSEND_PATH,
- '-t', '2000',
- 'clipped url',
' clipped url'
);
return;
@@ -488,8 +444,6 @@ sub get_yt_vid_name
system(
NOTIFYSEND_PATH,
- '-t', '4000',
- 'checking name',
' looking for video name'
);
$file_name = `yt-dlp -e $url`;
diff --git a/.local/bin/mic b/.local/bin/mic
index 492c773..31c9f43 100755
--- a/.local/bin/mic
+++ b/.local/bin/mic
@@ -7,7 +7,7 @@ use Sys::Hostname qw(hostname);
use constant {
MIXER_PATH => '/usr/sbin/mixer',
- NOTIF_PATH => '/usr/local/bin/notify-send'
+ NOTIF_PATH => '/usr/local/bin/herbe'
};
sub main
@@ -22,24 +22,14 @@ sub main
chomp $muted;
if ($muted eq "yes") {
system(
- '/usr/bin/notify-send',
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' muted'
+ '/usr/local/bin/herbe',
+ ' muted'
);
}
else {
system(
- '/usr/bin/notify-send',
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' restored'
+ '/usr/local/bin/herbe',
+ ' restored'
);
}
exit;
@@ -52,12 +42,7 @@ sub main
};
system(
NOTIF_PATH,
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' Microphone restored'
+ ' microphone restored'
);
}
else {
@@ -65,12 +50,7 @@ sub main
system(MIXER_PATH, 'rec', '0');
system(
NOTIF_PATH,
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' Microphone muted'
+ ' microphone muted'
);
};
}
diff --git a/.local/bin/mixer-set b/.local/bin/mixer-set
index 9963c91..24d6f21 100755
--- a/.local/bin/mixer-set
+++ b/.local/bin/mixer-set
@@ -28,9 +28,9 @@ sub main {
if ($host eq "po-rbo.ln.ysosecure.com") {
$curr_vol_cmd = "/usr/bin/pactl get-sink-volume \@DEFAULT_SINK\@ | /usr/bin/awk '{print \$5}'";
}
- my $ns = '/usr/local/bin/notify-send';
+ my $ns = '/usr/local/bin/herbe';
if (hostname() eq "po-rbo.ln.ysosecure.com") {
- $ns = '/usr/bin/notify-send';
+ $ns = '/usr/local/bin/herbe';
}
if ($ARGV[0] eq "lower" || $ARGV[0] eq "raise") {
if ($ARGV[0] eq "lower") {
@@ -55,17 +55,7 @@ sub main {
}
$curr_vol = `$curr_vol_cmd`;
chomp $curr_vol;
- system(
- $ns,
- '-h',
- 'int:value:' . $curr_vol,
- '-u',
- 'low',
- '-t',
- '1000',
- 'mixer-set',
- ' volume'
- );
+ system($ns, ' ' . $curr_vol);
system('kill -68 $(pidof dwmblocks)');
exit;
}
@@ -91,12 +81,7 @@ sub main {
}
system(
$ns,
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' muted'
+ ' muted'
);
system('kill -68 $(pidof dwmblocks)');
}
@@ -117,17 +102,7 @@ sub main {
);
};
}
- system(
- $ns,
- '-h',
- 'int:value:' . $curr_vol,
- '-u',
- 'low',
- '-t',
- '1750',
- 'mixer-set',
- ' restored'
- );
+ system($ns, ' ' . $curr_vol);
system('kill -68 $(pidof dwmblocks)');
}
exit;
diff --git a/.local/bin/powercmd b/.local/bin/powercmd
deleted file mode 100755
index 6e6c613..0000000
--- a/.local/bin/powercmd
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-[ -z "$1" ] && echo "no arg" && exit 1
-
-host="$(hostname -s)"
-case $host in
- mother) icon=" " ;;
- po-rbo) icon=" " ;;
- mars) icon=" " ;;
-esac
-
-case $1 in
- "lock") xscreensaver-command -lock ;;
- "sleep")
- notify-send -u normal "sleep" "$icon G'night, partner!"
- sleep 1
- xscreensaver-command -lock
- sleep 5
- case $host in
- mother) loginctl suspend ;;
- po-rbo) systemctl suspend ;;
- mars) acpiconf -s 3 ;;
- esac
- ;;
- "reboot")
- emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1
- notify-send -u normal reboot "$icon Rebootin' now!"
- sleep 2
- case $host in
- mother) loginctl reboot ;;
- po-rbo) systemctl reboot ;;
- mars) shutdown -r now ;;
- esac
- ;;
- "poweroff")
- emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1
- notify-send -u normal poweroff "$icon Farewell, partner!"
- sleep 2
- case $host in
- mother) loginctl poweroff ;;
- po-rbo) systemctl poweroff ;;
- mars) shutdown -p now ;;
- esac
- ;;
- *)
- echo "wrong arg"
- exit 1
- ;;
-esac
diff --git a/.local/bin/ref-newsboat b/.local/bin/ref-newsboat
index ca1aee1..08ee614 100755
--- a/.local/bin/ref-newsboat
+++ b/.local/bin/ref-newsboat
@@ -6,7 +6,7 @@ use Capture::Tiny qw(capture);
use constant {
NEWSBOAT_PATH => 'newsboat',
- NOTIFY_SEND_PATH => 'notify-send'
+ NOTIFY_SEND_PATH => 'herbe'
};
sub main
@@ -29,12 +29,7 @@ sub main
if ($stdout != 0) {
system(
NOTIFY_SEND_PATH,
- '-u',
- 'low',
- '-t',
- '4000',
- 'newsboat',
- ' <b>' . $stdout . '</b> new articles'
+ ' ' . $stdout . ' new articles'
);
}
return;
diff --git a/.local/bin/startemacs b/.local/bin/startemacs
deleted file mode 100755
index d0034d6..0000000
--- a/.local/bin/startemacs
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-
-if ! pgrep emacs >/dev/null; then
- emacs --daemon >/dev/null 2>&1
- exec notify-send -u low -t 2000 'emacs' ' Emacs daemonized'
-fi
diff --git a/.local/bin/stopemacs b/.local/bin/stopemacs
deleted file mode 100755
index d31541c..0000000
--- a/.local/bin/stopemacs
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-emacsclient -e '(save-buffers-kill-terminal)'
-exec notify-send -u low -t 2000 'emacs' ' Emacs daemon stoped'
diff --git a/.local/bin/swsnd b/.local/bin/swsnd
index d64a034..60feb1a 100755
--- a/.local/bin/swsnd
+++ b/.local/bin/swsnd
@@ -9,10 +9,7 @@ else if (`$cmd | rev | cut -d ' ' -f 1` == 0) then
else
$cmd=0 >&/dev/null
endif
-exec notify-send \
- -u low \
- -t 2000 \
- 'swsnd' \
- "Switched to `grep default /dev/sndstat | \
+exec herbe \
+ "Switched to `grep default /dev/sndstat | \
sed -e 's/.*<\(.*\)>.*/\1/' | \
sed -e 's/.*(\(.*\)).*/\1/'`"