You are not logged in.

#1 2010-06-05 03:25:46

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Question about conky variable ${acpiacadapter}

Hello. It's possible to do some flow control based on the ${acpiacadapter} state? I mean, when the laptop is plugged to the AC do this, when is not do that.

This is what I tried so far:

${if_match ${acpiacadapter} == "off-line"} foo ${else} bar ${endif}

Output error: "Conky: Bad arguments: 'on-line ' and ' "offline"' Conky: compare failed for expression 'on-line == "off-line"'

${if_match ${acpiacadapter} == off-line} foo ${else} bar ${endif}

Output error: "Conky: Bad arguments: 'on-line ' and ' offline' Conky: compare failed for expression 'on-line == off-line'

${if_empty ${acpiacadapter}} foo ${else} bar ${endif}

Turns out that the var it's never empty (as expected).

I cannot remove the battery of the laptop, it's locked under the chassis (it's a really thin laptop), so I can't check if the battery is plugged in or not. Any pointer? Thanks!


Sorry for my English. Feel free to point out my errors.

Offline

#2 2010-06-05 03:33:43

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: Question about conky variable ${acpiacadapter}

I have `${if_match "$battery_short" != "F"}$battery_short($battery_time)$endif` in my conkyrc. You need to quote the variable when using if_match.

Last edited by livibetter (2010-06-05 03:34:12)

Offline

#3 2010-06-05 04:04:29

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Question about conky variable ${acpiacadapter}

Thank you! Worked like a charm smile


Sorry for my English. Feel free to point out my errors.

Offline

Board footer

Powered by FluxBB