herbstluftwm: Fix error when no tags set
The default value for `xsession.windowManager.herbstluftwm.tags` is an empty list, but the config file uses `builtins.head` on it, which causes an error upon evaluation. With this change the tags configuration is skipped if the list is empty.
This commit is contained in:
parent
e7eba9cc46
commit
1a0a5f5037
6 changed files with 66 additions and 11 deletions
|
|
@ -145,15 +145,17 @@ in {
|
|||
|
||||
${renderSettings cfg.settings}
|
||||
|
||||
if ${cfg.package}/bin/herbstclient object_tree tags.by-name | ${pkgs.gnugrep}/bin/grep default; then
|
||||
herbstclient rename default ${
|
||||
lib.escapeShellArg (builtins.head cfg.tags)
|
||||
}
|
||||
fi
|
||||
${lib.optionalString (cfg.tags != [ ]) ''
|
||||
if ${cfg.package}/bin/herbstclient object_tree tags.default &>/dev/null; then
|
||||
herbstclient rename default ${
|
||||
lib.escapeShellArg (builtins.head cfg.tags)
|
||||
}
|
||||
fi
|
||||
|
||||
for tag in ${lib.escapeShellArgs cfg.tags}; do
|
||||
herbstclient add "$tag"
|
||||
done
|
||||
for tag in ${lib.escapeShellArgs cfg.tags}; do
|
||||
herbstclient add "$tag"
|
||||
done
|
||||
''}
|
||||
|
||||
${renderKeybinds cfg.keybinds}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue