vdotfiles

Cem's Dotfiles for Void Linux
git clone git://git.ckyln.com/vdotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 08ef45a2ed7d080e7fc9e6b5ac16ab045b896a4c
parent 61ccb4f4abb367ac7169e7f11a3abcb442574090
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri,  1 Nov 2019 13:22:20 +0300

Added shortcut generator

Diffstat:
A.config/files | 18++++++++++++++++++
A.local/bin/dsh | 8++++++++
A.local/bin/shortcuts | 22++++++++++++++++++++++
3 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/.config/files b/.config/files @@ -0,0 +1,18 @@ +# Syntax: +# d for directories +# f for files +# "d/f" "shortcut" "file/directory" +# Example: +# f cv $HOME/.config/nvim/init.vim +# d bin $HOME/.local/bin +# +f cv $HOME/.config/nvim/init.vim +f cfz $HOME/.zshrc +f cfp $HOME/.profile +f cfcp $HOME/.customprofile +f csf $HOME/.config/files +f csd $HOME/.config/directories +f bib $BIB +d pr $HOME/Projects +d bin $HOME/.local/bin +d df $HOME/dotfiles diff --git a/.local/bin/dsh b/.local/bin/dsh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +. $HOME/.config/dshrc +chosen="$(for i in $list; do printf "$i\\n"; done | dmenu -p "Choose shortcut")" +echo $chosen +[ -z "$chosen" ] && exit +${comms[$chosen]} + diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts @@ -0,0 +1,22 @@ +#!/usr/bin/env sh +# Unactivated progs should go to /dev/null +shellshortcuts="$HOME/.config/shortcutrc" +dmenushortcuts="$HOME/.config/dshrc" + +printf "# vim:filetype=sh\nalias " > "$shellshortcuts" +printf "# vim:filetype=sh\ndeclare -A comms\n" > "$dmenushortcuts" + +sed '/#/d' $HOME/.config/files | while read -r ext shrt loc; do + case $ext in + f) + echo "$shrt=\"\$EDITOR $loc\" \\" >> "$shellshortcuts" + echo "list=\"$shrt \$list\"" >> "$dmenushortcuts" + echo "comms[\"$shrt\"]=\"\$TERMINAL -e \$EDITOR $loc\"" >> "$dmenushortcuts" + ;; + d) + echo "$shrt=\"cd $loc && ls -a\" \\" >> "$shellshortcuts" + echo "list=\"$shrt \$list\"" >> "$dmenushortcuts" + echo "comms[\"$shrt\"]=\"\$TERMINAL -e \$FILE $loc\"" >> "$dmenushortcuts" + ;; + esac +done