LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2021, 03:32 PM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Rep: Reputation: 110Reputation: 110
What application is responding to PrintScreen? Possibly Openbox?


I use Openbox and I have this command in my ~/.config/openbox/lxde-rc.xml file:

Code:
<!-- Keybinding for PrintScreen Key -->
<keybind key="Print">
  <action name="Execute">
    <execute>scrot -e 'mv $f /home/data/scrot/'</execute>
  </action>
</keybind>
I press PrintScreen and the new screenshot materializes at /home/data/scrot/ as expected. The file name is 2021-05-05-172530_1920x1080_scrot.png.

But an exact copy of the screenshot is also saved to ~/Pictures and the file name is 2021-05-05--1620246330_1920x1080_scrot.png.

Questions:

1) The first file name is obviously made up of the date, time and screen resolution. I can tell because it matches the current date and time exactly. What does '1620246330' in the second file name mean though?

2) How can I find out what application is writing the second file? I really have no idea.

TIA
 
Old 05-05-2021, 03:49 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
Quote:
What does '1620246330' in the second file name mean though?
That would be epoch time. Enter 15:30, about the time that you posted.

Code:
#!/usr/bin/bash

col1=$(tput setaf 2)
col2=$(tput setaf 3)
clr=$(tput sgr0)

message="Enter time-date with format:
12:34 | apr 10 12:34 | apr 10 12:34 2021 | Sat apr 10 12:34 2021

Enter date/time:> "

while :; do
    read -p "${message}" clock_time

    Time_sec=$(date -d "$clock_time" +"%s")

    echo -e ""$col1"\nEpoch time is: "$col2""$Time_sec"\n"$clr""
done
 
Old 05-05-2021, 03:52 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
Code:
man scrot
...
-e, --exec APP
              Exec APP on the saved image.
Code:
<execute>scrot -e 'mv $f /home/data/scrot/'</execute>
 
Old 05-05-2021, 08:13 PM   #4
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by teckk View Post
Code:
man scrot
...
-e, --exec APP
              Exec APP on the saved image.
Code:
<execute>scrot -e 'mv $f /home/data/scrot/'</execute>
Your first comment is about the epoch time, and yes, it's correct.
I don't understand your second comment.
 
Old 05-05-2021, 08:25 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
You can use xev to view the output of "Print Sceen." That could cast some light on what happens when you press that key.

Be forewarned, the output of pressing a single key is more voluminous than one might expect.
 
Old 05-06-2021, 12:40 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lucmove View Post
I use Openbox and I have this command in my ~/.config/openbox/lxde-rc.xml file:

Code:
<!-- Keybinding for PrintScreen Key -->
<keybind key="Print">
  <action name="Execute">
    <execute>scrot -e 'mv $f /home/data/scrot/'</execute>
  </action>
</keybind>
I press PrintScreen and the new screenshot materializes at /home/data/scrot/ as expected. The file name is 2021-05-05-172530_1920x1080_scrot.png.
That much is clear and unambiguous.

What that other file is and where it came from, who knows? Sleepwalking on the keyboard?
Does it happen every time you take a screenshot? That you end up with two files? Show us.
 
Old 05-06-2021, 04:02 PM   #7
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by ondoho View Post
Does it happen every time you take a screenshot? That you end up with two files? Show us.
Yes, every time. Of course it is every time. That should be obvious.
 
Old 05-07-2021, 12:30 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lucmove View Post
Yes, every time. Of course it is every time. That should be obvious.
Show us the filenames for both files, preferably at least 3 pairs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Openbox terminate process upon logout of openbox How to? BW-userx Linux - Software 3 02-23-2019 02:19 PM
[SOLVED] "Permission denied" when Openbox tries to execute autostart.sh in ~/.config/openbox alarazr Linux - Software 4 10-04-2012 03:50 PM
Openbox autostart.sh and setting alias on openbox start Jelloir Linux - Desktop 1 07-03-2011 03:56 AM
Printscreen - HOWTO ? blackx Linux - General 1 05-29-2003 11:10 AM
PrintScreen Shots in linux chrehmatali Linux - General 2 04-26-2003 02:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration