Skip to main content

Posts

Showing posts with the label ubuntu

Lock and Turn-off ... why not by default?!

For reasons that I do not understand, most distributions including Linux Mint and my old favourite Ubuntu, doesnt seem to turn the display off once I have locked it (with keys Ctrl+Alt+L). For me, when I lock the display, it means that I am not interested in seeing anything on the display; or I am going away from the display/computer (physically). Either way, my intention was to make it secure while I leave it unattended! If I am not interested in the display, wouldn't it make sense to turn it off as well?! For me logically yes! Anyway, I had to make it work like that for me. Had to knock-together a little script and re-assign the lock keyboard shortcut to execute that script. The below script did it for me. #!/bin/sh ( sleep 3 && /usr/bin/xset dpms force off )& /usr/bin/gnome-screensaver-command --lock It starts a background task which will kick-in after three seconds since we locked the display. For some unknown reason, in my case, it didn't work w...

cups-pdf : wish it could open when done

Its been something I always wanted in cups-pdf; to see the PDF output from the printing. Just to make sure that the printer didn't run out of ink! After a bit of digging, I managed to get it working with inotify-tools. Here is what I had to do. sudo apt-get install inotify-tools inotify is one of the facilities in Linux that I adore. Very scalable; have used it extensively in production environment that fires a few thousand events per second (it is capable of doing a lot more). For our purpose, we need to setup an event monitor and make the event do something; which is in our case monitor for write+close event, and ask gnome (in my case) to open the file. The best we can do is to run a background script on gnome session startup . The script as below; make sure you set execute permission on the file. #!/bin/bash if [ "$1" != "-nohup-" ]; then     nohup $0 "-nohup-" </dev/null &>/dev/null &     exit 0; fi inotifyw...