I want to have a shortcut for lfcd as I use it often, so instead of opening the terminal and then using ^o, I want a direct shortcut
I tried to change the keybind Mod+r in ~/.local/src/dwm from TERMINAL, "lf", NULL to TERMINAL, "lfcd", NULL, but this didn't work. A terminal opens and instantly closes.
I then tried making a script named lfcd in ~/.local/bin with:
trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
This still didn't work. I have very little experience and have no idea how to get this working. Any suggestions?
I want to have a shortcut for lfcd as I use it often, so instead of opening the terminal and then using ^o, I want a direct shortcut
I tried to change the keybind
Mod+r
in~/.local/src/dwm
fromTERMINAL, "lf", NULL
toTERMINAL, "lfcd", NULL
, but this didn't work. A terminal opens and instantly closes. I then tried making a script namedlfcd
in ~/.local/bin with:This still didn't work. I have very little experience and have no idea how to get this working. Any suggestions?