Results 1 to 1 of 1

Thread: PrtScr and Alt-PrtScr for Lubuntu/LXQt 19.04 and 19.10

  1. #1
    GhX6GZMB is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    Jun 2019
    Beans
    1,093

    PrtScr and Alt-PrtScr for Lubuntu/LXQt 19.04 and 19.10

    The keyboard shortcuts PrtScr (copy full screen to clipboard) and Alt-PrtScr (copy active window to clipboard) are not available in Lubuntu/LXQt, although they are extremely useful.

    Here's a recipe for settling them up.

    First, install "scrot" and "xclip" (it's very likely that they are already installed).

    Open Preferences -> LXQt Settings -> Shortcut Keys from the Applications Menu.

    Check if PrtScr ("Print") and Alt-PrtScr ("Print Window") shortcuts are already present (they probably aren't). Otherwise create them.

    Assign this command to the PrtScr shortcut: sh -c 'scrot -o /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
    Do the same for Alt-PrtScr using: sh -c 'scrot -o -u /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''

    Now you can paste the latest PrtScr screenshot into any graphics or LibreOffice program. Even "Ctrl-V" will work.

    The PrtScr shortcut command will create the file /tmp/clip_"UID" (eg, /tmp/clip_1001), this will disappear after each reboot and will be overwritten with each new screenshot.


    COMMENT:
    The reason for including the UID in the filename instead of just naming the screenshot file "/tmp/clip" is due to file ownership/permissions. When changing user (logout...login), the "/tmp/clip" file still exists with the previous user:group attributes and cannot be modified/overwritten by the new user.
    Last edited by GhX6GZMB; March 6th, 2020 at 09:41 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •