diff --git a/home/home.nix b/home/home.nix index 14fabb3..4398f14 100644 --- a/home/home.nix +++ b/home/home.nix @@ -40,6 +40,7 @@ in { curl ripgrep neovide + wf-recorder tree # temp # Just cool diff --git a/home/scripts/default.nix b/home/scripts/default.nix index 789431f..6d13b91 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -9,6 +9,8 @@ ./screenshot ./startup ./nerdfont_fzf + ./system + ./zip ./misc.nix ]; diff --git a/home/scripts/nerdfetch/default.nix b/home/scripts/nerdfetch/default.nix index e5de25b..3e0d3cf 100644 --- a/home/scripts/nerdfetch/default.nix +++ b/home/scripts/nerdfetch/default.nix @@ -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 diff --git a/home/scripts/startup/default.nix b/home/scripts/startup/default.nix index 9e3ecb3..55ef973 100644 --- a/home/scripts/startup/default.nix +++ b/home/scripts/startup/default.nix @@ -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 ]; } diff --git a/home/scripts/system/default.nix b/home/scripts/system/default.nix index 67c5a5d..97ae457 100644 --- a/home/scripts/system/default.nix +++ b/home/scripts/system/default.nix @@ -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 ''; diff --git a/home/scripts/zip/default.nix b/home/scripts/zip/default.nix new file mode 100644 index 0000000..0276187 --- /dev/null +++ b/home/scripts/zip/default.nix @@ -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 ]; } diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix index 1ce3c82..4a29fa4 100644 --- a/home/system/hyprland/default.nix +++ b/home/system/hyprland/default.nix @@ -106,6 +106,7 @@ in { "QT_QPA_PLATFORM=wayland,xcb" "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" "GTK_THEME,Flat-Remix-GTK-Violet-Darkest-Solid:dark" + # "GTK_THEME,Nixy-GTK" # "HYPRCURSOR_THEME,rose-pine-hyprcursor" # "HYPRCURSOR_SIZE,16" ]; diff --git a/home/system/hyprland/hyprlock.nix b/home/system/hyprland/hyprlock.nix index 7772ee8..a1f4378 100644 --- a/home/system/hyprland/hyprlock.nix +++ b/home/system/hyprland/hyprlock.nix @@ -30,7 +30,7 @@ fade_on_empty = true placeholder_text = Password... # Text rendered in the input box when it's empty. hide_input = false - position = 0, 50 + position = 0, 80 halign = center valign = bottom } diff --git a/home/system/shell/zsh.nix b/home/system/shell/zsh.nix index 4cadf72..ce804a3 100644 --- a/home/system/shell/zsh.nix +++ b/home/system/shell/zsh.nix @@ -9,11 +9,12 @@ syntaxHighlighting.enable = true; historySubstringSearch.enable = true; - # If the variable config.theme.print-neofetch is set to true, neofetch will be printed initExtraFirst = '' bindkey -e - ${if config.theme.print-neofetch then + ${if config.theme.neofetch == "neofetch" then pkgs.neofetch + "/bin/neofetch" + else if config.theme.neofetch == "nerdfetch" then + "nerdfetch" else ""} ''; diff --git a/home/system/waybar/default.nix b/home/system/waybar/default.nix index 42ce7a5..3149348 100644 --- a/home/system/waybar/default.nix +++ b/home/system/waybar/default.nix @@ -12,9 +12,12 @@ layer = "top"; position = "top"; spacing = 0; - "margin-top" = config.theme.gaps-out; - "margin-left" = config.theme.gaps-out; - "margin-right" = config.theme.gaps-out; + "margin-top" = + if config.theme.waybar.float then config.theme.gaps-out else 0; + "margin-left" = + if config.theme.waybar.float then config.theme.gaps-out else 0; + "margin-right" = + if config.theme.waybar.float then config.theme.gaps-out else 0; height = 44; modules-left = [ "custom/logo" "hyprland/window" ]; modules-center = [ "hyprland/workspaces" ]; @@ -129,19 +132,29 @@ window#waybar { background-color: ${ - if config.theme.waybar-transparent then + if config.theme.waybar.transparent then "rgba(0, 0, 0, 0)" else "#${config.theme.colors.bg}" }; transition-property: background-color; transition-duration: 0.5s; - border-radius: ${toString config.theme.rounding}px; + border-radius: ${ + if config.theme.waybar.float then + toString config.theme.rounding + else + "0" + }px; font-size: 13px; } .modules-left, .modules-center, .modules-right { - border-radius: ${toString config.theme.rounding}px; + border-radius: ${ + if config.theme.waybar.float then + toString config.theme.rounding + else + "0" + }px; background-color: #${config.theme.colors.bg}; padding: 2px 6px; } diff --git a/home/themes/config/load_colors.nix b/home/themes/config/load_colors.nix new file mode 100644 index 0000000..08ec008 --- /dev/null +++ b/home/themes/config/load_colors.nix @@ -0,0 +1,38 @@ +{ config, ... }: { + config.theme.colors.primary-ansi-16-number = + if config.theme.colors.primary-ansi-16 == "black" then + 0 + else if config.theme.colors.primary-ansi-16 == "red" then + 1 + else if config.theme.colors.primary-ansi-16 == "green" then + 2 + else if config.theme.colors.primary-ansi-16 == "yellow" then + 3 + else if config.theme.colors.primary-ansi-16 == "blue" then + 4 + else if config.theme.colors.primary-ansi-16 == "magenta" then + 5 + else if config.theme.colors.primary-ansi-16 == "cyan" then + 6 + else if config.theme.colors.primary-ansi-16 == "white" then + 7 + else if config.theme.colors.primary-ansi-16 == "bright-white" then + 8 + else if config.theme.colors.primary-ansi-16 == "bright-black" then + 9 + else if config.theme.colors.primary-ansi-16 == "bright-red" then + 10 + else if config.theme.colors.primary-ansi-16 == "bright-green" then + 11 + else if config.theme.colors.primary-ansi-16 == "bright-yellow" then + 12 + else if config.theme.colors.primary-ansi-16 == "bright-blue" then + 13 + else if config.theme.colors.primary-ansi-16 == "bright-magenta" then + 14 + else if config.theme.colors.primary-ansi-16 == "bright-cyan" then + 15 + else + 0; + +} diff --git a/home/themes/config/template.nix b/home/themes/config/template.nix index a7dc40a..e98ed45 100644 --- a/home/themes/config/template.nix +++ b/home/themes/config/template.nix @@ -2,14 +2,21 @@ with lib; { options.theme = { - waybar-transparent = mkOption { - type = types.bool; - description = "Does waybar have a transparent background?"; + waybar = { + transparent = mkOption { + type = types.bool; + description = "Does waybar have a transparent background?"; + }; + + float = mkOption { + type = types.bool; + description = "Floating mode for waybar (gap)"; + }; }; - print-neofetch = mkOption { - type = types.bool; - description = "Does kitty launch neofetch?"; + neofetch = mkOption { + type = types.str; + description = "Options: neofetch/nerdfetch/none"; }; wallpaper = mkOption { diff --git a/home/themes/default.nix b/home/themes/default.nix index 9910123..b2b09b6 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -1,39 +1 @@ -{ config, ... }: { - imports = [ ./nixy.nix ./wallpapers ]; - config.theme.colors.primary-ansi-16-number = - if config.theme.colors.primary-ansi-16 == "black" then - 0 - else if config.theme.colors.primary-ansi-16 == "red" then - 1 - else if config.theme.colors.primary-ansi-16 == "green" then - 2 - else if config.theme.colors.primary-ansi-16 == "yellow" then - 3 - else if config.theme.colors.primary-ansi-16 == "blue" then - 4 - else if config.theme.colors.primary-ansi-16 == "magenta" then - 5 - else if config.theme.colors.primary-ansi-16 == "cyan" then - 6 - else if config.theme.colors.primary-ansi-16 == "white" then - 7 - else if config.theme.colors.primary-ansi-16 == "bright-white" then - 8 - else if config.theme.colors.primary-ansi-16 == "bright-black" then - 9 - else if config.theme.colors.primary-ansi-16 == "bright-red" then - 10 - else if config.theme.colors.primary-ansi-16 == "bright-green" then - 11 - else if config.theme.colors.primary-ansi-16 == "bright-yellow" then - 12 - else if config.theme.colors.primary-ansi-16 == "bright-blue" then - 13 - else if config.theme.colors.primary-ansi-16 == "bright-magenta" then - 14 - else if config.theme.colors.primary-ansi-16 == "bright-cyan" then - 15 - else - 0; - -} +{ ... }: { imports = [ ./wip.nix ./wallpapers ./config/load_colors.nix ]; } diff --git a/home/themes/nixy.nix b/home/themes/nixy.nix index 36283e4..51a0c90 100644 --- a/home/themes/nixy.nix +++ b/home/themes/nixy.nix @@ -3,15 +3,22 @@ theme = { wallpaper = "default.png"; - waybar-transparent = true; - print-neofetch = true; + font-mono = "FiraCode Nerd Font Mono"; font = "SFProDisplay Nerd Font"; + rounding = 12; gaps-in = 10; gaps-out = 20; border-size = 3; + neofetch = "nerdfetch"; + + waybar = { + transparent = true; + float = true; + }; + colors = { bg = "040409"; fg = "FCFCFC"; diff --git a/home/themes/wip.nix b/home/themes/wip.nix new file mode 100644 index 0000000..b880198 --- /dev/null +++ b/home/themes/wip.nix @@ -0,0 +1,51 @@ +{ + imports = [ ./config/template.nix ]; + + theme = { + wallpaper = "house-cloud.png"; + + font-mono = "FiraCode Nerd Font Mono"; + font = "SFProDisplay Nerd Font"; + + rounding = 8; + gaps-in = 6; + gaps-out = 12; + border-size = 2; + + neofetch = "nerdfetch"; + + waybar = { + transparent = false; + float = false; + }; + + colors = { + bg = "040409"; + fg = "FCFCFC"; + alt-bg = "101012"; + alt-fg = "ECECEC"; + primary-ansi-16 = "cyan"; + primary-bg = "BBCDE5"; + primary-fg = "000000"; + secondary-bg = "4928B8"; + secondary-fg = "000000"; + color0 = "000000"; + color1 = "f7768e"; + color2 = "73daca"; + color3 = "e0af68"; + color4 = "7aa2f7"; + color5 = "9978F8"; + color6 = "7dcfff"; + color7 = "E4E5E7"; + color8 = "515878"; + color9 = "f7869e"; + color10 = "83eada"; + color11 = "f0bf78"; + color12 = "8ab2f7"; + color13 = "A988F8"; + color14 = "8ddfff"; + color15 = "f4f5f7"; + }; + }; + +}