PortValhalla/scripts/Arch/Software/vscode/main.fish
2024-10-06 21:25:34 +02:00

47 lines
1 KiB
Fish
Executable file

#!/bin/env fish
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 \
visual-studio-code-bin (
# Trash functionality
) gvfs
end
function configureSW -V dir
setFlags
end
function userConfig -V dir
setFlags $argv
fish "$dir/../../../Common/Software/vscode/main.fish" userConfig $argv
end
runInstaller $argv
end