feat(hypr): swww -> wpaperd
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-04-21 14:57:38 -04:00
parent a1400a2335
commit 2af97f6b5a
6 changed files with 48 additions and 40 deletions

Binary file not shown.

BIN
flake.nix

Binary file not shown.

17
home/wpaperd.nix Normal file
View file

@ -0,0 +1,17 @@
{
pkgs,
wpaperd,
...
}: let
inherit (pkgs.writers) writeTOML;
wpaperdPkg = wpaperd.packages.${pkgs.system}.default;
wallpaper = "${pkgs.dracula-theme}/wallpapers/waves.png";
in {
home.packages = [wpaperdPkg];
xdg.configFile."wpaperd/config.toml".source = writeTOML "config.toml" {
default = {
path = wallpaper;
};
};
}

View file

@ -1,5 +1,5 @@
const { Box, Entry, Label, Window } = Widget; const { Box, Entry, Label, Window } = Widget;
const { execAsync, idle, readFileAsync } = Utils; const { idle, readFileAsync } = Utils;
const greetd = await Service.import('greetd'); const greetd = await Service.import('greetd');
@ -11,10 +11,6 @@ const DEFAULT_NAME = 'matt';
import { StringObject } from 'types/@girs/gtk-4.0/gtk-4.0.cjs'; import { StringObject } from 'types/@girs/gtk-4.0/gtk-4.0.cjs';
// Run Wallpaper daemon here to not cause issues at startup
execAsync(['bash', '-c',
`swww init --no-cache && swww img -t none ${App.configDir}/.wallpaper`]).catch(print);
const parsePasswd = (fileContent: string) => { const parsePasswd = (fileContent: string) => {
const splitUsers = fileContent.split('\n'); const splitUsers = fileContent.split('\n');
const parsedUsers = splitUsers.map((u) => { const parsedUsers = splitUsers.map((u) => {

View file

@ -17,38 +17,36 @@ in {
imports = [ imports = [
astal.homeManagerModules.default astal.homeManagerModules.default
../../home/theme ../../home/theme
../../home/wpaperd.nix
]; ];
programs.astal.enable = true; programs.astal.enable = true;
home = { home.packages = [
packages = [
hyprland hyprland
pkgs.bun pkgs.bun
pkgs.dart-sass pkgs.dart-sass
pkgs.swww
pkgs.gtk3 pkgs.gtk3
pkgs.glib pkgs.glib
]; ];
file = { xdg.configFile = {
".config/astal/.wallpaper".source = "${pkgs.dracula-theme}/wallpapers/waves.png"; "astal" = {
".config/astal" = {
source = ../ags/astal; source = ../ags/astal;
recursive = true; recursive = true;
}; };
".config/astal/config.js".text = "astal/config.js".text =
/* /*
javascript javascript
*/ */
'' ''
import { transpileTypeScript } from './js/utils.js'; import { transpileTypeScript } from './js/utils.js';
Utils.execAsync('wpaperd -d');
export default (await transpileTypeScript('greeter')).default; export default (await transpileTypeScript('greeter')).default;
''; '';
}; };
}; };
};
} }

View file

@ -1,13 +1,10 @@
{ {config, ...}: let
config,
pkgs,
...
}: let
inherit (config.vars) configDir; inherit (config.vars) configDir;
in { in {
imports = [../../home/theme]; imports = [
../../home/theme
home.packages = with pkgs; [swww]; ../../home/wpaperd.nix
];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
@ -15,7 +12,7 @@ in {
exec-once = [ exec-once = [
"hyprctl setcursor Dracula-cursors 24" "hyprctl setcursor Dracula-cursors 24"
"sleep 0.1 && swww init --no-cache && swww img -t none ${pkgs.dracula-theme}/wallpapers/waves.png" "wpaperd -d"
]; ];
windowrule = [ windowrule = [