WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Openbox - xrandr pipe menu for resolution and stuff  (Read 15365 times)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Openbox - xrandr pipe menu for resolution and stuff
« on: April 17, 2016, 08:11:22 PM »
Hi there.
I sometimes connect a bigger screen to my netbook so I was happy when I found  ob-randr  which makes things easy for Openbox users.
http://openbox.org/wiki/Openbox:Pipemenus (-> Miscellaneous: ob-randr) or https://github.com/whiteinge/ob-randr

It's a Python script though, pretty much the only one I was using, so I converted its functionality to Shell script because reasons.



Also, this way I can extend it (easily) if needed (dunno python).
For now, I just added the possibility to set  DISPLAY-X <[--left-of|--right-of|--above|--below|--same-as]> Display-Y , which the original ob-randr still has on its TODO list (5-years-ninja'ed),



added settings for software-brightness (gamma) and the possibility to change settings of not-connected displays (i.e. still generating the menu for setting "left-of" before turning on the display, etc. ; just no resolution settings).

The config layout from the original  ob-randr  works, too. Meaning one can save often used xrandr settings to a file and execute them with this menu ("shortcuts") in the same way as the original python version of ob-randr does (I hope).


Currently, the script does only little error checking regarding the use of Xorg. Needs more checking under Xvesa and Xfbdev.
« Last Edit: April 17, 2016, 08:21:39 PM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Openbox - xrandr pipe menu for resolution and stuff
« Reply #1 on: April 17, 2016, 08:42:32 PM »
Oh, I also added that VGA info (question mark in VRAM comes from lspci cannot see more than 256MB, which may be more actually; Depending on driver, Xorg's log may provide more info which is used instead if it does).

Install instructions are in the script.

Complains welcome.
« Last Edit: April 17, 2016, 08:45:02 PM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Openbox - xrandr pipe menu for resolution and stuff
« Reply #2 on: April 17, 2016, 09:04:02 PM »
One more thing I should note:
Since the default Openbox scripts on TinyCore rewrite the Openbox config (menu.xml) upon starting the X sever, the following is needed to make this menu persistent across reboots...

~/.config/openbox/rc.xml  defines the menu file
Code: [Select]
...
<file>menu.xml</file>
...
Change that to
Code: [Select]
...
<file>menu-whatever.xml</file>
...
And ...
Code: [Select]
cp ~/.config/openbox/menu.xml ~/.config/openbox/menu-whatever.xml
Then ...
Code: [Select]
editor ~/.config/openbox/menu-whatever.xml
And add ...
Code: [Select]
<menu id="xrandr-menu" label="Displays" execute="~/.config/openbox/pipe_xrandr.sh"/>
... wherever suitable.
Download a copy and keep it handy: Core book ;)