Compare commits
2 Commits
621e97d8f1
...
d5f72ee2fd
Author | SHA1 | Date |
---|---|---|
Sam | d5f72ee2fd | |
Sam | 46018fb461 |
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
# Notification scripts
|
# Notification scripts
|
||||||
./scripts/dunstify-volume-notification.nix
|
./scripts/dunstify-volume-notification.nix
|
||||||
|
./scripts/dunstify-battery-notification.nix
|
||||||
|
|
||||||
# Helper scripts
|
# Helper scripts
|
||||||
./scripts/emoji-picker.nix
|
./scripts/emoji-picker.nix
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
./scripts/git-commit-ai.nix
|
./scripts/git-commit-ai.nix
|
||||||
./scripts/aichat-wrapper.nix
|
./scripts/aichat-wrapper.nix
|
||||||
./scripts/dmenu-wifi.nix
|
./scripts/dmenu-wifi.nix
|
||||||
|
./scripts/battery-status.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
(pkgs.writeShellScriptBin "battery-status" ''
|
||||||
|
status=$(${pkgs.acpi}/bin/acpi)
|
||||||
|
bat_name=$(echo "$status" | grep -o -e "^[Aa-Zz]*\s[0-9]:")
|
||||||
|
bat_status=$(echo $status | grep -o -e "[A-Z][a-z]*," | sed "s/,//")
|
||||||
|
bat_pct=$(echo $status | grep -o -e "[0-9]*%")
|
||||||
|
bat_time=$(echo $status | grep -o -e "[0-9]*:[0-9]*:[0-9]* [a-z].*")
|
||||||
|
power=$(cat /sys/class/power_supply/BAT0/power_now)
|
||||||
|
power_watts=$(${pkgs.bc}/bin/bc <<< "scale=3; $power / 1000000")
|
||||||
|
|
||||||
|
echo -e "$bat_name ($bat_status)\nCharge: $bat_pct\nTime: $bat_time\nPower consumption: $power_watts W "
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
(pkgs.writeShellScriptBin "dunstify-battery-notification" ''
|
||||||
|
msgTag="battery-notify"
|
||||||
|
${pkgs.dunst}/bin/dunstify -a "batteryNotify" -u critical -i battery-notify -h string:x-dunst-stack-tag:$msgTag "Battery Status" "$(battery-status)" -t 5000
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
|
@ -15,21 +15,9 @@
|
||||||
XF86AudioMicMute
|
XF86AudioMicMute
|
||||||
pamixer --default-source --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
|
pamixer --default-source --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
|
||||||
|
|
||||||
XF86MonBrightnessUp
|
|
||||||
light -A 5 && dunstify-brightness-notification
|
|
||||||
|
|
||||||
XF86MonBrightnessDown
|
|
||||||
light -U 5 && dunstify-brightness-notification
|
|
||||||
|
|
||||||
XF86Messenger
|
XF86Messenger
|
||||||
dunstify-battery-notification
|
dunstify-battery-notification
|
||||||
|
|
||||||
control + Home
|
|
||||||
bookmark-add
|
|
||||||
|
|
||||||
control + Insert
|
|
||||||
bookmark-insert
|
|
||||||
|
|
||||||
control + F8
|
control + F8
|
||||||
clipboard-image-recall /tmp/clipboard/images/
|
clipboard-image-recall /tmp/clipboard/images/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue