From 77b0f29905e2c1eaa21bf043c3f5c41aa04f4edf Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 11 Oct 2023 09:32:01 +0100 Subject: Added three tiny scripts for symbolic links The idea is to create symlinks to files that are currently being worked on, in one place. Here we can set the link, delete it and list them. --- curdel.sh | 13 +++++++++++++ curlist.sh | 10 ++++++++++ curset.sh | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 curdel.sh create mode 100755 curlist.sh create mode 100755 curset.sh 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 + -- cgit v1.2.3 From 115f7acbd49591f4ce2d9efca7019b511a0451b3 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 16 Oct 2023 07:21:43 +0100 Subject: Change path for docs and fzf --- batnote | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/batnote b/batnote index 57d455a..110d7c7 100755 --- a/batnote +++ b/batnote @@ -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 -- cgit v1.2.3