Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

bindsym Print exec bash -c 'grim -g "$(slurp)" ~/Screenshots/$(date…

  1. User

    bindsym Print exec bash -c 'grim -g "(slurp)" /Screenshots/(slurp)" ~/Screenshots/(date +%Y-%m-%d_%H-%M-%S).png && swappy -f ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png' swappy storing screenshot in home directory when I click save in swappy

  2. Assistant

    The command you've shared is set up to take a screenshot using grim, save it in the ~/Screenshots/ directory with a timestamp, and then open swappy to allow you to annotate or edit the screenshot. However, the issue you're experiencing is that swappy saves the edited image in your home directory instead of the ~/Screenshots/ directory.

    To resolve this issue, you can modify swappy to save the edited output to the same ~/Screenshots/ directory. One way to do this is by changing the command to either specify a save location for swappy or by moving the file after you save it.

    Option 1: Specify Save Location in Swappy

    You can use swappy's -o or --output option to specify the output file directly. Here’s how you can modify your command:

    bindsym Print exec bash -c 'grim -g "$(slurp)" ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png && swappy -f ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png -o ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S)_edited.png'
    

    Option 2: Move the Output Later

    If swappy does not have an output option that suits your needs, you can leave the command as it is (where swappy saves the result in your home directory) and then move the saved file to the ~/Screenshots/ directory after you're done. Here’s how you can set that up:

    bindsym Print exec bash -c 'grim -g "$(slurp)" ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png && swappy -f ~/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png; mv ~/$(date +%Y-%m-%d_%H-%M-%S)_edited.png ~/Screenshots/'
    

    Summary

    1. Use swappy with the -o option to directly specify where to save the edited image.
    2. Alternatively, you can move the edited image to ~/Screenshots/ after saving if swappy does not provide an option to specify the output location.

    Try out one of these solutions, and it should help you manage your screenshots better!