feat: stow and unstow applications shortcut function

This commit is contained in:
hesam-init 2024-02-24 16:10:28 +03:30
parent 5e73ab9988
commit 3604752ed7
4 changed files with 47 additions and 7 deletions

View file

@ -1 +1,2 @@
zsh
zsh
shortcuts

View 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;

View 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
View file

@ -1,5 +1,9 @@
#!/bin/bash
dots_dir="dots"
hyprland_dir="hyprland"
shortcuts_target_dir="$HOME/.local/share/applications"
display_help() {
echo "Usage: [-s | -u] [-h]"
echo " -s Stow dotfiles"
@ -7,17 +11,27 @@ display_help() {
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 dots
stow -d dots -S zsh -t ~/
stow hyprland
stow $dots_dir
stow -d $dots_dir -S zsh -t ~/
stow $hyprland_dir
echo "Dotfiles stowed successfully!"
}
unstow_dotfiles() {
stow -D dots
stow -D -d dots -t ~/ zsh
stow -D hyprland
stow -D $dots_dir
stow -D -d $dots_dir -t ~/ zsh
stow -D -d $dots_dir -t $shortcuts_target_dir shortcuts
# stow -D $hyprland_dir
echo "Dotfiles unstowed successfully!"
}
@ -25,6 +39,7 @@ while getopts ":suh" opt; do
case $opt in
s)
stow_dotfiles
stow_shortcuts
;;
u)
unstow_dotfiles