You are not logged in.

#1 2009-07-27 17:33:32

majiq
Member
Registered: 2009-03-06
Posts: 259

Openbox Window Manipulation

I'm using an openbox setup, with no GNOME or KDE. I'm using feh, thunar, xterm, etc. The only GNOME item I'm using is the keyring.

The long and the short of it is I essentially always want a terminal on my desktop. I know that there are a number of ways to do this, but I haven't found a one that makes the terminal resistant to minimizing on a "show desktop". So, my question is does someone have a way to prevent the window from minimizing/being registered as minimizable? The alternative that I was thinking about was is there a way to change how it registers, for example make the terminal seem like a dock or a panel instead of a window?

What I've tried:
1. Using xprop to remove the _NET_WM_ACTIONS field so that minimize was not listed.
2. Mapping a wmctrl -b remove hidden -r <target id> remove hidden action to the same keybinding as the show desktop keybinding. (It had no effect, but the same command afterwards issued from a new terminal showed the original target terminal).
3. Mapping a script that used wmctrl to both toggle the show desktop action and then show the terminal. (failed at minimizing the desktop).
4. Digging through the xterm (which is the terminal in question, by the by) man pages for anything on type of window, but did not find anything there.
5. Checking out the override redirection concept (took it from wbar; from reading the code comments that's what seems to do keep the WM off it), but that seems to need to be set in the source and compiled in.
6. Asking on IRC (!give majiq f).

Edit: Being an IRC noob, I wasn't able to get to a proper #openbox. I got to a ##openbox, which had two others in it, but I don't think that's the right one...pointers on that also accepted.

Other ideas:
A. wmctrl -b has a modal option, which I don't know what it does.
B. Maybe there's something that I can do with Xresources that will do the trick?
C. Possibly I can patch the openbox code to reference the _NET_WM_ACTIONS field if someone can point my in the direction for how to interface with that setup?
D. One thought I had, but it'd get out of control, was create a new desktop to go to instead of actually showing the desktop, but I don't know if that's too great an idea cause things might get out of hand...

I've been trying for many hours and played with many ideas, but I'd really like to get this done somehow because I think others would benefit from it as well. Note that it doesn't have to be a prebuiltin option; you can suggest making the option, but if you do, a push in the right direction is appreciated. Also, if there's a program (minimalistic and light at that) that can toggle this for me, please point it out.

Also, let's work under the assumption that the following responses are fail "Don't minimize everything", "Don't use show desktop", and please minimize "Use XYZ WM instead".

Thinking hats on?

Last edited by majiq (2009-07-27 17:34:44)

Offline

#2 2009-07-27 17:36:22

Square
Member
Registered: 2008-06-11
Posts: 435

Re: Openbox Window Manipulation

Perhaps this can help you. It does a lot of manipulation of windows (perfectly with openbox) using wmctrl.

http://bbs.archlinux.org/viewtopic.php?id=64100


 

Offline

#3 2009-07-27 17:57:39

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Openbox Window Manipulation

majiq wrote:

Edit: Being an IRC noob, I wasn't able to get to a proper #openbox. I got to a ##openbox, which had two others in it, but I don't think that's the right one...pointers on that also accepted.

The right channel is at irc://irc.oftc.net/#openbox.  As for the terminal-on-desktop thing, maybe try something like this.

Last edited by Wintervenom (2009-07-27 18:05:46)

Offline

#4 2009-07-27 18:20:58

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Openbox Window Manipulation

@Square: I assume you mean for me to look through the source code. Thanks, I will.

@Wintervenom: I *was* trying to avoid devilspie for some unknown reason, but I'll look into it, thanks. Edit: And thanks for the point about the IRC server; I hadn't paid attention to that.

Keep the suggestions coming. I'm confident (not sure nor highly confident) that this can be done somehow with the current setup.

Last edited by majiq (2009-07-27 18:59:48)

Offline

#5 2009-07-27 18:30:19

mthode
Member
From: Atlanta, GA USA
Registered: 2008-09-07
Posts: 55
Website

Re: Openbox Window Manipulation


GIT d- s-:- a--- C++++ UL++++ P--- L+++ E--- W+++ N++ o K++ w-- O M V-- PS++ PE-- Y++ PGP++ t+ 5+ X R !tv b+ DI++ D++ G
http://www.geekcode.com/geek.html

Offline

#6 2009-07-27 18:57:49

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Openbox Window Manipulation

mthode wrote:

I'm guessing you don't run openbox. And that you if do, you didn't try what the wiki said. And that if you did, you didn't try the show desktop keybinding. And that if it did magically work, you left an insightful response. And if you thought that was an insightful response, fail.

Better luck next time. It's okay, it happens at some point to once. Go get yourself a coke.

Offline

#7 2009-07-27 19:03:35

mthode
Member
From: Atlanta, GA USA
Registered: 2008-09-07
Posts: 55
Website

Re: Openbox Window Manipulation

majiq wrote:
mthode wrote:

I'm guessing you don't run openbox. And that you if do, you didn't try what the wiki said. And that if you did, you didn't try the show desktop keybinding. And that if it did magically work, you left an insightful response. And if you thought that was an insightful response, fail.

Better luck next time. It's okay, it happens at some point to once. Go get yourself a coke.

Last time I tried it it worked (yesterday with openbox),  I also just realized that my nick here is different then irc (prometheanfire).  I don't know if the show desktop will work though, I honestly find using guake the beast solution.


GIT d- s-:- a--- C++++ UL++++ P--- L+++ E--- W+++ N++ o K++ w-- O M V-- PS++ PE-- Y++ PGP++ t+ 5+ X R !tv b+ DI++ D++ G
http://www.geekcode.com/geek.html

Offline

#8 2009-07-28 03:41:07

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Openbox Window Manipulation

Friends, Romans, distromen, thank you. The quest is over. Credit goes to square and mthode, for (in the latter case, eventually) leading me to xdotool. My solution is as follows:

In a configuration file call desktop_items.conf, place the titles of the desired desktop items. Then, I replace the show desktop keybinding command to my script:
Edit: Added comments

#!/bin/bash

#a file to see if the minimize state was triggered; rm-ed every startup
lockfile="/tmp/."$USER"_desktop_show_lock"

#if the desktop was minimized
if [ -e $lockfile ]; then

  #sometimes, you start doing things after minimizing and you want to minimize again. I gave it fifteen minutes.
  if [ $(( $(date +%s) - $(stat --format="%Y" $lockfile) )) -gt $((1*15)) ]; then
    rm $lockfile
    $0
    exit
  fi

  #Bring everything back up
  for id in $( wmctrl -l | cut -f 1 -d ' ' ); do
    xdotool windowmap $id
  done

  #Burn the lockfile
  rm $lockfile
else #When you want to minimize

  #Use the show desktop feature
  wmctrl -k on

  #Then unhide everything you wanted to keep
  for pattern in $(cat ~/.config/openbox/desktop_items.conf ); do
    for id in $( wmctrl -l | grep "$pattern" | cut -f 1 -d " "); do
      xdotool windowactivate $id
    done
  done

  #And note the fact that you minimized.
  touch $lockfile || xmessage "Touch fail"

fi
exit 0

I realized that upon activating the other desktop windows (such as dclock and xterm), the "wmctrl -k off" would have no effect, so I just told it to restore everything. It's not a perfect script, mostly because of the temp file that I use (couldn't figure out a good workaround / didn't care enough to find a good workaround). As a note, devilspie seems like it can do it, if I were to spend time trying to figure it out. As another note, I think override redirect is really the best way to go, but I can't figure out how to change it.

Last edited by majiq (2009-07-28 03:43:57)

Offline

Board footer

Powered by FluxBB