Compare commits
2 Commits
c051c228c2
...
da01ac5190
| Author | SHA1 | Date | |
|---|---|---|---|
| da01ac5190 | |||
| 330bcee0b6 |
@ -845,11 +845,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739247514,
|
||||
"narHash": "sha256-n19X1SBJANxFARRq+mpdHbcxsjZJTBmg4HPLVNUjg2A=",
|
||||
"lastModified": 1739408191,
|
||||
"narHash": "sha256-r0662zux0hM5OTdEMR3DLE6MlFNK9Xya8wmwRyKWCO0=",
|
||||
"owner": "kaylorben",
|
||||
"repo": "nixcord",
|
||||
"rev": "6696ee49650793e8a1d2def341c4fd75cc856f91",
|
||||
"rev": "13e0ab2cc99c9fd26121c50b7e75bda5745f17cf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
editor = "neovim"; # neovim, vscode
|
||||
|
||||
# List all themes: $ nix build nixpkgs#base16-schemes && ls result/share/themes
|
||||
theme = "evangelion-blood"; # catppuccin-mocha, tokyo-night-dark, one-dark
|
||||
theme = "catppuccin-mocha"; # catppuccin-mocha, tokyo-night-dark, one-dark
|
||||
background =
|
||||
if userSettings.theme == "catppuccin-mocha"
|
||||
then "aurora_borealis.png"
|
||||
|
||||
@ -6,7 +6,42 @@
|
||||
# Keyboard image for keyboard switch layout
|
||||
home.file = {
|
||||
".local/share/icons/kogami/keyboard.svg".source = ../../../../config/icons/keyboard.svg;
|
||||
".config/hypr/hypridle.conf".source = ./hypridle.conf;
|
||||
};
|
||||
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "hyprctl switchxkblayout at-translated-set-2-keyboard 0 ; pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 90; # 1.5min.
|
||||
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
on-resume = "brightnessctl -r"; # monitor backlight restore.
|
||||
}
|
||||
|
||||
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
|
||||
{
|
||||
timeout = 120; # 3min
|
||||
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
|
||||
}
|
||||
|
||||
{
|
||||
timeout = 210; # 3.5min
|
||||
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
|
||||
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
|
||||
}
|
||||
|
||||
{
|
||||
timeout = 1800; # 30min
|
||||
on-timeout = "systemctl suspend"; # suspend pc
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages =
|
||||
@ -91,33 +126,25 @@
|
||||
# Configuration variables (with default values)
|
||||
dock="''${BATTERY_NOTIFY_DOCK:-true}"
|
||||
batterynotify_conf="$HYDE_STATE_HOME/staterc"
|
||||
battery_full_threshold="''${BATTERY_NOTIFY_THRESHOLD_FULL:-100}"
|
||||
battery_critical_threshold="''${BATTERY_NOTIFY_THRESHOLD_CRITICAL:-5}"
|
||||
unplug_charger_threshold="''${BATTERY_NOTIFY_THRESHOLD_UNPLUG:-80}"
|
||||
battery_low_threshold="''${BATTERY_NOTIFY_THRESHOLD_LOW:-20}"
|
||||
timer="''${BATTERY_NOTIFY_TIMER:-120}"
|
||||
notify="''${BATTERY_NOTIFY_NOTIFY:-1140}"
|
||||
interval="''${BATTERY_NOTIFY_INTERVAL:-5}"
|
||||
execute_critical="''${BATTERY_NOTIFY_EXECUTE_CRITICAL:-systemctl suspend}"
|
||||
execute_low="''${BATTERY_NOTIFY_EXECUTE_LOW:-}"
|
||||
execute_unplug="''${BATTERY_NOTIFY_EXECUTE_UNPLUG:-}"
|
||||
execute_charging="''${BATTERY_NOTIFY_EXECUTE_CHARGING:-}"
|
||||
execute_discharging="''${BATTERY_NOTIFY_EXECUTE_DISCHARGING:-}"
|
||||
verbose=false
|
||||
state_file="/tmp/battery_notify_state"
|
||||
|
||||
# Display configuration info
|
||||
config_info() {
|
||||
cat <<EOF
|
||||
Modify $batterynotify_conf to set options.
|
||||
|
||||
STATUS THRESHOLD INTERVAL
|
||||
Full $battery_full_threshold $notify Minutes
|
||||
Critical $battery_critical_threshold $timer Seconds then '$execute_critical'
|
||||
Low $battery_low_threshold $interval Percent then '$execute_low'
|
||||
Unplug $unplug_charger_threshold $interval Percent then '$execute_unplug'
|
||||
STATUS THRESHOLD
|
||||
Critical $battery_critical_threshold then '$execute_critical'
|
||||
Low $battery_low_threshold then '$execute_low'
|
||||
|
||||
Charging: $execute_charging
|
||||
Discharging: $execute_discharging
|
||||
Notifications at: 80%, 90%, 100% (charging only).
|
||||
EOF
|
||||
}
|
||||
|
||||
@ -159,16 +186,23 @@
|
||||
battery_percentage=$((total_percentage / battery_count))
|
||||
}
|
||||
|
||||
# Check battery thresholds
|
||||
check_thresholds() {
|
||||
if [[ "$battery_percentage" -ge "$unplug_charger_threshold" && "$battery_status" != "Discharging" ]]; then
|
||||
notify_user "NORMAL" "Battery Charged" "Battery is at $battery_percentage%. You can unplug the charger!"
|
||||
elif [[ "$battery_percentage" -le "$battery_critical_threshold" ]]; then
|
||||
notify_user "CRITICAL" "Battery Critically Low" "$battery_percentage% remaining. Executing critical action."
|
||||
$execute_critical
|
||||
elif [[ "$battery_percentage" -le "$battery_low_threshold" && "$battery_status" == "Discharging" ]]; then
|
||||
notify_user "NORMAL" "Battery Low" "$battery_percentage% remaining. Connect the charger."
|
||||
$execute_low
|
||||
# Manage notifications for charging thresholds
|
||||
manage_charging_notifications() {
|
||||
local thresholds=(80 90 100)
|
||||
for threshold in "''${thresholds[@]}"; do
|
||||
if [[ "$battery_percentage" -ge "$threshold" && "$battery_status" == "Charging" ]]; then
|
||||
if ! grep -q "$threshold" "$state_file" 2>/dev/null; then
|
||||
notify_user "NORMAL" "Battery Charging" "Battery has reached $threshold%. Consider unplugging the charger."
|
||||
echo "$threshold" >> "$state_file"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Reset state when discharging
|
||||
reset_state_if_discharging() {
|
||||
if [[ "$battery_status" == "Discharging" ]]; then
|
||||
> "$state_file"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -176,7 +210,8 @@
|
||||
monitor_battery() {
|
||||
while :; do
|
||||
get_battery_info
|
||||
check_thresholds
|
||||
reset_state_if_discharging
|
||||
manage_charging_notifications
|
||||
sleep $interval
|
||||
done
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
general {
|
||||
lock_cmd = hyprctl switchxkblayout at-translated-set-2-keyboard 0 ; pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = loginctl lock-session # lock before suspend.
|
||||
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 90 # 1.5min.
|
||||
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
on-resume = brightnessctl -r # monitor backlight restore.
|
||||
}
|
||||
|
||||
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
|
||||
listener {
|
||||
timeout = 120 # 3min
|
||||
on-timeout = loginctl lock-session # lock screen when timeout has passed
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 210 # 3.5min
|
||||
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
|
||||
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 1800 # 30min
|
||||
on-timeout = systemctl suspend # suspend pc
|
||||
}
|
||||
@ -20,27 +20,119 @@
|
||||
"source" = "/home/shinya/.config/fastfetch/logo.png";
|
||||
"width" = 34;
|
||||
"height" = 18;
|
||||
"padding" = {
|
||||
"top" = 1;
|
||||
};
|
||||
};
|
||||
"modules" = [
|
||||
"break"
|
||||
"title"
|
||||
"separator"
|
||||
"os"
|
||||
"host"
|
||||
"kernel"
|
||||
"uptime"
|
||||
"packages"
|
||||
"shell"
|
||||
"de"
|
||||
"wm"
|
||||
"icons"
|
||||
"font"
|
||||
"cursor"
|
||||
"terminalfont"
|
||||
"cpu"
|
||||
"gpu"
|
||||
"disk"
|
||||
"break"
|
||||
{
|
||||
"type" = "title";
|
||||
"format" = "{#1}╭───────────── EVA 02 - {#}{user-name-colored}";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│ {#}System Information";
|
||||
}
|
||||
{
|
||||
"type" = "os";
|
||||
"key" = "{#separator}│ {#keys} OS";
|
||||
}
|
||||
{
|
||||
"type" = "kernel";
|
||||
"key" = "{#separator}│ {#keys} Kernel";
|
||||
}
|
||||
{
|
||||
"type" = "uptime";
|
||||
"key" = "{#separator}│ {#keys} Uptime";
|
||||
}
|
||||
{
|
||||
"type" = "packages";
|
||||
"key" = "{#separator}│ {#keys} Packages";
|
||||
"format" = "{all}";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│ {#}Desktop Environment";
|
||||
}
|
||||
{
|
||||
"type" = "de";
|
||||
"key" = "{#separator}│ {#keys} DE";
|
||||
}
|
||||
{
|
||||
"type" = "wm";
|
||||
"key" = "{#separator}│ {#keys} WM";
|
||||
}
|
||||
{
|
||||
"type" = "wmtheme";
|
||||
"key" = "{#separator}│ {#keys} Theme";
|
||||
}
|
||||
{
|
||||
"type" = "display";
|
||||
"key" = "{#separator}│ {#keys} Resolution";
|
||||
}
|
||||
{
|
||||
"type" = "shell";
|
||||
"key" = "{#separator}│ {#keys} Shell";
|
||||
}
|
||||
{
|
||||
"type" = "terminalfont";
|
||||
"key" = "{#separator}│ {#keys} Font";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│ {#}Hardware Information";
|
||||
}
|
||||
{
|
||||
"type" = "cpu";
|
||||
"key" = "{#separator}│ {#keys} CPU";
|
||||
}
|
||||
{
|
||||
"type" = "gpu";
|
||||
"key" = "{#separator}│ {#keys} GPU";
|
||||
}
|
||||
{
|
||||
"type" = "memory";
|
||||
"key" = "{#separator}│ {#keys} Memory";
|
||||
}
|
||||
{
|
||||
"type" = "disk";
|
||||
"key" = "{#separator}│ {#keys} Disk (/)";
|
||||
"folders" = "/";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}│";
|
||||
}
|
||||
{
|
||||
"type" = "custom";
|
||||
"format" = "{#1}╰───────────────────────────────╯";
|
||||
}
|
||||
#"separator"
|
||||
#"os"
|
||||
#"host"
|
||||
#"kernel"
|
||||
#"uptime"
|
||||
#"packages"
|
||||
#"shell"
|
||||
#"de"
|
||||
#"wm"
|
||||
#"icons"
|
||||
#"font"
|
||||
#"cursor"
|
||||
#"terminalfont"
|
||||
#"cpu"
|
||||
#"gpu"
|
||||
#"disk"
|
||||
#"break"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@ -58,7 +58,8 @@ in {
|
||||
|
||||
initExtra = ''
|
||||
${pkgs.pfetch}/bin/pfetch
|
||||
set -o emacs'';
|
||||
set -o emacs
|
||||
bindkey "^[[3~" delete-char'';
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user