Page 1 of 1
.shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 6:09 am
by i_ri
.shot timer delay period, quick.notsoquickshot.shot
Hello Everyone
quickshot config file add/edit to OPTION -d 2.
fluxbox keys add/edit Delay microseconds to full screen shot.
# Control Mod1 x :Delay {exec mxfb-quickshot r jpg} 2000000
This sample uses bash sleep to delay the quickshot after keypress. This sample provides quick change to the sleep NNs seconds.
Save these entries into ~/.fluxbox/keys
Code: Select all
Control Mod1 x :Exec ~/.fluxbox/scripts/quicklessquick
Control Mod1 z :MacroCmd {exec quicklessquickperiod} {reconfig}
This sample destination is /usr/local/bin/quicklessquickperiod
Code: Select all
#!/bin/bash
if ! [ -e $HOME/.fluxbox/scripts/quicklessquick ] ; then
echo "sleep 2s && mxfb-quickshot r jpg" > $HOME/.fluxbox/scripts/quicklessquick
fi
# needs to be allowed executable, after creation. quicklessquick.
me="$(basename "$0")";
running=$(ps h -C "${me}" | grep -wv $$ | wc -l);
[[ $running > 1 ]] &&wmctrl -R "sleep NNs " && exit;
TMP_FILE=$(mktemp --tmpdir=${XDG_RUNTIME_DIR:-/tmp} editbox.txt.XXXXXXXX)
yad --center --window-icon=/usr/share/pixmaps/menulibre.png \
--image=/usr/share/yelp/icons/hicolor/16x16/status/yelp-page-task.png \
--fore="#3F0000" --back grey84 --title="sleep NNs " --width 344 --height 180 \
--undecorated \
--text-info --show-uri --uri-color="#3F0000" --wrap \
--editable < "$HOME/.fluxbox/scripts/quicklessquick" 2>/dev/null > $TMP_FILE
case $? in
0) cat $TMP_FILE > "$HOME/.fluxbox/scripts/quicklessquick"
rm -f $TMP_FILE
quicklessquickperiod
# Save with OK. The above line keeps the editor box open; close with Cancel button. comment it to have close with the OK button.
;;
*) rm -f $TMP_FILE
;;
esac
/usr/local/bin/quicklessquickperiod allow executable.
Run /usr/local/bin/quicklessquickperiod
$HOME/.fluxbox/scripts/quicklessquick allow executable.
Try the keybinds. control+alt+x and control+alt+z.
Control Mod1 z brings a text box where change the numerals for seconds in sleep 2s. The big picture is that the keybind Control Mod1 x will launch what is typed in the box. For sample period timer confine edit on numerals. click OK to save.
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 7:38 am
by Jerry3904
Thanks for posting this. I'll be able to look at it later today.
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 8:50 am
by i_ri
hello
tenr.de is not responding.
I do think the original tenner shot sh was created before scrot had -d.
Am Trialing the sample on another system, no icons, but it works.
About Delay microseconds fluxboxCommands:
Imagine it set for eleven seconds and you realize that you are not going to be ready within eleven seconds. Press the keys combination again to extend additional eleven seconds. keypress restarts the timer.
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 9:52 am
by Jerry3904
Why are you looking at tener.de and not our mxfb-quickshot? BTW: the current scrot has it, and it works
Code: Select all
-d, --delay [b]SEC
Wait SEC seconds before taking a shot. When given the `b` prefix, e.g `-d b8`, the delay will be
applied before selection.
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 10:48 am
by i_ri
Hello Jerry3904
Historically speaking... about shot sh.
I think sleep has been the method.
Are you pleased with accomplishment of the shot delay without touching mxfb-quickshot or its config. file?
Sample script does not touch mxfb-quickshot or its config. file where the scrot -d can become OPTION. If you do edit OPTION for full screen i like -p for full screen too. wink. For -d to change on the fly is sed config. rather than this sample script singled out the command manipulating around mxfb-quickshot while not manipulating scrot.
Fluxbox keys "Delay" at twelve seconds is probably fairly durable and will not need change often(?)
Delay without touching mxfb-quickshot or its config. file.
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 11:21 am
by siamhie
i_ri wrote: Thu Aug 08, 2024 8:50 am
tenr.de is not responding.
The site has been down for a couple of weeks now. Not sure if it will be back. (it had a great section on learning to create custom styles)
It's a shame because it had a link to download all of the styles collected from all over the web. (I'm glad I downloaded that file awhile back)
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 12:49 pm
by Jerry3904
i_ri wrote: Thu Aug 08, 2024 10:48 am
Hello Jerry3904
Historically speaking... about shot sh.
I think sleep has been the method.
Are you pleased with accomplishment of the shot delay without touching mxfb-quickshot or its config. file?
Sample script does not touch mxfb-quickshot or its config. file where the scrot -d can become OPTION. If you do edit OPTION for full screen i like -p for full screen too. wink. For -d to change on the fly is sed config. rather than this sample script singled out the command manipulating around mxfb-quickshot while not manipulating scrot.
Fluxbox keys "Delay" at twelve seconds is probably fairly durable and will not need change often(?)
Delay without touching mxfb-quickshot or its config. file.
Haven't tried it yet. To be honest, my preference ATM is to modify mxfb-quickshot rather than introduce a separate script and mechanism. But we have ots of time...
Re: .shot timer delay period, quickshot.
Posted: Thu Aug 08, 2024 1:06 pm
by siamhie
Jerry3904 wrote: Thu Aug 08, 2024 12:49 pm
my preference ATM is to modify mxfb-quickshot rather than introduce a separate script and mechanism. But we have ots of time...
+1
The current way is easy. I press the print screen button and have a plus sign mouse pointer show up.
All I have to do is either left click (on an empty desktop area) for full screen images, left click on title bars for window shots
or left click hold and draw a rectangle around the object I want to screen shot.
Re: .shot timer delay period, quickshot.
Posted: Fri Aug 09, 2024 11:03 am
by i_ri
Thanks Jerry3904 and siamhie
hello gtkdialog
Assign value seconds for sleep. May i say retard?
Pause, wait, delay, timer, interim, postponement
Is paused mxfb-quickshot fullscreen Quickshot for later
Code: Select all
#!/bin/bash
export DIALOG=$(cat <<End_of_Text
<window title="DELAY ExecuteCommand" icon-name="player_pause" window-position="1" allow-grow="false" border-width="8">
<vbox>
<frame SECONDS interim click interim shot >
<spinbutton range-min="2" range-max="257" range-step="1" range-value="11" xalign="0.5" max-length="3" progress-fraction="0.00">
<variable>DELAYPERIOD</variable>
</spinbutton>
</frame>
<frame Pause Quickshot >
<button ok></button>
</frame>
</vbox>
</window>
End_of_Text
)
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog --program DIALOG); do
eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "OK" ] ; then
sleep ${DELAYPERIOD}s && mxfb-quickshot r jpg
else
exit
fi
test notify-send with
Code: Select all
notify-send -i love-emote hello everyone
To Turn On Quickshot notifications for shot Taken
go to mxfb-quickshot
Have line 270 reflect the notification on line 233;
add the && /usr/bin/notify-send -i "$ICONPATH" -t 3000 " $SUCCESS"
to end line 270 take_shot
Re: .shot timer delay period, quickshot.
Posted: Fri Aug 09, 2024 3:58 pm
by Jerry3904
Well that works, thanks! That's a good start on where I'd like to go.
In addition to a number of small edits, I will want to bind it to a couple of key patterns to fit in with existing ones. Maybe come up with a simple usage with a fixed delay for common situations that triggers the default interactive state, so Print then "d" would be all that was required. We'll see...
Re: .shot timer delay period, quickshot.
Posted: Fri Aug 09, 2024 5:26 pm
by FullScale4Me
siamhie wrote: Thu Aug 08, 2024 11:21 am
i_ri wrote: Thu Aug 08, 2024 8:50 am
tenr.de is not responding.
The site has been down for a couple of weeks now. Not sure if it will be back. (it had a great section on learning to create custom styles)
It's a shame because it had a link to download all of the styles collected from all over the web. (I'm glad I downloaded that file awhile back)
The Internet Archive has a copy of most of the site. Frequently the IA saves small linked files and images as well.
https://web.archive.org/web/20240418135252/http://tenr.de/
Re: .shot timer delay period, quickshot.
Posted: Fri Aug 09, 2024 11:25 pm
by siamhie
FullScale4Me wrote: Fri Aug 09, 2024 5:26 pm
siamhie wrote: Thu Aug 08, 2024 11:21 am
i_ri wrote: Thu Aug 08, 2024 8:50 am
tenr.de is not responding.
The site has been down for a couple of weeks now. Not sure if it will be back. (it had a great section on learning to create custom styles)
It's a shame because it had a link to download all of the styles collected from all over the web. (I'm glad I downloaded that file awhile back)
The Internet Archive has a copy of most of the site. Frequently the IA saves small linked files and images as well.
https://web.archive.org/web/20240418135252/http://tenr.de/
From that archive page I was able to save both the styles and texture pages.
I see you can still get individual styles but both tarballs are gone that had over 500 styles (which is what I grabbed when the site was still up).
Re: .shot timer delay period, quickshot.
Posted: Sat Aug 10, 2024 12:25 am
by i_ri
Thank You FullScale4Me
It is an honor to have the tenr.de link in this topic.
The tenr pages have a 2024 copyright label; interesting that it had attention recent.
Re: .shot timer delay period, quickshot.
Posted: Sat Aug 10, 2024 1:17 am
by i_ri
"with a fixed delay for common situations "
keeping it keyboard driven in fluxbox fits that with
Control Mod1 x :Delay {exec mxfb-quickshot r jpg} 12000000
Re: .shot timer delay period, quickshot.
Posted: Sat Aug 10, 2024 3:44 am
by i_ri
Use dialog timer in yad or xmessage to delay command?
Sample data
Sample tries to look generic can by case say,
Quickshot timer Launched ...
Code: Select all
xmessage "A process has been started that will execute momentarily.
Paused Quickshot. timer running. Wait (not press Ok.) do your setup workspace for shot.
Press the Okay button the process will execute complete immediately.
Okay means NOW. bypass timer and execute Now. " -timeout 14 ;sleep 1s ;mxfb-quickshot r jpg
the sleep is to allow dialog to get clear the iconbar for the shot.
Re: .shot timer delay period, quickshot.
Posted: Sat Aug 10, 2024 7:40 am
by i_ri
Code: Select all
notify-send -w -t 11000 -i camera "Quickshot Launched" " click here will abate timer. " ;sleep 1s ;mxfb-quickshot r jpg
Re: .shot timer delay period, quickshot.
Posted: Sun Aug 11, 2024 11:24 pm
by i_ri
I like that notify send example, as a static timer for shot.
It matches the current quickshot messages.
here another with static timer.
Re: .shot timer delay period, quickshot.
Posted: Wed Sep 04, 2024 9:57 pm
by i_ri
Hello Jerry3904
Remember when? we had Quickshot on the MX Dock.
With Quickshot on the Dock, Dockmaker Edit gives access to the command possibilities for mxfb-quickshot.
Dockmaker Edit Quickshot command can add the timer with the sleep command to the Quickshot button on MX Dock by give edit access to change the sleep value?
Re: .shot timer delay period, quickshot.
Posted: Fri Sep 06, 2024 12:53 am
by i_ri
Hello Jerry3904
mxfb-quickshot static timer
Your alias here. arg1.
argument one L is for longshot.
option of l is root shot delayed.
Code: Select all
ARG1=${1#-} # remove '-' from start of arg
case "${ARG1,,}" in # lower case
r|root)
OPTION=""
;;
u|focused)
OPTION="-u"
;;
l)
OPTION="-d 14"
;;
*)
display_help
exit 1
;;
esac
l1)
OPTION="-d 10"
;;
l2)
OPTION="--delay 20"
;;
twenty is a long time. liking this place to put --pointer in root mxfb-quickshot.
version 1.11 scrot is fantastic. stack works in fluxbox.
composited session xfce and kde stack includes root and panel.
in fluxbox just windows, not with root and panel.
The -s selection line mode new defaults are perfectly
auto backwards from
what works best here is xfce and kde need prefer edge. (auto is classic)
what works best here is fluxbox prefer classic. (auto is edge)
i like the classic the best.
sample mxfb-quickshot alias.arg1 for stack horizontal and vertical scrot v1.11.
k)
OPTION="-k -d 2"
;;
kv)
OPTION="--stack=v -Z 2 -d 2"
;;
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 8:46 am
by Jerry3904
I've been looking at this, and I think the simplest is to create a script called something like
quickshot_delay with the following content:
Code: Select all
# /bin/bash
SUCCESS=$(gettext 'Success!')
sleep 8
mxfb-quickshot -r -png
/usr/bin/notify-send -i /usr/share/icons/Papirus/24x24/devices/camera.svg -t 3000 "$SUCCESS"
exit 0
Make it executable and move it to ~/.local/bin so user can easily change delay seconds
Then the Keys entry would be very simple:
Code: Select all
# whole screen capture with delay (default 8 s)
Ctrl Print :Exec ~/.local/bin/quickshot_delay
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 10:40 am
by siamhie
Jerry3904 wrote: Sun Sep 08, 2024 8:46 am
Make it executable and move it to ~/.local/bin so user can easily change delay seconds
Would it be possible to have it in /usr/local/bin instead? I have never populated my home folder with bin directories.
*another possible location: ~/.config/MX-Linux/quickshot_delay
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 12:59 pm
by Jerry3904
1) /usr/ocal/bin woud not interest me b/c it's hidden away and requires root access to make the change
2) I tought about ~/.config but couldn't remember early this morning how to get the script to pay attention to it (something like source= I seem to recall...will look it up)
3) did you try the script and, if so, what did you think?
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 1:25 pm
by siamhie
Jerry3904 wrote: Sun Sep 08, 2024 12:59 pm
1) /usr/ocal/bin woud not interest me b/c it's hidden away and requires root access to make the change
2) I tought about ~/.config but couldn't remember early this morning how to get the script to pay attention to it (something like source= I seem to recall...will look it up)
3) did you try the script and, if so,
what did you think?
Works as expected. Created the file in ~/.config/MX-Linux/ and named it quickshot_delay, then made it an executable.
Added it to my root menu
Code: Select all
[exec] (Quickshot-delay) {~/.config/MX-Linux/quickshot_delay}
quickshot_delay.png
and when selected, it took a screenshot after the 8 second delay.
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 1:51 pm
by siamhie
Jerry3904 wrote: Sun Sep 08, 2024 8:46 am
Then the Keys entry would be very simple:
Code: Select all
# whole screen capture with delay (default 8 s)
Ctrl Print :Exec ~/.local/bin/quickshot_delay
This part doesn't work because it is not in the USERS path.
Code: Select all
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
If I add the path
Code: Select all
export PATH="$HOME/.local/bin:$PATH"
Code: Select all
echo $PATH
/home/siamhie/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
and edit the key binding as follows
Code: Select all
# whole screen capture with delay (default 8 s)
Ctrl Print :Exec /home/$USER/.local/bin/quickshot_delay
The key binding works.
*I then changed my menu entry to match the new path.
Code: Select all
[exec] (Quickshot-delay) {~/.local/bin/quickshot_delay}
I think it will be easier just to use the USERS default path (/usr/local/bin)
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 2:07 pm
by siamhie
Some more testing. I reverted back to using the default USERS path.
Code: Select all
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
Create the file, make it executable and (as root) move it to /usr/local/bin.
The user can still edit the delay time but won't need to type in root's password for the change.
The root menu entry would be this
Code: Select all
[exec] (Quickshot-delay) {quickshot_delay}
The keybinding would be this
Code: Select all
# whole screen capture with delay (default 8 s)
Ctrl Print :Exec /usr/local/bin/quickshot_delay
Maybe add something to MX Tweak to have a GUI change (instead of manual editing) like what was done for the screensaver timer.
Re: .shot timer delay period, quickshot.
Posted: Sun Sep 08, 2024 2:25 pm
by Jerry3904
Thanks, will come back to this later
Re: .shot timer delay period, quickshot.
Posted: Mon Sep 09, 2024 5:31 am
by i_ri
Hello Jerry3904
mxfb-quickshot
When arg1 matches r, then Quickshot extend invitation.
Sample-data mxfb-quickshot include invitation.
Use file name /mxfb-quickshot during trial the sample
replace the active /usr/bin/mxfb-quickshot
Code: Select all
#!/bin/bash
## this app is based on one by tenner that can be downloaded at http://tenr.de/snippets/scripts/shot.sh
## it has been modified and expanded for use with MX-Fluxbox
## released under GPLv3
# 2024week37
# mxfb-quickshot version
VERSION="230210"
## the following parameters are set in ${HOME}/.config/MX-Linux/mxfb-quickshot.conf
# OPTION="-s -q 100"
# DESTDIR="$(xdg-user-dir PICTURES)"
# NAME="$(date +'%y%m%d_%H%M%S')"
# SUF="png"
# PRE="quickshot_"
BASE_NAME=$(basename "$0")
DATE=$(date '+%Y%m%d')
CONFIG_DIR="$HOME/.config/MX-Linux"
BACKUP_DIR="$HOME/.restore/MX-Linux"
CONFIG_NAME="mxfb-quickshot.conf"
BACKUP_NAME="${CONFIG_NAME}_${VERSION}_${DATE}"
FLUXBOXKEYS="$HOME/.fluxbox/keys"
USER_CONFIG="${CONFIG_DIR}/${CONFIG_NAME}"
DISMISS_CHK="${CONFIG_DIR}/mxfb-quickshot-dismiss.chk"
BACKUP_CONF="${BACKUP_DIR}/${BACKUP_NAME}"
SYSTEM_CONF="/usr/share/mxfb-quickshot/$CONFIG_NAME"
ICONPATH="/usr/share/icons/Papirus/24x24/devices/camera.svg"
# take icon from theme if needed
[ -e "$ICONPATH" ] || ICONPATH=camera-photo
WM_CLASS=mxfb-quickshot
# messages shown
USAGE="Usage: $BASE_NAME [-p|p|-r|r|-u|u] [-png|png|-jpg|jpg]"
# set up translation
export TEXTDOMAIN=mxfb-accessories
export TEXTDOMAINDIR=/usr/share/locale
source gettext.sh
# Note: Comment lines above gettext lines are visible to translators.
# The capture of a screenshot was aborted.
NONE_SELECTED=$(gettext 'exiting, no image selected')
# The capture of a screenshot was cancelled.
CANCELLED=$(gettext 'Cancelled!')
# The capture of a screenshot was successful.
SUCCESS=$(gettext 'Success!')
# Do you want to allow a new config file to be installed?
OK_TO_PROCEED=$(gettext 'OK to proceed?')
# Do you want to display the Help message again?
DISMISS=$(gettext 'Dismiss')
DISMISS_HELP=$(gettext "Don't display the Help message again!")
# A new config file will be installed.
UPGRADE_MESSAGE=$(gettext 'This will install a new config file')
# The existing config file will be copied into a backup directory.
BACKUP_MESSAGE=$(gettext 'The existing file will be backed up in:')
MESSAGE="$UPGRADE_MESSAGE\n\n$BACKUP_MESSAGE\n\n<b>$BACKUP_DIR/</b>"
HELP_TITLE=$(gettext 'HELP: how to take a screenshot')
# How to take a screenshot...
HELP0=$(gettext 'Press "Print" (or "PrtSc") and use the mouse:')
# Press the Print-Screen-key to capture a window.
# WINDOW: press Print, then click anywhere inside
HELP1=$(gettext 'WINDOW: click anywhere inside')
# Press the Print-Screen-key to capture a wallpaper.
# DESKTOP: press Print, then click the background
HELP2=$(gettext 'DESKTOP: click the background')
# Press the Print-Screen-key to capture a screen selection.
# SELECTION: press Print, then draw a rectangle
HELP3=$(gettext 'SELECTION: draw a rectangle')
HELP_MESSAGE="
$HELP0
--$HELP1
--$HELP2
--$HELP3
"
# Hints for creating a screenshot
# The help message will not be displayed again, if user clicks on "Dismiss" button.
# The capture of a screenshot will start after closing this window.
HELP_HINTS=$(eval_gettext '
Hints
--Click "Dismiss" to hide Help in the future!
--Capture Help by clicking it after agreeing to proceed
--More: search "Quickshot" in the MX Wiki')
display_help() {
printf "%s\n" "$USAGE"
}
if [ ! -f "$DISMISS_CHK" ]; then
HELP=(
/usr/bin/notify-send
-i "$ICONPATH"
-t 30000
"$HELP_TITLE"
"$HELP_MESSAGE"
)
"${HELP[@]}"
sleep 3
YAD=(yad
--title="Quickshot"
--class="$WM_CLASS"
--window-icon="$ICONPATH"
--borders=20
--center
--fixed
--height=300
--width=300
--text-align=left
--text="\n\n<b>$HELP_HINTS</b>\n\n"
--button="$DISMISS"'!!'"$DISMISS_HELP":3
--button=gtk-ok
)
"${YAD[@]}"
if [ $? = 3 ]; then
[ -d "$CONFIG_DIR" ] || mkdir -p "$CONFIG_DIR"
echo "VERSION=$VERSION" > "$DISMISS_CHK"
fi
fi
if [ -r "$SYSTEM_CONF" ] && [ ! -r "$USER_CONFIG" ]; then
[ -d "$CONFIG_DIR" ] || mkdir -p "$CONFIG_DIR"
cp "$SYSTEM_CONF" "$USER_CONFIG"
[ -d "$BACKUP_DIR" ] || mkdir -p "$BACKUP_DIR"
cp "$USER_CONFIG" "$BACKUP_CONF"
fi
if ! ls "${BACKUP_DIR}/${CONFIG_NAME}_${VERSION}"* >/dev/null 2>&1 &&
[ -r "$USER_CONFIG" ] && [ -r "$SYSTEM_CONF" ] &&
! cmp -s "$SYSTEM_CONF" "$USER_CONFIG" ; then
YAD=(yad
--title="Quickshot"
--class="$WM_CLASS"
--window-icon="$ICONPATH"
--width=350
--height=200
--borders=20
--center
--text-align=center
--text="\n\n$MESSAGE\n\n"
--button="gtk-cancel":7
--button="$OK_TO_PROCEED":6
)
"${YAD[@]}"
[ $? = 6 ] || exit 0
[ -d "$BACKUP_DIR" ] || mkdir -p "$BACKUP_DIR"
cp "$USER_CONFIG" "$BACKUP_CONF"
cp "$SYSTEM_CONF" "$USER_CONFIG"
fi
# using "safe-source" instead of source "$USER_CONFIG"
# safe-source - will read only allowed config parameter lines from user config
# as defined in system config. Other paramter and lines are ignored.
#
ALLOWED_CONF_PARAMETER=( $(sed -r '/^\s*[a-zA-Z_]+=/!d; s/=.*//' $SYSTEM_CONF 2>/dev/null) )
if [ ${#ALLOWED_CONF_PARAMETER[@]} != 0 ]; then
CONF_PARAMETER_PATTERN="${ALLOWED_CONF_PARAMETER[*]}"
CONF_PARAMETER_PATTERN="${CONF_PARAMETER_PATTERN// /|}"
USER_CONF_PARAMETER=$(sed -r "/^\s*(${CONF_PARAMETER_PATTERN})=/!d" "$USER_CONFIG" 2>/dev/null )
eval "$USER_CONF_PARAMETER"
fi
# user config sanity check
# set to reasonable vaules with := assignment only if not set already
: ${OPTION:="-s -q 97"}
: ${DESTDIR:=$(xdg-user-dir PICTURES)}
: ${NAME:=$(date +%y%m%d_%H%M%S)}
: ${PRE:=screemx}
: ${SUF:=jpg}
: ${ICONPATH:=/usr/share/icons/Papirus/24x24/devices/camera.svg}
# take icon from theme if needed - in case user change in conf was allowed
[ -e "$ICONPATH" ] || ICONPATH=camera-photo
# use home directory if destdir is not defined
: ${DESTDIR:=$HOME}
take_shot() {
local ret
local filename="${PRE}${NAME}.${SUF}"
local exec_option='mv $f '"$DESTDIR"
[ -w "$PWD" ] || cd "$HOME" # to make shure current directory is writable
if [ "$(readlink -e "$DESTDIR")" = "$(readlink -e "$PWD")" ]; then
scrot ${OPTION} "${PRE}${NAME}.${SUF}"
ret=$?
else
scrot ${OPTION} "${PRE}${NAME}.${SUF}" -e "$exec_option"
ret=$?
fi
if [ $ret = 1 ]; then
/usr/bin/notify-send -i "$ICONPATH" -t 3000 "$CANCELLED"
exit 0
fi
if [ $ret = 2 ] ; then
echo "$NONE_SELECTED"
exit 1
fi
return $ret
}
if [ $# -eq 0 ]; then
take_shot && /usr/bin/notify-send -i "$ICONPATH" -t 3000 " $SUCCESS"
exit 0
fi
if [ $# -gt 2 ]; then
display_help
exit 1
fi
ARG1=${1#-} # remove '-' from start of arg
case "${ARG1,,}" in # lower case
p)
OPTION="-p -q 89"
;;
r|root)
OPTION=""
;;
u|focused)
OPTION="-u"
;;
l)
OPTION="-d 14"
;;
l2)
OPTION="-d 20"
;;
*)
display_help
exit 1
;;
esac
ARG2=${2#-} # remove '-' from start of arg
case "${ARG2,,}" in # lower case
jpg)
SUF="jpg"
;;
png)
SUF="png"
;;
*)
display_help
exit 1
;;
esac
take_shot && /usr/bin/notify-send -i "$ICONPATH" -t 3000 " $SUCCESS"
if [ "$OPTION" ]; then
exit
else
export DIALOG=$(cat <<End_of_Text
<window title="Quickshot" icon-name="player_pause" window-position="1" allow-grow="false" border-width="8">
<vbox>
<frame Take another Quickshot ? >
<button cancel></button>
</frame>
<frame Take another Quickshot ? >
<button ok></button>
<frame Pause Quickshot >
<frame SECONDS interim click interim shot >
<spinbutton range-min="2" range-max="257" range-step="1" range-value="2" xalign="0.5" max-length="3" progress-fraction="0.00">
<variable>DELAYTERM</variable>
</spinbutton>
</frame>
</frame>
</frame>
</vbox>
</window>
End_of_Text
)
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog --program DIALOG); do
eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "OK" ] ; then
sleep ${DELAYTERM}s && mxfb-quickshot p jpg
fi
fi
exit $?
screemxretrocapture mxfb-quickshot tested ok with scrot versions 1.11.1 and 1.8.1
Re: .shot timer delay period, quickshot.
Posted: Mon Sep 09, 2024 6:32 am
by Jerry3904
Thanks, I will look at it. The big problem for me is that the most recent release of the maintained version of scrot (1.11.1-1~mx23+1) that is currently now in MX Test has deprecated the use of "-d", which is why I have switched to using "sleep"
Re: .shot timer delay period, quickshot.
Posted: Fri Sep 05, 2025 12:48 am
by i_ri
Hello Jerry3904 and Everyone
Made gtkdialog a year ago for delay quickshot. is mx losing gtkdialog?
A yad dialog sleep variable user input delay mxfb-quickshot.
The word postpone? future shot.
Change or dismiss the sample entry, text, icons
A yad entry in .fluxbox /apps can alter yad window geometry.
Code: Select all
sleep $(yad --window-icon player_pause --title "shot in" --text-align center --text "desktop future quickshot " --entry --entry-label seconds. --numeric 1 300 --entry-text 8)s &&mxfb-quickshot -r -png
Re: .shot timer delay period, quickshot.
Posted: Fri Sep 05, 2025 5:57 am
by Jerry3904
I remember that you did this. My personal opinion is that quickshot was designed by tenr, and resuscitated during relatively early MXFB development, as a very simple, light and fast tool of the type
don't ask me any questions or show me a GUI, just do what I want!
IMO people who want or need more should just install something like xfce4's very useful tool--which I myself keep available for occasional use.
Re: .shot timer delay period, quickshot.
Posted: Fri Sep 05, 2025 6:44 am
by beardedragon
All of this reminds me why I use Shutter instead. Easier to set up in preferences.