
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Hate having to switch to a second display or projector with your laptop?
Here's your solution. Install this package to your Ubuntu laptop and whenever you plug in an external monitor or projector, the laptop will change to using the projector instantly and automatically.
To install:
sudo add-apt-repository ppa:hughescih/ppa && sudo apt-get update && sudo apt-get install autoswitcher
Testing:
- Works on Ubuntu 10.04, 10.10, 11.04
- Tested on Nvidia graphics cards
- Should work just fine on Intel and ATI cards
9 years ago
2.0.0 : New AppIndicator menu. Support for clone desktop, extend desktop. Remembers settings after reboot and applies them. Menu hides if no external display detected.
1.0.3 : After a reboot, it will switch back to the second monitor on startup if connected.
9 years ago
2.0.0 : New AppIndicator menu. Support for clone desktop, extend desktop. Remembers settings after reboot and applies them. Menu hides if no external display detected.
1.0.3 : After a reboot, it will switch back to the second monitor on startup if connected.
jjack92
9 years ago
Report
cewanf
9 years ago
:~$ /usr/lib/autoswitcher/autoswitcher.py -v -d
Display Resolution Detected: 1440x900
Traceback (most recent call last):
File "/usr/lib/autoswitcher/autoswitcher.py", line 327, in <module>
autoModeSwitcher = ModeSwitchAutomator(menu, debug=options.verbose)
File "/usr/lib/autoswitcher/autoswitcher.py", line 99, in __init__
self.set_display_mode(self.mode, self.direction)
File "/usr/lib/autoswitcher/autoswitcher.py", line 172, in set_display_mode
self.sw.switch_clone(displays, resolution)
File "/usr/lib/autoswitcher/switcher/swxrandr.py", line 71, in switch_clone
ress = ResolutionSelection(res, displays)
File "/usr/lib/autoswitcher/switcher/resolutions.py", line 145, in __init__
self.set(sress, displays)
File "/usr/lib/autoswitcher/switcher/resolutions.py", line 165, in set
raise ValueError('unrecognised resolution selection')
ValueError: unrecognised resolution selection
Report
qb89dragon
9 years ago
Thanks!
Report
cewanf
9 years ago
:~$ /usr/lib/autoswitcher/autoswitcher.py -v -d
Display Resolution Detected: 1600x1200
Traceback (most recent call last):
File "/usr/lib/autoswitcher/autoswitcher.py", line 322, in <module>
autoModeSwitcher = ModeSwitchAutomator(menu, debug=options.verbose)
File "/usr/lib/autoswitcher/autoswitcher.py", line 99, in __init__
self.set_display_mode(self.mode, self.direction)
File "/usr/lib/autoswitcher/autoswitcher.py", line 174, in set_display_mode
self.sw.switch_clone(displays, resolution)
File "/usr/lib/autoswitcher/switcher/swxrandr.py", line 71, in switch_clone
ress = ResolutionSelection(res, displays)
File "/usr/lib/autoswitcher/switcher/resolutions.py", line 145, in __init__
self.set(sress, displays)
File "/usr/lib/autoswitcher/switcher/resolutions.py", line 165, in set
raise ValueError('unrecognised resolution selection')
ValueError: unrecognised resolution selection
Report
boamaod
9 years ago
Report
qb89dragon
9 years ago
Report
luv2hike
10 years ago
Report
qb89dragon
10 years ago
Report
luv2hike
10 years ago
I did just discover one issue, though. My screensaver no longer works when using it as a regular laptop if the autoswitcher daemon is running.
After the idle timeout period, it starts to dim the display as normal, but then instead of showing the ants screensaver in GNOME, it returns to the desktop at the original brightness. Any ideas?
Report
qb89dragon
10 years ago
You can confirm this for me though by running
/usr/lib/autoswitcher/autoswitcher.py -v -d
and letting it kick on the screensaver, and post the output from the terminal up here so I can see what it's up to.
Thanks!
Report
luv2hike
10 years ago
Initially Configured Displays set(['DFP-0'])
Resolution {'DFP-0': <switcher.resolutions.Resolution instance at 0x28fe050>}
Nothing more when the screensaver tried doing its thing. The daemon is still running though. Maybe I need to kill it first? What is the proper way to stop and start the daemon without a reboot?
Report
qb89dragon
10 years ago
Having more than one instance doesn't stop the detection parts from working however. But perhaps you could try and see if the issue persists after you have stopped the daemon.
Here's how to stop it:
ps -A -f | grep autoswitcher.py
and you have to look for something like this:
1000 1432 1 0 Mar02 ? 00:02:07 python /usr/lib/autoswitcher/autoswitcher.py
the number you're looking for here is 1432. So now you type in
kill 1432
and you won't have it running anymore.
To start it back up, run the following:
/usr/lib/autoswitcher/autoswitcher.py
Report
luv2hike
10 years ago
sudo pkill -f autoswitcher
Then I started it from the Terminal with -v -d and waited for the screen saver. Still the same thing: No other info except what I posted before from when it just starts up.
Report
wacmemphis
10 years ago
i don't know how to debug it, since it starts new threads...
i'm using intel gma graphics chip.
Report
qb89dragon
10 years ago
Report
qb89dragon
10 years ago
/usr/lib/autoswitcher/autoswitcher.py -v -d
Thanks for your help debugging this.
Report
wacmemphis
10 years ago
Initially Configured Displays set(['LVDS1'])
Resolution {'LVDS1': <switcher.resolutions.Resolution instance at 0x8a2f38c>}
plugging the external display in, doesn't result in any change.
however restarting the autoswitcher when the external monitor is plugged in, i get:
Initially Configured Displays set(['LVDS1', 'VGA1'])
Resolution {'LVDS1': <switcher.resolutions.Resolution instance at 0x90b838c>, 'VGA1': <switcher.resolutions.Resolution instance at 0x90b86ec>}
so it extends the desktop to both screens. unplugging the external monitor doesn't switch back to just the internal monitor...
any ideas?
Report
qb89dragon
10 years ago
To switch back the program waits for the display VGA1 to be removed from the list. I'll add a option (when I get back from work tonight) that shows the display polling results so you can see if VGA1 disappears from the list when you pull the plug on it.
Report
wacmemphis
10 years ago
Report
brainvision
10 years ago
I'm starting to hate them, I'm sorry!! or better, a part of them..
Report
qb89dragon
10 years ago
I just happen to do so for some of the following reasons:
- It has only been tested on Ubuntu
- It has been built and packaged for Ubuntu (deb)
- It ties into Ubuntu features, such as libnotify which cannot be guaranteed present in other distros
- It is hosted on Launchpad and will be updated through that (Ubuntu/Debian/etc)
- Ubuntu is the most popular distro with the strongest focus on usability and seamless ease of use, which makes it an ideal target for this kind of technology.
- You can port this to most mainstream distributions with 'alien', or could just figure out that it is written in python and you can strip out the libnotify components and run it as a daemon on any distro, even on KDE.
Report
cwickert
9 years ago
I know it's written in python, still this or alien cannot replace a proper source tarball. Please be so kind to link it from this page. TIA!
Report
qb89dragon
9 years ago
A little known fact about deb packages is they're just renamed tar.gz files that can be opened with your archive manager to reveal, in this case, the original python source file. The install script in there might also be useful as it copies a .desktop file to /usr/share/gnome/autostart
Report
brainvision
10 years ago
wtf are you saying??? the problem is that this is ONLY for ubuntu!,I don't care a cent of the description!
Report
gnumdk
10 years ago
If you want stuff about your favorite distro on this site, just contribute, it's free software, you can package, create themes, wallpapers...
Sure, it's easy to speak while doing nothing...
Report