swayimg
swayimg copied to clipboard
bind multiple commands with `--config`
Hi, I want to write a script that allows me to browse a directory of images, and when on exit (pressing q
) the current image is
written to a file last_page.txt
, and then exit. So when running the script again it read the file last_page.txt
and pass it to swayimg
that way it starts up at the last page/image.
last_page=~/last_page_sway.txt
curr_page="$(cat $last_page)"
swayimg \
-p 0,0 \
--config='keys.viewer.q=exec echo "%" > ~/last_page_sway.txt; exit' \
$curr_page
The issue is, when pressing q
, the current_file
is not written to last_page.txt
and it just exits
I have commented out the q
keybind in the config file for both the viewer
and gallery
.