You are not logged in.

#51 2011-01-28 01:29:08

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [Openbox] Hacks and Configs Thread!

@quigybo: very cool! Didn't know about that feature. Buuut... not functioning properly. I just executed your lines directly from the terminal and I get the window id for tint2, so I see how that works to make sure it's running. I also see how you find out if it's visible. But sending the windowmap command makes it pop up about 8 pixels and that's it. From there if I move my mouse on it, it appears at the full 20px height and then autohides when I take the mouse away. Essentially windowmap just makes it function like normal, from what I can tell...

Windowunmap, on the other hand, makes it inaccessible with the mouse. The script seems like it would work if 1) the windowmap function actually made it appear and 2) you only wanted to use the keybind and never the actual cursor. I currently still prefer mine better. If this did what mine does without fiddling with the cursor, that would definitely be the ideal solution.

Offline

#52 2011-02-12 21:33:20

zippy
Member
Registered: 2009-02-01
Posts: 54

Re: [Openbox] Hacks and Configs Thread!

Well I just started w/Openbox a few days ago. Before i tackIe piping menus I'm loving obmenugen! Anyways, I wanted a wine menu.

First, add a entry in ~/config/obmenugen/obmenugen.schema

file:wine.xml

like so -

item:terminal
item:filemanager
item:webbrowser
#item:instantmessaging
item:editor
item:runcommand
submenu:windowsanddesktops
sep:Applications
cat:accesories
cat:graphics
cat:audiovideo
cat:education
cat:office
cat:games
cat:network
cat:development
cat:settings
cat:system
file:wine.xml
submenu:openbox
sep:
item:lock
item:exit

Here's a script that will find all your wine .desktop files and make a menu for them, run obmenugen to create a new menu.xml, and reconfigure openbox.

#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
FINDDIR="$HOME/.local/share/applications/wine"
OUTFILE="$HOME/.config/obmenugen/wine.xml"
FILES="$(find $FINDDIR -name '*.desktop')"

if [ -e $OUTFILE ]; then
    rm -f $OUTFILE
    
    echo "Updating WINE menu file."
    
    echo '    ' >>$OUTFILE
    
  for lines in $FILES;do
  
    echo '        '"$(grep env $lines| gawk -F"Exec=" '{ print $2 }' )"' '  >> $OUTFILE

  done
    echo "    " >> $OUTFILE

    # Stupid .desktop file fix
    sed -i 's/\\\\ /\\ /g' $OUTFILE

    # Regen Menu
    obmenugen

    # Put menu in play
    openbox --reconfigure

else

    echo "Creating WINE menu file."
    echo '    ' >>$OUTFILE
    
  for lines in $FILES;do
  
    echo '        '"$(grep env $lines| gawk -F"Exec=" '{ print $2 }' )"' '  >> $OUTFILE

  done
    echo "    " >> $OUTFILE

    # Stupid .desktop file fix
    sed -i 's/\\\\ /\\ /g' $OUTFILE

    # Regen Menu
    obmenugen

    # Put menu in play
    openbox --reconfigure

fi

IFS=$SAVEIFS

It was just some stuff i found on the web while looking for this ability. I tweaked it a little bit and added some things. If it can be written better or more efficient let me know!

Last edited by zippy (2011-02-12 22:14:38)

Offline

#53 2011-05-07 16:11:24

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [Openbox] Hacks and Configs Thread!

I have stolen a few things here, the menu + mod is very nice and easy.

I also have this:

PrtScrn:  Takes screenshot with scrot
Ctrl-Page Up: Master Volume Up (amixer set Master 5%+)
Ctrl-Page Down: Master Volume Down (amixer set Master 5%-)
Ctrl-End: Master Volume 0 (amixer set Master 0) // i do not want to really mute it but still have it shut down

I'm still in the process for my special menu i'm making. I can be lazy and ask it on the forums here but i just wanna do it myself so i learn something along the way smile

Offline

#54 2011-05-08 02:59:33

kyla
Member
From: Arlington, VA
Registered: 2011-03-12
Posts: 112
Website

Re: [Openbox] Hacks and Configs Thread!

Does anyone know why certain windows would act differently than others? I've mostly copied moljac024's config, but I've noticed that my urxvt terminal windows are always slightly smaller than everything else... :huh:

Thank you everyone who has posted here!

Offline

#55 2011-05-08 03:46:49

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [Openbox] Hacks and Configs Thread!

kyla wrote:

... I've noticed that my urxvt terminal windows are always slightly smaller than everything else...

That's common for many terminal apps.  The window is actually being set for the complete lines of text it can display.  If the vertical size you set would result in 32.5 lines, urxvt (and xterm and a few others) corrects this to 32.0 lines.

