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;
terminalColors = true;
theme = "wave";
transparent = false;
transparent = true;
undercurl = true;
};
};

View File

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

View File

@ -1,8 +1,7 @@
{
lib,
config,
pkgs,
...
{ lib
, config
, pkgs
, ...
}: {
imports = [
@ -12,20 +11,21 @@
wayland.windowManager.hyprland = {
enable = true;
systemd = {
variables = ["--all"];
enable = true;
# Same as default, but stop graphical-session too
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
variables = [ "--all" ];
enable = true;
# Same as default, but stop graphical-session too
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
extraConfig =
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)}";
active = "rgba(${config.colorScheme.colors.base08}ee)";
inactive = "rgba(${config.colorScheme.colors.base0C}ee)";
in ''
in
''
${monitor}
$terminal = alacritty
@ -155,7 +155,7 @@
bindm = $mainMod, mouse:272, movewindow
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,
...
}:
{
systemd.user.services.wallpaper-changer = {
Unit = {
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"
home.packages = with pkgs; [
(writeShellScriptBin "swww-wallpaper-changer" ''
export WAYLAND_DISPLAY="wayland-1"
wallpaper_dir="$HOME/.local/share/bg/"
[ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir"
${swww}/bin/swww-daemon &
# Allow some time for desktop to start
sleep 3
echo "starting daemon..."
${pkgs.swww}/bin/swww-daemon &
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${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
''}";
};
};
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
[ $? != 0 ] && echo "swww failed, exiting" && exit 1
sleep 600
done
done
'')
];
}

View File

@ -1,8 +1,7 @@
{
lib,
config,
pkgs,
...
{ lib
, config
, pkgs
, ...
}: {
# Let it try to start a few more times
systemd.user.services.waybar = {
@ -12,121 +11,132 @@
enable = true;
systemd.enable = true;
settings = {
primary = {
mode = "dock";
height = 30;
margin = "6";
spacing = 5;
modules-left = [
"custom/menu"
"wlr/workspaces"];
modules-center = [
"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;
};
settings = {
primary = {
mode = "dock";
height = 30;
margin = "6";
spacing = 5;
modules-left = [
"custom/menu"
"hyprland/workspaces"
"hyprland/window"
];
"network" = {
"format-wifi" = " {signalStrength}%";
"format-ethernet" = " wired";
"format-disconnected" = "";
"on-click" = "bash ~/.config/waybar/scripts/rofi-wifi-menu.sh";
};
modules-center = [
"clock"
];
"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" = "";
"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";
};
modules-right = [
"cpu"
"memory"
"network"
"pulseaudio"
"battery"
"tray"
"custom/exit"
"custom/hostname"
"custom/ip"
];
"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-size: 12pt;
@ -213,8 +223,8 @@
border-radius: 10px;
}
'';
};
'';
};
}

View File

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