Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Just something I came up with that is probably not how actual programmers/scripters(?) would advise, specially the parameter/flag thing which is beside the point here.
Code:
if [[ $1 == "v" ]] ; then
ver(){
echo $@
}
else
ver(){
: # ":" is a "do nothing" command
}
fi
a=10
echo normal output
ver verbose output $a
However arguable, some people want to trash by moving into another partition's trash folders. The linux/unix/whatever trash specifications theoretically prohibit that, but KDE's implementation doesn't. So a linked or bind-mounted trash into a different partition will behave normally, except it will move the file across, obviously.
If you also use trash-cli, which won't work with such hacks, it can be replaced with the kioclient command, that in turn can be scripted or perhaps even...
At least in Ubuntu wily, it doesn't seem to allow you to chose the default application to open a file type. You try to do it, but it "magically" restores the previous default association before your eyes. Even if you chanced the config file, somehow. (I'm assuming it's mimeapps.lst, but I'm not sure. It seems that it's cool nowadays to have cryptic, hidden config files, avoiding to mention them unless strictly necessary, pretending it's all magic and config files don't exist)
...
#!/bin/bash
# volume changer+notifier, using notify-send, and tested only with xfce4-notifyd
# the syntax is the same of the "end" of what you'd use in plain amixer, see "$1"
# Ex.: 5%-, 5%+, 30, 60%
com=(`amixer set "Master" $1`)
vol1=${com[20]}
# and here's why it won't work for everybody. The output of amixer includes
# things like soundcard features, which are array elements I'm just
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.