I am writing a little script to run a utility to check ink levels... and am finding some weirdness with getting it to run as root (the command needs to) from teh .desktop file (X-KDE-Username=root)...
As is above, the kdialog that results is made of kde3 widgets, but if i use the kdesu one I get the shiny new kde4 look (i am in kde4, so that is the intended result). Any thoughts?
Or any general thoughts on how this could be better? (This is my first attempt at writing any script, and my education has been provided by Google Community College).
In the kdesu version, not all the output is left justified, which is annoying...
Code:
#! /bin/sh # inky: script to check ink levels in Epson printer # Depends on Escputil version 5.0.2, Copyright (C) 2000-2006 Robert Krawitz # this version is for if the .desktop link is not ran as root # the -n switch keeps the password for this one command # inkremaining=$(kdesu -n -c "escputil --ink-level -r /dev/usb/lp0") # kdesu is removed if the .desktop file has inky.sh ran as root inkremaining=$(escputil --ink-level -r /dev/usb/lp0) kdialog --msgbox "$inkremaining" --icon utilities-log-viewer --caption Ink\ remaining --name inky
Or any general thoughts on how this could be better? (This is my first attempt at writing any script, and my education has been provided by Google Community College).
In the kdesu version, not all the output is left justified, which is annoying...
Comment