tidying
This commit is contained in:
parent
0728b2f34c
commit
690d21c949
9 changed files with 1 additions and 174 deletions
|
|
@ -26,11 +26,10 @@
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
- `home/` all user-level options
|
- `home/` all user-level options
|
||||||
- `/home/scripts` what it says on the tin
|
|
||||||
- `/home/desktop` all desktop/wm and related options
|
- `/home/desktop` all desktop/wm and related options
|
||||||
- `/home/terminal` all terminal and cli options
|
- `/home/terminal` all terminal and cli options
|
||||||
|
- `/home/resources` wallpapers, themes, icons, etc.
|
||||||
- `/home/multimedia` all media consumption options
|
- `/home/multimedia` all media consumption options
|
||||||
- `/home/resouces` wallpapers, themes, icons, etc.
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ in {
|
||||||
./desktop
|
./desktop
|
||||||
./terminal
|
./terminal
|
||||||
./multimedia
|
./multimedia
|
||||||
./scripts
|
|
||||||
];
|
];
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "24.11"; # IMPORTANT
|
stateVersion = "24.11"; # IMPORTANT
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
let
|
|
||||||
|
|
||||||
## Battery status for laptop
|
|
||||||
battery-notif = pkgs.writeShellScriptBin "battery-notif" ''
|
|
||||||
# Send notifications when low on battery and not in charge
|
|
||||||
while true; do
|
|
||||||
battery_level=$(cat /sys/class/power_supply/BAT*/capacity)
|
|
||||||
battery_status=$(cat /sys/class/power_supply/BAT*/status)
|
|
||||||
if [[ $battery_level -le 20 ]] && [[ $battery_status == "Discharging" ]]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send " Low battery" "Battery level is $battery_level%"
|
|
||||||
elif [[ $battery_level -le 10 ]] && [[ $battery_status == "Discharging" ]]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send --urgency=critical " Very low battery" "Battery level is $battery_level%"
|
|
||||||
fi
|
|
||||||
sleep 60
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
in { home.packages = [ battery-notif ]; }
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./startup.nix # Programs and scripts executed upon entering desktop environments
|
|
||||||
./desktop.nix # Programs and scripts essential to operating desktop environments
|
|
||||||
./battery.nix # Script for interfacing with batteries present on certain devices
|
|
||||||
./nix-utils.nix # Programs and scripts for interacting with NixOS infrastructure
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
increments = "5";
|
|
||||||
|
|
||||||
menu = pkgs.writeShellScriptBin "menu" ''
|
|
||||||
if pgrep wofi; then
|
|
||||||
pkill wofi
|
|
||||||
else
|
|
||||||
${pkgs.wofi}/bin/wofi --show drun
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
powermenu = pkgs.writeShellScriptBin "powermenu" ''
|
|
||||||
if pgrep wlogout; then
|
|
||||||
pkill wlogout
|
|
||||||
else
|
|
||||||
${pkgs.wlogout}/bin/wlogout
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
brightness-up = pkgs.writeShellScriptBin "brightness-up" ''
|
|
||||||
brightness-change up ${increments}
|
|
||||||
'';
|
|
||||||
|
|
||||||
brightness-down = pkgs.writeShellScriptBin "brightness-down" ''
|
|
||||||
brightness-change down ${increments}
|
|
||||||
'';
|
|
||||||
|
|
||||||
brightness-change = pkgs.writeShellScriptBin "brightness-change" ''
|
|
||||||
sleep 0.05
|
|
||||||
|
|
||||||
[[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ${increments}%+
|
|
||||||
[[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ${increments}%-
|
|
||||||
|
|
||||||
brightness_level=$(${pkgs.brightnessctl}/bin/brightnessctl get)
|
|
||||||
|
|
||||||
message=" Brightness: $brightness_level%"
|
|
||||||
|
|
||||||
${pkgs.libnotify}/bin/notify-send "$message" \
|
|
||||||
-h int:value:"$brightness_level" \
|
|
||||||
--replace-id="$(cat "/tmp/nixy-notification" 2>/dev/null || echo 0)" --print-id > "/tmp/nixy-notification"
|
|
||||||
'';
|
|
||||||
|
|
||||||
screenshot = pkgs.writeShellScriptBin "screenshot" ''
|
|
||||||
if [[ $2 == "swappy" ]];then
|
|
||||||
folder="/tmp"
|
|
||||||
else
|
|
||||||
folder="$HOME/Pictures/screenshots"
|
|
||||||
fi
|
|
||||||
filename="$(date +%Y-%m-%d_%H:%M:%S).png"
|
|
||||||
mode="region" # Default to region
|
|
||||||
|
|
||||||
if [[ $1 == "window" ]];then
|
|
||||||
mode="window"
|
|
||||||
elif [[ $1 == "monitor" ]];then
|
|
||||||
mode="output"
|
|
||||||
fi
|
|
||||||
|
|
||||||
${pkgs.hyprshot}/bin/hyprshot -m $mode -o $folder -f $filename -s || exit 1
|
|
||||||
|
|
||||||
if [[ $2 == "swappy" ]];then
|
|
||||||
${pkgs.swappy}/bin/swappy -f "$folder/$filename" -o "$HOME/Pictures/screenshots/$filename"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
message=" Screenshot saved"
|
|
||||||
|
|
||||||
${pkgs.libnotify}/bin/notify-send "$message" \
|
|
||||||
--icon="$folder/$filename" \
|
|
||||||
--replace-id="$(cat "/tmp/nixy-notification" 2>/dev/null || echo 0)" --print-id > "/tmp/nixy-notification"
|
|
||||||
'';
|
|
||||||
|
|
||||||
vault = pkgs.writeShellScriptBin "vault" ''
|
|
||||||
nvim $HOME/Nextcloud/obsidian
|
|
||||||
'';
|
|
||||||
|
|
||||||
in {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
menu
|
|
||||||
powermenu
|
|
||||||
brightness-up
|
|
||||||
brightness-down
|
|
||||||
brightness-change
|
|
||||||
screenshot
|
|
||||||
hyprshot
|
|
||||||
vault
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
{ pkgs, hostname, flakePath, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
nixrb = pkgs.writeShellScriptBin "nixrb" ''
|
|
||||||
cd ${flakePath} && sudo nixos-rebuild switch --flake .#${hostname} --show-trace
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixcb = pkgs.writeShellScriptBin "nixcb" ''
|
|
||||||
sudo /run/current-system/bin/switch-to-configuration boot
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixgc = pkgs.writeShellScriptBin "nixgc" ''
|
|
||||||
cd ${flakePath} && sudo nix-collect-garbage -d
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixu = pkgs.writeShellScriptBin "nixu" ''
|
|
||||||
cd ${flakePath} && sudo nix flake update
|
|
||||||
'';
|
|
||||||
|
|
||||||
in {
|
|
||||||
home.packages = [
|
|
||||||
nixrb
|
|
||||||
nixcb
|
|
||||||
nixgc
|
|
||||||
nixu
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{ pkgs, wallpaper, ... }:
|
|
||||||
let
|
|
||||||
|
|
||||||
startup = pkgs.writeShellScriptBin "startup" ''
|
|
||||||
|
|
||||||
systemctl --user start sops-nix
|
|
||||||
|
|
||||||
systemctl --user start hyprpolkitagent
|
|
||||||
|
|
||||||
swww init & sleep 0.1
|
|
||||||
|
|
||||||
swww img ${wallpaper}
|
|
||||||
'';
|
|
||||||
|
|
||||||
startupExtra = pkgs.writeShellScriptBin "startupExtra" ''
|
|
||||||
|
|
||||||
otd-gui
|
|
||||||
|
|
||||||
easyeffects
|
|
||||||
'';
|
|
||||||
|
|
||||||
in { home.packages = [ startup startupExtra ]; }
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue