Posts

Showing posts from April, 2015

default editor

export VISUAL=vim Sets vim as the default editor, I think. At least, when I run: crontab -e  to edit the cron jobs it now opens with vim instead of nano. more details at http://stackoverflow.com/questions/5952467/how-to-specify-a-editor-to-open-crontab-file-export-editor-vi-does-not-work I should figure out what that export command is really doing. sending an assignment of the editor name to a control file somewhere, I assume. Haven't successfully run a cronjob yet, though.

system art

Rulesets that generate images/combinations of images and music, whatever, from files on the system. Bash script that randomly selects images from the Pictures folder and combines them in different ways using imagemagick. Script that searches for internet images that meet certain criteria then apt-get and do things with them. As above, but creates gif and/or adds a sound effect chosen by similar means.

To Do

I enjoyed that little foray into problem-solving for Mint on the probook, and I learned some good stuff in the process. My C++ self-tutelage is stalling because it's just getting more and more abstract and I don't have any proper examples to work with. So it'd be nice to come up with some stuff to do on the linux system using bash or whatever. I'm going to put some ideas down here to investigate. * Cron jobs. I've been meaning to get around to this. The 1st idea I have is to take the items in my monthly folder and archive them. Or label them with tags. Or something like that. And start a new folder each new month? * Automate my photo process flow. Script that takes the contents of my camera's SD card and treats them how I want to enable uploads to flickr,  backup to the external HDD. Add tags? * Use scripted imagemagick actions to take all photos in my monthly folder, convert them to an appropriate size and resolution, then animate them into a...

quick change audio output 3

Well, I couldn't resist plugging away at this and I must say I'm pretty pleased with the results. here's the full script: #!/bin/bash status="$(cat /sys/class/drm/card0-HDMI-A-1/status)" if [ "${status}" = disconnected ] then pactl set-card-profile 0 output:analog-stereo+input:analog-stereo notify-send -i /usr/share/icons/Mint-X/status/48/notification-audio-volume-high.png "Audio Output" "Laptop Speakers" exit elif [ "${status}" = connected ] then pactl set-card-profile 0 output:hdmi-stereo+input:analog-stereo notify-send -i /usr/share/icons/Mint-X/status/48/notification-audio-volume-high.png "Audio Output" "HDMI" exit fi Which I openly admit I got from the dude on that thread, but hey! it's simple enough that I like to think I'd've got there myself without too much trouble. And I've tarted up the notify-send statements so they look professional, with a wee volume icon and a standard...

quick change audio output 2

Reasonable success. further down the thread (on February 1st, 2012, 02:00 AM) dar270785 gives a script for dynamically selecting the output, according to the same method I was working out in my previous post. (s)he doesn't use grep for this, but the principle's the same. I tried following those instructions, but although the script works when run manually, it doesn't do so automagically when the HDMI cable is plugged in. I guess that's what the whole /etc/udev/rules.d/ bit is about, but I'm not sure what's going wrong for me. I made sure the script names were right and rebooted the lappy, but no effect. So in the meantime I've settled for a script that's kept in /usr/local/bin (called audioselect.sh), and I've tied it to an F9 key shortcut. I'm a bit bothered by the fact that it doesn't actually just toggle the output. If I can't get it to autodetect the HDMI device, and have to press a button, I'd like the button to do a s...

quick change audio output

Currently when I plug the laptop into the tv via HDMI I have to manually switch the audio from analogue stereo to hdmi digital (or whatever) by right-clicking the volume applet, choosing preferences, changing to the hardware tab, scrolling up and down trying to remember which profile to use... it's a hassle. So I want to improve on that. My own efforts got nowhere so I searched and found this forum page . The script itself doesn't work for me ("Sink 9 does not exist") which I'm kind of relieved about because that might have been too easy. It's enough of a lead to show me that a small bash script should do the job though and I've already learned: * that by putting executable files in /usr/local/bin (and doing chown 755 if necessary) they can be run like any other program. * that devices have (at least hdmi has) a status file in their folder that's just a text file listing the device status. Run cat /sys/class/drm/card0-HDMI-A-1/status to see. h...

thumbnails

Linux Mint 17: following my whole repartitioning of the HDD and fresh installation of Mint in a logical volume at the start of the disk, I never did get thumbnails appearing. Long story short, root owns the thumbnails folder. Do: cd ~/.cache/thumbnails sudo chown mitch:mitch * and it's all OK