cleanup and fixes
This commit is contained in:
parent
b4364f1922
commit
c880cd3410
@ -33,6 +33,7 @@
|
|||||||
inkscape
|
inkscape
|
||||||
gnome-disk-utility
|
gnome-disk-utility
|
||||||
qbittorrent
|
qbittorrent
|
||||||
|
prismlauncher
|
||||||
|
|
||||||
(writeShellScriptBin "nvidia-offload" ''
|
(writeShellScriptBin "nvidia-offload" ''
|
||||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||||
|
|||||||
@ -50,6 +50,61 @@
|
|||||||
echo "$battery_percentage% $battery_icon"
|
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"
|
(writeShellScriptBin "playerctl-hyprlock"
|
||||||
''
|
''
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = "${userSettings.username}";
|
userName = "${userSettings.username}";
|
||||||
userEmail = "sigma@goon.cz";
|
userEmail = "sigma@goon.com";
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -148,9 +148,5 @@
|
|||||||
#useTheme = "catppuccin_mocha";
|
#useTheme = "catppuccin_mocha";
|
||||||
useTheme = "kali";
|
useTheme = "kali";
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
oh-my-posh
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user