Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
-
A very tiny quick dictionary look up script
Quote:Is the space supposed to be before the slash or after bash? I had never noticed a space there in any script I've ever seen.
Code:#! /bin/bash
Code:#!/bin/bash
(* - …which may be bash on most Linuxes, but if you're using bash-specific features, and you plan to run the script on systems where bash is not the default shell [but is installed], you'll want to explicitly tell the existing shell to switch to a different interpreter. )Posted 11-17-2011 at 05:40 AM by MrCode
Updated 11-17-2011 at 05:45 AM by MrCode -
A very tiny quick dictionary look up script
Thanks, I hadn't noticed. Is the space supposed to be before the slash or after bash? I had never noticed a space there in any script I've ever seen.Posted 11-16-2011 at 04:38 PM by the dsc -
A very tiny quick dictionary look up script
Quote:You need to to add an exclamation mark after the number sign and a space
…but yes, you do need it to be a she-bang line, not just a she- line.Posted 11-14-2011 at 08:15 PM by MrCode -
A very tiny quick dictionary look up script
You need to to add an exclamation mark after the number sign and a space (if you want to maintain compatibility).Posted 11-14-2011 at 07:58 PM by lupusarcanus -
A very tiny quick dictionary look up script
Kdict for kde3 still works these days though, and it's somewhat better than this script. It has links to other definitions within the text and such things. Combined with the qtcurve theme engine, it can even have the same look of all the other applications, even though it would normally be ignored by "more" native theme settings of KDE4, and completely ignored by gnome/gtk.Posted 11-13-2011 at 02:19 PM by the dsc -
Commanding openbox through scripts or command line
I've figured that it can be faked via acpi_fakekey. Instead of using something like the hypothetical "openbox-command menu whatever", one can use in some script "<sudo> acpi_fakekey <number of some of those special keys that may not even exist in one's keyboard>". And this key, something like "Xf86Whatever" is set on openbox' rc.xml as a keybinding to the desired menu or openbox action.
It's a shame we can't fake key combinations with acpi_fakekey. Or at least I don't know how to.Posted 10-21-2011 at 04:04 PM by the dsc -
Random song constrained by keyword on MPC
Newer, improved version:
Code:#!/bin/sh for i in $* ; do # search term parsing loop a="$a grep -i $i |" # makes a chain of greps from the search terms done a="mpc playlist -f \"[(@(%position%)@) %artist% %title% %file%]\" | $a" # adds a start to the grep chain - a start which is the generation of playist with special character markings for easier later extraction of the music number mpc play `shuf -e $(eval $(echo $a| sed 's/.\{2\}$//') | sed 's:)@).*::g' | sed 's:(@(::g') -n 1 ` # evals the search, then extract the number via sed, plays it obmpc.sh osd &
"obmpc.sh osd" is just a function of a different MPD-related script I have, would only show the selected song with aosd_cat at the bottom of the screen for a second.Posted 10-16-2011 at 07:42 PM by the dsc
Updated 10-16-2011 at 09:31 PM by the dsc -
Fixing the annoying firefox' associations issue once and for all
You're welcome.
I think that despite of the fact that it's not gimp's business to open PDFs and thus it shouldn't be in it's gimp.desktop, the other way around, changing the file-type configurations is a bit safer because, as someone else posted on those threads from which I've quoted this post, you may well just uninstall gimp (or change gimp.desktop) and then it will try to open the pdf with krita, because the pdf settings are stupid.Posted 08-30-2011 at 02:32 PM by the dsc -
Fixing the annoying firefox' associations issue once and for all
Thanks for this post. Though I tried using it for PackageKit .catalog files, the web server actually identified the mime type as text/plain so no luck there.
Anyway, to make it permanent until the package for the program it self is updated, you can edit the desktop file it self for the correct programs.
Open up
gimp.desktop and remove "application/pdf" from it's MimeType list.
Equally so, make sure the same is added to the one you want to use.
The next program that installs a desktop file will then run the program to re-cache the info in the desktop files. I'm not sure how it decides on the order though. As mine goes "calibre-gui, evince, calibre-ebook-viewer" So alphabetical order is not a priority. In the same directory, there is also a default.list file that contains entries as well. Not sure what writes that file.... It' might be part of xdg-mime. On top of that, there is another file that gets edited by various things in ~/.local/share/applications/mimeapps.list
So... yeah... lots of modifications to consider. The best bet, I would hope, is to default it in the user's home directory... but if you are using xdg-mime, that's probably where it set it and firefox is reading the other settings in the applications directory.... Or gimp is listed first in file the user's home...Posted 08-20-2011 at 12:29 AM by lumak -
Notes on how I may have managed to get wacom tablet to work on Arch, before I completely forget it
It turns out that I had to eventually add the same file on Debian, apparently after a GTK wacom settings GUI messed with my configuration -- after not being able to apply any settings at all (that's probably my fault though, the app was not made for debian).Posted 03-01-2011 at 09:53 AM by the dsc