← Back to team overview

hybrid-graphics-linux team mailing list archive

Re: TESTER NEEDED for a Bumblebee-UI

 

I have made some updates to bumblebee-ui... 

Including creating the configuration file if not exists... 




	Med venlig hilsen 

Martin Juhl 
IT-konsulent 
T: (+45) 70 20 10 63 
M: (+45) 27 52 46 58 
	
CASALOGIC A/S 



	Besøg os på 
www.casalogic.dk 
	



Fra: "Martin Juhl" <mj@xxxxxxxxxxxx> 
Til: "Davy RENAUD" <davy.renaud@xxxxxxxxxxx> 
Cc: hybrid-graphics-linux@xxxxxxxxxxxxxxxxxxx 
Sendt: onsdag, 27. juli 2011 09:39:48 
Emne: Re: [Hybrid-graphics-linux] TESTER NEEDED for a Bumblebee-UI 


Also one suggestion... 

If .local/share/applications/bumblebee-ui.cfg doesn't exist... this file should be created... 

This will make it much easier to package the program... 




	Med venlig hilsen 

Martin Juhl 
IT-konsulent 
T: (+45) 70 20 10 63 
M: (+45) 27 52 46 58 
	
CASALOGIC A/S 



	Besøg os på 
www.casalogic.dk 
	



Fra: "Davy RENAUD" <davy.renaud@xxxxxxxxxxx> 
Til: hybrid-graphics-linux@xxxxxxxxxxxxxxxxxxx 
Sendt: onsdag, 27. juli 2011 02:10:25 
Emne: [Hybrid-graphics-linux] TESTER NEEDED for a Bumblebee-UI 

Hello, 

After more than 3 weeks of learning to program in python with pygtk, I've decided to release this user interface candidate for bumblebee. 

The user interface allow you to configure desktop file to launch some application with optirun script, include a script that check if the laptop is on battery or not, and include an applet or indicator that can be set at startup. It has only be tested on UBUNTU and there might be some last minute error( by sample the install scrit hasn't been tested for now and there might be some manual configuration after install ) 

Confirmed or adventurous user should test this script set which still contain imperfection. 

Some things don't work well but I think that this UI is nice to use and made the use of Optimus maybe as easy as optimus on Windows (there is still laking a configuration database for each application but maybe someone want to try to connect the ui to a database like for bumblebee-configuration). Please give feedback and improve the code. 

I will take three week holidays and I hope that some persons will test this UI. I'll be in Madrid or Lisboa so if someone will offer me a beer... 

See you. 
Davy Renaud (glyptostroboides) 

PS: This is my first python program (and it's just a hobby) so if experimented coders can clean it and give me feedback it would be nice. 

PS bis: If you have a bit of time please improve the script : build a window or a notebook to configure bumblebee, review and optimize the code, configure the desktop file dynamically and avoid the logout/login to get the shortcuts to appear in Unity launcher, maybe one day this UI will be included in bumblebee debian package. 

Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ? 
Je crée ma boîte mail www.laposte.net 

_______________________________________________ 
Mailing list: https://launchpad.net/~hybrid-graphics-linux 
Post to : hybrid-graphics-linux@xxxxxxxxxxxxxxxxxxx 
Unsubscribe : https://launchpad.net/~hybrid-graphics-linux 
More help : https://help.launchpad.net/ListHelp 

_______________________________________________ 
Mailing list: https://launchpad.net/~hybrid-graphics-linux 
Post to : hybrid-graphics-linux@xxxxxxxxxxxxxxxxxxx 
Unsubscribe : https://launchpad.net/~hybrid-graphics-linux 
More help : https://help.launchpad.net/ListHelp 
diff -uNr Bumblebee-UI-rc1/app/AppSettings.py Bumblebee-UI-rc1-mj/app/AppSettings.py
--- Bumblebee-UI-rc1/app/AppSettings.py	2011-07-26 14:47:33.000000000 +0200
+++ Bumblebee-UI-rc1-mj/app/AppSettings.py	2011-07-27 10:02:47.932538246 +0200
@@ -31,11 +31,24 @@
 import pygtk
 pygtk.require('2.0')
 import gtk
+import os
 
 #ORIGINAL MODULE
 import Config
 from DesktopFile import DesktopFile, DesktopFileSet
 
+#CREATE FILE IF NOT EXIST
+if os.path.exists(Config.ui_config_file_path):
+	print "Using configuration file: " + Config.ui_config_file_path
+else:
+        print "Configuration File does not exist, creating.."
+        file = open(Config.ui_config_file_path, 'w')
+        file.write("[Bumblebee UI]\n")
+        file.write("preferred_app = []\n")
+        file.write("\n")
+	file.close()
+                                                
+
 #ICON CONFIGURATION
 class IconSet:
 	"""This small class contain the settings computed for categories"""
diff -uNr Bumblebee-UI-rc1/app/Config.py Bumblebee-UI-rc1-mj/app/Config.py
--- Bumblebee-UI-rc1/app/Config.py	2011-07-27 01:41:35.000000000 +0200
+++ Bumblebee-UI-rc1-mj/app/Config.py	2011-07-27 09:58:54.582538190 +0200
@@ -33,7 +33,6 @@
 import gtk
 import ConfigParser
 
-
 #DESKTOP FILES PATH
 user_home_directory = os.path.expanduser('~')
 user_relative_desktop_file_directory = '/.local/share/applications/'
diff -uNr Bumblebee-UI-rc1/bumblebee-ui.cfg Bumblebee-UI-rc1-mj/bumblebee-ui.cfg
--- Bumblebee-UI-rc1/bumblebee-ui.cfg	2011-07-26 14:42:09.000000000 +0200
+++ Bumblebee-UI-rc1-mj/bumblebee-ui.cfg	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-[Bumblebee UI]
-preferred_app = []
-
diff -uNr Bumblebee-UI-rc1/ecoptirun Bumblebee-UI-rc1-mj/ecoptirun
--- Bumblebee-UI-rc1/ecoptirun	2011-07-26 14:47:19.000000000 +0200
+++ Bumblebee-UI-rc1-mj/ecoptirun	2011-07-27 10:04:37.342538271 +0200
@@ -42,7 +42,7 @@
 #DEFAULT VALUE
 source /etc/default/bumblebee
 VGL_DRIVER="/usr/lib/nvidia-current"
-eco_mode='1'
+ECO_MODE='1'
 get_compression='0'
 get_display='0'
 
@@ -51,7 +51,7 @@
 for arg in "$@"
 	do
 	case $arg in
-		-f) 	eco_mode='0'
+		-f) 	ECO_MODE='0'
 			echo "ECOPTIRUN : The application will be run with Bumblebee also if the computer is not plugged to a power supply"
 			shift ;; #force optirun if on battery
 		-32) 	VGL_DRIVER="/usr/lib32/nvidia-current"
@@ -97,7 +97,7 @@
 	done
 
 #echo "Arguments for the application:""$@"
-#echo "Eco mode:" $eco_mode
+#echo "Eco mode:" $ECO_MODE
 #echo "32 bits mode:" $lib32_mode
 #echo "Compression mode:" $VGL_COMPRESS
 #echo "Display:" $VGL_DISPLAY 
@@ -137,7 +137,7 @@
 ac_device=$(ls /sys/class/power_supply | grep AC)
 power_state=$(cat /sys/class/power_supply/$ac_device/online)
 
-if [ "$power_state" -eq "1" ] || [ "$eco_mode" -eq "0" ]; then
+if [ "$power_state" -eq "1" ] || [ "$ECO_MODE" -eq "0" ]; then
 	optirun_launcher $@
 elif [ "$power_state" -eq "0" ]; then
 	$@
diff -uNr Bumblebee-UI-rc1/INSTALL Bumblebee-UI-rc1-mj/INSTALL
--- Bumblebee-UI-rc1/INSTALL	2011-07-27 01:40:02.000000000 +0200
+++ Bumblebee-UI-rc1-mj/INSTALL	2011-07-27 10:05:26.512538284 +0200
@@ -42,10 +42,6 @@
 #Create bumblebee-app-settings a link to AppSettings.py 
 ln -s /usr/local/bin/app/AppSettings.py /usr/local/bin/bumblebee-app-settings
 
-#Copy bumblebee.cfg in .local/share/applications/
-#NEED REFINEMENT, THIS CONFIG FILE IS NOT NICE
-cp bumblebee.cfg $HOME/.local/share/applications/
-
 #Copy desktop files in /usr/share/applications
 cp bumblebee-app-settings.desktop /usr/share/applications/
 cp bumblebee-indicator.desktop /usr/share/applications/

Follow ups

References