aboutsummaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/battery-low-check5
-rwxr-xr-xlocal/bin/battery-low-notify14
-rw-r--r--local/share/applications/mutt.desktop4
-rw-r--r--local/share/applications/st-mutt.desktop4
-rw-r--r--local/share/mimeapps.list25
5 files changed, 18 insertions, 34 deletions
diff --git a/local/bin/battery-low-check b/local/bin/battery-low-check
deleted file mode 100755
index dbbdc6b..0000000
--- a/local/bin/battery-low-check
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-capacity=$(cat /sys/class/power_supply/BAT0/capacity)
-
-[ "$capacity" -lt 10 ] && notify-send -u critical "Battery low $capacity%"
diff --git a/local/bin/battery-low-notify b/local/bin/battery-low-notify
new file mode 100755
index 0000000..605ea91
--- /dev/null
+++ b/local/bin/battery-low-notify
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+battery_dir='/sys/class/power_supply/BAT0'
+
+[ ! -d "$battery_dir" ] && exit 1
+
+if [ "$(cat "$battery_dir/status")" != 'Charging' ]
+then
+ capacity="$(cat "$battery_dir/capacity")"
+ [ "$capacity" -lt 15 ] &&
+ notify-send -u critical "Battery low: $capacity%"
+fi
+
+exit 0
diff --git a/local/share/applications/mutt.desktop b/local/share/applications/mutt.desktop
deleted file mode 100644
index 24d0a48..0000000
--- a/local/share/applications/mutt.desktop
+++ /dev/null
@@ -1,4 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Mail client
-Exec=/usr/bin/mutt %u
diff --git a/local/share/applications/st-mutt.desktop b/local/share/applications/st-mutt.desktop
new file mode 100644
index 0000000..d15aff8
--- /dev/null
+++ b/local/share/applications/st-mutt.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=Mutt in an st terminal
+Exec=/usr/local/bin/st -e /usr/bin/mutt %u
diff --git a/local/share/mimeapps.list b/local/share/mimeapps.list
deleted file mode 100644
index 49a184b..0000000
--- a/local/share/mimeapps.list
+++ /dev/null
@@ -1,25 +0,0 @@
-[Default Applications]
-
-# from: https://git.lukesmith.xyz/dotfiles/file/.config/mimeapps.list
-
-# xdg-open will use these settings to determine how to open filetypes.
-# These .desktop entries can also be seen and changed in ~/.local/share/applications/
-
-# text/x-shellscript=text.desktop;
-# x-scheme-handler/magnet=torrent.desktop;
-# application/x-bittorrent=torrent.desktop;
-x-scheme-handler/mailto=mail.desktop;
-# text/plain=text.desktop;
-application/postscript=zathura.desktop;
-application/pdf=zathura.desktop;
-
-image/png=sxiv.desktop;
-image/jpeg=sxiv.desktop;
-image/gif=sxiv.desktop;
-image/svg+xml=sxiv.desktop;
-
-application/rss+xml=newsboat.desktop
-
-video/x-matroska=mpv.desktop
-# x-scheme-handler/lbry=lbry.desktop
-# inode/directory=file.desktop