PortValhalla/scripts/Arch/Software/vscode/main.fish

49 lines
1.1 KiB
Fish
Raw Permalink Normal View History

#!/bin/env fish
begin
set -l dir (status dirname)
2024-11-01 12:12:16 +00:00
source "$dir/../../lib/software.fish"
function setFlags
argparse -i "user=" -- $argv
set -l user "$_flag_user"
2024-09-26 22:58:39 +00:00
set -l flags
set -l bins codium code
if [ -n "$user" ]
set homeDir ~"$user"
set flags -u "$user"
else
2024-10-06 19:25:34 +00:00
set homeDir /etc/skel
2024-09-26 22:58:39 +00:00
end
for bin in $bins
if type -q "$bin"
begin
set -l file "$homeDir/.config/$bin-flags.conf"
sudo $flags mkdir -p (dirname "$file")
2024-10-06 19:25:34 +00:00
echo --touch-events | sudo $flags tee "$file" >/dev/null
2024-09-26 22:58:39 +00:00
end
end
end
end
function installSW
yayinst \
vscodium-bin \
2024-07-17 13:49:30 +00:00
visual-studio-code-bin (
# Trash functionality
) gvfs
end
2024-07-17 14:33:59 +00:00
function configureSW -V dir
2024-09-26 22:58:39 +00:00
setFlags
2024-09-20 03:46:11 +00:00
end
2024-09-20 03:46:11 +00:00
function userConfig -V dir
2024-09-26 22:58:39 +00:00
setFlags $argv
2024-09-20 03:46:11 +00:00
fish "$dir/../../../Common/Software/vscode/main.fish" userConfig $argv
end
runInstaller $argv
end