Compiz -- Openbox + Compton setting synchronization

I'd like to make some scripts to synchronize settings, where possible, between Pantheon 3D and Pantheon Lite
This thread is for seeking advice as much as thinking out loud for how to get this done.
Openbox uses an xml file and Compton uses a json text configuration file.
Compiz can use a flat configuration file or gsettings, and I prefer gsettings.

First, as more applications start using gnome's client side decorations, compiz and openbox have to be told to stop decorating them. CSD windows apparently do not come with any nifty xorg tricks to filter them en masse.  I've been doing this by hand, per application thus far, and this is what those configurations look like at the moment:
org.compiz.profiles.Default.plugins.decoration-match
'(any) & !(class=Gnome-control-center) & !(class=Pantheon-*) & !(class=Audience) & !(class=Gedit) & !(class=Noise) & !(class=File-roller) & !(class=Gnome-tweak-tool) & !(class=Popcorn-Time) & !(class=PCSXR) & !(class=Shotwell) & !(class=Files)'
~.config/openbox/rc.xml (excerpt)
<application class="Gnome-control-center">
<decor>no</decor>
</application>
<application class="Pantheon-*">
<decor>no</decor>
</application>
<application class="Audience">
<decor>no</decor>
</application>
<application class="Gedit">
<decor>no</decor>
</application>
<application class="Noise">
<decor>no</decor>
</application>
<application class="File-roller">
<decor>no</decor>
</application>
<application class="Gnome-tweak-tool">
<decor>no</decor>
</application>
<application class="Popcorn-Time">
<decor>no</decor>
</application>
<application class="PCSXR">
<decor>no</decor>
</application>
<application class="Shotwell">
<decor>no</decor>
</application>
<application class="Files">
<decor>no</decor>
</application>
I need a utility to add new windows to both at the same time. I think this is scriptable, but I'm not fluent in things like sed, regex, or escape characters.
Sketch for a utility that appends new windows to the list:
get the window class to match (needs real sed incantation)
XWINCLASS=$(sed magic(input $(xprop), find WM_CLASS, find the last '"' on that line, output the string between that and the preceding '"'))
generate the compiz setting (needs escapes?):
NEW_UNDECOR_COMPIZ=" & !(class=$XWINCLASS)"
generate the openbox setting (needs escapes? proper newlines?):
NEW_UNDECOR_OB=" <application class="$XWINCLASS">\n <decor>no</decor>\n </application>\n"
Set the compiz setting (needs proper syntax? needs real sed incantation):
dconf write /org/compiz/profiles/Default/plugins/decor/decoration-match $(sed magic(input $(dconf read /org/compiz/profiles/Default/plugins/decor/decoration-match), find the last "'", insert $NEW_UNDECOR_COMPIZ one character before that, output))
Set the openbox setting (needs real sed incantation):
sed magic(input ~.config/openbox/rc.xml, find the first "<decor>no</decor>" from the end of the file, find the following "</application>", insert $NEW_UNDECOR_OB on the next line, output) > ~.config/openbox/rc.xml
Sketch for a utility that synchronizes the two (if they were not edited by the same utility):
Get the list of applications from compiz's dconf (needs real sed incantation)
XWINCLASSES_COMPIZ=$(sed magic(input $(dconf read /org/compiz/profiles/Default/plugins/decor/decoration-match), find "& !(class=", output the string between that and the following ")" + \n, repeat to end of input))
Get the list of applications from ~.config/openbox/rc.xml (needs real sed incantation; which is going to be a nightmare)
XWINCLASSES_OB$(sed magic(input ~.config/openbox/rc.xml, find "<decor>no</decor>", find the preceding " <application ", find the following "class=" or continue to the next "<decor>no</decor>" after the following, repeat until finding "class=", output the string between that and the following '"' + \n, repeat until the end of input))
Sort aphabetically both lists, diff, add new entries to the least recently changed, remove new deletions from the least recently changed.
no idea how to do that yet
Side note: any thoughts on a sed front-end called sedmagic that takes natural language input?

