Tuesday | 30 APR 2024
[ previous ]
[ next ]

Snipping Tool with Wayland

Title:
Date: 2023-10-19
Tags:  

I like the way I can use snipping tool very quickly in windows and wanted to mimic it on wayland. These instructions are for Arch but it will be similar for the other distros.

The first step is to install grimshot through the AUR.

cd ~/builds/
git clone https://aur.archlinux.org/grimshot.git
cd grimshot
makepkg
sudo pacman -U grimshot..x..zst

This may ask you to install some dependencies if you don't already have them.

You will also need to install wl-clipboard to get wl-copy:

sudo pacman -Sy wl-clipboard

Now we can take a screenshot by doing:

grimshot copy anything

This command will take a screenshot and leave it in the clipboard. We can paste teh image wherever we need to.

Now we are almost done. The last step is to write a script that will run this command from my launcher.

Create a file ~/bin/snipping and put the following:

#!/usr/bin/bash

grimshot copy anything

Now make it executable:

chmod +X ~/bin/snipping

Now I have ~/bin set to be added to my path in my bash/fish config files so my launcher will recognize snipping as a valid command.

Voila! I now have something very similar to what I had in windows to take screenshots.