-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnoprtscr
50 lines (43 loc) · 1.66 KB
/
noprtscr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#----------------------------------------------------------------------------------
# Project Name - miscellaneous/noprtscr (No Print Screen)
# Started On - Sun 21 Jan 18:30:36 GMT 2018
# Last Change - Mon 2 Apr 04:12:09 BST 2018
# Author E-Mail - [email protected]
# Author GitHub - https://github.com/terminalforlife
#----------------------------------------------------------------------------------
# A small script to remedy this issue in Linux Mint 18.3 with Cinnamon:
#
# https://forums.linuxmint.com/viewtopic.php?f=90&t=152887
#
# Also enable the exra feature (launch the Menu with PrtSc) with:
#
# OPTS: --version|-v - Output only the version datestamp.
# --prtsc-is-menu - Use PrtSC to launch the Mint Menu.
#----------------------------------------------------------------------------------
_VERSION_="2018-04-02"
XERR(){ printf "[L%0.4d] ERROR: %s\n" "$1" "$2" 1>&2; exit 1; }
if ! [ -x /usr/bin/gsettings ]; then
XERR "$LINENO" "Dependency '/usr/bin/gsettings' not met."
fi
while [ "$1" ]; do
case "$1" in
--version|-v)
printf "%s\n" "$_VERSION_"
exit 0 ;;
--prtsc-is-menu)
# Feature the OP in the thread requested.
SCHEMA="com.linuxmint.mintmenu"
/usr/bin/gsettings set "$SCHEMA" hot-key "Print" ;;
*)
XERR "$LINENO" "Incorrect argument(s) specified." ;;
esac
shift
done
SCHEMA="org.cinnamon.desktop.keybindings.media-keys"
for KEY in {area,window}-screenshot{,-clip} screenshot{,-clip}; {
if ! /usr/bin/gsettings set "$SCHEMA" "$KEY" "[]"; then
XERR "$LINENO" "Unable to clear: $KEY"
fi
}
# vim: ft=sh noexpandtab colorcolumn=84 tabstop=8 noswapfile nobackup