Capture, annotate, share screenshots with Shutter on Pop!_OS 20.10 (Gnome 3.38)

I’ve just waisted 5 hours of my life trying to reproduce what ShareX on Windows and Monosnap on Windows/Mac do effortlessly.

Removing built-in Gnome Screenshots

Can’t be done. Althought I uninstalled it from the Pop!_Shop, logged out, and even rebooted my system twice, the print screen key is still saving screenshots in ~/Images.

Pop!_Shop offers to install the package after it’s been uninstalled, even though it’s still working.

Workaround

Open Keyboard Preferences, scroll down to Customize Shortcuts, de-activate all screenshots hotkeys.

This looks like a bug and I whish I could report it to System76 once I’m more confident with contributions (it’s still unclear to me if it’s Pop-related, Gnome-related, Ubuntu-related, or PEBKAC).


Packages that do not work

  • Screencloud: I had to intall the sluggish Snap Store to install it. App was sluggish too. Was unable to launch app automatically after reboot. Was unable to change the hotkey to « print screen ». Was even unable to have the default hotkeys work without relaunching the app between each screenshot.
  • Kazam: no file sharing.
  • Flameshot: Pros: works, fast, nice interface. Cons: no text annotation.
  • Ksnip: no (S)FTP.
  • MagicCap: Looked like the perfect fit. Unfortunately, no instruction. Confusing post on GitHub on how to build/compile/whatever is inside the ZIP and .AppImage file that does not open. Turns out one has to go to the folder and run ./Magiccap. Options not working. Could find a way to launch it automatically after reboot.
  • Ginj: promisingly simple, but did not work.
  • Coreshot: promisingly elegant, but doesn’t share.

Enters Shutter

Blog posts about Shutter depict this program as the de facto screenshot editing and sharing software. Too bad it didn’t pop de facto during the 3 first hours I was googling these exact terms.

Whoever Logix is, God bless him or her for writing this tutorial, updated 4 days ago (at the time of me writing this post) entitled New Shutter PPA For Ubuntu 21.04, 20.10, 20.04 And 18.04 | Linux Mint 20.x And 19.x

It starts with a bad news: « Shutter screenshot tool was removed from Debian Unstable and Ubuntu 18.10 (to be released tomorrow) recently » so I hope I won’t waste another 5 hours looking for alternative on the next update. The website provides some updated PPAs (don’t ask me what it is and how it works) to fix that.

As a thank you, I am subscribing to their RSS feed and whitelisting their 10-tracker website from uBlock Origin:

Thanks for the PPA thing, guys!

The steps are straightforward, I’m copy-pasting here as a backup:

sudo add-apt-repository ppa:linuxuprising/shutter
sudo apt-get update
sudo apt install shutter
sudo apt install gnome-web-photo

Sweet Jesus, Shutter works.


How about buggy FTP?

I’d rather use SFTP of FTPS but after 3 hours of digging, FTP was OK.

I’ve been running a standard Vsftpd server for many years, it never disappointed me or my colleagues.
Somehow Shutter never agreed to connect to it, always returning 500 illegal PORT command error.

I’ve reviewed my configuration, reactivated, deactivated, rereactivated Passive mode, disabled, renabled the server’s firewall, updated the package (hint: no update available), restarted it, zilch. FileZilla works just fine.

No luck with GitHub issues history.

Another 30 minutes wasted.


Enters the Russian guy

I don’t know who Elivin is, but cheers for making a SFTP connector for Shutter 3 years go, posted on GitHub. I’m forking it for the sake of backup.

Instructions are not super clear however (maybe a Google Translate thing). So here’s what I had to do.

apt-get install libnet-sftp-foreign-perl

sudo wget https://raw.githubusercontent.com/elivin/shutter-sftp/master/SftpUpload.pm
sudo chmod +x SftpUpload.pm
nano ~/.config/shutter-sftp.json

File contents:

{
"host":"hostname_or_IP",
"directory":"/home/user/www",
"link":"https://destination_without_trailing_slash",
"username":"user",
"password":"*****"
}

Also I removed other plugins inside the upload_plugins/upload directory, it’s the only way I found to have the SFTP option selected by default in Shutter.

Debugging

There were white spaces and comas in my JSON that prevented Shutter to work. Except that it did launch, so I didn’t noticed the failure easily.

To find out, I had to launch Shutter using the command line:

germain@pop-os:/usr/share/shutter/resources/system/upload_plugins/upload$ shutter --debug
WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!

(...)

There I understood my mistake. Shutter won’t return any error if the JSON is malformed.


My Preferences

Shutter has a profile management system for Preferences. Great! Except that I saved mine at least 5 times, and everytime I quit and relaunch the app, my profile name is gone and replaced by « * »:

Reminder for my next clean install: here are my settings

Filename

$nb_name_%d%m%Y_$RRRR

Actions

Open with built-in editor

Automatic launch

Auto-delete files on tab closing


How about hotkeys?

As strange as it looks, there’s no hotkey panel in Shutter. One has to open System Preferences again, scroll down to Customize Shortcuts, and make any shortcut execute shutter -s:

Other options can be passed to the shutter command, I used them for delayed screenshots and active window screenshots:

Shutter Window
shutter --delay=0.1 -w

Shutter 10s
shutter --delay=10 -s

I know, I should name it 5s not 10s

All options to be found in man shutter:


What a night!

I begun hunting for a screenshot annotating & sharing tool at 00:09.
It’s now 05:08 A.M.

Tonight I missed Windows 10 and Mac OS.

Aaaand I don’t even remember which screenshot I wanted to share, and with whom.

Troubleshooting

Two days after I’m configuring Pop!_OS 20.10 on my office XPS 13 and therefore reinstalling Shutter. It all went OK except I can’t upload.

If something goes wrong, always load Shutter from the command line using (type shutter).

Can’t locate Net/SFTP/Foreign.pm

It looks like a Perl-related error. From this post on Red Hat forums, I tried:

perl -MCPAN -e shell
cpan[1]> install Net::SFTP

I have been asked a lot of questions which I have always answered by pressing the Enter key (default choice). Then my computer downloaded, compiled, installed a cubic shit-ton of stuff for 20 minutes. I changed fucking nothing.

This one did the trick:
cpan[1]> install Net::SFTP::Foreign (more info)

Next error:

Remote host signature

OK I know this one.
Just make a SFTP connexion through the command-line to validate the remote host’s fingerprint:

germain@xps:~$ sftp user@remote_host

BUT it works only when Shutter is launched from the CLI.
Using the application launcher, the SFTP plugin won’t appear.

How to debug:

Quit Shutter.

germain@xps:~$ sudo tail -f /var/log/syslog

Launch Shutter.

Can't locate Net/SFTP/Foreign.pm in @INC (you may need to install the Net::SFTP::Foreign module) (@INC contains: /usr/share/shutter/resources/modules /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.3 /usr/local/share/perl/5.30.3 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl) at /usr/share/shutter/resources/system/upload_plugins/upload/SftpUpload.pm line 72.

Quit Shutter.

germain@xps:~$ locate Foreign.pm
/home/germain/.cpan/build/Net-SFTP-Foreign-1.93-0/blib/lib/Net/SFTP/Foreign.pm
/home/germain/.cpan/build/Net-SFTP-Foreign-1.93-0/lib/Net/SFTP/Foreign.pm
/home/germain/perl5/lib/perl5/Net/SFTP/Foreign.pm

germain@xps:~$ sudo mkdir -p /usr/share/perl5/Net/SFTP
germain@xps:~$
sudo cp -r /home/germain/perl5/lib/perl5/Net/SFTP/* /usr/share/perl5/Net/SFTP/

Launch Shutter, pray, adapt, iterate.

Flipping Tables / (╯°□°)╯︵ ┻━┻

I checked, removed, reinstalled the modules, still not working.

Instead of throwing my computer away I changed my configuration to key authentication.

ssh-copy-id -i id_rsa.pub user@remote_host

nano ~/.config/shutter-sftp.json

File contents:

{
    "host":"hostname_or_IP",
    "directory":"/home/user/www",
    "link":"https://destination_without_trailing_slash",
    "username":"user",
    "key":"/home/germain/.ssh/id_rsa",
}

It’s finally working!

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.