diff --git a/scripts/Arch/Software/vscode/main.fish b/scripts/Arch/Software/vscode/main.fish index 235e8b64..6447314b 100755 --- a/scripts/Arch/Software/vscode/main.fish +++ b/scripts/Arch/Software/vscode/main.fish @@ -3,6 +3,28 @@ begin set -l dir (status dirname) source "$dir/../../Scripts/software.fish" + function setFlags -a user + set -l flags + set -l bins codium code + + if [ -n "$user" ] + set homeDir ~"$user" + set flags -u "$user" + else + set homeDir "/etc/skel" + end + + for bin in $bins + if type -q "$bin" + begin + set -l file "$homeDir/.config/$bin-flags.conf" + sudo $flags mkdir -p (dirname "$file") + echo "--touch-events" | sudo $flags tee "$file" > /dev/null + end + end + end + end + function installSW yayinst \ vscodium-bin \ @@ -12,20 +34,11 @@ begin end function configureSW -V dir - set -l bins codium code - - for bin in $bins - if type -q "$bin" - begin - set -l file "/etc/skel/.config/$bin-flags.conf" - sudo mkdir -p (dirname "$file") - echo "--touch-events" | sudo tee "$file" > /dev/null - end - end - end + setFlags end function userConfig -V dir + setFlags $argv fish "$dir/../../../Common/Software/vscode/main.fish" userConfig $argv end