You are Here:
Linux Lite 4.8 Final is now available for download and installation



Display XFCE shorcut keys cheat sheat on desktop

Author (Read 1171 times)

0 Members and 2 Guests are viewing this topic.

Display XFCE shorcut keys cheat sheat on desktop
« on: January 17, 2020, 06:21:44 PM »
 

Moltke

  • Gold Level Poster
  • *******
  • 628
    Posts
  • Country: ve
  • Reputation: 77
  • Linux Lite Member

  • Linux Lite: 3.8 64bit

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 4.x
Hi everyone! Hope you're all having a nice life and a wonderful 2020! :)

We all love having shortcut keys for launching our most used apps, open directories or execute  certain tasks, but sometimes it might be hard to remember each and every single one of them, even more if like me, you hardly ever use the mouse but rely on the keyboard most of the times. Once I had this idea of having a wallpaper with all the SCKs, but eventually I realized how inconvenient that was, besides the fact that it wasn't the prettiest background to look at day after day  :P I memorized a few and thought that was the best thing to do and the only solution, only it wasn't. A couple of years ago I discovered aswesome-wm and inmediately loved it; it's keyboard driven so most actions can be triggered by pressing a key combo, and that includes displaying all the available key combos, by pressing Meta key (win key)+S a quick presentation is displayed on the desktop with all of the shorcut keys available for every action you can perform; switch between windows, close/open a window, open a terminal, restart the window manager and so on ... so everytime I switched back to XFCE I really wanted to be able to do this, which I did and today I'm going to share with you how you can do it too.


1.- Create an image cointaining the shortcut keys you want to have at hand. You can do this by taking some screenshots at Settings >> Keyboard >> Application Shortcuts and Settings >> Window Manager >> Keyboard Then use something like GIMP and put those images together thus creating a new one, with the resolution of your screen i.e 1920x1080 or another size of your choice, name it whatever you like (I named mine sheet) and save it to your home directory or any other location of your choice. If you have the skiils, the time and the will to do so - I didn't - , you could also create your own custom image by tipying and/or copying and pasting them using GIMP or whatever it is you use.

 2.- You need feh,  https://feh.finalrewind.org/
Quote
an X11 image viewer aimed mostly at console users. Unlike most other viewers, it does not have a fancy GUI, but simply displays images. It is controlled via commandline arguments and configurable key/mouse actions.
This will be the app responsible for displaying your cheat sheet, to install it just open a terminal and type
Code: [Select]
sudo apt-get install feh app size is around 2mb and total install size is around 10.5mb, so it won't eat your HDD/SSD space. Don't close the terminal just yet, you still need it.  ;D



3.- Once feh's installed type
Code: [Select]
nano sc_cheat.sh and paste the following lines in the new file
Code: [Select]
#!/bin/bash
#Show shortcut keys cheat sheet

if pidof feh [0-9]
   then
    killall feh
   else
    feh sheet.png &   #this works if the img file is in your /home otherwise you have to specify the location or it won't. i.e feh /path/to/image &
fi

press Ctrl+o and then Enter to save the file, then press Ctrl+x to close nano. Don't close the terminal, you need to make the file executable, for that type
Code: [Select]
chmod 755 sc_cheat.sh and hit Enter. Now you can test the script to see whether or not it works, to do that just type
Code: [Select]
./sc_cheat.sh if eveything went right you'll be presented with your cheat sheet on your screen, to close the image, click on your terminal window and hit the up arrow key in your keyboard to go back a command in your history, which unless you had typed something else should be the script, then hit enter, o simply click on the close button  in the feh window, that is, click on the "x". Alternatively, if you don't like using the terminal, then open a text editor of your choice i.e mousepad and create a new file, paste the lines above and save it with the .sh extension, open the location of the file in your file manager, right click on it, select properties from the context menu and check the box that reads Allow this file to run as a program, double-click on it or select it and hit enter to test it.



4.- Open the terminal and type nano or use another text editor i.e mousepad, then copy and paste the following
Code: [Select]
[Desktop Entry]
Version=1.0
Name=Sheet
Categories=Accesories
Comment=Show shortcut keys cheat sheet
Exec=/home/youruser/sc_cheat.sh  #change "youruser" for your actual username
Icon=your_icon.png  #change "your_icon.png" for the actual name of the .png file.
Type=Application

