diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 22:48:29 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 22:48:29 +1100 |
| commit | cb8f5b4105d2308454a1c4880a37e7a3373f80e9 (patch) | |
| tree | b095206669e58001d319f8e163a8be51ab2fabe9 | |
| parent | scheme: set gtk light/dark mode when dynamic (diff) | |
| download | caelestia-cli-cb8f5b4105d2308454a1c4880a37e7a3373f80e9.tar.gz caelestia-cli-cb8f5b4105d2308454a1c4880a37e7a3373f80e9.tar.bz2 caelestia-cli-cb8f5b4105d2308454a1c4880a37e7a3373f80e9.zip | |
vscode integration
| -rwxr-xr-x | install/vscode.fish | 38 | ||||
| -rwxr-xr-x | scheme/apply-scheme.fish | 14 |
2 files changed, 52 insertions, 0 deletions
diff --git a/install/vscode.fish b/install/vscode.fish new file mode 100755 index 0000000..70a2fc7 --- /dev/null +++ b/install/vscode.fish @@ -0,0 +1,38 @@ +#!/bin/fish + +. (dirname (status filename))/util.fish + +function confirm-copy -a from to + if test -e $to + read -l -p "input '$(realpath $to) already exists. Overwrite? [y/N] ' -n" confirm + test "$confirm" = 'y' -o "$confirm" = 'Y' && log 'Continuing.' || return + end + cp $from $to +end + +install-deps git + +set -l dist $CONFIG/vscode + +# Clone repo +confirm-overwrite $dist +git clone 'https://github.com/caelestia-dots/vscode.git' $dist + +# Install settings +for prog in 'Code' 'Code - OSS' 'VSCodium' + set -l $conf $CONFIG/../$prog + if test -d $conf + confirm-copy $dist/settings.json $conf/User/settings.json + confirm-copy $dist/keybindings.json $conf/User/keybindings.json + end +end + +# Install extension +for prog in code code-insiders codium + if which $prog &> /dev/null + log "Installing extension for '$prog'" + $prog --install-extension $dist/caelestia-vscode-integration/caelestia-vscode-integration-0.0.1.vsix + end +end + +log 'Done.' diff --git a/scheme/apply-scheme.fish b/scheme/apply-scheme.fish index 462b4d8..b61ac88 100755 --- a/scheme/apply-scheme.fish +++ b/scheme/apply-scheme.fish @@ -31,6 +31,15 @@ function gen-ini -a program end end +function gen-json + set -e jq_args + for colour in $argv + set -l split (string split ' ' $colour) + set -a jq_args --arg $split[1] "#$split[2]" + end + jq -n $jq_args '$ARGS.named' +end + function gen-gtk cp (dirname (status filename))/../data/gtk.template $CONFIG/gtk/schemes/dynamic.css for colour in $argv @@ -76,6 +85,11 @@ if test -d $CONFIG/../fuzzel/schemes gen-ini fuzzel $colours end +if test -d $CONFIG/vscode + log 'Generating VSCode scheme' + gen-json $colours > $CONFIG/vscode/schemes/dynamic.json +end + if test -d $CONFIG/gtk log 'Generating GTK+ schemes' gen-gtk $colours |