Compare commits

..

2 Commits

Author SHA1 Message Date
da01ac5190 cleanup and fixes
- hypridle
- fastfetch
2025-02-15 21:00:13 +01:00
330bcee0b6 flake.lock: Update
Flake lock file updates:

• Updated input 'nixcord':
    'github:kaylorben/nixcord/6696ee49650793e8a1d2def341c4fd75cc856f91?narHash=sha256-n19X1SBJANxFARRq%2BmpdHbcxsjZJTBmg4HPLVNUjg2A%3D' (2025-02-11)
  → 'github:kaylorben/nixcord/13e0ab2cc99c9fd26121c50b7e75bda5745f17cf?narHash=sha256-r0662zux0hM5OTdEMR3DLE6MlFNK9Xya8wmwRyKWCO0%3D' (2025-02-13)
2025-02-13 21:34:57 +01:00
6 changed files with 264 additions and 164 deletions

View File

@ -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": {

View File

@ -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"

View File

@ -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 =
@ -88,131 +123,131 @@
'')
(writeShellScriptBin "battery-notify" ''
# 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
# Configuration variables (with default values)
dock="''${BATTERY_NOTIFY_DOCK:-true}"
batterynotify_conf="$HYDE_STATE_HOME/staterc"
battery_critical_threshold="''${BATTERY_NOTIFY_THRESHOLD_CRITICAL:-5}"
battery_low_threshold="''${BATTERY_NOTIFY_THRESHOLD_LOW:-20}"
timer="''${BATTERY_NOTIFY_TIMER:-120}"
interval="''${BATTERY_NOTIFY_INTERVAL:-5}"
execute_critical="''${BATTERY_NOTIFY_EXECUTE_CRITICAL:-systemctl suspend}"
execute_low="''${BATTERY_NOTIFY_EXECUTE_LOW:-}"
verbose=false
state_file="/tmp/battery_notify_state"
# Display configuration info
config_info() {
cat <<EOF
Modify $batterynotify_conf to set options.
# 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
EOF
}
Notifications at: 80%, 90%, 100% (charging only).
EOF
}
# Check if system is a laptop
is_laptop() {
if ! grep -q "Battery" /sys/class/power_supply/BAT*/type 2>/dev/null; then
echo "No battery detected. Exiting."
exit 0
fi
}
# Check if system is a laptop
is_laptop() {
if ! grep -q "Battery" /sys/class/power_supply/BAT*/type 2>/dev/null; then
echo "No battery detected. Exiting."
exit 0
fi
}
# Display verbose information
fn_verbose() {
if $verbose; then
echo "============================================="
echo "Battery Status: $battery_status"
echo "Battery Percentage: $battery_percentage"
echo "============================================="
fi
}
# Display verbose information
fn_verbose() {
if $verbose; then
echo "============================================="
echo "Battery Status: $battery_status"
echo "Battery Percentage: $battery_percentage"
echo "============================================="
fi
}
# Handle battery notifications
notify_user() {
local urgency=$1
local title=$2
local message=$3
notify-send -a "HyDE Power" -t 5000 -u "$urgency" "$title" "$message"
}
# Handle battery notifications
notify_user() {
local urgency=$1
local title=$2
local message=$3
notify-send -a "HyDE Power" -t 5000 -u "$urgency" "$title" "$message"
}
# Get battery status and percentage
get_battery_info() {
local total_percentage=0 battery_count=0
for battery in /sys/class/power_supply/BAT*; do
battery_status=$(<"$battery/status")
battery_percentage=$(<"$battery/capacity")
total_percentage=$((total_percentage + battery_percentage))
battery_count=$((battery_count + 1))
done
battery_percentage=$((total_percentage / battery_count))
}
# Get battery status and percentage
get_battery_info() {
local total_percentage=0 battery_count=0
for battery in /sys/class/power_supply/BAT*; do
battery_status=$(<"$battery/status")
battery_percentage=$(<"$battery/capacity")
total_percentage=$((total_percentage + battery_percentage))
battery_count=$((battery_count + 1))
done
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
fi
}
# 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
}
# Monitor battery status changes
monitor_battery() {
while :; do
get_battery_info
check_thresholds
sleep $interval
done
}
# Reset state when discharging
reset_state_if_discharging() {
if [[ "$battery_status" == "Discharging" ]]; then
> "$state_file"
fi
}
# Main function
main() {
is_laptop
config_info
if $verbose; then
echo "Verbose Mode is ON."
fi
monitor_battery
}
# Monitor battery status changes
monitor_battery() {
while :; do
get_battery_info
reset_state_if_discharging
manage_charging_notifications
sleep $interval
done
}
# Parse script arguments
case "$1" in
-i|--info)
config_info
exit 0
;;
-v|--verbose)
verbose=true
;;
-h|--help|*)
cat <<HELP
Usage: $0 [options]
# Main function
main() {
is_laptop
config_info
if $verbose; then
echo "Verbose Mode is ON."
fi
monitor_battery
}
[-i|--info] Display configuration information
[-v|--verbose] Enable verbose mode
[-h|--help] Show this help message
HELP
exit 0
;;
esac
# Parse script arguments
case "$1" in
-i|--info)
config_info
exit 0
;;
-v|--verbose)
verbose=true
;;
-h|--help|*)
cat <<HELP
Usage: $0 [options]
main
[-i|--info] Display configuration information
[-v|--verbose] Enable verbose mode
[-h|--help] Show this help message
HELP
exit 0
;;
esac
main
'')
#(writeShellScriptBin "windowpin")

View File

@ -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
}

View File

@ -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"
];
};
};

View File

@ -58,7 +58,8 @@ in {
initExtra = ''
${pkgs.pfetch}/bin/pfetch
set -o emacs'';
set -o emacs
bindkey "^[[3~" delete-char'';
};
})
];