Compare commits
2 Commits
15d45896a5
...
2a790fab56
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a790fab56 | |||
| 35a1760c0b |
@@ -12,6 +12,7 @@ in {
|
|||||||
./swaync.nix
|
./swaync.nix
|
||||||
./waybar.nix
|
./waybar.nix
|
||||||
./wlsunset.nix
|
./wlsunset.nix
|
||||||
|
./hyprpaper.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.home.desktop.hyprland = {
|
options.home.desktop.hyprland = {
|
||||||
@@ -33,6 +34,7 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.desktop = {
|
home.desktop = {
|
||||||
|
hyprpaper.enable = true;
|
||||||
rofi.enable = mkDefault true;
|
rofi.enable = mkDefault true;
|
||||||
swaync.enable = mkDefault true;
|
swaync.enable = mkDefault true;
|
||||||
waybar = {
|
waybar = {
|
||||||
@@ -41,6 +43,7 @@ in {
|
|||||||
};
|
};
|
||||||
wlsunset.enable = mkDefault true;
|
wlsunset.enable = mkDefault true;
|
||||||
};
|
};
|
||||||
|
services.blueman-applet.enable = true;
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
@@ -274,19 +277,5 @@ in {
|
|||||||
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
|
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
services = {
|
|
||||||
blueman-applet.enable = true;
|
|
||||||
hyprpaper = let
|
|
||||||
img = "/home/phundrak/Pictures/Wallpapers/nord/Nordic6.jpg";
|
|
||||||
in {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
ipc = "on";
|
|
||||||
splash = false;
|
|
||||||
preload = img;
|
|
||||||
wallpaper = ", ${img}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
87
users/modules/desktop/hyprpaper.nix
Normal file
87
users/modules/desktop/hyprpaper.nix
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.hyprpaper;
|
||||||
|
in {
|
||||||
|
options.home.desktop.hyprpaper = {
|
||||||
|
enable = mkEnableOption "Enables Hyprpaper";
|
||||||
|
default = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/home/phundrak/Pictures/Wallpapers/nord/Nordic6.jpg";
|
||||||
|
example = "/home/user/image.jpg";
|
||||||
|
};
|
||||||
|
wallpapers-dir = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/home/phundrak/Pictures/Wallpapers/nord/";
|
||||||
|
example = "/home/user/Pictures/";
|
||||||
|
};
|
||||||
|
rotation-interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "5m";
|
||||||
|
example = "10m";
|
||||||
|
description = "Interval between wallpaper rotations";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.hyprpaper = {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
settings = {
|
||||||
|
ipc = "on";
|
||||||
|
splash = false;
|
||||||
|
preload = cfg.default;
|
||||||
|
wallpaper = ", ${cfg.default}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.user = {
|
||||||
|
services.hyprpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Rotate Hyprpaper wallpaper";
|
||||||
|
After = "graphical-session.target";
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecCondition = "pidof Hyprland";
|
||||||
|
ExecStart = "${config.home.homeDirectory}/.config/hypr/hyprpaper-rotate.sh";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
timers.hyprpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Timer for rotating Hyprpaper wallpaper";
|
||||||
|
};
|
||||||
|
Timer = {
|
||||||
|
OnBootSec = cfg.rotation-interval;
|
||||||
|
OnUnitActiveSec = cfg.rotation-interval;
|
||||||
|
};
|
||||||
|
Install = {
|
||||||
|
WantedBy = ["timers.target"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home.file.".config/hypr/hyprpaper-rotate.sh" = {
|
||||||
|
text = ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
WALLPAPER_DIR="${cfg.wallpapers-dir}"
|
||||||
|
|
||||||
|
# Find a random wallpaper
|
||||||
|
WP=$(find "$WALLPAPER_DIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n 1)
|
||||||
|
|
||||||
|
if [ -z "$WP" ]; then
|
||||||
|
echo "No wallpapers found in $WALLPAPER_DIR"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Setting wallpaper to: $WP"
|
||||||
|
|
||||||
|
# Load and set the wallpaper
|
||||||
|
hyprctl hyprpaper preload "$WP" && hyprctl hyprpaper wallpaper ",$WP"
|
||||||
|
'';
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,9 +6,35 @@
|
|||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (
|
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (
|
||||||
epkgs: [
|
epkgs:
|
||||||
epkgs.mu4e
|
with epkgs; [
|
||||||
epkgs.pdf-tools
|
mu4e
|
||||||
|
pdf-tools
|
||||||
|
tree-sitter
|
||||||
|
tree-sitter-langs
|
||||||
|
(treesit-grammars.with-grammars (grammar:
|
||||||
|
with grammar; [
|
||||||
|
tree-sitter-bash
|
||||||
|
tree-sitter-c
|
||||||
|
tree-sitter-cpp
|
||||||
|
tree-sitter-css
|
||||||
|
tree-sitter-dockerfile
|
||||||
|
tree-sitter-http
|
||||||
|
tree-sitter-javascript
|
||||||
|
tree-sitter-jsdoc
|
||||||
|
tree-sitter-json
|
||||||
|
tree-sitter-just
|
||||||
|
tree-sitter-markdown
|
||||||
|
tree-sitter-markdown-inline
|
||||||
|
tree-sitter-nix
|
||||||
|
tree-sitter-rust
|
||||||
|
tree-sitter-sql
|
||||||
|
tree-sitter-toml
|
||||||
|
tree-sitter-typescript
|
||||||
|
tree-sitter-typst
|
||||||
|
tree-sitter-vue
|
||||||
|
tree-sitter-yaml
|
||||||
|
]))
|
||||||
]
|
]
|
||||||
));
|
));
|
||||||
cfg = config.home.dev.editors.emacs;
|
cfg = config.home.dev.editors.emacs;
|
||||||
@@ -25,7 +51,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
home.packages = [pkgs.emacs-all-the-icons-fonts];
|
home.packages = with pkgs; [
|
||||||
|
emacs-all-the-icons-fonts
|
||||||
|
emacs-lsp-booster
|
||||||
|
];
|
||||||
programs.emacs = mkIf cfg.enable {
|
programs.emacs = mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit (cfg) package;
|
inherit (cfg) package;
|
||||||
|
|||||||
Reference in New Issue
Block a user