This is a nifty way of showing the current directory with $HOME
abbreviated to ~
:
"${PWD/#$HOME/~}"
Nice!
(Find more bash string manipulation here)
July 25, 2014 Linux No comments Bash, Linux, Tricks
This is a nifty way of showing the current directory with $HOME
abbreviated to ~
:
"${PWD/#$HOME/~}"
Nice!
(Find more bash string manipulation here)
July 24, 2014 Linux No comments Fonts, Linux, X
If you want to use an X core font specified by its X Logical Font Description, and you want to access some unicode symbols, make sure you specify the CHARSET_REGISTRY
part as iso10646
. For example:
-*-freesans-medium-r-*-*-*-*-*-*-*-*-iso10646-*
July 23, 2014 Linux No comments Fonts, Linux, X
The X Core Font System is a very old font system of the X Window Server (some of the man
pages are 25 years old!). However, some things (most notably bar ain’t recursive) still use it.
The default installed fonts for the Core Font System aren’t very nice, and I wanted to use my own. Fortunately, it not only has support for TrueType fonts (wow), but it’s very easy add them:
/usr/share/fonts/truetype/ubuntu-font-family/
)mkfontscale
then mkfontdir
(you may need to install something like xfonts-utils
)xset fp+ /usr/share/fonts/truetype/ubuntu-font-family/
to your ~/.xinitrc
fileI’ve got a very nice Moka+Numix icon theme which works well with my dock and Nautilus, but unfortunately Openbox wasn’t picking up on it (not surprisingly, since the icon theme is a GNOME thing). As a result, the icons in Openbox’s Alt-Tab Switcher were inconsistent with the rest of my desktop.
It turns out that Openbox was using the icon specified in the X properties of the window. This is set by the application itself. Fortunately, there’s a rather useful xseticon
script made by Paul “LeoNerd” Evans that allows for the modification of these icons. Together with Devil’s Pie, a look at the XDG Icon Theme Specifications, and small script, this allowed me to automatically set the icon for all windows, so that now everything is nice and consistent.
This requires xseticon
, python-xdg
, and xprop
, all of which are in the Debian repositories (Wheezy).
The Devil’s Pie configuration file is:
1 |
(spawn_sync "$HOME/.local/bin/set-xdg-icon" (str (window_xid))) |
Replace $HOME
with your home directory.
The ~/.local/bin/set-xdg-icon
looks like:
An error has occurred. Please try again later. |
This can certainly be adapted for use with KDE, by just using whatever analogue of gsettings
KDE has when determining the icon theme.
Note that some .desktop
files don’t have the StartupWMClass
set. In order to get the corresponding applications to work with this, you’ll need to add it with the WM_CLASS found by xprop
‘ing the appropriate window.
Here’s a Gist.
I recently installed Openbox and the Numix Gtk Theme. This looked lovely for all my Gtk3 things, like Nautilus; however, all the Gtk2 things had horrible boxy borders like this:
After some searching around, I discovered that the Gtk2 bit of Numix uses the ‘murrine engine’. So, once I installed the gtk2-engines-murrine
Debian package, everything was fixed, and my Gtk2 things became beautiful.
This is a nice way of having mailto:
links open in Gmail with Debian and GNOME (it’ll probably work with other online email providers and other Linux distributions and other desktop environments).
All you need to do is create a file named gmail.desktop
in the /usr/share/applications
directory (you should probably be able to install it locally in ~/.local/share/applications
, if you prefer) and add the following:
1 2 3 4 5 6 7 8 9 |
[Desktop Entry] Categories=Office;Network;Email; Comment=Gmail email client Exec=sensible-browser 'https://mail.google.com/mail/?extsrc=mailto&url=%u' Icon=gmail Name=Gmail MimeType=x-scheme-handler/mailto; NoDisplay=true Type=Application |
Then ‘Gmail’ should be listed as an option in Gnome Settings > Details > Default Applications
(you may need to run sudo xdg-desktop-menu forceupdate
first).
Note, here I’m using Debian’s sensible-browser
command to launch the default web browser.