diff options
author | Matthew Lemon <y@yulqen.org> | 2023-10-17 13:10:41 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-10-17 13:10:41 +0100 |
commit | 658ec6b1bdb793148dc01ece2cf754c245eb5d76 (patch) | |
tree | ae2f32d5be15c12bc7bb16b8200c0dc6cda7fcc7 | |
parent | 495aa3b8d3b274a824b0752465fe9c7d4db92691 (diff) | |
parent | 115f7acbd49591f4ce2d9efca7019b511a0451b3 (diff) |
Merge branch 'master' of git.sr.ht:~yulqen/bash-scripts
-rwxr-xr-x | batnote | 4 | ||||
-rwxr-xr-x | curdel.sh | 13 | ||||
-rwxr-xr-x | curlist.sh | 10 | ||||
-rwxr-xr-x | curset.sh | 13 |
4 files changed, 38 insertions, 2 deletions
@@ -3,8 +3,8 @@ # a script for FZFing through my Notes folder for quick reading. # Uses bat if installed, otherwise will use less. -NOTES=/home/$USER/Notes -FZF_BIN=/home/$USER/.fzf/bin/fzf +NOTES=/home/$USER/Documents/Notes +FZF_BIN=/usr/bin/fzf BAT=/usr/bin/bat LESS=/usr/bin/less VIM=/usr/bin/vim diff --git a/curdel.sh b/curdel.sh new file mode 100755 index 0000000..e4263cf --- /dev/null +++ b/curdel.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +curdir=~/Documents/Notes/current/ +file=$(find $curdir -type l |fzf) +echo $file + +if [[ -d $curdir ]]; then + unlink "$file" + echo "Deleted symbolic link for $file in $curdir." +else + echo "The ~/Documents/Notes/current directory does not exist. Please create it to proceed." + exit 1 +fi diff --git a/curlist.sh b/curlist.sh new file mode 100755 index 0000000..6720b91 --- /dev/null +++ b/curlist.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +curdir=~/Documents/Notes/current/ + +if [[ -d $curdir ]]; then + ls "$curdir/" +else + echo "The ~/Documents/Notes/current directory does not exist. Please create it to proceed." + exit 1 +fi diff --git a/curset.sh b/curset.sh new file mode 100755 index 0000000..8d80605 --- /dev/null +++ b/curset.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +file=$(find ~/Documents/Notes -type f|fzf) +curdir=~/Documents/Notes/current/ + +if [[ -d $curdir ]]; then + ln -s "$file" "$curdir" + echo "Created symbolic link for $file in $curdir." +else + echo "The ~/Documents/Notes/current directory does not exist. Please create it to proceed." + exit 1 +fi + |