Showing posts with label xorg. Show all posts
Showing posts with label xorg. Show all posts

Sunday, October 6, 2013

LXDE Default Browser shortcut link for panel

LXDE includes the "Preferred Applications" (libfm-pref-apps) program to set the preferred web browser. It works by changing the following entry:
~/.local/share/applications/mimeapps.list
[Default Applications]
x-scheme-handler/http=iceweasel.desktop
The problem with this is if you have a shortcut on the LXPanel, or Desktop, then the link is not updated automatically.  Exo-open is designed for XFCE and is ineffective to fix this issue, xdg-open cannot be used in a shortcut unless a parameter is passed - which is no good if you just want to open the browser.

A workaround is to create a new script that uses xdg-mime to query for the default http handler and create a .desktop file that runs this new script:

 sudo nano /usr/local/bin/x-www-mime-browser
#!/bin/sh

# This script uses xdg-mime to check the default browser
# and executes the .desktop from ~/.local/share/applications
# or /usr/share/applications.

URL="$1"
HANDLER=`xdg-mime query default x-scheme-handler/http`
# If handler is customized, extract from .local/... and execute
if [ -f ~/.local/share/applications/$HANDLER ]; then
    `grep Exec ~/.local/share/applications/$HANDLER \\
    | awk -F= '{ print $2 }' \\
    | awk '{ print $1 }';`
else
    `xdg-mime query default x-scheme-handler/http | awk -F. '{ print $1 }'`
fi
 sudo chmod +x /usr/local/bin/x-www-mime-browser
 sudo nano /usr/share/applications/x-www-mime-browser.desktop
[Desktop Entry]
Name=Web Browser (default)
Exec=x-www-mime-browser %u
MimeType=application/x-xdg-web-browser
Terminal=false
Type=Application
Categories=WebBrowser;Other
Icon=web-browser
NoDisplay=false
When using the LXDE Application Launch Bar Settings the "Web Browser (default)" selection will be tucked away under the "Other" category - this will prevent an extra copy visible in the "Internet" category.

Sunday, February 17, 2013

LXDE Desktop Session Settings

LXDE - Preferences - Desktop Session Settings (lxsession-edit)
entries are read from 2 locations:

 /etc/xdg/autostart
and
 ~/.config/autostart

Ticking a box appends LXDE to the line: "OnlyShowIn="
Unticking does the opposite.
Some ".desktop" files may not appear if they include the entry "hidden=True".

To add a new startup entry you can copy the desktop file from /usr/share/applications.

Notes:
*If dbus is installed daemon's may be being launched from
 /usr/share/dbus-1/services

*For xfce4-notifyd, it may be preferable to simply disable notifications within the app:
 iceweasel -> about:config -> browser.download.manager.showAlertOnComplete
 Dropbox -> Preferences -> Display desktop notifications