Set vscode flags for all users

This commit is contained in:
Manuel Thalmann 2024-09-27 00:58:39 +02:00
parent c659dd926d
commit 5eae9dffdc

View file

@ -3,6 +3,28 @@ begin
set -l dir (status dirname) set -l dir (status dirname)
source "$dir/../../Scripts/software.fish" 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 function installSW
yayinst \ yayinst \
vscodium-bin \ vscodium-bin \
@ -12,20 +34,11 @@ begin
end end
function configureSW -V dir function configureSW -V dir
set -l bins codium code setFlags
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
end end
function userConfig -V dir function userConfig -V dir
setFlags $argv
fish "$dir/../../../Common/Software/vscode/main.fish" userConfig $argv fish "$dir/../../../Common/Software/vscode/main.fish" userConfig $argv
end end