summaryrefslogtreecommitdiff
path: root/fish
diff options
context:
space:
mode:
Diffstat (limited to 'fish')
-rw-r--r--fish/.config/fish/conf.d/rustup.fish1
-rw-r--r--fish/.config/fish/fish_variables2
-rw-r--r--fish/.config/fish/functions/update-vesktop.fish34
3 files changed, 36 insertions, 1 deletions
diff --git a/fish/.config/fish/conf.d/rustup.fish b/fish/.config/fish/conf.d/rustup.fish
new file mode 100644
index 0000000..e4cb363
--- /dev/null
+++ b/fish/.config/fish/conf.d/rustup.fish
@@ -0,0 +1 @@
+source "$HOME/.cargo/env.fish"
diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables
index 96a2ffc..34c0fcf 100644
--- a/fish/.config/fish/fish_variables
+++ b/fish/.config/fish/fish_variables
@@ -29,4 +29,4 @@ SETUVAR fish_pager_color_description:yellow\x1e\x2di
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
-SETUVAR fish_user_paths:/usr/sbin\x1e/sbin
+SETUVAR --export fish_user_paths:/home/sophie/\x2ecargo/bin\x1e/usr/sbin\x1e/sbin
diff --git a/fish/.config/fish/functions/update-vesktop.fish b/fish/.config/fish/functions/update-vesktop.fish
new file mode 100644
index 0000000..49133b3
--- /dev/null
+++ b/fish/.config/fish/functions/update-vesktop.fish
@@ -0,0 +1,34 @@
+function update-vesktop --description "Download and install latest Vesktop .deb if outdated"
+ set -l latest_tag (curl -s https://api.github.com/repos/Vencord/Vesktop/releases/latest | grep '"tag_name"' | cut -d'"' -f4)
+ set -l current (dpkg -s vesktop 2>/dev/null | grep '^Version' | cut -d' ' -f2)
+
+ if test "v$current" = "$latest_tag"
+ echo "Vesktop already up to date ($current)"
+ return 0
+ end
+
+ set -l download_url (curl -s https://api.github.com/repos/Vencord/Vesktop/releases/latest | grep "browser_download_url.*amd64\.deb\"" | cut -d '"' -f4)
+
+ if test -z "$download_url"
+ echo "Could not find download URL."
+ return 1
+ end
+
+ echo "Updating Vesktop: $current -> $latest_tag"
+ set -l tmpfile /tmp/vesktop.deb
+ curl -L -o $tmpfile $download_url
+ or begin
+ echo "Download failed."
+ return 1
+ end
+
+ file $tmpfile | grep -q "Debian binary package"
+ or begin
+ echo "Downloaded file doesn't look like a valid .deb, aborting."
+ cat $tmpfile
+ return 1
+ end
+
+ sudo apt install -y $tmpfile
+ rm $tmpfile
+end