gui for the script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
disper |
In Progress
|
Wishlist
|
wvengen |
Bug Description
hello
i wrote a very small gui frontend for disper for my basic needs (about 75 lines of code). it allows switching in the following modes: monitor 1, monitor 2, dual screen, extend monitor. this is based on python and gtk and uses the status icon or the application indicators (found in ubuntu). if you are interested in the application, i could send it over.
cheers
kinkerl
Related branches
Dennis Schwertel (tmassassin) wrote : | #1 |
description: | updated |
Nikke (nmellegard) wrote : | #2 |
Dennis Schwertel (tmassassin) wrote : | #3 |
hi nikke
i made a quick hack (about 30 lines) to the gnome panel applet and its an indicator applet now. works fine for me :)
but i did run in some problems with the installer or the debuild to create a debian package. i think the icons for the applet are not installed in either of the processes.
anyway: this is working for me right now. i could send you a patch with the changes. right now it kills the gnome-applet functionality. i can build a "hybrid" that can to both(with a cli parameter or something) or copy some of the code for a new package or just give you what i got now.
it would be great to combine this in a working debian package.
cheers
kinkerl
Nikke (nmellegard) wrote : | #4 |
Neat!
Post the patch here and I'll have a look at it.
/N
Dennis Schwertel (tmassassin) wrote : | #5 |
- indicator.diff Edit (2.2 KiB, text/plain)
diff is attached.
maybe the icon for the indicator doesnt load (i had to place the icon in /usr/share/icons myself but hey, icons are strange for me anyway). you will see
cheers
kinkerl
orGSD (orgsd) wrote : | #6 |
@kinkerl: Thank you for your contributions! Did you end up creating a debian package for this? I would love to test how well it works under KDE. Right now I am using a Plasma toggle switch to achieve this but it is severely limited in terms of functionality, but as a 5 second solution it is functional.
Dennis Schwertel (tmassassin) wrote : | #7 |
well a debian package for this does exist. at least the needed files to create one. unfortunately it does not work the way it should. is somebody maintaining this branch?
wvengen (wvengen) wrote : | #8 |
Hi, thanks for your work on this! For the record, there has been work on a qt-based gui as well at http://
If the applet can be called more or less completed, I'd be happy to create a disper branch for this. Great to hear you've done some packaging as well.
Dennis Schwertel (tmassassin) wrote : | #9 |
hi wvengen
how do you plan to handle these "subprojects"?
- gnome-panel
- application indicator and
- qt frontend
if somebody could fix the installer for the gnome-panel then i could copy this over to a new branch and maintain a shiny new app indicator. or this could stay in one branch and one debian package. this would reduce administration overhead and code maintainance.
wvengen (wvengen) wrote : | #10 |
Hi kinkerl,
What about using lp:disper/<subproject>/trunk, with <subproject>
Great to hear you're willing to maintain the app indicator. I'll try to find some time to have a look at lp:~nmellegard/disper/disper-applet-menu-icons 's installation.
wvengen (wvengen) wrote : | #11 |
Ok, a package that installs and works properly can be found at lp:~wvengen/+junk/disper-applet-menu-icons . I couldn't get it to propose a merge to your branch though, sorry. Changes:
* Install pixmaps too (and include disper pixmap with disper-applet, I think that's the best right now)
* Use DESTDIR the way it is intended
* Allow change of PREFIX
Looks cool!
Some very small issues I encountered:
- The menu pops up not below the icon but at the mouse position. This is not consistent with other applets.
- You may want to list each author on a new line in the credits dialog.
- The about dialog may benefit from a slightly less technical description, e.g. "On-the-fly display switch utility.\nA simple applet for disper." GtkAboutDialog's website link mechanism could then link to the disper website (unless you really would like to host your own). I could add a section about graphical interfaces to the page. And thanks for mentioning my name but you may safely move me to occupy a place with the other authors, if that suits you :).
- Still doubting which of the disper icons are best for the panel icon :)
wvengen (wvengen) wrote : | #12 |
Code available, still need to be reviewed, completed and imported into an official disper branch.
Changed in disper: | |
assignee: | nobody → wvengen (wvengen) |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Dennis Schwertel (tmassassin) wrote : | #13 |
uh nice, i will take a look at the package this weekend.
is the indicator support merged in it?
wvengen (wvengen) wrote : | #14 |
Hi Dennis, no it is still in the branch as mentioned in comment #11. If you would like to look at the issues mentioned that would be great. If not, I'll do it some time later. When the applet is ready for a first release, I'd like to put the panel subdirectory in an official branch. Does that sound reasonable?
One thing remains though: in disper trunk there is support for plugins, but these only get called when using the newly introduced Disper object. It does not provide a Displays class but I think it would be useful to integrate that into disper. But I don't necessarily want to wait for that right now; the applet is already very useful.
Dennis Schwertel (tmassassin) wrote : | #15 |
ok i played a little bit the the package for the applet and it installed fine. just some warnings:
W: disper-applet source: native-
W: disper-applet source: debhelper-
W: disper-applet source: package-
W: disper-applet source: build-depends-
W: disper-applet source: out-of-
W: disper-applet: new-package-
i just got the indicator back to work with the new package (the patch from #5 works fine). only one problem: the icon for the indicator must be in /usr/share/
Dennis Schwertel (tmassassin) wrote : | #16 |
ah i just found the disper.svg... doh... but it still should be in /usr/share/
wvengen (wvengen) wrote : | #17 |
Hi Dennis, thanks for the notes! I've fixed them in the repository mentioned in comment #11.
I've been looking for the correct install location of the application icon. How do you know that it should be in hicolor? It should be in the Debian filesystem hierarchy standard but I couldn't find it.
wvengen (wvengen) wrote : | #18 |
So we have an applet and an indicator. Does it make sense to keep both? If there is no relevant difference to the user, it might make sense to merge them so the user doesn't have make a choice when both are equal.
Dennis Schwertel (tmassassin) wrote : | #19 |
i am developing a little app myself (persy) and the hicolor theme folder works fine. this is copied this from another project. i dont know if its the best place but its a least a working place :)
hm. if done right, an app indicator will fallback to a status icon if the indicator stuff is not available on the os. this way it will still work on fedora etc. i would just merge them and provide a easy method to autostart the indicator (+ maybe a desktop menu entry?!). the gnome-applet will be there if somebody really needs it but it should not be the default.
Nikke (nmellegard) wrote : | #20 |
Hi guys
First, sorry for my complete absence (been working on my thesis...). Dennis, are you still working on this?
I have been thinking about this a bit, and was wondering whether it would be possible to use Disper and write a back-end to the existing monitor-
I've made a (quite half-assed) effort to try to locate the source code for the application to see if it would be possible to extend it with another back-end, but haven't managed to find which project it's part of...
I know this is going in a quite different direction from disper-
Cheers
N
Nikke (nmellegard) wrote : | #21 |
Hi all
I've fixed the issue with the menu popping up at the mouse pointer (attaching the patch).
@Dennis
About your app-indicator patch, the setting of the icon needs to be:
ind = appindicator.
Second parameter need to be set to the path to the icon (just stating "disper" would refer to a stock icon, which doesn't exist). And also, you had chosen CATEGORY_
Nikke (nmellegard) wrote : | #22 |
I've made some updates to disper-applet:
- Disper-applet can now run as an indicator (thanks Dennis). Run with param -i or --indicator
- Fixed issue with the menu popping up under cursor (properly this time, I was too quick with the fix in #21)
- Changed the description of applet in about-box (as proposed in #11)
- Each author now appears on a separate line in credits in about-box
- Added Dennis Schwertel as author in credits
- Added the disper-icon in the pixmaps folder
- Added mono themed icons (same as the previous, but desaturated)
The new version is available as rev 75 in https:/
Cheers
N
Dennis Schwertel (tmassassin) wrote : | #23 |
Hi Nikke
i will try this first thing tomorrow! did you include the debian fixes from #11 ?
Nikke (nmellegard) wrote : | #24 |
Hi Dennis
I have not fixed DESTDIR and PREFIX from #11 at this point. Feel free to, if you know how :)
BTW, are you able to push to the branch?
/n
Dennis Schwertel (tmassassin) wrote : | #25 |
I dont know. I never done anything more with bazar than a "checkout" but i think you have to grant me some additional rights to push in your branch.
wvengen (wvengen) wrote : | #26 |
Hi, great to see it's progressing! Regarding DESTDIR/PREFIX, you can look at the changes in my branch at lp:~wvengen/+junk/disper-applet-menu-icons .
Regarding bazaar, the personal bzr branches are only accessible to the owner if I am correct. If you want to make a change, just branch it yourself and upload it to your own personal launchpad bzr branch (bzr push lp:~myself/+junk/mybranch, or look at the code.launchpad.
Nikke (nmellegard) wrote : | #27 |
Hi,
I think I have made applied the debian-related changes from wvengen's branch. Thanks!
And, as proposed in #26, if you check out my branch, make changes and send me the diff:s I'll keep the branch updated!
As of now the applet works fine, but the indicator has a few issues:
- The parameter management is *very* rudimentary. @Dennis, looking at your Persy-code, you seems to know how to do it properly :)
- When starting the disper-applet as indicator, the menu is built once and for all on startup. This means that it won't show changes when a monitor is hooked up or removed. We need a way to detect when the indicator is clicked, and then call the __create_menu (as is done for the applet version in the gtk.Menu callback function __cb_click)
Dennis Schwertel (tmassassin) wrote : | #28 |
- parameter.diff Edit (1.6 KiB, text/plain)
i improved the parameter handling a bit. still not perfect but okay (i guess)
Nikke (nmellegard) wrote : | #29 |
Looked fine, and works! Patch applied, branch updated (rev 80).
/N
Christoph Buchner (bilderbuchi) wrote : | #30 |
works beautifully, thanks! (rev87)
Christoph Buchner (bilderbuchi) wrote : | #31 |
Will this applet be compatible with the upcoming 11.04's new application-
Alexander Egger (alexander-egger-gmail) wrote : | #32 |
Yet another indicator, this time using Ubuntu's Unity indicator API. Very basic but works on 11.04 Natty.
import gobject
import gtk
import appindicator
import commands
def single(w):
commands.
def extend(w):
commands.
def clone(w):
commands.
def add_menu_item(name, action):
menu_item = gtk.MenuItem(name)
menu.
menu_
menu_item.show()
if __name__ == "__main__":
ind = appindicator.
ind.set_status (appindicator.
menu = gtk.Menu()
add_menu_
add_menu_
add_menu_
ind.set_
gtk.main()
Khar Tahk (khartahk) wrote : | #33 |
If anyone is iterested I've got a shell script that I use to change display layout with a keyboard shortcut. I use Windows Key + F8 which is the same as my laptopts key to change the displays except that there it uses FN key. Any way this with windows key is much more usefull since i can sue a normal keyboard to change the displays. It changes from single to secondary to primary extend right and secondary extend left:
#! /bin/bash
DISPLAYS=$( disper -l | grep display | cut -f2 -d" " )
##
# Get primary and if attached secondary display
#
# DISPLAY0=DSP-0, DISPLAY1=DSP-1
##
DISPLAY0=
DISPLAY1=
##
# Get used displays
#
# FIRST=DSP-0 | DSP-1, SECND=DSP-1 | DSP-0
##
ALL=$(disper -p | grep metamode)
FIRST=$(echo $ALL | cut -f 1 -d "," | cut -f 2 -d ":")
FIRST=$(echo $FIRST | cut -f 1 -d" ")
SECND=$(echo $ALL | cut -f 2 -d "," | cut -f 1 -d ":")
SECND=$(echo $SECND | cut -f 1 -d" ")
XINERAMA=$(disper -p | grep xinerama | cut -f 2 -d ":")
XINERAMA=
DSPLY=$(echo $ALL | cut -f 2 -d "," | cut -f 5 -d " ")
if [ $DISPLAY0 ] && [ $DISPLAY1 ]
then
if [ "$XINERAMA" == "$DISPLAY0, $DISPLAY1" ] && [ $FIRST == $DISPLAY0 ] && [ $SECND == $DISPLAY1 ]
then
disper -s -q > /dev/null
#echo 1 PLUG0:"$DISPLAY0" PLUG1:"$DISPLAY1" FIRST:"$FIRST" SECND:"$SECND"
#echo $XINERAMA
elif [ "$XINERAMA" == "$DISPLAY1, $DISPLAY0" ] && [ $FIRST == $DISPLAY0 ] && [ $SECND == $DISPLAY1 ]
then
disper -q -e -d DFP-0,DFP-1 -t left > /dev/null && disper -e -d DFP-0,DFP-1 -t right > /dev/null
#echo 2 PLUG0:"$DISPLAY0" PLUG1:"$DISPLAY1" FIRST:"$FIRST" SECND:"$SECND"
#echo $XINERAMA
elif [ $FIRST == $DISPLAY0 ] && [ $SECND != $DISPLAY1 ]
then
disper -q -S > /dev/null
#echo 3 PLUG0:"$DISPLAY0" PLUG1:"$DISPLAY1" FIRST:"$FIRST" SECND:"$SECND"
#echo $XINERAMA
elif [ $FIRST == $DISPLAY1 ] && [ $SECND != $DISPLAY1 ]
then
disper -q -d $DISPLAY1,$DISPLAY0 -e -t left > /dev/null
#echo 4 PLUG0:"$DISPLAY0" PLUG1:"$DISPLAY1" FIRST:"$FIRST" SECND:"$SECND"
#echo $XINERAMA
fi
else
#echo 6 PLUG0: $DISPLAY0 PLUG1: $DISPLAY1 FIRST: $FIRST SECND: $SECND
disper -q -s
fi
Christoph Buchner (bilderbuchi) wrote : | #34 |
Nikke: Any news on this? Is this working on Unity?
Alexander: What should one do with your code? where to put it to get a Unity indicator?
Nikke (nmellegard) wrote : | #35 |
@Christoph: Yes in fact, I've found a way to get the indicator version to work as I want. I will try to update the makefile and debian stuff over the weekend and push the changes...
So, bottom line: yup, an indicator-version that works under Unity is in the pipeline
/Nikke
Nikke (nmellegard) wrote : | #36 |
Revision 85 of branch disper-indicator (renamed the disper-
How to install:
1. Install disper 0.2.3 or later
2. Check out the disper-indicator branch
3. Run 'sudo make install'
4. Start 'Disper Indicator'
Help needed:
Anyone who knows how to fix the debian stuff to be able to build a .deb file, please make the necessary changes and send me the diff/instructions and I'll fix the branch and set up a PPA for the indicator.
/N
Nikke (nmellegard) wrote : | #37 |
Update: I've managed to fix the debian stuff so I now can build the .deb-file!
About the setup a PPA, please test and report any problems!
Cheers
/N
Nikke (nmellegard) wrote : | #38 |
Disper-indicator is now available in the PPA: https:/
Although it states natty/i386 it should be compatible with older distributions and with amd64 as well. Again, anyone who knows this debian build stuff better than me, please check out the code and improve it :)
/N
Christoph Buchner (bilderbuchi) wrote : | #39 |
Just installed this. Works as expected (On Natty 64bit) as far as I can see, thanks!
The only strange thing is, that the app indicators etc (top bar, all icons on the right side except BFB) are all duplicated on the second monitor, but that's maybe a unity thing, isn't it?
Nikke (nmellegard) wrote : | #40 |
@Christoph: glad to hear it works, thanks for the report!
And, yup the indicators thing is Unity-related (or at least, beyond the control of disper-indicator).
/N
Christoph Buchner (bilderbuchi) wrote : | #41 |
@Nikke: Hm, something strange has happened - disper-indicator has stopped working. in fact, entering disper-indicator in the terminal yields "command not found". i checked with indicator-disper, just to be sure, same result.
purge/reinstall hasn't helped.
Should I file an extra bug for that, or do we keep it in this one?
Nikke (nmellegard) wrote : | #42 |
@Christoph: Keep it in this thread for now, so we don't mess up the bug section for Disper. Perhaps we should move disper-indicator to a separate project, I don't know....
Regarding your problem:
- Did you install from the PPA?
- Did it use to work?
- What happens if you write "python /usr/lib/
/N
Christoph Buchner (bilderbuchi) wrote : | #43 |
OK.
1) Yes
2) Yes
3) python: can't open file '/usr/lib/
ls on /usr/lib/
Synaptic shows the package as installed, v 0.2.1-1
Nikke (nmellegard) wrote : | #44 |
Actually all looks fine...
But, you missed the ".py" at the end of the command, it should be:
python /usr/lib/
Also, could you post the file:
/usr/share/
BTW, do you see Disper Indicator under System Tools section in the application menu?
/N
Christoph Buchner (bilderbuchi) wrote : | #45 |
- Disper-Indicator.desktop Edit (388 bytes, text/plain)
oh, now i feel stupid. ><
using the command you gave, it works as expected. indicator symbol and all. output:
MyDisplays.
MyDisplays.
etc...
desktop file attached.
Yes I see it in the applications lense, and can successfully start it from there. just not from the command line. a guess: maybe some symlink to /usr/bin or wherever went missing, so command line doesn't work?
Nikke (nmellegard) wrote : | #46 |
no worries :)
Actually, there's no script installed to /usr/bin ... Probably should be... I'll update the install package.
To get Disper-Indicator to automatically start on login, you'll need to manually add it to the start-up programs in your session.
/N
Christoph Buchner (bilderbuchi) wrote : | #47 |
yeah, I know about the start-up programs. but there, the command I added was "disper-indicator", and that one is not found. should this be something else?
Nikke (nmellegard) wrote : | #48 |
If you update to version 0.2.2 you should be able to use the command 'disper-indicator'
/N
debili (karatedebili) wrote : | #49 |
hello, please after running Disper indicator i still don't see any disper indicator in the top panel, running Natty/Unity 64. perhaps a hint how I could troubleshoot this? disper 0.3.0 installed. thank you
Nikke (nmellegard) wrote : | #50 |
@debili if you've updated to the latest version of disper-indicator (ver 0.2.2) you should be able to run it from the terminal using the command 'disper-indicator'. Try that and post the output here, and we'll see if there are any clues.
If you're still on previous version, you can try running 'python /usr/lib/
/N
debili (karatedebili) wrote : | #51 |
hm it seems i've got ver0.2.2 but i had to run the 'python..' command to get the indicator running/appearing.
details:
http://
thanks!
Christoph Buchner (bilderbuchi) wrote : | #52 |
what happens if you execute "disper-
Nikke (nmellegard) wrote : | #53 |
Christoph's on to the problem: 'disper-
It appears the Launchpad's internal build routine doesn't allow the way I wanted to create that link... There probably is a better way... wonder what that might be, though.....
Anyway, I'll make a few changes and disper-indicator v 0.2.3 should be up in a while.
Thanks for enduring my trial-and-error learning of Launchpads build-stuffs.
/N
Nikke (nmellegard) wrote : | #54 |
BTW, just to be on the safe side:
Uninstall the previous version of disper-indicator (ver. 0.2.2); i.e. don't upgrade, rather remove 0.2.2 and then install 0.2.3
/N
debili (karatedebili) wrote : | #55 |
I uninstalled 0.2.2, updated, and installed 0.2.3. works like it should now. wow, that was quickly done :) keep up the good work
Christoph Buchner (bilderbuchi) wrote : | #56 |
I just wanted to report, works flawlessly for me too, now!
Nikke (nmellegard) wrote : | #57 |
Good to know, thanks!
/N
Hi kinkerl
There's been a gnome-panel applet around for a while that basically does the same (nice initiative, though).
You can check out the source here:
bzr branch lp:~nmellegard/disper/disper-applet-menu-icons
The above branch contains both disper (in the root folder) and disper-applet (in a subfolder). To install disper-applet, just switch to disper-applet and type 'sudo make install'. Though, disper must obviously also be installed on the system...
The applet was started by a Eugene Arshinov a while back. I've modified it to use menu icons and to build the menu dynamically depending on the current monitor config.
Feel free to hack away on it if you like...
Cheers
N