Author Topic: pmss (Poor Man's Screenshooter)  (Read 3577 times)

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #60 on: December 26, 2016, 05:47:50 PM »
tint2 doesn't appear to be capable to override wmctrl.

The Xfce4 desktop is also wiped out by the Clean option (like wiping it with a cloth or something!). Keybindings still work so you can bring up a terminal or the session-logout screen and exit gracefully.

in a terminal -

Code: [Select]
wmctrl -l
lists the names as xfce4-panel and tint2. Is it possible to exclude those window names from a wmctrl iconify command?

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #61 on: December 26, 2016, 05:53:44 PM »
Hi VastOne,
Clean mode minimizes all open windows and takes the screenshot.
Can you run following commands and see what happens,

Code: [Select]
for i in $(xdotool search ".*");do xdotool windowminimize $i;done
Code: [Select]
for i in $(xdotool search --onlyvisible ".*");do xdotool windowminimize $i;done
Code: [Select]
wmctrl -k on
Cheers!!!

All ran without errors.. cleared the desktop in the exact same way the C option does in the script, like PackRat says 'wiping it with a cloth'

Here is the output from terminal if it means anything

Code: [Select]
vastone@vsido:~$ for i in $(xdotool search ".*");do xdotool windowminimize $i;done
Defaulting to search window name, class, and classname
vastone@vsido:~$ for i in $(xdotool search --onlyvisible ".*");do xdotool windowminimize $i;done
Defaulting to search window name, class, and classname
vastone@vsido:~$ wmctrl -k on

I had to restart everything to get tint2 back.. alt tab allowed me to go between open apps to write this and then to close everything cleany
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

hakerdefo

  • Posts: 484
    • View Profile
    • Looking at Linux through the Windows of Life
Re: pmss (Poor Man's Screenshooter)
« Reply #62 on: December 26, 2016, 08:36:54 PM »
Version 3.1 of pmss to address a Fluxbox related issue.
This should, hopefully, fix the The "Entire Screen -> Clean" option problem under VSIDO.
This version is specifically designed for VSIDO. If you want to use pmss under any other Distro/DE/WM please use Version 3.

Code: [Select]
#!/usr/bin/env bash

function bye_bye (){
printf "\033c"
echo -e '\E[1;32;49m'"A Screenshot Is An Image Of The Display On A Computer Screen"
echo -e '\E[1;32;49m'"But You Already Knew That So"
echo -e '\E[1;32;49m'"Bye, Ciao, Adios"
sleep 2
printf "\033c"
tput sgr0
exit 0
}

function empty_dir (){
if [ "$(ls -A "$DIR")" ]; then
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"This Will Remove All Saved Screenshots! Are You Sure?"
echo -e ""
echo -e '\E[1;32;49m'"Press \"Y\" To Empty Screenshots Directory"
echo -e '\E[1;32;49m'"Press \"N\" To Move Back To Main PMSS Menu"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"Y" | "y")
printf "\033c"
PMSS_RM=$(which rm)
"$PMSS_RM" -rf "$DIR"/*.png
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Screenshots Directory Has Been Emptied"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
;;
"N" | "n")
printf "\033c"
MenU
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Choice!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From Y-N"
echo -e ""
echo -e '\E[1;32;49m'"To Empty Screenshots Directory, Press \"Y\""
echo -e '\E[1;32;49m'"To Move Back To Main PMSS Menu, Press \"N\""
echo -e ""
echo -e '\E[1;32;49m'"Got it? It Is Not That Hard You See"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
empty_dir
;;
esac
else
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Screenshots Directory Is Empty"
echo -e '\E[1;32;49m'"Nothing To Delete. Say Cheese!"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
fi
}

function purge_shot (){
printf "\033c"
PMSS_RM=$(which rm)
"$PMSS_RM" -f "$NAME"
MenU
}

function imgur_upload (){
type curl >/dev/null 2>&1
RETVAL=$?
if [[ ! "$RETVAL" == 0 ]]; then
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"PMSS Requires \"cURL\" To Upload To imgur"
echo -e '\E[1;32;49m'"Install \"curl\" Via Your Package-manager"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
fi
printf "\033c"
response=$(curl -s --connect-timeout 30 --user-agent "Mozilla/5.0 Gecko/20100101" -H "Authorization: Client-ID $client_id" -H "Expect: " -F "image=@$NAME" https://api.imgur.com/3/image.xml 2>/dev/null)
RETVAL=$?
if [[ ! "$RETVAL" == 0 ]]; then
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"PMSS Cannot Connect To \"imgur\""
echo -e '\E[1;32;49m'"Check Your Internet Connection"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
else
URL3="${response##*<link>}"
URL2="${URL3%%</link>*}"
URL=$(echo "$URL2" 2>/dev/null | sed 's/^http:/https:/')
BASE_URL="${URL%.*}"
BASE_EXT="${URL##*.}"
DEL_HASH2="${response##*<deletehash>}"
DEL_HASH="${DEL_HASH2%%</deletehash>*}"
DEL_URL="https://imgur.com/delete/$DEL_HASH"
printf "\033c"
echo -e '\E[1;32;49m'"DIRECT LINK"
echo -e '\E[1;32;49m'"Original  : "'\E[0;32;49m'"$URL"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'""$BASE_URL"m."$BASE_EXT""
echo -e ""
echo -e '\E[1;32;49m'"BBCODE (FORUMS, MESSAGE BOARDS, ETC.)"
echo -e '\E[1;32;49m'"Original  : "'\E[0;32;49m'"[img]$URL[/img]"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"[url=$BASE_URL][img]"$BASE_URL"m."$BASE_EXT"[/img][/url]"
echo -e ""
echo -e '\E[1;32;49m'"MARKDOWN (REDDIT, GITHUB, ETC.)"
echo -e '\E[1;32;49m'"Original  : "'\E[0;32;49m'"[$SHORT_NAME]($URL)"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"[$SHORT_NAME]("$BASE_URL"m."$BASE_EXT")"
echo -e ""
echo -e '\E[1;32;49m'"HTML (WEBSITES, BLOGS, ETC.)"
echo -e '\E[1;32;49m'"Original  : "'\E[0;32;49m'"<a href="$BASE_URL"><img src="$URL" title="source: imgur.com" /></a>"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"<a href="$BASE_URL"><img src=""$BASE_URL"m."$BASE_EXT"" title="source: imgur.com" /></a>"
echo -e ""
echo -e '\E[1;32;49m'"IMAGE DELETE LINK"
echo -e '\E[1;32;49m'"Delete url: "'\E[0;32;49m'"$DEL_URL"
echo -e '\E[1;32;49m'""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
fi
}

function upload_check (){
type xdg-open >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
xdg-open "${NAME}"
else
echo -e ""
echo -e '\E[1;32;49m'"PMSS Unable To Open Saved Shot"
echo -e '\E[1;32;49m'"Install \"xdg-utils\" To Do This"
echo -e ""
fi
echo -e ""
echo -e '\E[1;32;49m'"Would You Like To Upload The Shot To imgur?"
echo -e ""
echo -e '\E[1;32;49m'"Press \"Y\" To Upload The Shot To imgur"
echo -e '\E[1;32;49m'"Press \"D\" To Purge The Shot & Go Back"
echo -e '\E[1;32;49m'"Press \"N\" To Go Back To The Main Menu"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"Y" | "y")
imgur_upload
;;
"D" | "d")
purge_shot
;;
"N" | "n")
printf "\033c"
MenU
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Choice!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From Y-D-N"
echo -e ""
echo -e '\E[1;32;49m'"To Upload Image To imgur, Press \"Y\""
echo -e '\E[1;32;49m'"To Delete Captured Image, Press \"D\""
echo -e '\E[1;32;49m'"To Move Back To The Menu, Press \"N\""
echo -e ""
echo -e '\E[1;32;49m'"Got it? It Is Not That Hard You See"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
MenU
;;
esac
}

function area_mouse (){
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Draw A Rectangle On The Screen By Click-Dragging Left Mouse Button"
echo -e '\E[1;32;49m'"And Release The Mouse Button Once You Have Selected The Area To Be"
echo -e '\E[1;32;49m'"Captured. Region Inside The Drawn Rectangle Will Be Shot By Script"
echo -e ""
echo -e '\E[1;32;49m'"Once The Screen Capture Mode Is Activated, Pressing Any Keys Will"
echo -e '\E[1;32;49m'"Abort The Screenshot. So Keep The Keyboard Silent In Capture Mode"
echo -e ""
read -r -s -p $'Press Any Key To Activate Screen Capture Mode..\n' -n1
PMSS_PID=$(xdotool getactivewindow)
xdotool windowminimize "$PMSS_PID"
sleep 1
scrot -s "${NAME}"
RETVAL=$?
if [[ "$RETVAL" == 2 ]]; then
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Keyboard Key Was Pressed. Screenshot Aborted"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
else
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
fi
}

function window_focus (){
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Select The Screenshot Mode"
echo -e ""
echo -e '\E[1;32;49m'"Press \"B\" To Capture The Window Open Below PMSS Window"
echo -e '\E[1;32;49m'"Press \"C\" To Capture The Window Under The Mouse Cursor"
echo -e '\E[1;32;49m'"Press \"M\" To Manually Select The Window To Be Captured"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"B" | "b")
PMSS_PID=$(xdotool getactivewindow)
xdotool windowminimize "$PMSS_PID"
sleep 1
scrot -u -b -c "${NAME}"
RETVAL=$?
if [[ "$RETVAL" == 2 ]]; then
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"No Open Window Found Below PMSS"
echo -e '\E[1;32;49m'"Hence No Screenshot Is Captured"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
window_focus
else
WIN_BLW=$(xdotool getactivewindow)
xdotool windowminimize "$WIN_BLW"
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
fi
;;
"C" | "c")
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Position The Mouse Cursor Over The Window To Capture"
echo -e '\E[1;32;49m'"Don't Click Just Position The Cursor Over The Window"
echo -e ""
read -r -s -p $'Press Any Key When You Are Ready..\n' -n1
PMSS_PID=$(xdotool getactivewindow)
MAGIC_SED='s/.*=\(.*\)/\1/'
WIN_BLW=$(xdotool getmouselocation --shell 2>/dev/null | grep WINDOW | sed "$MAGIC_SED")
xdotool windowactivate "$WIN_BLW"
sleep 1
scrot -u -b -c "${NAME}"
xdotool windowminimize "$WIN_BLW"
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
;;
"M" | "m")
PMSS_PID=$(xdotool getactivewindow)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Minimize Terminal And Bring The Window To Be Captured In Focus.."
echo -e ""
scrot -u -d12 -b -c "${NAME}"
RETVAL=$?
if [[ "$RETVAL" == 2 ]]; then
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"No Open Window Found Below PMSS"
echo -e '\E[1;32;49m'"Hence No Screenshot Is Captured"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
window_focus
else
WIN_BLW=$(xdotool getactivewindow)
xdotool windowminimize "$WIN_BLW"
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
fi
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Option!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From B-C-M"
echo -e ""
echo -e '\E[1;32;49m'"To Capture The Window Open Below PMSS Window, Press \"B\""
echo -e '\E[1;32;49m'"To Capture The Window Under The Mouse Cursor, Press \"C\""
echo -e '\E[1;32;49m'"To Manually Select The Window To Be Captured, Press \"M\""
echo -e ""
echo -e '\E[1;32;49m'"Got it? It Is Not That Hard You See"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
window_focus
;;
esac
}

function entire_area (){
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Select The Screenshot Mode"
echo -e ""
echo -e '\E[1;32;49m'"Press \"C\" For Clean Mode"
echo -e '\E[1;32;49m'"Press \"D\" For Dirty Mode"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"C" | "c")
printf "\033c"
DESK_TOP=$(xdotool get_desktop)
PMSS_PID=$(xdotool getactivewindow)
for i in $(xdotool search --onlyvisible --desktop "$DESK_TOP" ".*");do xdotool windowminimize $i;done
xdotool search --onlyvisible --desktop "$DESK_TOP" --class "tint2"
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
for i in $(xdotool search --desktop "$DESK_TOP" --class "tint2");do xdotool windowactivate $i;done
fi
xdotool search --onlyvisible --desktop "$DESK_TOP" --class "conky"
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
for i in $(xdotool search --desktop "$DESK_TOP" --class "conky");do xdotool windowactivate $i;done
fi
sleep 1
scrot -c "${NAME}"
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
;;
"D" | "d")
PMSS_PID=$(xdotool getactivewindow)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"Minimize Terminal & Any Open Window You Don't Wish To Capture.."
echo -e ""
scrot -d12 -c "${NAME}"
xdotool windowactivate "$PMSS_PID"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved In "'\E[0;32;49m'"$DIR"
echo -e ""
upload_check
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Option!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From C-D"
echo -e ""
echo -e '\E[1;32;49m'"To Capture The Desktop Without Any Open Window, Press \"C\""
echo -e '\E[1;32;49m'"To Capture The Desktop With Open-Active Window, Press \"D\""
echo -e ""
echo -e '\E[1;32;49m'"Got it? It Is Not That Hard You See"
echo -e ""
read -r -s -p $'Press Any Key To Continue..\n' -n1
entire_area
;;
esac
}

function MenU (){
type scrot >/dev/null 2>&1 || { printf "\033c"; echo -e ""; echo -e '\E[1;32;49m'"A required pmss dependency \"Scrot\" is not present."; echo -e '\e[1;32;49m'"\"Scrot\" is available for almost all linux distros."; echo -e '\e[1;32;49m'"Please install \"scrot\" using your package manager."; echo -e ""; tput sgr0; exit 1; }
type xdotool >/dev/null 2>&1 || { printf "\033c"; echo -e ""; echo -e '\E[1;32;49m'"A required pmss dependency \"xdotool\" is not present."; echo -e '\e[1;32;49m'"\"xdotool\" is available for almost all linux distros."; echo -e '\e[1;32;49m'"Please install \"xdotool\" using your package manager."; echo -e ""; tput sgr0; exit 1; }
DIR="${HOME}/images/scrots"
if [ ! -d "${DIR}" ]; then mkdir --parents "${DIR}"; fi
client_id="af2f809b77dea2c"
printf "\033c"
echo -e '\E[1;32;49m'"** PMSS<>MENU *************************************************"
echo -e ""
echo -e '\E[1;32;49m'"** Select One Of The Following Options"
echo -e ""
echo -e '\E[1;32;49m'"** Enter \"E\" To Take The Screenshot Of The Entire Screen"
echo -e '\E[1;32;49m'"** Enter \"W\" To Take The Screenshot Of Window In Focus"
echo -e '\E[1;32;49m'"** Enter \"A\" To Take The Screenshot Of Area Selected By Mouse"
echo -e '\E[1;32;49m'"** Enter \"D\" To Empty Screenshots Directory"
echo -e '\E[1;32;49m'"** Enter \"Q\" To Exit"
echo -e ""
echo -e '\E[1;32;49m'"***************************************************************"
echo -e ""
tput sgr0
read -er Options
case "$Options" in
"E" | "e")
entire_area
;;
"W" | "w")
window_focus
;;
"A" | "a")
area_mouse
;;
"D" | "d")
empty_dir
;;
"Q" | "q")
bye_bye
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Options\" Is An Invalid Option!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From E-W-A-D-Q"
echo -e ""
echo -e '\E[1;32;49m'"For Screenshot Of The Entire Screen, Press \"E\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"For Screenshot Of The Window In Focus, Press \"W\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"For Screenshot Of Area Selected By Mouse, Press \"A\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Empty Screenshots Directory, Press \"D\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Exit From PMSS, Press \"Q\" & Hit \"Enter\" Key"
echo -e ""
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
;;
esac
}
while :
do
MenU
done


Cheers!!!
You Can't Always Git What You Want

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #63 on: December 26, 2016, 09:20:39 PM »
After a long power outage I am back online  .. nasty storms still all around in the Midwest

Version 3.1 is a winner!  Every part of it works as expected....

Well done hakerdefo, I will make sure this version is the default in VSIDO on next ISO

Thank you mate

Cheers!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #64 on: December 26, 2016, 09:44:06 PM »
Quote
Well done hakerdefo

+100

Works as is in Void linux - just have to make sure the $DIR exists (or change that variable in the script).





Awesome piece of work.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #65 on: December 29, 2016, 06:05:06 PM »
I am telling you this script is fecking awesome...

I had to do a lot of meticulous screenshots to correct some problems on an update to this forum..

Once I figured out the keystrokes and patterns (burned them to memory) it was a spectacular easy thing to do...

What was once cumbersome is now a joy to do

Thank you hakerdefo for this incredible gift
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #66 on: December 29, 2016, 08:21:12 PM »
Once I figured out the keystrokes and patterns (burned them to memory) it was a spectacular easy thing to do...

Thank you hakerdefo for this incredible gift

Indeed.

I just created a key binding for the script, easy peasy with a couple key strokes to get from shot to post.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #67 on: December 29, 2016, 08:40:54 PM »
Share it please.. or at least a step by step...  ;)
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #68 on: December 29, 2016, 09:44:43 PM »
In your favorite text editor add this line to the $HOME/.fluxbox/keys file -

Code: [Select]
Mod4 Shift Print :Exec urxvt -title screenshot -e pmsshot
The key binding "Mod4 Shift Print" is optional, whatever is avaaiable to you - Alt p will work just as well.

The command

Code: [Select]
urxvt -title screenshot -e pmsshot
will launch urxvt with the title screenshot and execute pmsshot - as long as pmsshot (or whatever you have named the script) is on your path; otherwise use the full path name.

You can use your terminal of choice.

Code: [Select]
xterm -title screenshot -e pmsshot
Code: [Select]
xfce4-terminal --title screenshot -x pmsshot
note that xfce4-terminal uses --title not -title. Also, I believe it is recommended to use "-x" but the "-e" is still supported.

The title for the terminal is optional, just a way to keep track of which terminal is running the script - the screenshot terminal is identifiable in the fluxbox (any) iconbar:



It really didn't dawn on me until this morning that this utility is mouse free - all the more reason to like it; will be a nice addition to tiling window managers. More key bindings to create  ;D
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #69 on: December 29, 2016, 10:40:09 PM »
Thanks RatMan!

I ended up using

Code: [Select]
# take a screenshot with hakerdefo script pmss
Mod4 p :Exec launch xfce4-terminal --title pmss-screenshot -x pmss

I have an old piece of code in the keys file:

Code: [Select]
118 :Exec xfce4-screenshooter
This used to work using the print screen button to engage the screenshooter but that no longer works because ?!?!.. is there a code somewhere that discusses the numerical sequence of keys you know of?

I used the tool xev to get the new value of the key

launch is attached to this... make sure it is executable and in /usr/local/bin  .. one of the best pieces of script I have had the pleasure of using and being a part of
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #70 on: December 29, 2016, 10:52:37 PM »
^ I remembered the xev tool to identify keys on the keyboad
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #71 on: December 30, 2016, 12:15:46 AM »
You can't just use "Print" for that binding - or is the numeric value required for launch to work?

If Print or 107 (that's my keycode for Print as well) do not work, try the keysym 0xff61 - or whatever yours is. I have to use that keysym in some tiling window managers that don't recognize the multimedia keys, and won't include the  /X11/XF86keysym.h file.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #72 on: December 30, 2016, 12:19:22 AM »
^ Yes... it is what I did use the numeric value from xev

It had changed on this newer keyboard that I have now and I did not realize it was different

xev solved it all

launch did not matter at all.. I just included it because I used it in the example
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1795
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #73 on: December 30, 2016, 03:14:49 PM »
Code: [Select]
# take a screenshot with hakerdefo script pmss
Mod4 p :Exec launch xfce4-terminal --title pmss-screenshot -x pmss

That command will/can cause some trouble if you already have an instance of xfce4-terminal open won't it. The open terminal will be focused - and not run the command, correct? And if xfce4-terminal already has focus it will get iconified.

Guess it depends on how you want to compose a screenhot.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3841
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #74 on: December 30, 2016, 05:02:56 PM »
It is designed to open the current instance, so if xfce-terminal is already open it will open that

The reverse is if you keep hitting alt p pmss will open as many times as you open it..

launch is a choice, not a requirement. I use it on every command from tint2 and any other panel and also on everything from fluxbox menus so you do not open multiple instances of anything
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO