Openbox: autostarted conky cannot auto resize

My conkyrc has something like $if ... $endif, thus will resize when these conditions changed, such as ${if_up wlan0}.
but the instance autostarted by openbox from autostart.sh, cannot autoresize in this case, so some informations goes hidden.
then I killed conky, restarted it, and things are fine. also, when I started a standalone metacity with conky launched from .xinitrc, the autoresize goes pretty fine.
Here's my autostart.sh for openbox, beginning with those strange lines that comes with openbox:
# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox 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 "#303030"
# 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
# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
/usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null 2>&1; then
gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null 2>&1; then
xfce-mcs-manager n &
fi
# Preload stuff for KDE apps
if which start_kdeinit >/dev/null 2>&1; then
LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi
# Run XDG autostart things. By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV="OPENBOX"
if which /usr/lib/openbox/xdg-autostart >/dev/null 2>&1; then
/usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi
#well, now my autostarts...
xmodmap ~/.xmodmaps &
xcompmgr -c &
sleep 3
gvolwheel &
batti &
fcitx -d
devmon &
conky
pgrep emacs || emacs --daemon &
~/.fehbg &
tint2 &
pinot-dbus-daemon &
xscreensaver &

My conkyrc has something like $if ... $endif, thus will resize when these conditions changed, such as ${if_up wlan0}.
but the instance autostarted by openbox from autostart.sh, cannot autoresize in this case, so some informations goes hidden.
then I killed conky, restarted it, and things are fine. also, when I started a standalone metacity with conky launched from .xinitrc, the autoresize goes pretty fine.
Here's my autostart.sh for openbox, beginning with those strange lines that comes with openbox:
# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox 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 "#303030"
# 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
# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
/usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null 2>&1; then
gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null 2>&1; then
xfce-mcs-manager n &
fi
# Preload stuff for KDE apps
if which start_kdeinit >/dev/null 2>&1; then
LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi
# Run XDG autostart things. By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV="OPENBOX"
if which /usr/lib/openbox/xdg-autostart >/dev/null 2>&1; then
/usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi
#well, now my autostarts...
xmodmap ~/.xmodmaps &
xcompmgr -c &
sleep 3
gvolwheel &
batti &
fcitx -d
devmon &
conky
pgrep emacs || emacs --daemon &
~/.fehbg &
tint2 &
pinot-dbus-daemon &
xscreensaver &

Similar Messages

  • [SOLVED] Openbox autostart no longer working since upgrade

    After the upgrade on May 14 2013 my autostart file no longer works. I tried renaming my autostart.sh to just autostart no luck. There is nothing wrong with the autostart file as I can run it manually and it will load all my apps. Also, if I cd to  /usr/lib/openbox/ and run openbox-autostart directly it works. Here are the updated packages:
    [2013-05-14 21:34] [PACMAN] upgraded ethtool (1:3.8-1 -> 1:3.9-1)
    [2013-05-14 21:34] [PACMAN] upgraded firefox (20.0.1-5 -> 21.0-1)
    [2013-05-14 21:34] [PACMAN] upgraded gsettings-desktop-schemas (3.8.0-1 -> 3.8.2-1)
    [2013-05-14 21:34] [PACMAN] upgraded glib-networking (2.36.1-1 -> 2.36.2-1)
    [2013-05-14 21:34] [PACMAN] upgraded gnome-icon-theme-symbolic (3.8.0.1-2 -> 3.8.2.2-1)
    [2013-05-14 21:34] [PACMAN] upgraded gnome-icon-theme (3.8.0-1 -> 3.8.2-1)
    [2013-05-14 21:34] [PACMAN] upgraded gnupg (2.0.19-7 -> 2.0.20-1)
    [2013-05-14 21:34] [PACMAN] upgraded gtkmm (2.24.2-2 -> 2.24.3-1)
    [2013-05-14 21:34] [PACMAN] upgraded gvfs (1.16.1-2 -> 1.16.2-1)
    [2013-05-14 21:34] [PACMAN] upgraded libical (0.48-1 -> 1.0-2)
    [2013-05-14 21:34] [PACMAN] upgraded mplayer (35920-2 -> 35920-3)
    [2013-05-14 21:34] [PACMAN] upgraded orage (4.8.4-1 -> 4.8.4-2)
    [2013-05-14 21:34] [PACMAN] upgraded pango (1.34.0-1 -> 1.34.1-1)
    [2013-05-14 21:34] [PACMAN] upgraded pdnsd (1.2.9.a-1 -> 1.2.9.a-2)
    [2013-05-14 21:34] [PACMAN] upgraded python2-distribute (0.6.38-1 -> 0.6.39-1)
    [2013-05-14 21:34] [PACMAN] upgraded python2-zope-interface (4.0.3-1 -> 4.0.5-1)
    [2013-05-14 21:34] [PACMAN] upgraded sudo (1.8.6.p8-1 -> 1.8.6.p8-2)
    [2013-05-14 21:34] [PACMAN] upgraded thunderbird (17.0.5-2 -> 17.0.6-1)
    [2013-05-14 21:34] [PACMAN] upgraded virtualbox (4.2.12-2 -> 4.2.12-3)
    [2013-05-14 21:34] [PACMAN] upgraded vte-common (0.34.4-1 -> 0.34.5-1)
    [2013-05-14 21:35] [PACMAN] upgraded python3-threaded_servers (2013.5.12.3-1 -> 2013.5.14.1-1)
    Not sure what's going on or what could have caused it. My .xinitrc looks like this:
    #!/bin/sh
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
    done
    unset f
    fi
    export BROWSER="chromium"
    # Start GNOME Keyring
    eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh)
    # You probably need to do this too:
    export SSH_AUTH_SOCK
    export GPG_AGENT_INFO
    export GNOME_KEYRING_CONTROL
    export GNOME_KEYRING_PID
    exec openbox-session
    My .zprofile
    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx &> ~/.xlog
    My systemd startup service:
    # This file is part of systemd.
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.
    [Unit]
    Description=Getty on %I
    Documentation=man:agetty(8) man:systemd-getty-generator(8)
    Documentation=http://0pointer.de/blog/projects/serial-console.html
    After=systemd-user-sessions.service plymouth-quit-wait.service
    After=rc-local.service
    # If additional gettys are spawned during boot then we should make
    # sure that this is synchronized before getty.target, even though
    # getty.target didn't actually pull it in.
    Before=getty.target
    IgnoreOnIsolate=yes
    # On systems without virtual consoles, don't start any getty. (Note
    # that serial gettys are covered by [email protected], not this
    # unit
    ConditionPathExists=/dev/tty0
    [Service]
    # the VT is cleared by TTYVTDisallocate
    ExecStart=-/sbin/agetty -a dodo3773 %I 38400
    Type=simple
    #Restart=always
    #RestartSec=0
    UtmpIdentifier=%I
    TTYPath=/dev/%I
    TTYReset=no
    TTYVHangup=no
    TTYVTDisallocate=no
    KillMode=process
    IgnoreSIGPIPE=no
    # Unset locale for the console getty since the console has problems
    # displaying some internationalized messages.
    Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
    # Some login implementations ignore SIGTERM, so we send SIGHUP
    # instead, to ensure that login terminates cleanly.
    KillSignal=SIGHUP
    [Install]
    WantedBy=getty.target
    Edit: I tried switching to bash in a tty and then just startx but that doesn't help either.
    Edit2: To be clear openbox does load a desktop. The autostart scripts at ~/.config/openbox/ just don't run. Thanks.
    Edit3: I decided to run the command issued in openbox-session and added --debug to it. Here is the output of "xinit /usr/bin/openbox --debug --startup "/usr/lib/openbox/openbox-autostart OPENBOX" "$@" -- :1 -nolisten tcp" :
    X.Org X Server 1.14.1
    Release Date: 2013-04-17
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 3.8.7-1-ARCH x86_64
    Current Operating System: Linux dodo713 3.9.2-2-ck #1 SMP PREEMPT Sun May 12 18:19:49 EDT 2013 x86_64
    Kernel command line: BOOT_IMAGE=/vmlinuz-linux-ck root=UUID=06874255-7a5d-4968-8f09-1e53cb761f44 ro quiet init=/usr/lib/systemd/systemd
    Build Date: 17 April 2013 02:37:06PM
    Current version of pixman: 0.30.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.1.log", Time: Fri May 17 08:14:11 2013
    (==) Using config file: "/etc/X11/xorg.conf"
    (==) Using config directory: "/etc/X11/xorg.conf.d"
    setversion 1.4 failed
    Initializing built-in extension Generic Event Extension
    Initializing built-in extension SHAPE
    Initializing built-in extension MIT-SHM
    Initializing built-in extension XInputExtension
    Initializing built-in extension XTEST
    Initializing built-in extension BIG-REQUESTS
    Initializing built-in extension SYNC
    Initializing built-in extension XKEYBOARD
    Initializing built-in extension XC-MISC
    Initializing built-in extension SECURITY
    Initializing built-in extension XINERAMA
    Initializing built-in extension XFIXES
    Initializing built-in extension RENDER
    Initializing built-in extension RANDR
    Initializing built-in extension COMPOSITE
    Initializing built-in extension DAMAGE
    Initializing built-in extension MIT-SCREEN-SAVER
    Initializing built-in extension DOUBLE-BUFFER
    Initializing built-in extension RECORD
    Initializing built-in extension DPMS
    Initializing built-in extension X-Resource
    Initializing built-in extension XVideo
    Initializing built-in extension XVideo-MotionCompensation
    Initializing built-in extension XFree86-VidModeExtension
    Initializing built-in extension XFree86-DGA
    Initializing built-in extension XFree86-DRI
    Initializing built-in extension DRI2
    Loading extension GLX
    Loading extension NV-GLX
    Loading extension NV-CONTROL
    Loading extension XINERAMA
    setversion 1.4 failed
    Openbox-Debug: --startup /usr/lib/openbox/openbox-autostart OPENBOX
    Openbox-Debug: Moving to desktop 1
    Openbox-Debug: not managing override redirect window 0x4000bb
    which: no hsetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
    which: no esetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
    which: no xsetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
    kupfer: Reading from stdin
    The XKEYBOARD keymap compiler (xkbcomp) reports:
    > Warning: Compat map for group 2 redefined
    > Using new definition
    > Warning: Compat map for group 3 redefined
    > Using new definition
    > Warning: Compat map for group 4 redefined
    > Using new definition
    Errors from xkbcomp are not fatal to the X server
    Openbox-Debug: Caught signal 22. Ignoring.
    Openbox-Debug: UPDATE DESKTOP NAMES
    Openbox-Debug: Keyboard map changed. Reloading keyboard bindings.
    Edit4: Removed everything from /etc/xdg/autostart and ~/.config/autostart/ directories. That didn't work.
    Edit5: Tried installing xorg-xsetroot to let openbox set the color of the wallpaper. That didn't work.
    Edit6: Checked the output of "loginctl show-session $XDG_SESSION_ID" to make sure that wasn't the issue. Looks okay to me:
    Id=1
    Timestamp=Fri 2013-05-17 10:25:53 PDT
    TimestampMonotonic=13650783
    DefaultControlGroup=systemd:/user/1000.user/1.session
    VTNr=1
    TTY=tty1
    Remote=no
    Service=login
    Leader=405
    Audit=1
    Type=tty
    Class=user
    Active=yes
    State=active
    KillProcesses=no
    IdleHint=no
    IdleSinceHint=1368811547544203
    IdleSinceHintMonotonic=7545641
    Name=dodo3773
    Edit7: Tried installing xorg-xrdb thinking maybe that would help and did todays updates. No luck yet.
    Edit8: Kupfer still loads even though nothing else does. So I uninstalled kupfer. Same thing though. No autostart.
    Edit9: Tried booting into repo kernel instead of ck kernel. Didn't work.
    Last edited by dodo3773 (2013-05-19 06:34:44)

    WonderWoofy wrote:Interestingly, of all those things you included in your post, you forgot to include the autostart script itself.  What does that look like?
    Well, since it worked fine even when called indirectly through openbox-autostart and since it's worked fine for months I figured it was fine. I am happy to post it though. Here you go:
    feh --bg-scale /home/dodo3773/Pictures/blacksolid.png &
    xfce4-panel &
    numlockx &
    keepassx -lock &
    kupfer --no-splash &
    ~/Documents/Scripts/startupopen.sh &
    sleep 30 && sudo /usr/bin/ntpd -qg &
    sudo /usr/sbin/ethtool -K eth0 rx off &
    ~/Documents/Scripts/conky.sh &
    sudo /home/dodo3773/Documents/Scripts/temp_throttlenew > /dev/null 2>&1 &
    Here are the external scripts that are called (startupopen.sh and temp_throttlenew):
    startupopen.sh
    #! /bin/bash
    sleep 13
    chromium &
    thunderbird &
    sleep 20
    devilspie -a &
    sleep 7
    pkill devilspie &
    exit
    temp_throttlenew
    #!/bin/bash
    # temp_throttle.sh max_temp
    # USE CELSIUS TEMPERATURES.
    if [[ $EUID -ne 0 ]]; then
    echo "This script must be run as root" 1>&2
    exit 1
    fi
    #if [ $# -ne 1 ]; then
    # If temperature wasn't given, then print a message and exit.
    # echo "Please supply a maximum desired temperature in Celsius." 1>&2
    # echo "For example: ${0} 60" 1>&2
    # exit 2
    #else
    #Set the first argument as the maximum desired temperature.
    MAX_TEMP=85
    #fi
    # The frequency will increase when low temperature is reached.
    let LOW_TEMP=$MAX_TEMP-5
    CORES=$(nproc) # Get number of CPU cores.
    echo -e "Number of CPU cores detected: $CORES\n"
    # Temperatures internally are calculated to the thousandth.
    MAX_TEMP=${MAX_TEMP}000
    LOW_TEMP=${LOW_TEMP}000
    # FREQ_LIST is a list (array) of all available cpu frequencies the system allows.
    declare -a FREQ_LIST=($(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies))
    # CURRENT_FREQ relates to the FREQ_LIST by keeping record of the currently set frequency.
    let CURRENT_FREQ=1
    function set_freq {
    echo ${FREQ_LIST[$1]}
    cpupower frequency-set -g "ondemand" -d "800MHz" -u ${FREQ_LIST[$1]}
    function throttle {
    if [ $CURRENT_FREQ -ne $((${#FREQ_LIST[@]}-1)) ]; then
    let CURRENT_FREQ+=1
    echo -n "throttle "
    set_freq $CURRENT_FREQ
    fi
    function unthrottle {
    if [ $CURRENT_FREQ -ne 0 ]; then
    let CURRENT_FREQ-=1
    echo -n "unthrottle "
    set_freq $CURRENT_FREQ
    fi
    function get_temp {
    # Get the system temperature.
    # If one of these doesn't work, the try uncommenting another.
    TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
    #TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input)
    #TEMP=$(cat /sys/class/hwmon/hwmon1/device/temp1_input)
    while true; do
    get_temp
    if [ $TEMP -gt $MAX_TEMP ]; then # Throttle if too hot.
    throttle
    elif [ $TEMP -le $LOW_TEMP ]; then # Unthrottle if cool.
    unthrottle
    fi
    sleep 3
    done
    Stuff that needs sudo is in my sudoers as "username hostname NOPASSWD: item1,item2,etc,etc". Nothing too exciting. Seems like if there was suddenly something wrong with my autostart file at least some of the stuff would run either way though cause of "&". Pretty puzzling this issue is.

  • [SOLVED] Openbox Autostarting only some programs

    Ok, so I've tried searching the forums and either cannot find the one that answers my question or it doesn't exist.  Either way, I have my openbox autostart script set up like this:
    xcompmgr &
    nitrogen --restore &
    yakuake &
    cairo-dock &
    The file is saved as ~/.config/openbox/autostart.sh Only cairo dock and yakuake start up at the start of the openbox session.  The cairo dock has the black box around it from xcompmgr not being run but then if i manually start it in a terminal with "xcompmgr" then it goes away like it should.  So xcompmgr won't autostart and nitrogen won't restore either.  Nitrogen works if I manually do it after the openbox session has begun but only stays while i'm logged in, no restoring upon next login.  I'm trying to figure out if I have some syntax wrong?  I've tried separating the xcompmgr as far away from the cairo dock to give it more time to load but nothing...any help would be very appreciated.
    other info: I have no DE, just the dock, openbox and nitrogen for my desktop.
    Last edited by DonTonberry (2012-10-05 00:48:00)

    did as you said 2ManyDogs and received this:
    ~]$ ~/.config/openbox/autostart.sh
    /home/tonberry/.config/openbox/autostart.sh: line 3: $'\357\273\277nitrogen': command not found
    /home/tonberry/.config/openbox/autostart.sh: line 1: $'\357\273\277xcompmgr': command not found
    [tonberry@knife ~]$ QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Yakuake is already running, opening window....
    ============================================================================
    Cairo-Dock version : 3.0.2
    Compiled date : Jul 16 2012 19:29:57
    Built with GTK : 3.4
    Running with OpenGL: 1
    ============================================================================
    CairoKeyBinding '<Super>L' failed!
    warning : (/tmp/yaourt-tmp-arch/aur-cairo-dock/src/cairo-dock-3.0.2/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:283)
    Couldn't bind '<Super>L' (Log out: Lock the screen)
    This shortkey is probably already used by another applet or another application
    CairoKeyBinding '<Control>F12' failed!
    warning : (/tmp/yaourt-tmp-arch/aur-cairo-dock/src/cairo-dock-3.0.2/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:283)
    Couldn't bind '<Control>F12' (Log out: Show the log-out menu)
    This shortkey is probably already used by another applet or another application
    CairoKeyBinding '<Control>Return' failed!
    warning : (/tmp/yaourt-tmp-arch/aur-cairo-dock/src/cairo-dock-3.0.2/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:283)
    Couldn't bind '<Control>Return' (Scooby-Do: Enable/disable the Finder)
    This shortkey is probably already used by another applet or another application
    CairoKeyBinding '<Super>Return' failed!
    warning : (/tmp/yaourt-tmp-arch/aur-cairo-dock/src/cairo-dock-3.0.2/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:283)
    Couldn't bind '<Super>Return' (Control from keyboard: Enable/disable the keyboard control of the dock)
    This shortkey is probably already used by another applet or another application
    CairoKeyBinding '<Shift><Ctrl>F4' failed!
    warning : (/tmp/yaourt-tmp-arch/aur-cairo-dock/src/cairo-dock-3.0.2/src/gldit/cairo-dock-keybinder.c:cd_keybinder_bind:283)
    Couldn't bind '<Shift><Ctrl>F4' (Show Desktop: Expose all the desktops)
    This shortkey is probably already used by another applet or another application

  • How can I disable the auto resizing in NetBeans?

    Hello,
    how can I disable the auto resizing in NetBeans?
    I cannot resize nor displace components due to this automation.

    first what do u mean by auto resizing ? if u mean the layout that automatically aligns itself then ..... if that's yr question then u need to set the layout to null
    if using netbeans then right click on the the mainPanel and setlayout to null if eclipse the frame.getContent.setlayout(null);
    NetBean doesn't have a forum it has mailing list u can subscribe there
    http://www.netbeans.org/servlets/TLogin
    Edited by: raven_roy on Mar 12, 2008 2:58 AM

  • JButton with auto resizing icon

    Hi,
    I want to extend the JButon in order to make it auto resize the icon image to the button size itself.
    I tried somethink like the following code and it work but there is some recursive side effect I cannot understand becouse I get a 100% CPU usage and from the print() I see the paint() method is called continuosly.
    import java.awt.Graphics;
    import java.awt.Image;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    public class IconButton extends JButton {
    private static final long serialVersionUID = 4049919355141829686L;
    int cntr;
    public IconButton(ImageIcon icon) {
    super(icon);
    public void paintComponent(Graphics g) {
    System.out.println(cntr++);
    Icon icn = getIcon();
    if (icn instanceof ImageIcon) {
    ImageIcon ii = (ImageIcon)icn;
    Image img = ii.getImage();
    img = img.getScaledInstance(getWidth(), getHeight(), Image.SCALE_AREA_AVERAGING);
    icn = new ImageIcon(img);
    super.setIcon(icn);
    super.paintComponent(g);
    Maybe there's a better way... for example by changing the icon only when the button size change: but how?
    Thank in advance,
    Carlo.

    ok,
    the question is:
    how to have a Button with the icon automatically resized to the button size? Is it right to extends JButton or is better extends AbstractButton?
    thanks.

  • Openbox Autostart (What is starting Guake?)

    I just commented out my entry for guake in ~/.config/openbox/autostart because there were two entries there in tint2.  I read the wiki, and it does mention /etc/xdg/autostart/ as a handy place to check, but there was no listing for guake in that directory.  So my question is, what exactly is starting guake? 
    ~/.config/openbox/autostart:
    ## Autostart File ##
    ##xcompmgr (compositor)
    #(sleep 1s && xcompmgr) &
    #not using xcompmg because in OB, it definitely introduces screen tearing
    ##compton (compositor)
    #(sleep 1s && compton) & #what I was using. Tearing problems
    (sleep 1s && compton -bfzcCG --backend glx --vsync opengl-swc --paint-on-overlay -D5 -r6 -l-8 -t-8) & #This did solve tearing problem, but may make bl2 unplayable. #actually, it didn't effect bl2.
    ##Screensaver
    (sleep 1s && xscreensaver -no-splash) &
    ##guake dropdown terminal
    #(sleep 1s && guake) & #I disabled this because their were two entries in openbox for guake in tint2. I don't know what is starting guake now.
    ##tint2 panel
    (sleep 1s && tint2) &
    ##Background
    (sleep 1s && nitrogen --restore) &
    ##numlock
    (sleep 1s && numlockx) &
    ##Mount stuff automatically
    (sleep 7s && udiskie --tray) &
    ##start conky
    #conky -c /home/convergence/.conkyrc #this messes everything up!
    ## NetworkManager Frontend
    #(sleep 7s && nm-applet) &
    Here is a thread that seemed relevant:  https://bbs.archlinux.org/viewtopic.php?id=114803
    I used the command " ps -o user,pid,ppid,command -ax" found in this thread to find out what the parent PID is of guake, and it was bash, started by my current user.  That's not very helpful!
    Edit:  As you can see, I take notes in my own config files so that I can remember why I made the changes that I did.  I edited this entry post because apparently one of my notes had some foul language.
    Last edited by Convergence (2015-02-13 19:38:23)

    @dodo3773:  I think you nailed it. I verified the existence of /usr/share/dbus-1/services/org.guake.Guake.service. I honestly don't understand Dbus and how it relates to systemd.  I'll read this:  http://www.freedesktop.org/wiki/IntroductionToDBus/ when I get a chance.    I switched from windows to Linux a long time ago.  I learned quite a bit back then, but then stopped learning (I'm not in a tech field), and Linux kept evolving.  I'm a total freakin n00b. 
    @drcouzelis:  I don't use startx.  I use KDM because I need to share my computer with my wife, and I think she would have an anxiety attack if she was confronted with a command line. 
    @Trilby: I think that xinitrc is only parsed if X is started manually.  I use a DM (a necessity).  PS, should I mark this solved?  I haven't tested it yet (because I don't know how), but I suspect that Dodo3773 was correct
    Thanks everyone for responding.
    Last edited by Convergence (2015-02-17 21:00:09)

  • [ SOLVED ] [ Openbox ] autostart.sh is being ignored ..

    ~/.config/openbox/autostart.sh
    # Turn On numlock
    numlockx &
    # Desktop background
    nitrogen --restore &
    # Panel
    tint2 &
    # Conky
    conky -c ~/.conkyrc
    .xinitrc
    exec ck-launch-session openbox
    start-pulseaudio-x11
    When Openbox starts, nothing happens ( none of the entries gets executed ).
    ** Works perfectly when I execute the given file from the command line ..
    How to fix it ?
    [ SOLVED ] Changed .xinitrc line from openbox to openbox-session and everything seems to be working now ..
    Last edited by Minimal Scope (2010-10-29 18:17:06)

    Sorry I'm new with linux. Thanks you for your time
    Last edited by Jeager (2010-05-16 20:40:26)

  • I cannot move, resize, minimize, or close the browser window despite everything inside the window still working.

    I don't know what details are needed so I'll just rattle off anything that I can think of.
    I am running an Asus laptop with windows 7. I have never had an issue with firefox in the past (beyond the usual freezing and some obvious issues with pop up ads that are par for the course with firefox since adblocker never does what it says.... not really. Lets be honest.) I am using Avast for my virus protection and it is also up to date.
    My issue started about an hour ago when firefox stopped responding. The video I had playing kept going but I could not interact with anything. Assuming the program froze for the billionth time that week I rebooted it. This has always solved freezing issues in the past. Now, however, firefox is doing something new.
    I can access the menus and almost everything on the window itself except for the minimize/maximize/close buttons, I cannot move the window at all, and I cannot manually resize it. I have also noticed that although videos will play, I can only click on their buttons if there is another smaller window overtop of firefox. The video controls will only appear that way and when I click them firefox naturally comes to the front and the video responds with the button I used but the buttons are gone again and I cannot resume playing without the smaller window back in front to make the buttons show again.
    It's as if half of firefox is frozen while the other half is still running somehow.
    I have no themes that could be causing this. Literally none. I only use firefox for the things that can no longer be opened in Opera so I have no need for any theme beyond default. The only addons I installed on purpose were adblockers (lord knows why. they don't DO anything.) though several other random things seem to have been installed over time to aid in one thing or another. Various plugins and players and versions of java, that sort of thing. But I have everything (and i mean EVERYTHING) in the addon menu disabled.
    I have tried booting it up in safe mode (the program, not windows) and the problem is still there except now it won't show the menu bar at all unless I press the alt key first and even then it wont let me actually click on anything in the menu bar. When I try the whole bar vanishes. I had to close firefox with the task manager.
    Rebooting will fix the issue for about 15 seconds before it all comes back.
    Any attempts at updating have failed as it says I am already up to date on everything so I don't know what its issue is.
    It's not an urgent issue right now as most of what i need to do can be done on the half screen window I am using, but some of my sites have buttons that literally vanish in anything but full screen and I imagine that this will be a much greater annoyance within a few days.

    After following all the instructions given, I poked around safe websites as suggested. I am not sure why this step was needed, as websites functioned rather normally before I came here but I did it anyways and found that the websites still work the same as they did. I can still do everything I used to be able to do. I see no change in the function of the websites.
    However, I still cannot resize, close, or move the browser window. I don't know if Netflix is a safe site or not (too many conflicting opinions on that one from the masses) so I don't know if the issue with the vanishing buttons is still there, but all the issues I had with the browser window itself is still there.
    Even in safe mode the browsers three window control buttons on the top right refuse to let me use them and the window itself will refuse to be moved around.

  • Popup windows are small and cannot be resized in Firefox v31.0. v30.0 and earlier does not have this problem. Example: Hostgator's SmarterMail. XP, 7, 8.1.

    My webmail interface is SmarterMail from Plesk as supplied by Hostgator. When Firefox updated to v31.0, I lost the ability to send mail because the popup windows for "New", "Reply", "Reply All", and "Forward" are too small to enter information and cannot be resized or maximized.
    This problem does not occur with older versions of Firefox (tested 16.0.2, 21.0, 24.0, and 30.0) or with Chrome or Internet Explorer. While I am writing to you from a Windows XP Pro SP3 system, I have also verified the problem under Windows 7 Pro (x64) and Windows 8.1 (x64).
    It's not profile settings, malware, or add-ons. I've tried Firefox Safemode and I've tried "Reset Firefox".
    For the time being the workaround is to disable Firefox updates and downgrade everybody with v31 to v30. Please fix this ASAP. You have lots of people reporting it.

    As a temporary workaround, you can block website scripts from resizing windows. It's a bit of a sledgehammer, but another user who has this problem indicated that it does stop the SmarterMail script from rolling up the window.
    Here's how:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''dom''' and pause while the list is filtered
    (3) Double-click the '''dom.disable_window_move_resize''' preference to switch it from false to true.

  • [Solved]Openbox: Autostart.sh doesn't work

    Hello
    I just made a fresh install of arch with openbox but I can't launch my applications at start
    xterm &
    nitrogen --restore &
    This doesn't work in ~/.config/openbox/autostart.sh neither in /etc/xdg/openbox/autostart.sh
    Can someone help me plz ?
    thanks and sorry for my bad english
    Last edited by Jeager (2010-05-16 20:48:43)

    Sorry I'm new with linux. Thanks you for your time
    Last edited by Jeager (2010-05-16 20:40:26)

  • Cannot auto size columns in iTunes 10.4.  Columns are all mixed up with headings I have never seen. Cannot change by right clicking on columns.

    Cannot auto size columns in iTunes 10.4.  Columns are all mixed up with headings I have never seen. Cannot change by right clicking on columns. Cannot order albums alphabetically by double clicking on heading.

    Very many thanks to you, Putaro!  Your answer provided the solution. It was a buggy plug-in that turned out to be the culprit.
    You're off the hook, Apple, and my apologies for stating that you let a dog run loose. You skated by this time, Apple. But I'm watching you.
    But again, Putaro's reference to the plugins I had installed over the years turned out to illuminate the problem. I have several plugins in my iTunes plugins folder, pretty much all designed to add more visualizer functionality. I removed all of them, and ALL of the problems I noted in my post went away, with full iTunes functionality restored.
    I began adding the plugins back to hopefully single out the culprit. Among the ones I had been using included fielder, G-Force, Timestrech, volcanokit, QuartzComposer, and Jax. I hadn't used any of them in a while - probably at least a verison or more back in iTunes updates, but iTunes continued to work with all of them installed. Currently, only QuartzComposer continues to work in iTunes 10.4. The rest no longer even show up as visualizer opitons, with one exception. Jax does show up, but does not work. AND THE PRESENCE OF JAX IS WHAT KILLED MY ITUNES.
    I looked into it and went back to the developer, and it appears that they discontinued developing Jax some time ago - evidently, it was buggy and crash prone. I remember after buying it, having problems with it - having never worked to its touted potential, but I didn't pursue it, and never uninstalled it. Leaving it in there caused all iTunes functionality to cease with the iTunes 10.4 update.
    If you've got Jax installed, consider removing it before updating to iTunes 10.4.
    My iTunes is now working right as rain, thanks again to Putaro!
    -Jon

  • JTable in JScrollPane auto resize refresh problem

    Hello,
    I have a JTable in a JScrollPane. Number of rows is changing.
    I'm using the following to auto-resize JScrollPane.
    public Dimension getPreferredSize() {
                  Dimension size = super.getPreferredSize();
                  size.height -= getViewport().getPreferredSize().height;
                  Component view = getViewport().getView();
                  if(view != null)
                  size.height += view.getPreferredSize().height;
                  return size;
             }There is a JButton, which adds an empty row to the JTable. It all works fine, except the auto-resize when a new row is added. I want all rows of JTable to be visible, with no scrollbars present. I tried repaint(), revalidate(), addNotify(). What should I do?
    Thanks.

    Sure
    DefaultTableModel dtm = new DefaultTableModel(vec, header);
              jt0 = new JTable(dtm);
              jt0.getTableHeader().setReorderingAllowed(false);
              jt0.setFont(new Font("Tahoma", Font.PLAIN, 12));
              jt0.getTableHeader().setFont(new java.awt.Font("Tahoma", java.awt.Font.BOLD, 12));
              jt0.setRowHeight(18);
            jt0.setPreferredScrollableViewportSize(new Dimension(500, jt0.getRowCount() * jt0.getRowHeight()));
            jt0.setFillsViewportHeight(false);
              jsp0 = new JScrollPane(jt0);
    GridBagConstraints gbc = new GridBagConstraints(); 
            gbc.insets = new Insets(2,1,2,1); 
            gbc.weightx = 1.0; 
            gbc.weighty = 1.0; 
            JPanel p0 = new JPanel(new GridBagLayout()); 
            gbc.fill = gbc.HORIZONTAL;
            p0.add(jsp0, gbc);
              JButton jb1 = new JButton("add row");
              jb1.setSize(40, 18);
    jb1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent e) {
                        dtm.addRow(new Object[]{....});
    //                    jt0.scrollRectToVisible(jt0.getCellRect(jt0.getModel().getRowCount()-1, 1, false));
    //                    jt0.setRowSelectionInterval(jt0.getModel().getRowCount()-1, jt0.getModel().getRowCount()-1);
        public class SizeX extends JScrollPane {
             public Dimension getPreferredSize() {
                  Dimension size = super.getPreferredSize();
                  size.height -= getViewport().getPreferredSize().height;
                  Component view = getViewport().getView();
                  if(view != null)
                  size.height += view.getPreferredSize().height;
                  return size;
        }

  • Auto resize webpage?

    i have just finished my site which can be seen here www.jbpermanentcosmetics.co.uk The site looks fine on my Macbook pro on Mac and windows but it is way too large for 4:3 monitors. The site width is 1200 which in hindsight is too large really but i don't want to have to resize the whole website. Is there any HTML code which i can add which will auto resize the page to avoid horizontal scrolling?

    rossn49 wrote:
    I found the following code which looks like it might do what i want:
    <SCRIPT language="JavaScript">
    <!--
    if ((screen.width>=1024) && (screen.height>=768))
    window.location="highres.html";
    else
    window.location="lowres.html";
    //-->
    </SCRIPT>
    rossn49, you can not use that javascript. It switches between two pages/sites (I bolded the code), which means you have to add another site with narrow width.... you indicated that you wouldn't like to do that.
    However, you can find the sweet spot for your site design; many people started to design their sites for regular computer and also accommodate mobile devices such as iPhone.
    You may like to do just that, iPhone's resolution is 960px wide, so I would conservatively take it down to 900px~920px wide.
    OT, thanks for the good words... I'd not read the forum today. I'd been spending time today to figure out and mount my GPS on my new motorscooter, maybe I will buy motorscootersaurus.com for my new site. LOL!

  • Auto-resizing all components

    Is there a method that auto resizes all components on a JFrame when it is maximised for example. I have got a JTable (in a scrollpane) and some other components on a panel. I have sized the frame to be approx 80% of the screen size. When the frame is maximised, the table and the other components retain their original size (understandably so!). Is there a method available that can resize the panel and its components to resize accordingly when the frame is maximised?...I know I can add the componentListener and implement a method in the componentResized() method...but I dont want to duplicate stuff that's already available. Thanx for your help.

    I don't know the specific needs.
    BorderLayout: simple Layout; Components are oriented NORTH, EAST, SOUTH, WEST
    FlowLayout: all components are added after the other
    GridLayout: components are oriented in a grid
    GridBagLayout: complex once
    See the Java Tutorial for more information.

  • Error: -9899: The partition cannot be resized.

    +Error: -9899: The partition cannot be resized. Try reducing the amount of change in the size of the partition.+
    I get this error everytime I try to resize selected partition. It is 340 GB volume with 115 GB of free space. I tried to make it 250 GB and I got this error. Then I tried to make it 300 GB (only 40 GB smaller - it would have much free space after that) and again - I got this error. This is external HD connected by FireWire. Neither Disk Utility nor "diskutil resizeVolume" was able to resize it. I checked the volume - there is nothing to repair. What else can I do? How can I resize it?

    While you are resizing your partition, do tail -f /var/log/kernel.log or run the Console app and select kernel.log.
    This will tell you why the resize is failing.
    Unfortunately, it will only give you the inode number for the file or directory that is preventing the resize.
    To find the file name corresponding to this inode, you can use the find command from the terminal:
    $ cd /Volumes/<volume you are trying to resize>
    $ find -x . -inum <the inode number from kernel.log>
    Once you find the file, copy it to a different volume if you want to save it, and delete it.
    Then rerun the resize operation and it should succeed.  If it doesn't, repeat the above procedure until you are successful.
    See also: http://superuser.com/questions/72896/cannot-resize-os-x-partition/291378

Maybe you are looking for

  • How do I determine the size of an object on a particular layer?

    Whether it's a rectangle, circle, line, etc. how do I determine what the size of an object is on a particular layer?

  • Where are custom icon's stored in Mountain Lion?

    If I were to copy an image to my clipboard, and paste it over the icon in "get info", where is that image held? It doesn't seem to change the file in any way, it still gives the same CRC hash unless the metadata of the file doesn't matter in such an

  • DW CS5 Image preview jpeg bug?

    Hi I've noticed that when placing .psd files in DW CS5, the predicted file size stops increasing once I get to around 80% quality. Normally there would be a huge increase in file size between 90% - 100%, but the file size remains the same (apparently

  • Console app quits unexpectedly

    I cant launch Console, and ffmpeg keeps crashing, i was going to use console to see what was going on and got this problem!! Any help/advice would be appreciated. Thanks Process: Console [14169] Path: /Applications/Utilities/Console.app/Contents/MacO

  • Configure the file adaptor so as to send sample XML message to integration

    Hi all , I am totally new to XI. I had done the configuration and now i want to test the scenario but i dont now how to do that . please help me out how to do it. its an urgent. Thanks, shuja