Last active
October 6, 2022 00:03
-
-
Save Kuxe/976d4765ee520c88d336fa1fefe01dc6 to your computer and use it in GitHub Desktop.
A script that allows you to open workspaces in Code - OSS via rofi, e.g: "rofi -modes drun,window,code-workspaces:~/bin/code-workspaces.sh -show drun". You need ripgrep and awk available in $PATH.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd () { | |
command pushd "$@" > /dev/null | |
} | |
popd () { | |
command popd "$@" > /dev/null | |
} | |
if [ $# -eq 0 ] | |
then | |
pushd ~/.config/Code\ -\ OSS/User/workspaceStorage && rg ".code-workspace" | awk '{print substr($3,9,length($3)-24);}' | sort && popd | |
else | |
WORKSPACEFILE="$1" | |
WORKSPACEEXTENSION=".code-workspace" | |
FULLWORKSPACEFILE="$WORKSPACEFILE$WORKSPACEEXTENSION" | |
code $FULLWORKSPACEFILE > /dev/null | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very good job!