cleanup and fixes

This commit is contained in:
foglar 2025-04-18 14:39:28 +02:00
parent b4364f1922
commit c880cd3410
4 changed files with 57 additions and 5 deletions

View File

@ -33,6 +33,7 @@
inkscape
gnome-disk-utility
qbittorrent
prismlauncher
(writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1

View File

@ -50,6 +50,61 @@
echo "$battery_percentage% $battery_icon"
'')
(writeShellScriptBin "battery-hyprlock-legacy" ''
show_avg=0
show_charging=0
show_plugged=0
short_output=0
if [[ $# -eq 0 || " $* " == *" --help "* ]]; then
echo "Usage: $0 [--avg] [--charging] [--plugged] [--full] [--short]"
echo " --avg Show average battery percentage"
echo " --charging Show how many batteries are charging"
echo " --plugged Show if system is plugged in"
echo " --full Uses all show arguments"
echo " --short Use short output format"
exit 0
fi
for arg in "$@"; do
case $arg in
--avg) show_avg=1 ;;
--charging) show_charging=1 ;;
--plugged) show_plugged=1 ;;
--short) short_output=1 ;;
--full) show_avg=1; show_charging=1; show_plugged=1 ;;
*) echo "Unknown option: $arg"; echo "Use --help for usage."; exit 1 ;;
esac
done
batteries=(/sys/class/power_supply/BAT*)
total=0
count=0
charging=0
plugged_in=$(cat /sys/class/power_supply/AC*/online)
for bat in "''${batteries[@]}"; do
capacity=$(cat "$bat/capacity")
status=$(cat "$bat/status")
total=$((total + capacity))
count=$((count + 1))
[[ "$status" == "Charging" ]] && charging=$((charging + 1))
done
avg=$((total / count))
output=()
if [[ $short_output -eq 1 ]]; then
[[ $show_avg -eq 1 ]] && output+=("$avg ")
[[ $show_charging -eq 1 ]] && output+=("$charging/$count ")
[[ $show_plugged -eq 1 ]] && output+=("$plugged_in ")
echo "''${output[*]}"
else
[[ $show_avg -eq 1 ]] && echo "Avg: $avg%"
[[ $show_charging -eq 1 ]] && echo "Charging: $charging/$count"
[[ $show_plugged -eq 1 ]] && echo "Plugged: $plugged_in"
fi'')
(writeShellScriptBin "playerctl-hyprlock"
''
if [ $# -eq 0 ]; then

View File

@ -13,7 +13,7 @@
programs.git = {
enable = true;
userName = "${userSettings.username}";
userEmail = "sigma@goon.cz";
userEmail = "sigma@goon.com";
lfs.enable = true;
};

View File

@ -148,9 +148,5 @@
#useTheme = "catppuccin_mocha";
useTheme = "kali";
};
home.packages = with pkgs; [
oh-my-posh
];
};
}