Lubuntu 24.04 LTS
sh -c 'scrot -o /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
Are global variables now the same as they were in 22.04?
Which manpages are they specified in?
Lubuntu 24.04 LTS
sh -c 'scrot -o /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
Are global variables now the same as they were in 22.04?
Which manpages are they specified in?
To the best of my knowledge, there is no significant change in âglobal variablesâ between Lubuntu 22.04 and 24.04.
The command you mentioned relies on scrotâs own behavior: the $f variable is a special variable passed by scrot to the command given with the -e option, not a system-wide environment variable.
This is documented in man scrot, while general environment variables are documented in man environ and have not changed in any notable way between these releases.
If you are seeing different behavior or an actual issue on 24.04, it would be best to fill out the support template below so others can help more accurately.
Ubuntu Support Template
**Ubuntu Version**:
Example: 22.04 LTS, 24.04, 25.10
**Desktop Environment (if applicable)**:
Example: GNOME, KDE Plasma, XFCE, Budgie, etc.
**Problem Description**:
Describe what youâre trying to do and what happens instead.
If you can easily reproduce the problem, include the steps so others can try.
Example:
Open Settings â Displays
Try to change resolution
Screen goes black
**Relevant System Information**:
Include any details that might help (e.g., hardware, drivers, or special configurations).
**Screenshots or Error Messages**:
If applicable, paste error messages or screenshots.
We prefer copy-pasted text and screenshots instead of photos of screens.
For multi-line text or logs, wrap them in triple backticks like this or highlight the text and use </> in the composer:
`sudo dmesg | tail -20`
**What Iâve Tried**:
List the solutions or workarounds youâve already attempted.
**Before Posting**:
:mag: Please check if similar issues have already been reported and resolved.
:blue_book: See the âStart hereâ guide:
https://discourse.ubuntu.com/t/welcome-to-support-and-help/49951
Actually, Iâm noticing compromised resultâs instead of the expected usual resultâs which I had on 22.04.
This is more of âgrasping at strawsâ trying to find the real issue so I can correct it as well as my âless than bestâ practices.
Although I donât understand the question being asked, there is something noticed that might be causing an issue:
Is the quoting in this command really what you intend?
As written, it will run sh with the following 6 arguments (which Iâve separated by newlines for visual clarity):
-c
'scrot -o /tmp/clip_$(id -u) -e 'xclip
-selection
clipboard
-t
image/png
and the following redirection
<
$f
where $f will be substituted with whatever the f variable is set to in the shell where this command is being run (or empty string if $f is not set).
Did you intend this? -
sh -c 'scrot -o /tmp/clip_$(id -u) -e '\''xclip -selection clipboard -t image/png < $f'\'
Thanks for that info.
The command in question is actually a âshortcut keyâ passed to me from another Lubuntu user on ubuntuforums.org who requested his account be closed upon his departure.
He said, ânot everybody agreeâs with his ways of doing thingsâ.
I suspect his current user name here on discourse, but I donât intend to bother him about it.
My inquiry here is about the differences between how it worked in previous 22.04 as compared to its compromised fuction now.
(at least on my desktop; I believe its more about dependencies rather than inside distributed Lubuntu)
Itâs a âwindows-like fuctionâ using the âPrtScrâ key.
And now the âshortcut keyâ donât have the same result as before.
In this, I only have current documentation, which I didnât research the âwhy and howâ of the key while the chance was available.
I believe it used Qlipper, but Iâm not yet ready to confirm or discredit that belief.
(As the key itself mentions xclip and also scrot.)
(xclip and qlipper may share some dependants or dependencies
)
Thanks for clarifying.
So in previous 22.04, this commandâŠtook a screenshot and copied it to clipboard?
And in 24.04âŠwhat specific âcompromised functionâ does it now do instead?
What happens if you manually run the command in Terminal?
Does changing the quoting per my previous post make any difference?
Itâs a âshortcut keyâ spec.
Should I check how it functions being ran through terminal?
At least in a âdry-runâ scenario?
Yes exactly
copy+paste the command to run it in terminal instead of running it via the shortcut key, and see what happens
sh -c 'scrot -o /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
I never tried running a shortcut key in a terminal as a simulated dry-run.
-s or --dry-runâŠ
where would I put that?
Should I use apt or apt-getâŠor something other?
This is a new thing for me.
Dry-runâs arenât whats new to meâŠbut dry-running a shortcut keyâŠthatâs whats new to me.
Not as a dry-run. Just actually run the command in Terminal and see what happens. This command is harmless and non-destructive, right?
Running this command in Terminal is the same thing as running it via shortcut key, the terminal just provides more options to observe and control the commandâs behavior.
Oh okâŠ
By the way, what did you mean by âchanging the quotingâ?
Did you mean changing the quoting from what I was using before to what you had coded at the end of that post?
I just didnât know it was completely harmless and non-destructive at all.
I know as a shortcut key it is actually harmless and non-destructive.
Bingo. If the command does not behave as expected when you run it in Terminal (i.e. it doesnât do what is supposed to happen when you press the shortcut key), then try the command as coded at the end of post #4.
In a terminalâŠ
sh -c 'scrot -o /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
And terminal saysâŠ
The command at the bottom of post 4âŠ
Didnt display at the endâŠwyatt@wyatt-82xb:~$âŠ
And terminal saysâŠ
That usually means the command is âstuckâ. Whatâs the Lubuntu/LXQt equivalent of gnome-system-monitorâs âAll Processesâ / âShow Dependenciesâ? Check the process tree in case it looks clear which specific process is stuck (is it sh, scrot, or xclip?), then does pressing Ctrl+C in the stuck terminal to send the processes SIGINT get the processes to quit & the shell return to the prompt?
setting to âScreen shotâ in âShortcut keysâ the proposed code in post 4 had no improved output.
###================================================================###
That is correct.
I used the âfull-screenâ procedureâs from the other Lubuntu user I mentioned who also provided the âshortcut keyâ.
It worked as expected in 22.04.
There is one part in the following that I took out because I never used it in my particular case.
(provided to show available key strokes as per relevance to the current matter)
And this command to the "Alt-PrtScr" key:
sh -c 'scrot -o -u /tmp/clip_$(id -u) -e 'xclip -selection clipboard -t image/png < $f''
###================================================================###
When pasting the âfull-screenâ screenshot into the graphics editor (I use kolourpaint)âŠ
It acts as if I used the âAlt-PrtScrâ command in the âPrtScrâ command spot within âShortcut keysâ.
And the paste within kolourpaint isnât usable as before
###================================================================###
doneâŠsuggester says âstuckâ
###================================================================###
default
screengrab
from
sh -c âscrot -o /tmp/clip_$(id -u) -e âxclip -selection clipboard -t image/png < $fââ
to
sh -c 'scrot -o /tmp/clip_$(id -u) -e â'âxclip -selection clipboard -t image/png < $fâ'â
###================================================================###
okâŠwhat all still needs to be tried so farâŠlets seeâŠ
Just a passing ideaâŠ
Would it be wise to see how it might âperformâ in a live session?
Am I missing anything?
Is the below all that is left to perform now?
Sorry, I misunderstood this because the forum software messed the formatting
To avoid this problem with terminal output, please type a line of only three backticks before and a line of only three backticks after, like this -
```
paste terminal output here
```
What you got is the âsecondaryâ shell prompt from the bash shell you were trying to run the command in, because I added an erroneous extra trailing single quote
Apologies. Fixing post #4 nowâŠ
okâŠlet me try that part again
lemme know when its ready