Save it  and name it whatever you like with the .desktop extension in /home/your_user/.local/share/applications (I named mine Sheet.desktop) now the script will be available in whisker menu.



5.- We want this to be available with a shorcut; it will run and stop the action when pressing the keys you assigned, so go to Settings >> Keyboard >> Application Shortcut click on the "+ Add" button and in the window that pops up where it reads command type /home/your_user/sc_cheat.sh or click on the open button and navigate to the script's location and select it, then click on OK and when asked press the keys you want to assign for launching it as well as stopping it and that's it. 











You can also make the window borderless by passing the -x flag to feh, for that our script should look like this.
Code: [Select]
#!/bin/bash
#Show shortcut keys cheat sheet

if pidof feh [0-9]
   then
    killall feh
   else
    feh -x sheet.png &   #this will make the window borderless
fi



Now you won't have to remember every single one of  your shortcut keys but just one, instead you can use that space in your memory you just gained for something else.  ;D

Last Edit: January 18, 2020, 12:34:19 PM by Moltke
Without each others help there ain't no hope for us :)
 


Re: Display XFCE shorcut keys cheat sheat on desktop
« Reply #1 on: January 17, 2020, 09:06:25 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7425
    Posts
  • Country: nz
  • Reputation: 697
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960

  • Kernel: 4.x
Very nice :) Do you have any screenshots?
 

Re: Display XFCE shorcut keys cheat sheat on desktop
« Reply #2 on: January 18, 2020, 12:01:11 AM »
 

Moltke

  • Gold Level Poster
  • *******
  • 628
    Posts
  • Country: ve
  • Reputation: 77
  • Linux Lite Member

  • Linux Lite: 3.8 64bit

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 4.x
Very nice :) Do you have any screenshots?

I just added a few :) I do have some others when first did this but they are in Spanish  and I thought it might be better if they are in English so members/users don't struggle while trying to follow the instructions.
Last Edit: January 18, 2020, 12:35:49 PM by Moltke
Without each others help there ain't no hope for us :)
 

Re: Display XFCE shorcut keys cheat sheat on desktop
« Reply #3 on: January 18, 2020, 05:50:06 PM »
 

Moltke

  • Gold Level Poster
  • *******
  • 628
    Posts
  • Country: ve
  • Reputation: 77
  • Linux Lite Member

  • Linux Lite: 3.8 64bit

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 4.x
I knew posting this tutorial here wil pay off and indeed it did :) Been playing a bit with the cheat sheet cause I honestly didn't care too much that it was so simple as long as it served its purpose and it does, but I thought I might do better than that and think I'm going in the right direction ;D ... behold!









By the way, while playing around with this and reading here and







By the way, while playing around with this I learnt that you can use imagemagick to manipulate the image and in fact use it in the script by passing something like this
Code: [Select]
display -colorspace CMY -raise 5 sheet.png &
This will result in something like the second image, the one with the black background. If you don't want to install feh, you can use that since magick's aleady installed in LL by default. However, I find that using feh is much better since using the magick method will open the image in the magick editor; right-clicking in the image pops ups the menu. Feh, on the other hand is just an image viewer so it won't do anything else but that.  Forget that, after posting that out of curiosity I checked and turns out that right-clicking in the image with feh, also brings up a menu to perform some basic operations, but unlike magick it doesn't open an extra window., a very tiny one but still ;D
Last Edit: January 18, 2020, 09:19:35 PM by Moltke
Without each others help there ain't no hope for us :)
 

Re: Display XFCE shorcut keys cheat sheat on desktop
« Reply #4 on: January 19, 2020, 05:28:32 PM »
 

Moltke

  • Gold Level Poster
  • *******
  • 628
    Posts
  • Country: ve
  • Reputation: 77
  • Linux Lite Member

  • Linux Lite: 3.8 64bit

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 4.x
Making progress ;D @Jerry  How do you like these ones?







Still far from perfect cause I'm not artist nor is graphical design my area of expertise but definitely getting better and better ;D
Last Edit: January 20, 2020, 01:44:44 PM by Moltke
Without each others help there ain't no hope for us :)
 


Tags:
 


Linux Lite 4.8 Final is now available for download and installation