Last edited by miegiel; February 23rd, 2011 at 02:04 AM.
Threads merged
i noticed a strange quirk that i've been meaning to try and address but well, forgot about till now. in the screenshot, conky reports the system volume is 81%, but in the bottom right corner, you can see i get output at 71%..is there a reason for this? here is the script i use
EDIT : sorry, i guess i put up an offensive background so apologies for that everyone. Here's an updated backgroundCode:#!/bin/bash amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "Mute" } else { print $2"% " }}'
Last edited by merlin_ie; February 23rd, 2011 at 02:34 AM.
Linux...The mistress we all left Windows for
Last edited by Sector11; February 23rd, 2011 at 03:30 PM.
w00t!
Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU
OK, in bash you can do this:
... a comparison is made at each step until a match is made or the test falls through to the final "else" clause. So 1000 elifs, worst case scenerio 1000 tests before you finish the routine.Code:if [ $placey==1 ] then ; cx=across elif [ $placey==2 ] then ; cx=across+(gaph*1) elif [ $placey==3 ] then ; cx=across+(gaph*2) elif [ $placey==4 ] then ; cx=across+(gaph*3) elif [ $placey==5 ] then ; cx=across+(gaph*4) elif [ $placey==6 ] then ; cx=across+(gaph*5) elif [ $placey==7 ] then ; cx=across+(gaph*6) else cx=across+(gaph*7) fi
...or you can use a Case statement which does one single test at the top and looks like this:
the bigger the routine the more you save in CPU and time obviously, but I like the clean look tooCode:case $placey in 1 ) cx=across ;; 2 ) cx=across+(gaph*1) ;; 3 ) cx=across+(gaph*2) ;; 4 ) cx=across+(gaph*3) ;; 5 ) cx=across+(gaph*4) ;; 6 ) cx=across+(gaph*5) ;; 7 ) cx=across+(gaph*6) ;; * ) cx=across+(gaph*7) ;; esac
|| Kubuntu x86_64 (15.10 Dev.) || KDE 4.9.00 ||
|| Dell Inspiron 570 || 8GB PC3-10600 DDR3 RAM || AMD Phenom II X4 820 @ 2.8Ghz ||
|| Logitech M570 Trackball || Logitech G15 Gaming Keyboard ||
Conky: ... no such configuration: 'normal'
very interesting!
i found this page
http://lua-users.org/wiki/SwitchStatement
which apparently has examples so that lua can emulate a case statement...
i'll have to read it more thoroughly when i have more time
So... One thread again? ...Well that's handy.
Now to hope the backup posts still work.
*EDIT* They Do! All is well then! (What's with the beans all of a sudden? 48 becomes 13?)
Last edited by 42dorian; February 23rd, 2011 at 06:41 AM.
Bookmarks