Offline

#56 2011-05-08 13:23:00

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [Openbox] Hacks and Configs Thread!

Redostrike wrote:

I have stolen a few things here, the menu + mod is very nice and easy.

I also have this:

PrtScrn:  Takes screenshot with scrot
Ctrl-Page Up: Master Volume Up (amixer set Master 5%+)
Ctrl-Page Down: Master Volume Down (amixer set Master 5%-)
Ctrl-End: Master Volume 0 (amixer set Master 0) // i do not want to really mute it but still have it shut down

I'm still in the process for my special menu i'm making. I can be lazy and ask it on the forums here but i just wanna do it myself so i learn something along the way smile

Ok discoverd notify-send/osd today so i was thinking to myself lets use this with key bidings so i took those from above and made them notify me what i'm doing.

Here is what (for example) ctrl+page up does now:
- Kill all notify-OSD // this is here if i push ctrl+page up rapidly it kills it of the screen and then shows it again real fast
- Up the volume like before
- Make a notify of volume Up

code for it:

...
    
      
        killall notify-osd
      
      
        amixer set Master 5%-
      
      
        notify-send "Volume Down" -t 10
      
    
...

Still expirimenting with this as i think it's posible to merge them and/or show them in a diffrent place on the screen. Stuff like that but as you can see i'm "new" to all this.

Still working on my special menu (if i can figure it out though).

Last edited by Redostrike (2011-05-08 13:28:33)

Offline

#57 2011-05-10 09:19:47

zoqaeski
Member
From: /earth/australia/.
Registered: 2009-09-30
Posts: 133

Re: [Openbox] Hacks and Configs Thread!

After trying out GNOME 3 to see how bad it was first-hand (and I'll have to admit that it'd be quite usable, IF you've never used a computer before—old habits die hard), I figured I'd implement a few of its best features with Openbox. I haven't got a GNOME-shell-style interface (slingshot is buggy), but I am using workspaces more productively now, and I can create a temporary one as needed with some keybindings. Enjoy and feel free to plunder smile

(For the record I've got about 116 of them defined. Chaining is awesome.)

http://pastie.org/1884340

Basically, it's set up so that a chain enters a command sequence, such as for window management, desktop management, application shortcuts, etc, and I can perform pretty much every action imaginable from the keyboard. Needless to say I've probably gone totally overboard but I've definitely defined the most common actions. The only part of the desktop management I'm not sure about is dynamically defining names for workspaces, but I'll figure that out sometime.

Offline

#58 2011-06-14 13:28:00

NewWorld
Member
Registered: 2010-02-15
Posts: 33

Re: [Openbox] Hacks and Configs Thread!

Here is an example of how to bind keys to programs for lightning-fast movement between apps: (in this example press Meta-W to switch to the virtual desktop Opera is on and focus it):

    
      
        sh -c 'wmctrl  -a "- Opera"'
      
    

You'll need to install 'wmctrl'. I have all my most-used apps bound to the LHS of the keyboard, next to the Meta key - got browser, IM, IRC, file manager, music player all bound; you'll be amazed how much more efficiently you'll be switching between apps smile

Last edited by NewWorld (2011-06-14 17:49:20)

Offline

#59 2011-06-14 14:32:09

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Openbox] Hacks and Configs Thread!

@NewWorld: can you outline how this approach is different from using the "DesktopLast", "SendToDesktopLast" and "NextWindow" (with yes) actions?

Offline

#60 2011-06-14 17:42:30

NewWorld
Member
Registered: 2010-02-15
Posts: 33

Re: [Openbox] Hacks and Configs Thread!

quigybo wrote:

@NewWorld: can you outline how this approach is different from using the "DesktopLast", "SendToDesktopLast" and "NextWindow" (with yes) actions?

Haha big_smile I remember asking on the #openbox channel if this was implemented, and I was given no solutions except to script it xD Thanks for telling me this action exists; I'll delete the relevant parts of my previous post.

EDIT: As for "NextWindow", it's a lot more efficient to bind keyboard shortcuts to apps, because there is a lot more overhead locating an app using Alt-Tab when you have more than a few apps loaded.

Last edited by NewWorld (2011-06-14 17:54:15)

Offline

#61 2011-09-29 10:16:12

vandakiara
Member
From: Lisbon, Portugal
Registered: 2011-06-13
Posts: 20
Website

Re: [Openbox] Hacks and Configs Thread!

So, nothing special but here are my keybindings - basically I hate using the mouse for anything (I'm mostly on my netbook, who cares about the mousepad really? And I don't really feel like bringing my mouse to college so...) so I've setup some shortcuts for my mostly used applications and such..

Here they are:


    
      
        
          true
          Terminal-popup
        
        gmrun
      
    
    
      
        
          true
          Chromium
        
        chromium
      
    
    
      
        
          true
          Gnome Terminal
        
        gnome-terminal
      
    
    
      
        
          true
          Gimp
        
        gimp
      
    
    
      
        
          true
          Nautilus
        
        nautilus
      
    
    
      
        
          true
          Audacity
        
        audacity
      
    
    
      
        
          true
          LibreOffice
        
        libreoffice
      
    
    
      
        
          true
          Terminar Sessão
        
        logout
      
    
    
      
        
          true
          Screenshot
        
        gnome-screenshot
      
    

On another note, there are mostly only keybindings in this thread... Aren't there any ways to "hack" Openbox and do something different with it? For example, setting up a cube - (can that even be done?) that would be an interesting hack to see... oh well, but I'm a girl - it's normal for me to wish for flashy effects (a year and a half ago, that was the reason why I converted to Linux and started using Ubuntu)...


~ Believing oneself to be perfect is often the sign of a delusional mind ~

Offline

#62 2011-09-29 16:16:06

nc
Member
From: Braga, Portugal
Registered: 2009-04-08
Posts: 20

Re: [Openbox] Hacks and Configs Thread!

From all my keybiobknds, the most useful are:

  • alt+[1..6]: go to desktop x

  • shift+alt+[1..6]: send window to desktop x

  • alt+p: execute dmenu_run

  • shift+alt+c: close a window

Offline

#63 2011-10-26 15:53:25

sleepforlife
Member
Registered: 2011-09-27
Posts: 109

Re: [Openbox] Hacks and Configs Thread!

how do I remove the decorations from all openbox?

this lines is not working. sorry for my poor english+



  
  
    no
  

  
  
    yes
  

Offline

#64 2012-04-24 10:32:25

morgulbrut
Member
Registered: 2012-01-06
Posts: 3

Re: [Openbox] Hacks and Configs Thread!

If it counts as a hack, here is mine:

menu.xml



	

and a part of the actual menu.sh

#!/bin/bash

NAME=`wmctrl -d | grep "*" | awk '{print $10}'` # returns the name of your desktop.

programItem(){
echo ""
echo "	"
echo "		"
echo "			$2"
echo "		"
echo "	"
echo ""
}
pipemenuItem(){
	echo ""
}
separatorItem(){
	echo ""
}
beginmenuItem(){
	echo ""
}
endmenuItem(){
	echo ""
}
reconfItem(){
	echo ""
	echo "	"
	echo ""
}
recstartItem(){
	echo ""
	echo "	"
	echo ""
}


echo "" 
	echo ""
	programItem "Run Program" "gmrun"
	separatorItem
.
.
.
	programItem "Exit" "oblogout"
echo ""

so finally i got:
1. my menu shows the desktopname
2. because it is a pipemenu, you can edit the menu.sh file and use it without reconfigure openbox.

Last edited by morgulbrut (2012-04-24 10:32:41)

Offline

#65 2012-06-01 01:05:19

ninjaprawn
Member
From: Manchester, UK
Registered: 2008-01-26
Posts: 485

Re: [Openbox] Hacks and Configs Thread!

hmmm quick question on hacking openbox.... i cant seem to find this anywhere..... but is it possible to make all windows permanently undecorated? i can right click on each window one by one and select undecorate, but i want the effect to be permanent and for everything. in the rc.xml i have set the attribute for decor as follows, but no joy no
any ideas?


2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound

Offline

#66 2012-06-01 01:12:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [Openbox] Hacks and Configs Thread!

Ninja, can you post the surrounding region of your rc.xml.  That works perfectly for me.

Are your running `openbox --reconfure` after you edit your rc.xml?

Last edited by Trilby (2012-06-01 01:13:22)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#67 2012-06-01 01:28:57

ninjaprawn
Member
From: Manchester, UK
Registered: 2008-01-26
Posts: 485

Re: [Openbox] Hacks and Configs Thread!

Trilby wrote:

Ninja, can you post the surrounding region of your rc.xml.  That works perfectly for me.

Are your running `openbox --reconfure` after you edit your rc.xml?

yeah, always do the `openbox --reconfigure`after changes... the only thing i can find anywhere in all the documentation about getting rid of the titlebar/decoration is the to change the line "yes" to "no" which i have done.......



  
    10
    20
  
  
    yes
    
    no
    
    yes
    
    no
    
    200
    
    no
    
  
  
    Smart
    
    
yes
Active 1
Shiki-Statler NLIMC yes yes sans 8 bold normal sans 8 bold normal sans 9 normal normal sans 9 normal normal Sans 8 2 1 500 yes Never Center 10 10 0 0 0 0 TopLeft 0 0 no Below Vertical no 300 300 Middle C-g no oblogout yes oblogout no no no no no no no 2 3 4 gmrun yes gmrun ~/.config/dmenu/dmenu-bind.sh yes dmenu client-menu yes yes pcmanfm yes File Manager chromium yes Minefield Web Browser gucharmap yes gucharmap urxvt yes urxvt xkill yes Kill an application urxvt -e packer -Syyuf yes System Upgrade leafpad yes leafpad gnome-mplayer yes Gnome Media Player slimlock yes lock chromium /usr/share/ab/DOC.html yes DOC conkyswitcher yes Switches conky root-menu amixer set Master 5%+ unmute amixer set Master 5%- unmute amixer set Master toggle slimlock sudo pm-suspend 8 200 400 client-menu top left client-menu right client-menu bottom client-menu client-menu client-menu client-list-combined-menu root-menu menu.xml200no100400 if this is a negative value, then the delay is infinite and the submenu will not be hidden until a different submenu is opened --> yes yes yes 1 yes no

2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound

Offline

#68 2012-06-01 01:35:48

ninjaprawn
Member
From: Manchester, UK
Registered: 2008-01-26
Posts: 485

Re: [Openbox] Hacks and Configs Thread!

oooops sorry, i posted to hastily!! i solved it by adding no to the following bit as well at the bottom... thanks tho smile

     
         .........................
................................
...........................
........................
   


2007 - Started using Arch Linux as my only/main OS
- Samsung Series 3, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz - 8Gb DDR3 ram - 700Gb HDD
On board intel Graphics & Sound

Offline

#69 2012-06-01 01:42:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [Openbox] Hacks and Configs Thread!

Yup, where you had it is actually commented out.  That part of the example rc.xml always bothered me - it's really not very clear that those are ALL comments, particularly when they mix comment styles (lines starting with # have no special meaning in XML - they are not actually commented out*).  That whole region of the file is commented out between the "".

*Edit for clarification: Those lines are commented out, but not because of the #, the # is irrelevant.  They are all commented (# or not) because of the

Last edited by Trilby (2012-06-01 02:04:56)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#70 2012-06-12 01:35:14

sw2wolf
Member
From: China
Registered: 2009-06-08
Posts: 99
Website

Re: [Openbox] Hacks and Configs Thread!

Can OpenBox group windows as FluxBox does ?


e^(π⋅i) + 1 = 0

Offline

#71 2012-06-12 02:46:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [Openbox] Hacks and Configs Thread!

Short answer: no.

There are some tools that will provide some degree of tabbed window functionality in openbox - but these are add ons.  Openbox does not provide such an option.  This may be the biggest difference between the two *boxes (and the only advantage of fluxbox IMHO).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#72 2013-03-14 06:15:59

bakytn
Member
Registered: 2013-03-14
Posts: 4

Re: [Openbox] Hacks and Configs Thread!

I was able to use one really neat thing. In many DE or WM, when you maximize the window and then try drag the window from the titlebar, the window would be unmaximized. I was able to achieve this by following config:


 
  
  
 

The Move action is necessary to keep to be still moving window.

BUT there is one thing...I hope you can help me..

This way, when window become unmaximized, the cursor will still be on top of the screen (it looks ugly when you move your mouse and window below moves too). How to move the cursor to still be on a titlebar?

Last edited by bakytn (2013-03-14 10:43:30)

Offline

#73 2013-03-14 10:06:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [Openbox] Hacks and Configs Thread!

bakytn, I doubt there is a way to do this in "pure" openbox, but you could call xdotool to warp the mouse pointer.

Add and ... between the Unmaximize and the Move that executes the appropriate xdotool command.

This is completely untested, and is just my brainstorming - but it should be able to do what you want.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#74 2013-03-14 10:55:53

bakytn
Member
Registered: 2013-03-14
Posts: 4

Re: [Openbox] Hacks and Configs Thread!

Trilby, I think this is very acceptable workaround. Thank you very much!

Last edited by bakytn (2013-03-15 04:57:40)

Offline

#75 2013-03-26 12:28:05

Next7
Member
Registered: 2011-12-07
Posts: 44

Re: [Openbox] Hacks and Configs Thread!

Hi!

Does anybody know is there a way to hide bars (tint2, fbpanel or similar) on a particular desktop through key binding as it is possible in WMs like dwm and awesome? Or is there possibility to never show these bars on a particular desktop?

I'm aware of the "autohide" option of these bars but that's not what I'm looking for.

Offline

Board footer

Powered by FluxBB