feat(nix-darwin): add setbg
script
Sets the background of all spaces on all displays/desktops to an image (passed as a command-line argument) preserving the focused spaces and window after running Depends on `yabai` (>`System Integrity Protection must be partially disabled.`) and `jq` Written in `applescript`
This commit is contained in:
parent
d9a01b42ae
commit
c57ddea18b
3 changed files with 98 additions and 1 deletions
27
modules/nix-darwin/yabai/setbg/default.nix
Normal file
27
modules/nix-darwin/yabai/setbg/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ lib
|
||||
, writeShellScriptBin
|
||||
, symlinkJoin
|
||||
, makeWrapper
|
||||
, jq
|
||||
, yabai
|
||||
}:
|
||||
|
||||
let
|
||||
# NOTE: passing `${1}` because `${0}` resolves to the `.setbg-wrapped` path
|
||||
setWallpaperUnwrapped =
|
||||
writeShellScriptBin "setbg" ''
|
||||
osascript ${./setbg.scpt} "''${1}"
|
||||
'';
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "setbg";
|
||||
paths = [ setWallpaperUnwrapped ];
|
||||
buildInputs = [ makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/setbg \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
jq
|
||||
yabai
|
||||
]}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue