Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
System XI Headquarters (Thinkpad Tray Daemon)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
der bastler
Apprentice
Apprentice


Joined: 13 Apr 2003
Posts: 257

PostPosted: Thu Jul 29, 2010 9:27 pm    Post subject: System XI Headquarters (Thinkpad Tray Daemon) Reply with quote

Hello,

after quite a while (two years) I'm able to spend some time documenting work of mine.

In November 2009 I bought a Lenovo Thinkpad T400S and signed up for mobile broadband access. Of course, I bought the machine without OS and installed Gentoo AMD64. As this is my eleventh Gentoo system derivate, it was named System XI and the notebook got the hostname "Enterprise."

Since December 2009 I am developing BASh- and Python-based tools to manage various subsystems and features of this very well designed and perfectly working notebook.

At first this was a shell-like command line interface for establishing dial-up connections and switching Bluetooth/WLAN/WWAN/GPS on and off. Backed up by custom ACPI daemon sripts.

But in spring 2010 I decided to explore the depths of PyQT4 and in the process ported the CLI to a QT GUI with KDE4 tray support. New features were context menu driven dialing control, battery monitoring and an interface to XRandR. For example, as shown in this screenshot of the main window, the program analyses available graphical output devices and offers a list of possible (reasonable) output configurations for easy singlehead/clone/multihead setup.

This version worked well, but perhaps most of you know: perfection lies just one step ahead... :wink:

So this month I started a re-write, cleaning up code as well as structure. But before I create another program tailored to my needs I wonder if someone else would find this sort of Thinkpad (T400S) tray daemon useful?
_________________
Tempus fugit.
@frank@troet.cafe
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Fri Jul 30, 2010 10:00 am    Post subject: Reply with quote

Something like this has been on my want-to-do list for some time now, though on less capable hardware. I was going to be happy just switching wifi on and off, and controlling VPNs. I got a bit of systray proof-of-concept stuff done with a thing called "eggtrayicon", but never had the time to get far.

I'd be interested in seeing what you have, both for function and learning. Thanks.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
der bastler
Apprentice
Apprentice


Joined: 13 Apr 2003
Posts: 257

PostPosted: Tue Aug 10, 2010 9:46 am    Post subject: Next generation of HQ is ready Reply with quote

Redesign of the System XI Headquarters tray application (sysxihq.py) is completed.

Outline of its structure:

  • QT GUI and monitoring process are seperated (using QThread) and communicate via slots and signals. This is a change from a polling-based to a state change architecture.
  • Object-oriented access to the notebook's subsystems is defined in module "sysxicore."
  • XML-based localisation of program strings and automatic file resource registration is done via module "sysxires."
  • UMTS Dial-up connection is held with automatic re-dialing (owning to the fact that the connection becomes unstable at speeds above 130 km/h)


Besides Python standard library modules following third-party Python modules are imported:

  • dev-python/PyQt4 (modules PyQt4.QtGui, PyQt4.QtCore)
  • kde-base/pykde4 (modules PyKDE4.kdeui, PyKDE4.kdecore)
  • dev-python/dbus-python (module dbus)
  • dev-python/pyserial (module serial)
  • sci-geosciences/gpsd (module gps)


Sysxihq relies on some custom BASh ACPI scripts for management of kill switches, sleep/suspend and other subsystems. These in turn require some programs/packages:

  • net-dialup/ppp: /usr/sbin/chat for simple communication with the built-in Ericsson F3507g modem
  • sci-geosciences/gpsd: support for built-in GPS device (part of the Ericsson modem)
  • sys-apps/baselayout: /sbin/start-stop-daemon is used to get GPSd up and running.
  • sys-apps/ethtool: power management of ethernet devices requires /usr/bin/ethtool
  • sys-apps/hal: power management of DVD drive requires /usr/bin/hal-disable-polling
  • sys-power/cpufrequtils: power management of the CPU requires /usr/bin/cpufreq-set
  • app-laptop/tp_smapi: IBM ThinkPad SMAPI BIOS driver (battery control, accelerometer)
  • sys-power/hibernate-script: support for suspend-to-ram and suspend-to-disk


My custom BASh ACPI script collection consists of:

  • ac.sh: called when acpid receives AC adapter events; performs a timed runlevel switch.
  • atcpin.chatscript: script with AT commands to unlock SIM card (-rw------- 1 root root).
  • bluetooth.sh: switch Bluetooth subsystem on or off or request status.
  • gpsd.sh: switch GPS subsystem on (via modem commands) and start/stop/zapp GPSd; reports status, too.
  • killswitch.sh: called when hardware killswitch is activated; tries to gracefully stop related services (bluetooth, gps, wlan, wwan).
  • set_battery_thresholds.sh: simple script to set thresholds for start/stop of charging of installed batteries; This is a great feature as it keeps the battery without load (and thus without charge/discharge cycles) when connected to an external power supply.
  • sleep.sh: gracefully stops services, invokes hibernate-ram, restores services and runlevel and restarts ethernet.
  • suspend.sh: not done yet; I did not dare to suspend to disk yet ;-)
  • switch_runlevel.sh: does not really switch a runlevel; instead it tunes the system to power save and normal mode depending on AC adapter state.
  • sysxilib.sh: custom function library for killswitch access and modem communication (-rwx------ 1 root root).
  • timed_runlevel_switch.sh: this one actually is needed when one travels with Deutsche Bahn; on board power nets sometimes tend to switch off for a few seconds; this script prevents unneccessary calls to switch_runlevel.sh by killing any previous instance and doing a countdown timer before executing switch_runlevel.sh. Some kind of moving average filter...
  • turbo_boost.sh: using cpufreq-set this script limits the maximum clock rate of both CPU; CPUs get very hot at 2.4 GHz, but I do not sense any leap forwards in computing speed.
  • wlan.sh: switch WLAN subsystem on or off or request status.
  • wwan.sh: switch WWAN subsystem on and unlock SIM card , switch it off, or request status.
  • wwan_connection.sh: dial-in, hang up or re-dial via UMTS modem.


Further information as well as some screenshots will be given soon.

Does anybody know a good webhoster for such projects? Are there any strings attached with ScourceForge/GNU Savannah/WordPress.com. (Yes, I know, the last one just offers a blog, 3 GB of file storage and no developer tools.)
_________________
Tempus fugit.
@frank@troet.cafe
Back to top
View user's profile Send private message
der bastler
Apprentice
Apprentice


Joined: 13 Apr 2003
Posts: 257

PostPosted: Thu Aug 12, 2010 6:11 pm    Post subject: Screenshots Reply with quote

And here are some screenshots:


Generation 2 of System XI Headquarters (C++ daemons, PyQt GUI) is in the planning stages...
_________________
Tempus fugit.
@frank@troet.cafe
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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