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

VastOne

  •      v-ger
  • Posts: 3861
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #45 on: December 21, 2016, 04:08:58 AM »
Version 3 ready in my head  8)
Need sometime to put it all together on MEdit  ;)
May be this weekend!
Some new ways to capture them scrots coming your way :D
Stay Tuned ;D

Cheers!!!

Looking forward to it... How do you improve perfection?

One item I would not mind seeing... a clean all scrots option, as in delete.. I like it just for housekeeping. The scrots directory IMO is temporary for most and anyone wanting to keep the scrots should never use the proposed clean all option
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #46 on: December 21, 2016, 04:01:17 PM »
Looking forward to it... How do you improve perfection?

One item I would not mind seeing... a clean all scrots option, as in delete.. I like it just for housekeeping. The scrots directory IMO is temporary for most and anyone wanting to keep the scrots should never use the proposed clean all option

+1 looking forward to the new script.

One other item would be to port the script to yad/zenity - no need to open a terminal. I did a quick hack of the yad script for ceni and the scrot commands work just fine. Pretty much the limit of my scripting capabilities.

Goal would be to have a gui VSIDO screenshooter app to replace xfce4-screenshooter (still installed by default isn't it?). Decrease in overhead on the iso is probably minimal, but it would be cool VSIDO tool.
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

Snap

  • Posts: 462
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #47 on: December 22, 2016, 05:20:53 AM »
^ I agree. That will be a great GUI tool for Vsido.

...though I have to say that it will put me away  from pmss  ::)

Code: [Select]
depends yad
yad
  Depends: libatk1.0-0
  Depends: libc6
  Depends: libcairo-gobject2
  Depends: libcairo2
  Depends: libgdk-pixbuf2.0-0
  Depends: libglib2.0-0
  Depends: libgtk-3-0
  Depends: libpango-1.0-0
  Depends: libpangocairo-1.0-

