waybar ricing and alacritty transparency

This commit is contained in:
Sam 2024-06-05 23:27:36 +01:00
parent bd8fbdacd0
commit f60f4bee7a
6 changed files with 171 additions and 179 deletions

View File

@ -8,7 +8,7 @@
dimInactive = true; dimInactive = true;
terminalColors = true; terminalColors = true;
theme = "wave"; theme = "wave";
transparent = false; transparent = true;
undercurl = true; undercurl = true;
}; };
}; };

View File

@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, ... }:
let
user = config.home.username;
in
{ {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
@ -38,9 +35,13 @@ in
}; };
}; };
window.padding = { window = {
x = 5; padding = {
y = 5; x = 5;
y = 5;
};
blur = true;
opacity = 0.9;
}; };
shell.program = "${pkgs.zsh}/bin/zsh"; shell.program = "${pkgs.zsh}/bin/zsh";

View File

@ -1,8 +1,7 @@
{ { lib
lib, , config
config, , pkgs
pkgs, , ...
...
}: { }: {
imports = [ imports = [
@ -12,20 +11,21 @@
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
systemd = { systemd = {
variables = ["--all"]; variables = [ "--all" ];
enable = true; enable = true;
# Same as default, but stop graphical-session too # Same as default, but stop graphical-session too
extraCommands = lib.mkBefore [ extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target" "systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target" "systemctl --user start hyprland-session.target"
]; ];
}; };
extraConfig = extraConfig =
let let
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}"; monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}";
active = "rgba(${config.colorScheme.colors.base08}ee)"; active = "rgba(${config.colorScheme.colors.base08}ee)";
inactive = "rgba(${config.colorScheme.colors.base0C}ee)"; inactive = "rgba(${config.colorScheme.colors.base0C}ee)";
in '' in
''
${monitor} ${monitor}
$terminal = alacritty $terminal = alacritty
@ -155,7 +155,7 @@
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
exec-once=bash ~/.config/hypr/start.sh exec-once=swww-wallpaper-changer
''; '';
}; };
} }

View File

@ -1,37 +1,19 @@
{ pkgs, ... }:
{ {
pkgs, home.packages = with pkgs; [
... (writeShellScriptBin "swww-wallpaper-changer" ''
}: export WAYLAND_DISPLAY="wayland-1"
{ wallpaper_dir="$HOME/.local/share/bg/"
systemd.user.services.wallpaper-changer = { [ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir"
Unit = { ${swww}/bin/swww-daemon &
Description = "Script to change wallpaper using swww";
PartOf = [ "hyprland-session.target" ];
After = [ "hyprland-session.target" ]; # or "wayland.target", depending on your system setup
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = [ "simple" ];
ExecStart = "${pkgs.writeShellScript "swww-wallpaper-changer" ''
export WAYLAND_DISPLAY="wayland-1"
wallpaper_dir="$HOME/.local/share/bg/"
[ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir"
# Allow some time for desktop to start while true; do
sleep 3 find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
echo "starting daemon..." ${swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
${pkgs.swww}/bin/swww-daemon & [ $? != 0 ] && echo "swww failed, exiting" && exit 1
sleep 600
while true; do done
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do done
${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60 '')
[ $? != 0 ] && echo "swww failed, reloading daemon" && ${pkgs.swww}/bin/swww-daemon & ];
sleep 600
done
done
''}";
};
};
} }

View File

@ -1,8 +1,7 @@
{ { lib
lib, , config
config, , pkgs
pkgs, , ...
...
}: { }: {
# Let it try to start a few more times # Let it try to start a few more times
systemd.user.services.waybar = { systemd.user.services.waybar = {
@ -12,121 +11,132 @@
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
settings = { settings = {
primary = { primary = {
mode = "dock"; mode = "dock";
height = 30; height = 30;
margin = "6"; margin = "6";
spacing = 5; spacing = 5;
modules-left = [ modules-left = [
"custom/menu" "custom/menu"
"wlr/workspaces"]; "hyprland/workspaces"
modules-center = [ "hyprland/window"
"clock" ];
];
modules-right = [
"cpu"
"memory"
"network"
"pulseaudio"
"battery"
"tray"
"custom/exit"
"custom/hostname"
];
"wlr/workspaces" = {
"format" = "{icon}";
"on-click" = "activate";
"format-icons"= {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"urgent" = "";
"active" = "";
"default" = "";
};
};
"clock" = {
"format" = "<span> </span>{:%m/%d %H:%M}";
"tooltip-format" = "<big>{:%B %Y}</big>\n<tt><small>{calendar}</small></tt>";
"on-click" = "calendar";
};
"cpu"= {
"interval" = 10;
"format" = " {}%";
"max-length" = 10;
"on-click" = "";
};
"memory" = {
"interval" = 30;
"format" = " {}%";
"format-alt" = " {used:0.1f}G";
"max-length" = 10;
};
"network" = { modules-center = [
"format-wifi" = " {signalStrength}%"; "clock"
"format-ethernet" = " wired"; ];
"format-disconnected" = "";
"on-click" = "bash ~/.config/waybar/scripts/rofi-wifi-menu.sh";
};
"battery" = { modules-right = [
"bat" = "BAT0"; "cpu"
"adapter" = "ADP0"; "memory"
"interval" = 60; "network"
"states" = { "pulseaudio"
"warning" = 30; "battery"
"critical" = 15; "tray"
}; "custom/exit"
"max-length" = 20; "custom/hostname"
"format" = "{icon} {capacity}%"; "custom/ip"
"format-warning" = "{icon} {capacity}%"; ];
"format-critical" = "{icon} {capacity}%";
"format-charging" = "<span font-family='Font Awesome 6 Free'></span> {capacity}%";
"format-plugged" = " {capacity}%";
"format-alt" = "{icon} {time}";
"format-full" = " {capacity}%";
"format-icons" = [" " " " " " " " " "];
};
"tray" = {
"spacing" = 10;
};
"custom/menu" = {
"format" = "";
"on-click" = "rofi -show drun";
};
"custom/hostname" = {
"exec" = "echo $USER@$(hostname)";
"on-click" = "alacritty";
};
"custom/exit" = {
"format" = "";
"on-click" = "wlogout";
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-muted" = " 0%";
"format-icons" = {
"headphone" = "";
"headset" = "";
"portable" = "";
"default" = [ "" "" "" ];
};
"on-click" = "pavucontrol";
};
"hyprland/window" = {
"format" = "{}";
"rewrite" = {
"(.*) Mozilla Firefox" = "$1";
};
"separate-outputs" = true;
}; };
"hyprland/workspaces" = {
"format" = "{name}";
"on-click" = "activate";
"format-icons" = {
"urgent" = "";
"active" = "";
"default" = "";
};
};
"clock" = {
"format" = "<span> </span>{:%y-%m-%d %H:%M:%S}";
"tooltip-format" = "<big>{:%B %Y}</big>\n<tt><small>{calendar}</small></tt>";
"on-click" = "calendar";
};
"cpu" = {
"interval" = 10;
"format" = " {}%";
"max-length" = 10;
"on-click" = "";
};
"memory" = {
"interval" = 30;
"format" = " {}%";
"format-alt" = " {used:0.1f}G";
"max-length" = 10;
};
"network" = {
"format-wifi" = " {signalStrength}%";
"format-ethernet" = " wired ({ipaddr})";
"format-disconnected" = "";
};
"battery" = {
"bat" = "BAT0";
"adapter" = "ADP0";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"max-length" = 20;
"format" = "{icon} {capacity}%";
"format-warning" = "{icon} {capacity}%";
"format-critical" = "{icon} {capacity}%";
"format-charging" = "<span font-family='Font Awesome 6 Free'></span> {capacity}%";
"format-plugged" = " {capacity}%";
"format-alt" = "{icon} {time}";
"format-full" = " {capacity}%";
"format-icons" = [ " " " " " " " " " " ];
};
"tray" = {
"spacing" = 10;
};
"custom/menu" = {
"format" = " Nixos";
"on-click" = "wofi --show drun";
};
"custom/hostname" = {
"exec" = "echo $USER@$(hostname)";
"on-click" = "$TERMINAL";
};
"custom/exit" = {
"format" = "";
"on-click" = "wlogout";
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-muted" = " 0%";
"format-icons" = {
"headphone" = "";
"headset" = "";
"portable" = "";
"default" = [ "" "" "" ];
};
"on-click" = "pavucontrol";
};
};
}; };
style = '' style = ''
* { * {
font-family: JetBrainsMono Nerd Font; font-family: JetBrainsMono Nerd Font;
font-size: 12pt; font-size: 12pt;
@ -213,8 +223,8 @@
border-radius: 10px; border-radius: 10px;
} }
''; '';
}; };
} }

View File

@ -1,16 +1,15 @@
{ pkgs ? import <nixpkgs> { }, stdenv, fetchFromGitHub }: { pkgs ? import <nixpkgs> { }, fetchFromGitHub }:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation {
pname = "sddm-theme"; pname = "sddm-theme";
version = "1.6"; version = "1.6";
dontBuild = true; dontBuild = true;
# nativeBuildInputs = with pkgs; [
# sddm
# ];
installPhase = '' installPhase = ''
mkdir -p $out/share/sddm/themes mkdir -p $out/share/sddm/themes
cp -aR $src $out/share/sddm/themes/sugar-candy cp -aR $src $out/share/sddm/themes/sugar-candy
touch $out/share/sddm/themes/balls touch $out/share/sddm/themes/balls
''; '';
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Kangie"; owner = "Kangie";
repo = "sddm-sugar-candy"; repo = "sddm-sugar-candy";