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

@ -40,6 +40,7 @@ in {
curl curl
ripgrep ripgrep
neovide neovide
wf-recorder
tree # temp tree # temp
# Just cool # Just cool

View File

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

View File

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

View File

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

View File

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

View File

@ -106,6 +106,7 @@ in {
"QT_QPA_PLATFORM=wayland,xcb" "QT_QPA_PLATFORM=wayland,xcb"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1" "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"GTK_THEME,Flat-Remix-GTK-Violet-Darkest-Solid:dark" "GTK_THEME,Flat-Remix-GTK-Violet-Darkest-Solid:dark"
# "GTK_THEME,Nixy-GTK"
# "HYPRCURSOR_THEME,rose-pine-hyprcursor" # "HYPRCURSOR_THEME,rose-pine-hyprcursor"
# "HYPRCURSOR_SIZE,16" # "HYPRCURSOR_SIZE,16"
]; ];

View File

@ -30,7 +30,7 @@
fade_on_empty = true fade_on_empty = true
placeholder_text = <i>Password...</i> # Text rendered in the input box when it's empty. placeholder_text = <i>Password...</i> # Text rendered in the input box when it's empty.
hide_input = false hide_input = false
position = 0, 50 position = 0, 80
halign = center halign = center
valign = bottom valign = bottom
} }

View File

@ -9,11 +9,12 @@
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
historySubstringSearch.enable = true; historySubstringSearch.enable = true;
# If the variable config.theme.print-neofetch is set to true, neofetch will be printed
initExtraFirst = '' initExtraFirst = ''
bindkey -e bindkey -e
${if config.theme.print-neofetch then ${if config.theme.neofetch == "neofetch" then
pkgs.neofetch + "/bin/neofetch" pkgs.neofetch + "/bin/neofetch"
else if config.theme.neofetch == "nerdfetch" then
"nerdfetch"
else else
""} ""}
''; '';

View File

@ -12,9 +12,12 @@
layer = "top"; layer = "top";
position = "top"; position = "top";
spacing = 0; spacing = 0;
"margin-top" = config.theme.gaps-out; "margin-top" =
"margin-left" = config.theme.gaps-out; if config.theme.waybar.float then config.theme.gaps-out else 0;
"margin-right" = config.theme.gaps-out; "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; height = 44;
modules-left = [ "custom/logo" "hyprland/window" ]; modules-left = [ "custom/logo" "hyprland/window" ];
modules-center = [ "hyprland/workspaces" ]; modules-center = [ "hyprland/workspaces" ];
@ -129,19 +132,29 @@
window#waybar { window#waybar {
background-color: ${ background-color: ${
if config.theme.waybar-transparent then if config.theme.waybar.transparent then
"rgba(0, 0, 0, 0)" "rgba(0, 0, 0, 0)"
else else
"#${config.theme.colors.bg}" "#${config.theme.colors.bg}"
}; };
transition-property: background-color; transition-property: background-color;
transition-duration: 0.5s; 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; font-size: 13px;
} }
.modules-left, .modules-center, .modules-right { .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}; background-color: #${config.theme.colors.bg};
padding: 2px 6px; padding: 2px 6px;
} }

View File

@ -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;
}

View File

@ -2,14 +2,21 @@
with lib; { with lib; {
options.theme = { options.theme = {
waybar-transparent = mkOption { waybar = {
transparent = mkOption {
type = types.bool; type = types.bool;
description = "Does waybar have a transparent background?"; description = "Does waybar have a transparent background?";
}; };
print-neofetch = mkOption { float = mkOption {
type = types.bool; type = types.bool;
description = "Does kitty launch neofetch?"; description = "Floating mode for waybar (gap)";
};
};
neofetch = mkOption {
type = types.str;
description = "Options: neofetch/nerdfetch/none";
}; };
wallpaper = mkOption { wallpaper = mkOption {

View File

@ -1,39 +1 @@
{ config, ... }: { { ... }: { imports = [ ./wip.nix ./wallpapers ./config/load_colors.nix ]; }
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;
}

View File

@ -3,15 +3,22 @@
theme = { theme = {
wallpaper = "default.png"; wallpaper = "default.png";
waybar-transparent = true;
print-neofetch = true;
font-mono = "FiraCode Nerd Font Mono"; font-mono = "FiraCode Nerd Font Mono";
font = "SFProDisplay Nerd Font"; font = "SFProDisplay Nerd Font";
rounding = 12; rounding = 12;
gaps-in = 10; gaps-in = 10;
gaps-out = 20; gaps-out = 20;
border-size = 3; border-size = 3;
neofetch = "nerdfetch";
waybar = {
transparent = true;
float = true;
};
colors = { colors = {
bg = "040409"; bg = "040409";
fg = "FCFCFC"; fg = "FCFCFC";

51
home/themes/wip.nix Normal file
View File

@ -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";
};
};
}