Fix spacing

This commit is contained in:
Hadi
2024-05-09 13:33:18 +02:00
parent a26fbaa2c3
commit abfe7ca839
15 changed files with 172 additions and 91 deletions

View File

@@ -9,6 +9,8 @@
./screenshot
./startup
./nerdfont_fzf
./system
./zip
./misc.nix
];

View File

@@ -1,8 +1,6 @@
# Nerdfetch: https://github.com/ThatOneCalculator/NerdFetch
{ pkgs, config, ... }:
let
homedir = config.home.homeDirectory;
nerdfetch = pkgs.writeShellScriptBin "nerdfetch" ''
ostype="$(uname)"
@@ -348,9 +346,9 @@ let
## USER VARIABLES -- YOU CAN CHANGE THESE
lc="$reset$bold$magenta" # labels
nc="$reset$bold$magenta" # user
hn="$reset$bold$magenta" # hostname
lc="$reset$bold''$${config.theme.colors.primary-ansi-16}" # labels
nc="$reset$bold''$${config.theme.colors.primary-ansi-16}" # labels
hn="$reset$bold''$${config.theme.colors.primary-ansi-16}" # labels
ic="$reset$white" # info
c0="$reset$grey" # first color
c1="$reset$white" # second color

View File

@@ -1,23 +1,8 @@
# File runned at startup by Hyprland
{ pkgs, config, ... }:
{ pkgs, ... }:
let
homedir = config.home.homeDirectory;
variable = import ../../../variables.nix;
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
'';
nextcloud-watch = pkgs.writeShellScriptBin "nextcloud-watch" ''
# Start nextcloud if I'm on my networks
while true;do
@@ -51,16 +36,9 @@ let
[[ ${toString variable.enableNextcloud} == "true" ]] && nextcloud-watch &
battery-notif &
sleep 2
echo "${toString variable.enableNextcloud}" > /tmp/nextcloud-enable
system-notif &
${pkgs.waybar}/bin/waybar &
'';
in {
home.packages = with pkgs; [
startup
battery-notif
nextcloud-watch
nextcloud-client
];
}
in { home.packages = with pkgs; [ startup nextcloud-watch nextcloud-client ]; }

View File

@@ -10,7 +10,6 @@ let
done
}
minute &
'';
@@ -19,9 +18,9 @@ let
OLD_BATTERY_STATUS=$(cat /tmp/old_battery_status 2>/dev/null || echo "Unknown")
if [[ $BATTERY_STATUS != $OLD_BATTERY_STATUS ]]; then
if [[ $BATTERY_STATUS == "Discharging" ]]; then
${pkgs.libnotify}/bin/notify-send "󰁻 " "Battery is unplugged"
${pkgs.libnotify}/bin/notify-send "󰚦 " "Battery is unplugged"
else
${pkgs.libnotify}/bin/notify-send "󰁻 " "Battery is plugged in"
${pkgs.libnotify}/bin/notify-send "󰚥 " "Battery is plugged in"
fi
fi
echo $BATTERY_STATUS > /tmp/old_battery_status
@@ -34,6 +33,8 @@ let
${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%"
elif [[ $BATTERY_LEVEL -eq 100 ]] && [[ $BATTERY_STATUS -ne "Discharging" ]]; then
${pkgs.libnotify}/bin/notify-send "󰁹 Fully charged"
fi
'';

View File

@@ -0,0 +1,21 @@
# From https://github.com/Frost-Phoenix/nixos-config
{ pkgs, ... }:
let
compress = pkgs.writeShellScriptBin "compress" ''
if (( $# == 1 )) then
# echo -ne "Archive name: "
# read name
# tar -cvzf "$name.tar.gz" $1
tar -cvzf "$1.tar.gz" $1
else
echo "Wrong number of arguments..."
fi
'';
extract = pkgs.writeShellScriptBin "extract" ''
for i in "$@" ; do
tar -xvzf $i
break
done
'';
in { home.packages = with pkgs; [ compress extract ]; }