From 5986988c0c166b1654bb4c88218a8f92ba30602f Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 4 Jan 2024 16:32:29 +0100 Subject: [PATCH] zsh: add function to generate i3/sway configs --- .config/zsh/functions/gen_i3sway_config | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .config/zsh/functions/gen_i3sway_config diff --git a/.config/zsh/functions/gen_i3sway_config b/.config/zsh/functions/gen_i3sway_config new file mode 100755 index 0000000..fe92a18 --- /dev/null +++ b/.config/zsh/functions/gen_i3sway_config @@ -0,0 +1,11 @@ +#!/usr/bin/env zsh +# generates config for i3 and sway by combining the common and local configs + +setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL + +for wm in i3 sway; do + local dir=${HOME}/.config/${wm} + + [[ -f ${dir}/config.local ]] || touch ${dir}/config.local + \cat ${dir}/config.common ${dir}/config.local > ${dir}/config +done