Compare commits

..

3 commits

Author SHA1 Message Date
d6ba358108
worst wallpaper switcher EVER 2024-11-14 14:27:25 -08:00
cff640a554
hyprlock adjust 2024-11-14 11:05:37 -08:00
ef5a11042c
printing 2024-11-14 10:47:24 -08:00
16 changed files with 86 additions and 4 deletions

View file

@ -37,6 +37,7 @@
hardware = { hardware = {
bluetooth.enable = true; bluetooth.enable = true;
pipewire.enable = true; pipewire.enable = true;
print.enable = true;
}; };
dev = { dev = {
enable = true; enable = true;

View file

@ -26,6 +26,10 @@ in {
no_fade_in = true; no_fade_in = true;
no_fade_out = true; no_fade_out = true;
text_trim = true; text_trim = true;
# this will render the color we specified on the background before the image is loaded
# i like this because we will no longer see our screen for a split second before the image is ready
# extra security feature too
immediate_render = true;
}; };
background = [ background = [
{ {
@ -74,7 +78,7 @@ in {
halign = "center"; valign = "center"; halign = "center"; valign = "center";
} }
{ {
position = "-15, -13"; position = "-15, -11";
halign = "right"; valign = "top"; halign = "right"; valign = "top";
color = "rgb(${base05})"; color = "rgb(${base05})";
font_size = 14; font_size = 14;

View file

@ -4,7 +4,8 @@ with lib;
let let
cfg = config.modules.desktop.swww; cfg = config.modules.desktop.swww;
img = ../../assets/wallpaper.png; wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds";
lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper";
in { in {
options.modules.desktop.swww = { options.modules.desktop.swww = {
enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes"; enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes";
@ -16,8 +17,25 @@ in {
startScript = mkOption { startScript = mkOption {
type = types.package; type = types.package;
default = pkgs.writeScript "swww-start" '' default = pkgs.writeScript "swww-start" ''
if [ ! -f "${lastWallpaper}" ]; then
echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
fi
${cfg.package}/bin/swww-daemon & ${cfg.package}/bin/swww-daemon &
${lib.getExe cfg.package} img "${img}" --transition-type none ${lib.getExe cfg.package} img "${wallpapersFolder}/$(cat ${lastWallpaper})" --transition-type none
'';
};
swapScript = mkOption {
type = types.package;
default = pkgs.writeScript "swww-swap" ''
file=$(ls ${wallpapersFolder} | ${lib.getExe pkgs.rofi-wayland} -dmenu -sep '\n' -i -p "select a wallpaper")
wallpaper="${wallpapersFolder}/$file"
[ ! -f "$wallpaper" ] && exit 1
${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 0.915,0.977 --transition-duration 1.5
echo "$file" > "${lastWallpaper}"
''; '';
}; };
}; };

View file

@ -66,6 +66,7 @@ in {
"battery" "battery"
"custom/weather" "custom/weather"
"privacy" "privacy"
"custom/wallpaper"
]; ];
}; };
"group/power" = { "group/power" = {
@ -98,6 +99,12 @@ in {
tooltip-format = "Power menu"; tooltip-format = "Power menu";
on-click = "${powerSelect}"; on-click = "${powerSelect}";
}; };
"custom/wallpaper" = {
format = "";
tooltip = true;
tooltip-format = "Change wallpaper";
on-click = "${config.modules.desktop.swww.swapScript}";
};
"hyprland/workspaces" = { "hyprland/workspaces" = {
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {

View file

@ -0,0 +1,30 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.modules.hardware.print;
in {
options.modules.hardware.print = {
enable = mkEnableOption "Enable various print services";
};
config = mkIf cfg.enable {
services.printing.enable = true;
services.printing.startWhenNeeded = true; # i am not the avid printer user
services.printing.browsed.enable = true;
services.printing.drivers = with pkgs; [
# gutenprint is very generic and supports a lot of printers
gutenprint
gutenprintBin
# brother laser printers
brlaser
];
# network discovery
services.avahi = {
enable = true;
openFirewall = true;
nssmdns4 = true;
};
};
}

View file

@ -13,7 +13,7 @@ stdenvNoCC.mkDerivation {
installPhase = '' installPhase = ''
mkdir -p "$out/lib/firmware/brcm" mkdir -p "$out/lib/firmware/brcm"
cp -r lib/firmware/brcm/. "$out/lib/firmware/brcm/" cp -r "$src/lib/firmware/brcm/." "$out/lib/firmware/brcm/"
''; '';
meta = with lib; { meta = with lib; {

View file

@ -0,0 +1,22 @@
{ lib, stdenvNoCC }:
stdenvNoCC.mkDerivation {
pname = "wallpapers";
version = "unstable";
src = ./.;
# later, add XML files to /usr(?)/share/backgrounds
# then, it is selectable from places like in gnome and also do the same for KDE
installPhase = ''
mkdir -p "$out/share/backgrounds"
cp -r "$src/img/." "$out/share/backgrounds/"
'';
meta = with lib; {
description = "Small collection of wallpapers";
# idk what to put here:
# license = licenses.ofl;
platforms = platforms.all;
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View file

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 KiB