feat: stow and unstow applications shortcut function
This commit is contained in:
parent
5e73ab9988
commit
3604752ed7
4 changed files with 47 additions and 7 deletions
|
@ -1 +1,2 @@
|
||||||
zsh
|
zsh
|
||||||
|
shortcuts
|
11
dots/shortcuts/nekoray.desktop
Normal file
11
dots/shortcuts/nekoray.desktop
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Nekoray
|
||||||
|
Comment=V2ray Client
|
||||||
|
GenericName=VPN
|
||||||
|
Exec=/opt/nekoray/nekoray
|
||||||
|
Icon=/opt/nekoray/nekobox.png
|
||||||
|
Type=Application
|
||||||
|
Terminal=false
|
||||||
|
Categories=Network;Internet;
|
||||||
|
MimeType=
|
||||||
|
Keywords=nekoray;VPN;V2Ray;
|
13
dots/shortcuts/vscode.desktop
Normal file
13
dots/shortcuts/vscode.desktop
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Visual Studio Code
|
||||||
|
Comment=Code Editing. Refined.
|
||||||
|
GenericName=Text Editor
|
||||||
|
Exec=/opt/vscode/code --no-sandbox --unity-launch
|
||||||
|
Icon=/opt/vscode/resources/app/resources/linux/code.png
|
||||||
|
Type=Application
|
||||||
|
StartupNotify=false
|
||||||
|
StartupWMClass=Code
|
||||||
|
Categories=Utility;TextEditor;Development;IDE;
|
||||||
|
MimeType=text/plain;inode/directory;application/x-visual-studio-code-workspace;
|
||||||
|
Actions=new-empty-window;
|
||||||
|
Keywords=vscode;
|
27
stow.sh
27
stow.sh
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
dots_dir="dots"
|
||||||
|
hyprland_dir="hyprland"
|
||||||
|
shortcuts_target_dir="$HOME/.local/share/applications"
|
||||||
|
|
||||||
display_help() {
|
display_help() {
|
||||||
echo "Usage: [-s | -u] [-h]"
|
echo "Usage: [-s | -u] [-h]"
|
||||||
echo " -s Stow dotfiles"
|
echo " -s Stow dotfiles"
|
||||||
|
@ -7,17 +11,27 @@ display_help() {
|
||||||
echo " -h Display this help message"
|
echo " -h Display this help message"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stow_shortcuts() {
|
||||||
|
mkdir -p $shortcuts_target_dir
|
||||||
|
stow -d $dots_dir -S shortcuts -t $shortcuts_target_dir
|
||||||
|
|
||||||
|
echo "Shortcuts stowed successfully!"
|
||||||
|
}
|
||||||
|
|
||||||
stow_dotfiles() {
|
stow_dotfiles() {
|
||||||
stow dots
|
stow $dots_dir
|
||||||
stow -d dots -S zsh -t ~/
|
stow -d $dots_dir -S zsh -t ~/
|
||||||
stow hyprland
|
stow $hyprland_dir
|
||||||
|
|
||||||
echo "Dotfiles stowed successfully!"
|
echo "Dotfiles stowed successfully!"
|
||||||
}
|
}
|
||||||
|
|
||||||
unstow_dotfiles() {
|
unstow_dotfiles() {
|
||||||
stow -D dots
|
stow -D $dots_dir
|
||||||
stow -D -d dots -t ~/ zsh
|
stow -D -d $dots_dir -t ~/ zsh
|
||||||
stow -D hyprland
|
stow -D -d $dots_dir -t $shortcuts_target_dir shortcuts
|
||||||
|
# stow -D $hyprland_dir
|
||||||
|
|
||||||
echo "Dotfiles unstowed successfully!"
|
echo "Dotfiles unstowed successfully!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +39,7 @@ while getopts ":suh" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
s)
|
s)
|
||||||
stow_dotfiles
|
stow_dotfiles
|
||||||
|
stow_shortcuts
|
||||||
;;
|
;;
|
||||||
u)
|
u)
|
||||||
unstow_dotfiles
|
unstow_dotfiles
|
||||||
|
|
Loading…
Add table
Reference in a new issue