eccentric blog

[ Home | RSS 2.0 | ATOM 1.0 ]

Wed, 12 Dec 2018

Running latest firefox on debian installed as user

Debian packages the firefox-esr release which works quite well most of the time, but I find often the newest browser is often required for some functionality. I've put together a little script that basically sets this up with a local firefox install in ~/.opt

You can copy/paste this into a terminal and it will download the latest firefox, extract it to ~/.opt/firefox and setup a desktop file so that it will appear in the desktop menu

mkdir -p ~/.opt
cd ~/.opt

FFCHANNEL=latest
LIBDIRSUFFIX="64"
VER=${VER:-$(wget --spider -S --max-redirect 0 "https://download.mozilla.org/?product=firefox-${FFCHANNEL}&os=linux${LIBDIRSUFFIX}&lang=${FFLANG}" 2>&1 | sed -n '/Location: /{s|.*/firefox-\(.*\)\.tar.*|\1|p;q;}')}
echo $VER

wget https://ftp.mozilla.org/pub/firefox/releases/${VER}/linux-x86_64/en-US/firefox-${VER}.tar.bz2 -P /tmp
tar jxvf /tmp/firefox-${VER}.tar.bz2

mkdir -p ~/.local/share/applications
BASEDIR=`pwd`
cat <<EOF >> ~/.local/share/applications/firefox-stable.desktop
[Desktop Entry]
Name=Firefox
Comment=Web Browser
Exec=${BASEDIR}/firefox/firefox %u
Terminal=false
Type=Application
Icon=${BASEDIR}/firefox/browser/chrome/icons/default/default128.png
Categories=Network;WebBrowser;
StartupWMClass=Firefox
StartupNotify=true
EOF

sudo ln -sf ${BASEDIR}/firefox/firefox /usr/local/bin/firefox

More information in the debian wiki: https://wiki.debian.org/Firefox

posted at: 19:34 | path: /debian | permanent link to this entry

Tue, 11 Dec 2018

Adding a menu location for locally installed xdg .desktop application links

I ran into an issue recently trying to install a application menu link on a debian system (desktop was mate in this case, but I think it applies to any gnome based desktop). The issue was that I would install a new .directory file for a new menu entry along with the .desktop file, and when I did, the application would show up under "Other" and not under the menu category I was trying to add.

The processes being:

Running this as the local user, correctly installs the files in ~/.local/share/, but it does not write a menu file. And so the application will show up under Applications->Other

If you run the command as root, it will install system wide, and creates the menu for you under /etc/xdg/menus/applications-merged/company-company.menu

But if you don't want this installed system wide, it seems like the only way to fix this is to setup the .menu file manually? I feel like I'm doing this wrong, and there is a way to specify the menu in a user folder, but at the time I can't seem to figure this out.

To fix the issue I created the /etc/xdg/menus/applications-merged/company-company.menu file manually like this:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
  "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
    <Name>Applications</Name>
<Menu>
    <Name>company-company</Name>
    <Directory>company-company.directory</Directory>
    <Include>
        <Category>Company</Category>
    </Include>
</Menu>
</Menu>

This added the menu entry, and the locally installed applications now show up in the correct location.

posted at: 23:43 | path: /linux | permanent link to this entry

Made with Pyblosxom