You can sign up to get a daily email of our articles, see the Mailing List page!
Support us on Patreon to keep GamingOnLinux alive. This ensures we have no timed articles and no paywalls. Just good, fresh content! Alternatively, you can donate through Paypal, Flattr and Liberapay.!
Take a screenshot on mouse button press?
liamdawe commented on 25 April 2018 at 9:40 am UTC

Hi all, looking for a simple way to setup a mouse button press (one of my extra side buttons) to take a screenshot.

Anyone got a good idea?

Bonus points if you know of a script that I can setup to take a screenshot every x seconds as well.

Ehvis commented on 25 April 2018 at 10:23 am UTC

You can use something like xbindkeys to map mouse buttons to key presses. Should be enough for Steam screenshots.

You could use OBS to make 30 screenshots per second and combine them into a convenient screenshot library file.

liamdawe commented on 25 April 2018 at 10:28 am UTC

I've tried using screenshots taken from an OBS recording, but no matter what the quality of an OBS recording on any setting just doesn't compare to a screengrab even when set on maximum recording quality.

xbindkeys seems interesting, but I've literally no idea what I'm looking at

liamdawe commented on 25 April 2018 at 10:40 am UTC

Okay, I think I have something that will suffice:
while true; do scrot -u "/home/liam/Pictures/Screenshots/`date`.png"; done
Takes a shot of the active window every second and saves it, basically what I need for taking screenshots of games in-action. Might do until I find something to easily map a mouse button

ageres commented on 25 April 2018 at 12:38 pm UTC

1. Install some programs:
sudo apt install xbindkeys xautomation

2. Learn what number your desired button has:
xev | grep state
(press keys and buttons and see output in your terminal)
Let's say it's mouse button 9

3. Create a config file:
nano ~/.xbindkeysrc
Type there:

"xte 'key Print'"

4. Launch xbindkeys:
If you want to change something in that config, after that execute:
killall xbindkey

Xpander commented on 25 April 2018 at 1:52 pm UTC

im using this:

all binded to keyboard shortcuts.
makes a notification also so i know it succeeded or failed

Due to spam you need to Register and Login to comment.

Or login with...

Livestreams & Videos
Community Livestreams
  • Story Time: „Unforeseen Incidents“
  • Date:
See more!
Popular this week
View by Category
Latest Comments
Latest Forum Posts