Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-07-29 10:58:41

deanr
Member
Registered: 2021-04-08
Posts: 15

Unhide a window?

In the Window Manager there's a shortcut setting for 'hide window'. But how can I restore the window with a keyboard shortcut - and I don't mean maximise, I want to restore it to the same place and size from which it was hidden?

Offline

#2 2021-07-29 11:29:00

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Unhide a window?

There is nothing built-in that can do this, but you can use an external tool like xdotool to map/unmap windows and script something to keep track of the last window unmapped. Have a look at JoeJoe's answer here for an example of such a script. You would bind this to a keyboard shortcut and the first time you shortcut it would hide the active window and the next time you use it, it would restore the window.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-07-29 11:36:25

deanr
Member
Registered: 2021-04-08
Posts: 15

Re: Unhide a window?

Thanks, I'll look into it.

Seems like a rather odd omission on behalf of the develops though... roll

Offline

#4 2021-07-29 11:51:51

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Unhide a window?

Having a closer look at the script linked there, it doesn't really work well because it doesn't accommodate for window decorations. The end result is everytime you remap the window, it drifts to a new position. I've updated the script to account for this, but you need to specify the "xoffset" and "yoffset" values. "xoffset" is the width of the left+right borders, and "yoffset" is the height of the window titlebar+lower border. Here is the updated script:

#!/bin/bash

yoffset=56	#height of window title bar and top/bottom borders
xoffset=4	#width of left/right borders

file=/tmp/last_active_window
geo=/tmp/last_active_window_geometry

if [[ -s $file ]] ; then
    xdotool windowmap `cat $file`
    xpos=$(( $(cat $geo | awk -F',' '{print $1}')-$xoffset ))
    ypos=$(( $(cat $geo | awk -F',' '{print $2}')-$yoffset ))
    xdotool getactivewindow windowmove $xpos $ypos
    cat /dev/null > $file
else 
    echo $(xdotool getactivewindow getwindowgeometry | grep Position | awk '{print $2}') > $geo
    wid=$(xdotool getactivewindow)
    xdotool windowunmap $wid
    echo $wid > $file
fi

Seems like a rather odd omission on behalf of the develops though

I wouldn't say an omission. It would require extra code to keep track of the last active window and xfwm4 is designed to be a minimalist window manager. Regardless, feel free to create a bug report to see what the developer says.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2021-07-30 00:44:49

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

Re: Unhide a window?

i thought it was an "omission", too.  but "minimalist" is always going to "omit" things to achieve its goal.  maybe you can start with XFCE, add some things, especially things that match what XFCE already has, and create a "middle-ist" DE.  be sure to release it with all the XFCE credits and same licensing.  i'll be looking forward to trying it.

there are, already, other DEs at each extreme.  it might not be perfect, but XFCE has saved me a lot of work.

Offline

Board footer

Powered by FluxBB