Similar Messages

  • Set Synchronize with Item property at runtime in Forms

    Hi,
    We have a requirement to set the "sychronize with item" property to null for one of the fields of seeded form during run time (this is to avoid modifying the seeded form which has the synchronize property of field A set to field B. We are planning to do this change in CUSTOM.PLL). I couldn't find any property in "APP_ITEM_PROPERTY2.set_property" which can suffice my requirement. I am working on Forms 10g.
    Please let me know if anybody has worked on similar requirement.
    Thanks,
    Shree

    Hello.
    You can perform this by using:
    set_tab_page_property('Tab_page_name', label,'your_desire_label');
    and for item set_item_property.
    More details on these built-ins and also some example can be found in Forms Builder Help.
    Regards,
    Alex
    If someone's answer is helpful or correct please mark it accordingly.

  • Strange shade of plank while using compton inside openbox

    Click to View ScreenShot
    As the image indicates. There is a strange shade at the bottom of the screen. Is there anyway to get ride of it?
    Info:
    plank-bzr(aur)
    openbox
    compton-git(aur)
    My compton options:
      compton -m 0.7  -e 0.7  -c  -f &
    Last edited by jilen (2013-09-14 14:57:49)

    ooo wrote:
    you could try adding -C (Avoid drawing shadows on dock/panel windows)  in your compton command.
    I'm pretty sure that should work since I've used docky myself without getting the shadow beneath it.
    if not, there's also a --shadow-exclude option
    It just works perfectly , Thansk guy!!!!!

  • [SOLVED] [Openbox] Icon-theme not working(?)

    Hi!
    I hope you guys could help me with the following problem.
    Currently I'm running Openbox, compton, tint2, gtk2/3 on my Arch-system.
    The problem I'm having right now is that tint2 tray icons are not showing Faenza-Dark but showing gnome(?) dark icons. I would like to have white/grey icons instead of dark ones!
    My tint2 config:
    # Tint2 config file
    # Generated by tintwizard (http://code.google.com/p/tintwizard/)
    # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
    # Background definitions
    # ID 1
    rounded = 0
    border_width = 0
    background_color = #FFFFFF 20
    border_color = #FFFFFF 0
    # Backgrounds
    panel_background_id = 1
    taskbar_background_id = 0
    task_background_id = 0
    task_active_background_id = 1
    systray_background_id = 0
    clock_background_id = 0
    # Panel
    panel_monitor = 1
    panel_position = bottom center horizontal
    panel_size = 0 38
    panel_items = LTSC
    panel_margin = 0 0
    panel_padding = 0 0 5
    font_shadow = 0
    panel_background_id = 1
    wm_menu = 1
    panel_dock = 0
    panel_layer = top
    # Launcher
    launcher_icon_theme = Numix
    launcher_padding = 10 10 10
    launcher_icon_size = 22
    launcher_tooltip = 0
    launcher_apps_dir = /home/archie/.config/tint2/launchers
    # Taskbar
    taskbar_mode = single_desktop
    taskbar_padding = 0 0 10
    # Tasks
    urgent_nb_of_blink = 20
    task_icon = 1
    task_text = 0
    task_centered = 1
    task_maximum_size = 58 0
    task_padding = 10 4
    # Systray
    systray_padding = 0 10 6
    systray_sort = left2right
    systray_icon_size = 22
    systray_icon_asb = 100 0 0
    systray_icon_theme = Faenza-Dark
    # Clock
    time1_format = %I:%M %p
    time1_font = Open Sans 9
    time2_format = %D
    time2_font = Open Sans 9
    clock_font_color = #ffffff 80
    clock_padding = 10 0
    # Tooltip
    tooltip = 0
    # Mouse
    mouse_middle = close
    mouse_right = none
    # Autohide
    autohide = 0
    /home/archie/.config/gtk-3.0/settings.ini:
    [Settings]
    gtk-theme-name=Greybird
    gtk-icon-theme-name=Faenza-Dark
    gtk-font-name=Open Sans 9
    gtk-cursor-theme-name=Vanilla-DMZ
    gtk-cursor-theme-size=0
    gtk-toolbar-style=GTK_TOOLBAR_ICONS
    gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
    gtk-button-images=0
    gtk-menu-images=0
    gtk-enable-event-sounds=1
    gtk-enable-input-feedback-sounds=1
    gtk-xft-antialias=1
    gtk-xft-hinting=1
    gtk-xft-hintstyle=hintfull
    gtk-xft-rgba=rgb
    I'm running tint2-svn and already tried the normal one.
    Could some tell me a hint?
    Last edited by beta990 (2014-01-13 21:58:18)

    Thanks for posts!
    I have done all the steps, but real key was to reboot the system! Even pkill X didn't work. It's now solved.
    To give users with the same issue a solution:
    - Set icon-theme with lxappearance
    - Be sure that gtk3.0/settings.ini has fallback and icon-theme the same value (not know if it really needed)
    - Reboot! pkill X didn't work for me.
    Thanks again.

  • (SOLVED) Compiz, GLX error even tough i start compiz with LIBGL_AWLAYS

    Hi,
    I have tried to read trough the wiki, google and forum. I cant get this to be solved?
    I installed compis with:
    # pacman -S compiz-fusion-gtk (no to emerald, emerald-themes and compiz-fusion-plugins-extra)
    made sure metacity compositioning was off with gconf
    then i added these:
    gconftool-2 --set -t string /desktop/gnome/session/required_components/windowmanager compiz
    gconftool-2 --set -t string /desktop/gnome/applications/window_manager/current /usr/bin/compiz
    gconftool-2 --set -t string /desktop/gnome/applications/window_manager/default /usr/bin/compiz
    Have added these to xorg.conf
    ServerLayout:
    Option "AIGLX" "true"
    Device:
    Option "XAANoOffscreenPixmaps" "true"
    Option "DRI" "true"
    Option "Accelmethod" "EXA"
    added a section called "Extension" where i added:
    Option "Composite" "Enable"
    and a section "DRI" :
    group "video"
    mode 0660
    If i launch compiz with :
    LIBGL_ALWAYS_INDIRECT=1 compiz --replace --indirect-rendering
    I still get the glx error! And i dont have the window borders. Read from the troubleshooting to activate the window decaritons, rezise and move, still the same.
    Running Gnome with slim. And how should i launch the fusion-icon with a parameter? (ie LIBGL..) i get an error?
    My specs: Dell d420, intel gma945 express
    sincerely, THANKS!
    #update 1: Dont know how, but it kinda works now think the problem was something with compiz-dekorator-gtk.
    now my problem is, how to add it to startup?
    Last edited by tiddylicious (2009-12-06 13:05:43)

    Solved:
    _NO_ xorg.conf. -Also synaptics driver, and im loading into the environment from inittab. These did the trick !

  • [closed] Compiz not holding shortcut key designation

    Hi, I installed compiz as standalone and followed directions for compiz-deskmenu then compiz-boxmenu, I also generated menu items using AUR menumaker for compiz. I couldn't get the exact setup working. In compiz when I set <Control>space om "General>Commands>Commandline 0 the Command0 in commands changes <Control>space to <primary>space, I thought maybe just "implemetation no big deal" where the problem starts is that when I close ccsm the reference to <Primary> dissappears and only "space " stays effectively killing my space bar. So I changed it to <Super>z, now I get a menu but not when I middle click mouse but only when I scroll forward, so I had to disable "move prev" mouse binding that was for "view port switcher  move Prev". I do not mind this but why would the <Primary>space (which should be <Control>space change to just "space"? Also last strange bit is that for my saved shortcuts they only work when compiz database is flat file and not Gconf.
    I appreciate any enlightement you may impart,
    thanks again
    --jerry
    Last edited by jk121960 (2012-01-19 11:50:56)

    no one gives a **bleep** myfriend, Nokia is busy building iPhone killers...or something

  • Set TimeOut for SwingWorker

    nice day,
    1/ how can I get real Html size in kB with intention to set as maxValue to ProgressMonitor
    2/ how can I set/synchronize current valueOfDownLoadedHtml in kB to ProgressMonitor throught downloading Html content
    3/ how can I set TimeOut for this Tast, (maybe ... could I use Timer)
    import java.awt.BorderLayout;
    import java.awt.Insets;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    import java.nio.charset.Charset;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.ProgressMonitor;
    import javax.swing.SwingWorker;
    public class ProgressMonitorDemo extends JPanel implements ActionListener, PropertyChangeListener {
        private static final long serialVersionUID = 1L;
        private ProgressMonitor progressMonitor;
        private JButton startButton;
        private JTextArea taskOutput;
        private Task task;
        private int sizeIn_kB = 0;
        class Task extends SwingWorker<Void, Void> {
            private String str;
            int progress = 0;
            public Task(String str) {
                this.str = str;
            @Override
            public Void doInBackground() {
                if (str.equals("Loads")) {
                    addBackgroundLoadsData();
                    setProgress(0);
                    while (progress < sizeIn_kB && !isCancelled()) {
                        progress += sizeIn_kB;
                        setProgress(Math.min(progress, sizeIn_kB));
                return null;
            @Override
            public void done() {
                if (str.equals("Loads")) {
                    Toolkit.getDefaultToolkit().beep();
                    startButton.setEnabled(true);
                    progressMonitor.setProgress(0);
        public void addBackgroundLoadsData() {
            InputStream in = null;
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            String charset ="";
            try {
                String UrlString = "http://java.sun.com/";
                URL url = new URL(UrlString);
                URLConnection conn = url.openConnection();
                sizeIn_kB = conn.getContentLength();
                charset = conn.getContentEncoding();
                conn.setRequestProperty("Accept-Charset", charset);
                in = conn.getInputStream();
                int len;
                byte[] buf = new byte[1024];
                while ((len = in.read(buf)) > 0) {
                    bos.write(buf, 0, len);
                in.close();
                String charEncoding = Charset.defaultCharset().name();
                //String fileEncoding = System.getProperty("file.encoding");
                //System.out.println("File Encoding: " + fileEncoding);
                //System.out.println("Char Encoding: " + charEncoding);
                //System.out.println("Char Encoding: " + Charset.availableCharsets());
                charEncoding = "cp1250";
                String groupImport = new String(bos.toByteArray(), charEncoding);
                conn = null;
            } catch (IOException ioException) {
                ioException.printStackTrace();
                JOptionPane.showMessageDialog(null, ioException.getMessage(), "Htlm error", JOptionPane.ERROR_MESSAGE);
            } catch (StringIndexOutOfBoundsException ioException) {
                ioException.printStackTrace();
                JOptionPane.showMessageDialog(null, ioException.getMessage(), "InputStream error", JOptionPane.ERROR_MESSAGE);
        public ProgressMonitorDemo() {
            super(new BorderLayout());
            startButton = new JButton("Start");
            startButton.setActionCommand("start");
            startButton.addActionListener(this);
            taskOutput = new JTextArea(5, 20);
            taskOutput.setMargin(new Insets(5, 5, 5, 5));
            taskOutput.setEditable(false);
            add(startButton, BorderLayout.PAGE_START);
            add(new JScrollPane(taskOutput), BorderLayout.CENTER);
            setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
        @Override
        public void actionPerformed(ActionEvent evt) {
            progressMonitor = new ProgressMonitor(ProgressMonitorDemo.this, "Running a Long Task", "", 0, 100);
            progressMonitor.setProgress(0);
            task = new Task("Loads");
            task.addPropertyChangeListener(this);
            task.execute();
            startButton.setEnabled(false);
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if ("progress" == null ? evt.getPropertyName() == null : "progress".equals(evt.getPropertyName())) {
                int progress = (Integer) evt.getNewValue();
                progressMonitor.setProgress(progress);
                String message = String.format("Completed %d%%.\n", progress);
                progressMonitor.setNote(message);
                taskOutput.append(message);
                if (progressMonitor.isCanceled() || task.isDone()) {
                    Toolkit.getDefaultToolkit().beep();
                    if (progressMonitor.isCanceled()) {
                        task.cancel(true);
                        taskOutput.append("Task canceled.\n");
                    } else {
                        taskOutput.append("Task completed.\n");
                    startButton.setEnabled(true);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("ProgressMonitorDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JComponent newContentPane = new ProgressMonitorDemo();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    See the session-descriptor element of weblogic.xml deployment descriptor:
    http://download.oracle.com/docs/cd/E21764_01/web.1111/e13712/weblogic_xml.htm#i1071981

  • Synchronize Workflow

    I have two concurrent report set's running by the following name.
    Synchronize Workflow LOCAL table (1) (Report Set)
    Synchronize Workflow LOCAL tables (Report Set)
    First one is failing and the log file shows the following error.
    "The stage registered as the first stage is invalid."
    I suspect the first one might be a dummy created by somebody. But still i want to confirm the difference between the two, before i delete.
    I really don't know how to proceed. Can somebody help me regarding this.

    Thx.
    I looked into that doc.
    But in my case it looks like the program is not really existing.
    I searched for this request set as follows.
    Concurrent---Requests--- Set
    F11
    Synchronize Workflow LOCAL table (1)
    Ctr+F11
    This doesn't fetch me the request set.
    Whereas, Synchronize Workflow LOCAL table fetches the details.
    Does this means this request set doesn't exist any more ?
    Is there any other way of checking the same ???

  • [SOLVED] Compiz standalone + dzen statusbar

    I've recently started using compiz standalone.
    Is there a way to prevent windows from going below the statusbar?
    Edit: solved by starting dzen with the -dock option
    Last edited by abiotic (2014-01-24 11:52:56)

    Okay solved the problem now. Here's how I did it:
    First I install compiz-alone-utils-git from AUR.
    Change /etc/slim.conf line (remove dbus-launch):
    login_cmd exec ck-launch-session /bin/bash -login ~/.xinitrc %session
    Change ~/.xinitrc:
    exec compiz-alone-session
    The remaining autostart applications put into ~/.config/compiz/autostart.sh:
    # This shell script is run before Compiz launches.
    # Environment variables set here are passed to the Compiz session.
    # Set a background color
    BG=""
    if which hsetroot >/dev/null 2>&1; then
    BG=hsetroot
    else
    if which esetroot >/dev/null 2>&1; then
    BG=esetroot
    else
    if which xsetroot >/dev/null 2>&1; then
    BG=xsetroot
    fi
    fi
    fi
    test -z $BG || $BG -solid "#202020"
    # D-bus
    if which dbus-launch >/dev/null 2>&1 && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval `dbus-launch --sh-syntax --exit-with-session`
    fi
    # Run XDG autostart things. By default don't run anything desktop-specific
    # See xdg-autostart --help more info
    DESKTOP_ENV="COMPIZ"
    if which /usr/bin/xdg-autostart >/dev/null 2>&1; then
    /usr/bin/xdg-autostart $DESKTOP_ENV
    fi
    xrdb -merge ~/.Xresources
    export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'
    nvidia-settings -l
    sh ~/.fehbg &
    xrdb -merge ~/.Xresources &
    volumeicon &
    xfce4-panel &
    conky &
    covergloobus &
    (you can find the skeleton file within /etc/xdg/compiz/autostart.sh)
    The relevant part is the xdg-autostart part within the autostart.sh it seems.
    Commenting it out resurrects the problem.

  • .xmodmap in autostart.sh (openbox) - keys don't behave correct

    Hello everyone,
    I am trying to switch ESC and Caps_Lock to improve my vi-effectiveness. Thus i put the following lines into my ~/.Xmodmap
    ! swap caps lock and escape
    remove Lock = Caps_Lock
    keysym Escape = Caps_Lock
    keysym Caps_Lock = Escape
    add Lock = Caps_Lock
    And tried it by executing `xmodmap ~/.Xmodmap`
    As result Esc and Caps_lock got swapped as expected, thus i put `xmodmap ~/.Xmodmap` into .config/openbox/autostart.sh and to try if it is loaded correctly i restarted X.
    What happens is the following:
    Esc and Capslock are swapped (as expected) and here comes the odd part: when hitting the keys for ']' there is also an Esc invoked.
    I tried to figure out what exactly the problem is, but I wasn't able to discover anything else. Putting xmodmap ~/.Xmodmap into the .xinitrc instead of the autostart.sh didn't solve the problem either. So I was trying to figure out if openbox does set something related to xmodmap, but i couldn't find any resources.
    Also i got the following lines in my .Xmodmap and they worked without any asinine side effect in the .xinitrc file:
    keycode 77 = Num_Lock
    keycode 234 = F19
    keycode 233 = F20
    In addition I tried to use just
    remove Lock = Caps_Lock
    keysym Caps_Lock = Escape
    Resulting in the same problems.
    Would be nice to get some nice advice, since I am really completely out of
    ideas.

    jt512 wrote:
    Get the keycodes by using xev, since those are the keycodes that xmodmap uses.  After associating the audio keysymnames (XF86AudioStop, etc.) to the correct keycodes, you must bind a command to each kyesmname in your window/desktop manager.  For instance, I have the command "aumix -v+5" bound to XF86AudioRaiseVolume.  How you accomplish the keybindings is different in every WM/DM. In openbox it's done in the rc.xml file.  In Xfce4 it's done in the keyboard settings dialog.
    Jay
    All of the keycodes in my config are from xev. Is there a way to set this up properly in awesome?
    Last edited by soupcan (2009-04-19 04:05:11)

  • Compiz and git

    This might be an odd question as I'm a complete n00b to Arch and package managers though I've been using Slackware and FreeBSD for years (so I can find my way around the Arch system without too much difficulty).
    basically I've got Compiz Fusion all set up and running well, but I want to install a few more plug ins which wasn't included with the package pacman pulled (as per the instructions here: http://wiki.archlinux.org/index.php/Compiz_Fusion )
    ones like the unsupported bits.
    would these be in any additional repositories? (and if so how do i configure pacman to pick them up?) or can i just download the tar balls and build them myself in the same method i would on my Slackware system?

    Do know about the Arch User Repository (AUR)? The link is there in the top right of the page.
    There's a package in the AUR called: compiz-fusion-plugins-unsupport. If you don't
    have that installed yet, it may contain the plugins you're looking for. You can download
    the PKGBUILD from the AUR, build the package with makepkg, and then install
    with pacman -U YOURPKG.pkg.tar.gz.
    You can also investigate yaourt and other tools that search and build directly from AUR.

  • [SOLVED] SLiM background no longer persists with Openbox

    Hello,
    I've been using SLiM and Openbox in conjunction for a while now, and one of the features I really liked was how, after logging in, the slim theme would become the Openbox desktop background.
    (I didn't set up any configuration file to do this. It happens by default, and as far as I know it might be a bug.)
    Recently, I decided to try out some other login managers. Eventually, I decided to return to using SLiM.
    Now, however, after logging in, Openbox blanks the screen, replacing the SLiM theme with the default grey background.
    I don't know if one of the other login managers modified some configuration files, or if something completely different is happening.
    In short, I have two questions:
    Has anyone else experienced this behaviour between SLiM and Openbox? If so, can anyone confirm whether or not the persistent background is a bug or intentional?
    What files cause Openbox to blank the screen on startup? How could I disable this?
    Thanks in advance for your help/input, everyone.
    Last edited by Dekusola (2014-08-05 20:49:08)

    I'm pretty sure this behavior is a bug. I use SLIM and if you don't set the background after you log in, the SLIM background will persist including any prompts that might pop up (try pressing F1 to bring up the WM selection prompt and then log in to see what I mean).
    I use hsetroot from the AUR with Openbox to set the background at start up by putting it in ~/.config/openbox/autostart.
    There are also other similiar programs you can use to set the background with openbox like nitrogen, feh, to name a few. Take your pick.
    Here is the relevant section from the openbox wiki page https://wiki.archlinux.org/index.php/Op … d_programs

  • Openbox trouble

    Trying to setup openbox.  I have installed it and everything but cant seem to save any changes.  I am using it as my user account and not as root, but when I run obconf I get:
    An error occured while saving the config file '/root/.config/openbox/rc.xml'
    Also - my keyboard on my user is US when it is UK on root, anyway I can change this

    wyvern wrote:
    eerok wrote:Maybe X was running as root when openbox was set up?  I didn't think running X as root was allowed, though.
    I set up my Arch install that way; got X running correctly, set up sudo and then installed my regular user. I reckon that's what happened though, hence the permission problems
    I consider that an unnecessarily risky way to do it
    Better to set up X from console and log in first (and every) time as user.
    wyvern wrote:
    eerok wrote:Is there even a ~/.config/openbox?
    There always has been for me, from distro to distro O_o
    In before the edit   Yes, I realized that was a silly question.  Odd that it should default to root when accessing the conf as user, though.

  • MyGtkMenu dinamic menu generator (auto-updated)

    I switched from lxpanel to bmpanel2 about a week or 10 days ago. With lxpanel I used the menu it provides, but bmpanel2 doesn't cames with a menu widget. One of the solutions suggested is use myGtkMenu, called from a launcher. I use Openbox with obmenugen, which auto-updates the menu every time I call it (right click on desktop), so, I want the same approach with myGtkMenu. This means that if I install a new application and it puts a .desktop file (which is the most common behavior), when I right-click in the desktop, and the menu is shown, the application is already under the category it belongs.
    The first version of obmenugen I wrote, was in python. obmenugen has evolved a lot since that, but the original python script, still having the main code needed to get the information from .desktop files, so, I tweaked the script and quickly have a usable version which generates a dinamic menu using the information present in .desktop files (/usr/share/applications/*.desktop).
    By now, the script still not adding icons to the menu, so, you end having a menu that looks similar to the Openbox menu. The layout of the menu is quite fixed (I don't know the term in english to describe "rígido"). To configure it, you must tweak the script itself, but it's easy if you don't need so much.
    In the future (I hope soon) I will be writing a modified version of obmenugen, also in the D programming language, with the same flexibility as obmenugen, but generating in myGtkMenu format.
    Edit it as needed (CONFIG, MY_GTK_MENU_BINARY, MENUPOS), and simply run it directly (save the code to a file, give it execution permissions, and call it).
    This is the script:
    #!/usr/bin/env python
    # -*- coding: UTF-8 -*-
    __license__ = """
    Copyright 2010 Pável Varela Rodríguez <[email protected]>
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 2 of the License, or (at your option)
    any later version.
    __author__ = "Pável Varela Rodríguez <[email protected]>"
    __version__ = "0.1"
    ### EDIT THIS TO YOUR NEEDS ###
    CONFIG = {
    "Terminal": "sakura",
    "Editor" : "gedit",
    "FileManager" : "thunar",
    "RunCommand" : "gmrun",
    "ExitCommand" : "oblogout"
    MY_GTK_MENU_BINARY="~/bin/myGtkMenu"
    MY_GTK_MENU_FILE="/tmp/myGtkMenu.txt"
    ICONSIZE=-1 # Set to -1 to ignore icon
    MENUPOS=(1, 30) # Set both to -1 to ignore position
    ### DO NOT EDIT FROM HERE ###
    import os, re
    OB_CFG_HOME = os.path.expanduser("~/.config/openbox")
    DEFAULT_CFG = {
    "Terminal": "xterm",
    "Editor" : "gedit",
    "FileManager" : "thunar",
    "RunCommand" : "gmrun"
    LANG = {}
    LANG["Long"] = os.environ["LANG"].split(".")[0]
    LANG["Short"] = LANG["Long"].split("_")[0]
    DOT_DESKTOP_LOCATIONS = [
    "/usr/share/applications",
    "/usr/share/applications/kde4"
    FILTERS = {
    "dotDesktop": re.compile('.+\.desktop'),
    "Categories": re.compile('Categories=.+'),
    "Name": re.compile('Name(\[(en_US|en)\]|)=.+'),
    "Exec": re.compile('Exec=.+'),
    "Icon": re.compile('Icon=.+'),
    CATEGORIES_PRIORITY = ["01System", "02Settings", "03Development", "04Education",
    "05AudioVideo", "06Audio", "07Video", "08Office",
    "09Graphics", "10Network", "11Utility", "12Viewer",
    "13Game"]
    MENU_TEMPLATE = """
    MENU_TOP
    SEPARATOR
    MENU_ACCESORIES
    MENU_GRAPHICS
    MENU_EDUCATION
    MENU_AUDIOVIDEO
    MENU_OFFICE
    MENU_GAMES
    MENU_NETWORK
    MENU_DEVEL
    MENU_SETTINGS
    MENU_SYSTEM
    SEPARATOR
    #submenu = Openbox Settings
    #\ticon = NULL
    #\tMENU_OPENBOX
    EXIT
    MENU_TOP = """item=Terminal\ncmd="%s"\nicon=NULL\n
    item=Editor\ncmd="%s"\nicon=NULL\n
    item=FileManager\ncmd="%s"\nicon=NULL\n
    item=Run\ncmd="%s"\nicon=NULL\n"""
    MENU_CATEGORY = """submenu = %s\n\ticon = NULL\n%s\n\n"""
    ITEM_ACTION = """\titem=%s\n\tcmd="%s"\n\ticon=%s\n\n"""
    MENU = ""
    LISTS = {
    "accesories": {"categories": ["utility"], "label": "Accesories", "files": []},
    "graphics": {"categories": ["graphics"], "label": "Graphics", "files": []},
    "education": {"categories": ["education"], "label": "Education", "files": []},
    "audiovideo": {"categories": ["audiovideo", "audio", "video"], "label": "Audio & Video", "files": []},
    "office": {"categories": ["office"], "label": "Office", "files": []},
    "games": {"categories": ["game"], "label": "Games", "files": []},
    "network": {"categories": ["network"], "label": "Network", "files": []},
    "devel": {"categories": ["development"], "label": "Development", "files": []},
    "settings": {"categories": ["settings"], "label": "Settings", "files": []},
    "system": {"categories": ["system"], "label": "System Tools", "files": []}
    def getDotDesktopFiles():
    filelist = []
    for directory in DOT_DESKTOP_LOCATIONS:
    utf8_dir = directory.decode('utf8')
    filelist += [os.path.join(utf8_dir, item.decode('utf8'))
    for item in os.listdir(directory)
    if FILTERS["dotDesktop"].match(item)]
    return filelist
    def __cleanValue(value):
    for to_clean in ["%U", "%u", "%F", "%f", "\n"]:
    value = value.replace(to_clean, "")
    value = value.replace("&", "&")
    value = value.strip()
    return value
    def getName(content):
    for line in content:
    if FILTERS["Name"].match(line):
    return __cleanValue(line.split("=")[1])
    return None
    def getCategory(content):
    for line in content:
    if FILTERS["Categories"].match(line):
    categories = [item.replace("\n", "") for item in line.split("=")[1].split(";")]
    for cat in CATEGORIES_PRIORITY:
    if cat[2:] in categories:
    return __cleanValue(cat[2:])
    return None
    def getExecCmd(content):
    for line in content:
    if FILTERS["Exec"].match(line):
    return __cleanValue(line.split("=")[1])
    return None
    def getIcon(content):
    if ICONSIZE > 0:
    for line in content:
    if FILTERS["Icon"].match(line):
    return __cleanValue(line.split("=")[1])
    return "NULL"
    def parseDotDesktopFile(filepath):
    content = open(filepath, "r").readlines()
    name = getName(content)
    category = getCategory(content)
    exec_cmd = getExecCmd(content)
    icon = getIcon(content)
    if None in [name, category, exec_cmd]:
    return None
    else:
    return {"Name": name,
    "Category": category,
    "Exec": exec_cmd,
    "Icon": icon}
    def fillLists():
    files = getDotDesktopFiles()
    for currentFile in getDotDesktopFiles():
    info = parseDotDesktopFile(currentFile)
    if info:
    for category_list in LISTS.keys():
    if info["Category"].lower() in LISTS[category_list]["categories"]:
    LISTS[category_list]["files"].append(info)
    def __genMenuTop():
    for key in CONFIG.keys():
    if CONFIG[key]: DEFAULT_CFG[key] = CONFIG[key]
    return MENU_TOP % (DEFAULT_CFG["Terminal"],
    DEFAULT_CFG["Editor"],
    DEFAULT_CFG["FileManager"],
    DEFAULT_CFG["RunCommand"])
    def __genCategoryMenu(category):
    items = ""
    LISTS[category]["files"].sort()
    for item in LISTS[category]["files"]:
    items += ITEM_ACTION % (item["Name"], item["Exec"], item["Icon"])
    if not items:
    return ""
    menu_label = LISTS[category]["label"]
    return MENU_CATEGORY % (menu_label, items)
    def __genMenuOpenbox():
    items = ""
    AUTOSTARTSH = os.path.join(OB_CFG_HOME, "autostart.sh")
    if not os.path.exists(AUTOSTARTSH):
    f = open(AUTOSTARTSH, "w")
    f.close()
    os.chmod(AUTOSTARTSH, 0744)
    items += ITEM_ACTION[8:] % ("Configure Autostarted Applications", "%s %s" % (DEFAULT_CFG["Editor"], AUTOSTARTSH))
    for item in LISTS["settings"]["files"]:
    if item["Exec"] in ["obconf"]:
    items += ITEM_ACTION[:-1] % (item["Name"], item["Exec"], item["Icon"])
    return items
    def __genMenu():
    fillLists()
    MENU = MENU_TEMPLATE.replace("MENU_TOP", __genMenuTop())
    for category in LISTS.keys():
    MENU = MENU.replace("MENU_%s" % category.upper(), __genCategoryMenu(category))
    #MENU = MENU.replace("MENU_OPENBOX", __genMenuOpenbox())
    MENU = MENU.replace("EXIT", "\nitem=Exit\ncmd=%s\nicon=NULL\n" % CONFIG["ExitCommand"])
    if ICONSIZE > 0:
    MENU = "iconsize = %d\n%s" % (ICONSIZE, MENU)
    if MENUPOS[0] > 0 and MENUPOS[1] > 0:
    MENU = "MenuPosition = %d %d\n%s" % (MENUPOS[0], MENUPOS[1], MENU)
    return MENU
    def __writeMenuFile(content):
    filePath = os.path.join("/tmp", MY_GTK_MENU_FILE)
    menuFile = open(filePath, "w")
    menuFile.write(content)
    menuFile.close()
    if __name__ == "__main__":
    if len(os.sys.argv) > 2:
    print("Bad arguments length!!")
    elif "--help" in os.sys.argv or "-h" in os.sys.argv:
    print "La ayuda"
    elif len(os.sys.argv) == 1:
    menu = __genMenu()
    #print(menu)
    __writeMenuFile(menu)
    os.system("%s %s" % (MY_GTK_MENU_BINARY, MY_GTK_MENU_FILE))
    else:
    print("Argument error: %s" % " ".join(os.sys.argv[1:]))
    The only things you need to edit are those present in the first section of the script. If you know wath you do, can also change the order of the categories, editing MENU_TEMPLATE.
    The most important are settings are:
    - MY_GTK_MENU_BINARY: Which you must set up to the myGtkMenu binary (the full path or simply myGtkMenu if it is in $PATH)
    - CONFIG: Put there the tools you use
    - MENUPOS: If you will use the generated menu the way Openbox show it's own menu (ie. with compiz+emerald standalone), set this to (-1, -1), the menu will appear just under the mouse pointer. I setted it to (1, 30), because I have my bmpanel2 at screen's top, and the launcher is at the begining (the left).
    Sorry about the ugly code, but this was written to do the job, quick and dirty.
    I hope you enjoy it, and wait for next versions, which will be really flexible and fast, as obmenugen.
    See you
    Last edited by NeOnsKuLL (2010-01-05 05:32:48)

    I used this script and it as the icon names generated by it are the ones in the .desktop files, myGtkMenu was not able to show icons. So i inserted a piece of code from cbpanel to get the absolute path into the mygtkmenu file.
    Here is the relevant piece of code:
    #copied from the cbpanel code
    def find_icon(icon):
    foundiconfile=None
    if icon == '':
    return foundiconfile
    if icon[0] == '/':
    return icon
    iconbase=('','Faenza','elementary','gnome','hicolor','locolor')
    iconpath='/usr/share/icons'
    sizelist =('', 'scalable', '256x256', '128x128', '64x64', '48x48', '32x32', '24x24')
    categorylist=('actions', 'apps','devices', 'categories','filesystems', 'places', 'status', 'stock', '')
    extensionlist = ('png', 'svg', 'xpm')
    iconimagelist=[]
    for extension in extensionlist:
    if (icon.find('.'+extension) != -1):
    icon = icon.replace('.'+extension,'')
    for size in sizelist:
    for extension in extensionlist:
    for category in categorylist:
    for iconbasecat in iconbase:
    iconfile = iconpath+"/"+iconbasecat+'/'+size+'/'+category+'/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    for extension in extensionlist:
    iconfile = '/usr/share/pixmaps/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    for extension in extensionlist:
    iconfile = '/usr/share/app-install/icons/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    # Seek if the files in pre-generated list exists.. first match is the best
    # return it
    for iconimage in iconimagelist:
    if os.path.exists(iconimage):
    return iconimage
    return foundiconfile
    #end of copy from cbpanel code
    And the relevant modification in NeOnsKuLL's script:
    def getIcon(content):
    if ICONSIZE > 0:
    for line in content:
    if FILTERS["Icon"].match(line):
    #return __cleanValue(line.split("=")[1])
    return find_icon(__cleanValue(line.split("=")[1]))
    return "NULL"
    This is my first attempt at doing anything with Python, so somebody with  any skills will do much better  than this copy-paste job
    I have no idea why the icons were not displayed in the first place though.
    Hope somebody finds it useful as I found NeOnsKull's script.

  • Two objects created at the same time with the same hashcode

    We have this object with the following constructor:
    2010-06-24 00:10:31,260 [LoadBalancerClientSubscriber(3)(pid:24312)] INFO  com.intel.swiss.sws.netstar.application.caching.framework.data
    set.synchronizer.DatasetSynchronizer - Initializing dataset synchronizer for: [/nfs/iil/iec/sws/work/damar/ds_cama/tmp/ds_126631277304794
    /d81], i am com.intel.swiss.sws.netstar.application.caching.framework.dataset.synchronizer.DatasetSynchronizer@2ed3cae0
    2010-06-24 00:10:31,260 [LoadBalancerClientSubscriber(5)(pid:24315)] INFO  com.intel.swiss.sws.netstar.application.caching.framework.data
    set.synchronizer.DatasetSynchronizer - Initializing dataset synchronizer for: [/nfs/iil/iec/sws/work/damar/ds_cama/tmp/ds_126631277304794
    /d31], i am com.intel.swiss.sws.netstar.application.caching.framework.dataset.synchronizer.DatasetSynchronizer@2ed3cae0Note that two objects are created by different threads with exactly the same hash code. Any idea if/how this is possible?

    isocdev_mb wrote:
    The last part definitely suggests already that relying on uniqueness is incorrect. Hash codes are very often equal on distinct objects, viz. new String("java").hashCode == new String("java").hashCode(). Use a class level counter as suggested earlier.For that case we would of course expect the hashCodes to be equal, since the objects are equal. But even in the case of non-equal objects that don't override hashCode, you can still get the same value. Or, for that matter, non-equal objects that do override it. There are 2^32 possible hashCode values. There are 2^64 possible Long values. That means that there are 2^32 Longs that have a hashCode of 1, 2^32 Longs that have a hashCode of 2, etc.
    And for non-equal objects...
    package scratch;
    import java.util.Set;
    import java.util.Map;
    import java.util.HashMap;
    public class HashCodeIsNotUnique {
      public static void main(String[] args) throws Exception {
        Map<Integer, Integer> hashCodeCounts = new HashMap<Integer, Integer>();
        int numObjects = 10000;
        for (int i = 0; i < numObjects; i++) {
          Object obj = new Object();
          int hashCode = obj.hashCode();
          if (!hashCodeCounts.containsKey(hashCode)) {
            hashCodeCounts.put(hashCode, 0);
          hashCodeCounts.put(hashCode, hashCodeCounts.get(hashCode) + 1);
        for (Map.Entry<Integer, Integer> entry : hashCodeCounts.entrySet()) {
          int key = entry.getKey();
          int value = entry.getValue();
          if (value > 1) {
            System.out.println(key + " occurred " + value + " times");
    9578500 occurred 2 times
    14850080 occurred 2 times

Maybe you are looking for

  • Aarrrghh - can't find image size and position in captivate 8!

    I was using Captivate 8 and it was under a tab in properties (don't remember the name of the "sub-tab"). Now, I'm using a newly downloaded version and cannot find size and position (x, y, width, length, etc.). This should NOT be so hard Any suggestio

  • HD Export Settings?

    My video is 1080p, 30fps. After editing in CS4, I'm exporting via Adobe Media Encoder to make a blu-ray DVD. Using H.264 I want to export with 1440x1080p 30fps (or 29.97 fps) but that choice is unavailable. Do I use: 1440x1080i 29.97 HQ 1440x1080p 23

  • Safari won't connect to certain webpages

    Welp, on my G5, in the past few weeks, Safari won't connect with only certain internet pages, like ebay, qvc, and my school webpage. Called Apple help and the man said there was a third party thingie in the way. Dumped preferences, then re-installed

  • Firefox dissappear from my screen for about one second, then it returns on its own. what can cause this inconvenience?

    I'm using windows 7, home premium, 64-bit. it started recently; sometimes while I am on Firefox reading any news or looking some pictures etc. that are in front page (my main page is AOL) all of a sudden the screen goes to my desktop, then it comes b

  • Query of Default Documents/Reports

    Dear All,          I want to get the Query of Default Documents/Reports , like Purchase Analysis (Purchasing Reports), Open Item List (Sales Reports) etc. Thanks, Ghazanfar Ahmed