libgtk-3. Nope. I'm more than fine with dmenu and/or rofi for scripts GUI.

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: pmss (Poor Man's Screenshooter)
« Reply #48 on: December 25, 2016, 08:11:58 PM »
As Promised.
A present on a Christmas day  ;)
V3 of pmss (Poor Man's Screenshooter) is here  8)

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 (){
printf "\033c"
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
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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")
printf "\033c"
PMSS_PID=$(xdotool getactivewindow)
xdotool windowminimize "$PMSS_PID"
sleep 1
scrot -u -b -c "${NAME}"
RETVAL=$?
if [[ "$RETVAL" == 2 ]]; then
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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}"
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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")
PMSS_PID=$(xdotool getactivewindow)
for i in $(xdotool search ".*");do xdotool windowminimize $i;done
sleep 1
scrot -c "${NAME}"
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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}"
printf "\033c"
xdotool windowactivate "$PMSS_PID"
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 (){
printf "\033c"
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"
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'"To Take The Screenshot Of The Entire Screen, Press \"E\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Take The Screenshot Of Window In Focus, Press \"W\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Take The 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

You Can't Always Git What You Want

VastOne

  •      v-ger
  • Posts: 3861
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #49 on: December 25, 2016, 08:31:32 PM »
Very nice..

I ran the script and everything worked perfectly except for the following:

Questions though.. What exactly is going on during

** Enter "E" To Take The Screenshot Of The Entire Screen

Press "C" For Clean Mode
Press "D" For Dirty Mode

C pretty much shutdown fluxbox and took a blank background screenshot. I had to log out and back in to get anything going again

D ran as expected by taking a normal screenshot after 12 seconds
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #50 on: December 26, 2016, 03:03:52 AM »
Clean worked for me - all open windows were iconified and I got a screenshot of the desktop.

Only difference that comes to mind is that VSIDO has compton running by default - not sure if / how that would matter. 
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

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: pmss (Poor Man's Screenshooter)
« Reply #51 on: December 26, 2016, 05:40:09 AM »
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!!!
You Can't Always Git What You Want

Snap

  • Posts: 462
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #52 on: December 26, 2016, 11:33:05 AM »
@Packrat: How do you set your background?  I use hsetroot and the background is captured too. Maybe nitrogen is treated as a window by wmctrl.

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: pmss (Poor Man's Screenshooter)
« Reply #53 on: December 26, 2016, 11:44:39 AM »
@Packrat: How do you set your background?  I use hsetroot and the background is captured too. Maybe nitrogen is treated as a window by wmctrl.
Hi Snap,
So does the 'clean mode' in the 'capture entire desktop' option work for you? It should minimize all open windows and capture the 'clean' desktop.

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

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #54 on: December 26, 2016, 02:17:52 PM »
@Packrat: How do you set your background?  I use hsetroot and the background is captured too. Maybe nitrogen is treated as a window by wmctrl.

I actually use the fluxbox internal application to set the desktop background:

Code: [Select]
fbsetbg -c -r ~/wallpaper
It's a wrapper that needs another wallpaper setter like hsetroot - which is the one I install, so indirectly hsetroot. It will also use feh, or nitrogen if available, Works best with hsetroot and feh. I think the heirarchy when more than one is installed is  1. hsetroot  2. feh  3. nitrogen.

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

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #55 on: December 26, 2016, 02:36:55 PM »
@snap - assumig you (anyone) is using them, did your tint2 and conky disappear from your Clean screenshot?

That is most likely because fluxbox is unique in that Desktop is actually a named layer. From the fluxbox man page:

Code: [Select]
   Layers
       fluxbox manages the following layers (from highest to lowest):

           •Above Dock

           •Dock

           •Top

           •Normal

           •Bottom

           •Desktop

       Windows on a higher layer will always appear above those on a lower
       one. These layers can be used on application windows, the slit or the
       toolbar. You can assign applications to a certain layer by specifying
       it in the ‘apps’ file or through the WindowMenu. We discuss the ‘apps’
       file in fluxbox-apps(5). We discuss the WindowMenu in the MENUS
       section. We discuss layers in more detail in the LAYERS section.

The wallpaer is set on the Desktop layer in fluxbox, conky and tint2 (any 3rd party panel) windows are not - although the xfce4-panel may be an exception. So when a "show desktop" command is invoked, the conky and tint2 windows also get iconified. Middle click on the desktop and you can find them in the Icons list and de-iconify them.

Best way to get around that is to use the ~/.fluxbox/apps file and set the layer for conky and tint2 to Desktop. In conky you can set:

Code: [Select]
own_window_class = 'ConkyFB',
own_window_title = 'ConkyFB',

to give conky a unique class and title to use in the apps file. Use the xprop tool to get name and class for tint2.

To illustrate -

Dirty -
 

Clean -


The Tao and Weather conky iconified, the system conky does not because it is set to "own_window_type = dock" and resides in the fluxbox slit.

And since each conky is set to "own_window = yes", they show as iconified windows - setting "own_window = no" will output conky to the desktop so it will not be iconified.

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

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: pmss (Poor Man's Screenshooter)
« Reply #56 on: December 26, 2016, 03:23:50 PM »
@PackRat's knowledge of everything related to window managers is AMAZING!
So setting the layer for conky and tint2 to Desktop in .~/.fluxbox/apps file will fix this problem?

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

VastOne

  •      v-ger
  • Posts: 3861
    • View Profile
    • VSIDO Community
Re: pmss (Poor Man's Screenshooter)
« Reply #57 on: December 26, 2016, 03:31:32 PM »
^ +1000

the RatMan never ceases to amaze me...

... just like you and your coding skills!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #58 on: December 26, 2016, 03:41:23 PM »
@PackRat's knowledge of everything related to window managers is AMAZING!
So setting the layer for conky and tint2 to Desktop in .~/.fluxbox/apps file will fix this problem?

Cheers!!!

I thought it would, but it doesn't seem to be working - for the weather conky anyway. I have done it in the past, but that was in conjuction with the fluxbox internal macros -

# key binding to toggle show desktop.
Code: [Select]
Mod1 F12 :ToggleCmd {ShowDesktop} {DeIconify all originquiet}
fluxbox apps file - layer 12 is desktop (layers are numbered 2, 4, 6, 8, 10, 12 top to bottom in that man page list)

Code: [Select]
[app] (name=conkyweather) (class=conkyweather)
  [Shaded] {no}
  [Layer] {12}
[end]

that binding works and the weather conky is still visible

wmctrl commands may have super powers and overrride fluxbox internals.

Needs more testing.

Edit - the conky-kryptonite for wmctrl super powers is to set:

Code: [Select]
own_window_type = 'override'
as well as something like -

Code: [Select]
own_window_class = 'Conkyfull',
own_window_title = 'Conkyfull',

in the ~/.fluxbox/apps file -
[app] (name=Conkyfull) (class=Conkyfull)
  [Layer]   {12}
[end]

The apps file does use wild cards (although the syntax escpaes me right now) so something along the lines of: (in the fluxbox-apps man file) -

[app] (name=Conky.*) (class=Conky.*)
  [Layer]   {12}
[end]

Would put all conkyrc with class and name begining with "Conky" on the desktop and keep them de-iconified for screenshots.

Screenshot or it didn't happen -



system conky docked in slit, tao and weather set to override and placed on Desktop layer.

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

PackRat

  • Posts: 1816
    • View Profile
Re: pmss (Poor Man's Screenshooter)
« Reply #59 on: December 26, 2016, 04:26:45 PM »
For tint2 -

Code: [Select]
[app] (name=tint2) (class=Tint2)
  [Layer] {12}
[end]

in the ~/.fluxbox/apps file works with the Showdesktop keybinding above, but wmctrl still iconifies the tint2 panel. Most likely need to mess with the tint2 strut_policy settings to discover the tint2-kryptonite
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