How to disable PrtSc in Cinnamon

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
chenaren
Level 1
Level 1
Posts: 10
Joined: Thu Dec 12, 2013 6:24 am

How to disable PrtSc in Cinnamon

Post by chenaren » Sat Dec 14, 2013 2:38 am

Since the PrtSc button is very easy to be hit by accident on my keyboard, I'd like to disable its function. I've tried to Google the solution, and it seems there's an easy solution on Ubuntu [[url]http://askubuntu.com/questions/279496/how-to-disable-print-screen-shortcut[/url]], but there's no such Screenshots item in my shortcut setting menu. Does anyone know how to disable PrtSc in the Cinnamon desktop environment? Thanks a lot. :)

User avatar
jungle_boy
Level 7
Level 7
Posts: 1715
Joined: Thu Aug 19, 2010 2:51 pm
Location: Amazon Rain Forest Land

Re: How to disable PrtSc in Cinnamon

Post by jungle_boy » Sat Dec 14, 2013 3:07 pm

I researched a lot about how to disable the Print Screen key in cinnamon, it is very difficult to find some consistency, but I found a solution that I think will work in your case.
The Print Screen key is used by the program gnome-screenshot, so we need to disable gnome-screenshot binary. On the other hand, you may be unable to take screenshots of your desktop; to resolve this you will have to install another program for taking screenshots, as Shutter, for example; Here we go:

Using cinnamon, click the terminal icon on the taskbar, and then type:

Code: Select all

sudo su
<type your root password>
cd /usr/bin
chmod a-x gnome-screenshot
apt-get install shutter
Should be something like this:

Code: Select all

mint@ubuntu ~ $ sudo su
[sudo] password for mint: 
ubuntu mint # cd /usr/bin
ubuntu bin # chmod a-x gnome-screenshot
ubuntu bin # apt-get install shutter
Close terminal and test your Print Screen key...
Del Inspiron 5480, Quad-core, Core I5 8th Gen, Geforce MX 150,
LM 19.2 Cinnamon

darvelo
Level 1
Level 1
Posts: 4
Joined: Fri Sep 19, 2008 7:36 pm

Re: How to disable PrtSc in Cinnamon

Post by darvelo » Sat Jan 11, 2014 4:42 am

I managed to find out where to disable the PrtSc button in Cinnamon. If you:

Code: Select all

$ sudo apt-get install dconf-editor
and then fire it up, all you have to do is navigate to "org -> cinnamon -> settings-daemon -> plugins -> media-keys" and in the right-hand pane, change the line labeled screenshot to be empty (by default it says "Print". After this you can leave it disabled, or feel free to remap the PrtSc key to anything you like using the Keyboard menu in Cinnamon's System Settings as normal.

azyr
Level 1
Level 1
Posts: 1
Joined: Sat Jul 16, 2016 3:15 am

Re: How to disable PrtSc in Cinnamon

Post by azyr » Sat Jul 16, 2016 3:21 am

darvelo wrote:I managed to find out where to disable the PrtSc button in Cinnamon. If you:

Code: Select all

$ sudo apt-get install dconf-editor
and then fire it up, all you have to do is navigate to "org -> cinnamon -> settings-daemon -> plugins -> media-keys" and in the right-hand pane, change the line labeled screenshot to be empty (by default it says "Print". After this you can leave it disabled, or feel free to remap the PrtSc key to anything you like using the Keyboard menu in Cinnamon's System Settings as normal.
The location of this particular setting might change between Cinnamon versions. You should try hitting <ctrl-f> on dconf-editor and searching for "screenshot". You will most likely find your the correct setting this way.

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 10:46 am

jungle_boy wrote:I researched a lot about how to disable the Print Screen key in cinnamon, it is very difficult to find some consistency, but I found a solution that I think will work in your case.
The Print Screen key is used by the program gnome-screenshot, so we need to disable gnome-screenshot binary. On the other hand, you may be unable to take screenshots of your desktop; to resolve this you will have to install another program for taking screenshots, as Shutter, for example; Here we go:

Using cinnamon, click the terminal icon on the taskbar, and then type:

Code: Select all

sudo su
<type your root password>
cd /usr/bin
chmod a-x gnome-screenshot
apt-get install shutter
Should be something like this:

Code: Select all

mint@ubuntu ~ $ sudo su
[sudo] password for mint: 
ubuntu mint # cd /usr/bin
ubuntu bin # chmod a-x gnome-screenshot
ubuntu bin # apt-get install shutter
Close terminal and test your Print Screen key...
I need to revert this change, how can I do that? I have removed shutter (sudo apt-get remove shutter), but the print screen function does not work.
Thank you.
[SOLVED}
Last edited by rishiddh on Sun Jan 21, 2018 3:34 pm, edited 1 time in total.

User avatar
greerd
Level 6
Level 6
Posts: 1058
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: How to disable PrtSc in Cinnamon

Post by greerd » Sun Jan 21, 2018 10:59 am

Have you tried keyboard mapping? In cinnamon its menu - Preferences - Keyboard - Shortcuts - System - Screenshots and Recording.
You can remove or remap the keys. Also @rishiddh, you should be able to setup your mapping again.

User avatar
Flemur
Level 17
Level 17
Posts: 7385
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: How to disable PrtSc in Cinnamon

Post by Flemur » Sun Jan 21, 2018 11:29 am

rishiddh wrote: ubuntu bin # chmod a-x gnome-screenshot
...
I need to revert this change, how can I do that?
The "chmod" change?

Code: Select all

sudo chmod a+x `which gnome-screenshot`
Or reinstalling gnome-screenshot might fix it...
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
phd21
Level 19
Level 19
Posts: 9516
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How to disable PrtSc in Cinnamon

Post by phd21 » Sun Jan 21, 2018 1:26 pm

Hi "chenaren",

Couldn't you just remove the current keyboard shortcut to that through System Settings -> Keyboard --> Shortcuts -> System -> Screenshots and Recording, or reassign it to another key combination like the "pause/break" key? Just click the shortcut (accelerator key), and hit the backspace to erase it.

Hope this helps ...
Cinnamon
Cinnamon
Cinnamon<br />- add a new print screen utility
Cinnamon
- add a new print screen utility
Last edited by phd21 on Sun Jan 21, 2018 2:26 pm, edited 1 time in total.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, 256gb SDD, only Intel 4 Graphics. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 2:04 pm

greerd wrote:Have you tried keyboard mapping? In cinnamon its menu - Preferences - Keyboard - Shortcuts - System - Screenshots and Recording.
You can remove or remap the keys. Also @rishiddh, you should be able to setup your mapping again.
@greerd, yes I was able to set screenshot to another key combination using shortcut stettings as you have mentioned. I remapped PrtSc key to context menu using Xmodmap. It workes for me, but the changes are not permanent. I have to remap it everytime I login to my system.

I am not able to permanently write this keymap.

thank you.

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 2:13 pm

Flemur wrote:
rishiddh wrote: ubuntu bin # chmod a-x gnome-screenshot
...
I need to revert this change, how can I do that?
The "chmod" change?

Code: Select all

sudo chmod a+x `which gnome-screenshot`
Or reinstalling gnome-screenshot might fix it...
I tried sudo chmod a+x `which gnome-screenshot` within bin directory and within home directory, it is giving me an error saying

Code: Select all

chmod: cannot access 'which gnome-screenshot': No such file or directory
I am runing these with root privileges.
then I tried reinstalling gnome-screenshot, and it is already installed. Still the screenshot function does not work.

thank you Flemur

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 2:23 pm

phd21 wrote:Hi "chenaren",

Couldn't you just remove the current keyboard shortcut to that through System Settings -> Keyboard --> Shortcuts, or reassign it to another key combination like the "pause/break" key?

Hope this helps ...

Cinnamon_PrintScreen_Shortcut1.jpg

Cinnamon_PrintScreen_Shortcut2.jpg
HI, I dont see shutter shortcut in my custom list.
And I was able to assign screenshot to anothed key combination as well as disable it. This did help with remapping Print key to Menu key, but this changes are not permanent.

User avatar
phd21
Level 19
Level 19
Posts: 9516
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How to disable PrtSc in Cinnamon

Post by phd21 » Sun Jan 21, 2018 2:34 pm

Hi "rishiddh" and "chenaren", etc...

I just updated my text and screenshots from my last reply, please re-read it.

There are various screenshot (print screen, screen capture) applications available in addition to the default screenshot application that comes with each edition and version of Linux Mint.

"Shutter" is a great screenshot (print screen) application that anyone can install using the Software Manager or Synaptic Package Manager (SPM), or using their PPA. It has many features.

"Ksnip" is another excellent, newly updated, screenshot application with a built-in painter editor, and can upload to "imgur" image hosting website. See post on "Ksnip" in this forum.
FYI - "ksnip" really nice screen capture app with Imgur upload and built-in painter functions
viewtopic.php?f=47&t=260112&hilit=ksnip

If you change the trigger Key (accelerator shortcut key), or remove it using the Backspace key, through the System Settings menu, it should stick (unless you are using the Live test drive installation version of Linux Mint).

Hope this helps ...
Last edited by phd21 on Sun Jan 21, 2018 2:57 pm, edited 6 times in total.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, 256gb SDD, only Intel 4 Graphics. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
Termy
Level 5
Level 5
Posts: 764
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: How to disable PrtSc in Cinnamon

Post by Termy » Sun Jan 21, 2018 2:35 pm

I wrote this small script for you, in hopes that it would solve your problems, or at least work around them:

https://github.com/terminalforlife/misc ... r/noprtscr

Download and save the script by running:

Code: Select all

wget -q https://raw.githubusercontent.com/terminalforlife/miscellaneous/master/noprtscr -O ./noprtscr
You should now see a "noprtscr" file (the script) in the current directory, which you can move whereever, then run it as a startup item, so it executes on login. This will replace the keybaord shortcuts in question (all Print keys) with "Null", thus disabling the keys, but not actually removing the entries, allowing you to make use of them at some point in the future. Let me know if it helps.

EDIT: I forgot something simple, but it's fixed now.
Last edited by Termy on Sun Jan 21, 2018 2:39 pm, edited 1 time in total.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

User avatar
Flemur
Level 17
Level 17
Posts: 7385
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: How to disable PrtSc in Cinnamon

Post by Flemur » Sun Jan 21, 2018 2:38 pm

rishiddh wrote:I tried sudo chmod a+x `which gnome-screenshot` within bin directory and within home directory, it is giving me an error saying

Code: Select all

chmod: cannot access 'which gnome-screenshot': No such file or directory

Code: Select all

which gnome-screenshot
returns the location of the executable, so it doesn't matter where you run that command, like
$ ls -l `which apt-get`
-rwxr-xr-x 1 root root 43128 Jul 27 14:36 /usr/bin/apt-get
rishiddh wrote:I am runing these with root privileges.
then I tried reinstalling gnome-screenshot, and it is already installed. Still the screenshot function does not work.
thank you Flemur
Well, the first problem indicates that it's not installed.
EDIT: NO IT DOESN'T! ^^^ After an executable is marked not-executable, it doesn't show up in 'which'!

What does

Code: Select all

which gnome-screenshot
return?

Edit: do it like this:
I tried reinstalling gnome-screenshot, and it is already installed.

Code: Select all

sudo apt-get install gnome-screenshot --reinstall
or

Code: Select all

sudo dpkg-reconfigure gnome-screenshot
Last edited by Flemur on Sun Jan 21, 2018 2:45 pm, edited 1 time in total.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: How to disable PrtSc in Cinnamon

Post by Mute Ant » Sun Jan 21, 2018 2:42 pm

Those are not apostrophes ''''' they are back-ticks `````
sudo chmod a+x `which gnome-screenshot`

sudo chmod a+x $(which gnome-screenshot)
...does the same and is easier to read.

Reinstalling gnome-screenshot will fix it...
sudo apt-get install --reinstall gnome-screenshot
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

User avatar
Flemur
Level 17
Level 17
Posts: 7385
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: How to disable PrtSc in Cinnamon

Post by Flemur » Sun Jan 21, 2018 2:46 pm

Mute Ant wrote:Those are not apostrophes ''''' they are back-ticks `````
sudo chmod a+x `which gnome-screenshot`
He was doing it correctly - see my bold-big-font correction of the bad advice I gave him above.

Code: Select all

$ which apt-get
/usr/bin/apt-get
$ sudo chmod a-x `which apt-get`
$ which apt-get [nothing returned]
$ sudo chmod a+x /usr/bin/apt-get 
$ which apt-get
/usr/bin/apt-get
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
Termy
Level 5
Level 5
Posts: 764
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: How to disable PrtSc in Cinnamon

Post by Termy » Sun Jan 21, 2018 3:00 pm

Okay, ignore my script. I got the right idea, but the wrong batch of entries. I'm pretty sure it's org.cinnamon.desktop.keybindings.media-keys but getting them to be unassigned is a pain. You could set them to a key you never use though. I'll update the script on GitHub if and when I ever figure it out.

OK, fixed. Tested it and it works, at least for me.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 3:07 pm

Flemur wrote:
rishiddh wrote:I tried sudo chmod a+x `which gnome-screenshot` within bin directory and within home directory, it is giving me an error saying

Code: Select all

chmod: cannot access 'which gnome-screenshot': No such file or directory

Code: Select all

which gnome-screenshot
returns the location of the executable, so it doesn't matter where you run that command, like
$ ls -l `which apt-get`
-rwxr-xr-x 1 root root 43128 Jul 27 14:36 /usr/bin/apt-get
rishiddh wrote:I am runing these with root privileges.
then I tried reinstalling gnome-screenshot, and it is already installed. Still the screenshot function does not work.
thank you Flemur
Well, the first problem indicates that it's not installed.
EDIT: NO IT DOESN'T! ^^^ After an executable is marked not-executable, it doesn't show up in 'which'!

What does

Code: Select all

which gnome-screenshot
return?

Edit: do it like this:
I tried reinstalling gnome-screenshot, and it is already installed.

Code: Select all

sudo apt-get install gnome-screenshot --reinstall
or

Code: Select all

sudo dpkg-reconfigure gnome-screenshot
Thank you Flemur, reinstalling worked and the screenshot function is working.

Code: Select all

which gnome-screenshot
this did not return anything, and after that I reinstalled gnome-screenshot. Now it returns

Code: Select all

/usr/bin/gnome-screenshot
Flemur wrote:returns the location of the executable, so it doesn't matter where you run that command, like
$ ls -l `which apt-get`
-rwxr-xr-x 1 root root 43128 Jul 27 14:36 /usr/bin/apt-get
thank you, I am fairly new to Linux and I look forward to such explainations.

[SOLVED}
Last edited by rishiddh on Sun Jan 21, 2018 3:37 pm, edited 1 time in total.

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 3:21 pm

Mute Ant wrote:Those are not apostrophes ''''' they are back-ticks `````
sudo chmod a+x `which gnome-screenshot`

sudo chmod a+x $(which gnome-screenshot)
...does the same and is easier to read.

Reinstalling gnome-screenshot will fix it...
sudo apt-get install --reinstall gnome-screenshot
Thank you Mute Ant, I had no idea and I shall be careful about back-ticks now on.

@ Flemur: I was typing apostrophes instead of back-ticks

But Reinstalling it worked like you both suggested.

Thank you.

[SOLVED}
Last edited by rishiddh on Sun Jan 21, 2018 3:37 pm, edited 1 time in total.

rishiddh
Level 1
Level 1
Posts: 12
Joined: Tue Oct 10, 2017 9:42 am

Re: How to disable PrtSc in Cinnamon

Post by rishiddh » Sun Jan 21, 2018 3:33 pm

Termy wrote:I wrote this small script for you, in hopes that it would solve your problems, or at least work around them:

https://github.com/terminalforlife/misc ... r/noprtscr

Download and save the script by running:

Code: Select all

wget -q https://raw.githubusercontent.com/terminalforlife/miscellaneous/master/noprtscr -O ./noprtscr
You should now see a "noprtscr" file (the script) in the current directory, which you can move whereever, then run it as a startup item, so it executes on login. This will replace the keybaord shortcuts in question (all Print keys) with "Null", thus disabling the keys, but not actually removing the entries, allowing you to make use of them at some point in the future. Let me know if it helps.

EDIT: I forgot something simple, but it's fixed now.
Thank you Termy for the script. I ran your script, and there were no errors. But I can still take screenshots with a reassigned key combination (Alt+P). Also I am fairly new to Linux, I could have made some mistake in this or I am not understanding what it is doing.

And about re designating/remapping Print ket to Menu(this is because of the new thinkpad keypad layout where prtsc key is in place of menu), Than is still not permanent.


Thank you for all the help.

Locked

Return to “Newbie Questions”