Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
KDE/(no)polkit: Battery widget without upower. [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
ChadJoan
n00b
n00b


Joined: 17 Oct 2010
Posts: 18

PostPosted: Mon May 20, 2013 12:19 am    Post subject: KDE/(no)polkit: Battery widget without upower. [SOLVED] Reply with quote

Is there an alternative to the default battery plasmoid that sits in the system tray? Or possibly a way to make it work without upower installed?

I have removed polkit/consolekit/udisks/upower from my system and the battery widget no longer works. I know I can "cat /proc/acpi/battery/BAT1/<usefulfiles>" to get very detailed numbers, but I was wondering if I can make it easy to determine with a glance of the eyes.


Last edited by ChadJoan on Mon May 20, 2013 7:02 am; edited 1 time in total
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1492

PostPosted: Mon May 20, 2013 12:37 am    Post subject: Reply with quote

I think the KDE battery plasmoid is a lost cause. There are doubtless 3rd party applications that will replace it. x11-plugins/wmbattery might do it, but I can's say as I have never used it. Conky can definitely do it, if you want to go that way.

By the way, powerdevil is going to bite you soon. You can either maintain your own ebiuld without powerdevel or use startkde and emerge --noreplace the components you want.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
ChadJoan
n00b
n00b


Joined: 17 Oct 2010
Posts: 18

PostPosted: Mon May 20, 2013 7:02 am    Post subject: Reply with quote

Yeah, I figured the plasmoid was not salvageable.

wmbattery didn't work: it is a fixed-size widget, which makes it really small on my 1920x1200 monitor, and it interacts poorly with KDE (it's always on the wrong draw layer, can't be dragged, etc). It's closer to what I want though, because it actually retrieves battery info.

Conky is the one that worked for me. I've spent much of the evening configuring it though.
Here is my setup:
Make a script, call it something like ~/conky.sh
Put this in it:
Code:
#! /bin/bash
conky -b -&

Go to KDE Launcher -> System Settings -> Startup and Shutdown, then click Add Program and select the script.
(Alternative to the Startup and Shutdown menu: find KDE's Autostart directory, something like ~/.kde4/Autostart or ~/.config/autostart, and place a symlink to your script in there (untested, but should work))
Tweak the heck out of conky's config file. Mine was at /etc/conky/conky.conf and it now has the following contents:
Code:
# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

alignment top_right # Chad Joan 2013-05-19
background no
border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no                                                                                                                                               
draw_shades no                                                                                                                                               
use_xft yes                                                                                                                                                   
xftfont DejaVu Sans Mono:size=12                                                                                                                             
gap_x 5
#gap_y 60
gap_y 0 # Chad Joan 2013-05-19
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
own_window yes
own_window_class Conky
#own_window_type desktop
own_window_type override # Chad Joan 2013-05-19
own_window_transparent yes # Chad Joan 2013-05-19
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no
#update_interval_on_battery 1.0 # Chad Joan 2013-05-19

# original:
#TEXT
#${scroll 16 $nodename - $sysname $kernel on $machine | }
#$hr
#${color grey}Uptime:$color $uptime
#${color grey}Frequency (in MHz):$color $freq
#${color grey}Frequency (in GHz):$color $freq_g
#${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
#${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
#${color grey}CPU Usage:$color $cpu% ${cpubar 4}
#${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes
#$hr
#${color grey}File systems:
# / $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
#${color grey}Networking:
#Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}
#$hr
#${color grey}Name              PID   CPU%   MEM%
#${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
#${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
#${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
#${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}

# Chad Joan 2013-05-19
color0 CadetBlue3
color1 CadetBlue1

TEXT
${color0}Battery status:$color1 ${battery BAT1} ${battery_bar BAT1}
${color0}Battery time left:$color1 ${battery_time BAT1}
${color1}$hr
${color0}Uptime:$color1 $uptime
${color0}Frequency (in MHz):$color1 $freq
${color0}Frequency (in GHz):$color1 $freq_g
${color0}RAM Usage:$color1 $mem/$memmax - $memperc% ${membar 4}
${color0}Swap Usage:$color1 $swap/$swapmax - $swapperc% ${swapbar 4}
${color0}CPU Usage:$color1 $cpu% ${cpubar 4}
${color0}Processes:$color1 $processes  ${color0}Running:$color1 $running_processes
${color1}$hr
${color0}File systems:
 / $color1${fs_used /}/${fs_size /} ${fs_bar 6 /}
${color0}Networking:
Up:$color1 ${upspeed eth0} ${color0} - Down:$color1 ${downspeed eth0}
${color1}$hr
${color0}Name              PID   CPU%   MEM%
${color1} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color1} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color1} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color1} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}


A lot of my time went towards figuring out how to get my ~/.xsession to be executed. My hack: put the line `session="custom"` near the top of /usr/share/config/kdm/Xsession (it was picking up "default" instead of "custom" before I did that). I then realized the unfortunate truth that ~/.xsession probably isn't very useful for launching conky, since it happens rather too early and conky ends up painting over everything else always. It took me a little while longer to discover that the autostart directories exist. Those will execute it after the desktop background layer is drawn, which somehow allows it to find the correct layer to belong to.

The Doctor, thank you for mentioning Conky. I did not know about that. It took a bit of install work, but it meets my needs. Cool!

As for the powerdevil thing: I don't have it installed right now. I am assuming that you probably mean that it will become a dependency of kde-meta and get pulled in, thus causing problems. I think I somehow ended up taking your advice long ago, because my world file has a bunch of kde packages (including startkde) but no kde-meta. Hopefully I'm good to go then. Thanks for the heads-up.

Hopefully this thread can help others that want to avoid polkit/consolekit.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum