diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cd5fe6f..bf0cf3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Instead of grouping changes by tag, they are grouped by the date they are releas ### Added +* Add `feh` to automatically select a random wallpaper and link it with i3 and autorandr. * Add Telescope keymaps to find the current word under the cursor within the open project. ## 4th January 2024 diff --git a/system/nixos/home-manager/desktop.nix b/system/nixos/home-manager/desktop.nix index 35f37d5f..41604cd2 100644 --- a/system/nixos/home-manager/desktop.nix +++ b/system/nixos/home-manager/desktop.nix @@ -34,8 +34,5 @@ }; }; - xdg.configFile.wallpaper = { - source = ../../../config/wallpaper; - recursive = true; - }; + programs.feh.enable = true; } diff --git a/system/nixos/home-manager/modules/autorandr.nix b/system/nixos/home-manager/modules/autorandr.nix index 799cbb0d..3650dd9b 100644 --- a/system/nixos/home-manager/modules/autorandr.nix +++ b/system/nixos/home-manager/modules/autorandr.nix @@ -1,6 +1,17 @@ +{ username, ... }: + { services.autorandr.enable = true; + xdg.configFile."autorandr/postswitch" = { + executable = true; + text = '' + #!/usr/bin/env bash + + feh --randomize --bg-scale /home/${username}/Pictures/Wallpaper/*; + ''; + }; + programs.autorandr = { enable = true; diff --git a/system/nixos/home-manager/modules/i3.nix b/system/nixos/home-manager/modules/i3.nix index ff3d809c..0dd8d46b 100644 --- a/system/nixos/home-manager/modules/i3.nix +++ b/system/nixos/home-manager/modules/i3.nix @@ -1,11 +1,9 @@ -{ config, inputs, self, ... }: +{ config, inputs, self, username, ... }: let modifier = "Mod4"; in { - home.file.".background-image".source = ../../../../config/wallpaper/wallpaper.jpg; - xsession.windowManager.i3 = { enable = true; @@ -60,6 +58,8 @@ in bindswitch --reload --locked lid:on output $laptop disable bindswitch --reload --locked lid:off output $laptop enable + exec --no-startup-id feh --randomize --bg-scale /home/${username}/Pictures/Wallpaper/*; + default_border none default_floating_border none smart_borders on