This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Use different screen orientation in different activity

Tags: None
(comma "," separated)
User avatar
Rewarp
Registered Member
Posts
70
Karma
0
OS
I would like to have different screen orientations in different activities. My monitor can be physically toggled into landscape or portrait mode, and at present the way to change the screen orientation in Plasma is to manually change the orientation under Display Configuration.

If possible, I would like to associate an Activity with the desktop orientation as well, so when I physically rotate the monitor, I can do a simple shortcut switch to the appropriate activity with the mouse settings and notifications at the correct orientation (seeing as widgets can be freely rotated).

I am currently running Plasma 5. Anyone with any ideas how to implement thi?
luebking
Karma
0
org.kde.ActivityManager emits CurrentActivityChanged(QString activity)
You could connect that signal directly or invoke libkactivities.

I also wrote http://sourceforge.net/p/be-shell/code/ ... e.watched/ (yon don't need the rest of be::shell, it's a plain Qt client) to be able to connect random dbus signals or file updates to random executions. (It's smart enough to listen to its own config file for a reconfiguration ;-)
User avatar
Rewarp
Registered Member
Posts
70
Karma
0
OS
Thanks for answering. Though I am not sure how I am suppose to use the command you gave. If you have the time, could you expand further?
luebking
Karma
0
It's not a command but a dbus signal - it's send to the system when the current activity changes.
Your problem is to somehow catch it.

That will require "something" to listen for it ie. some daemon that you either have to write in c++ as kded module or eg. QtScript as a plasmoid - or in the laguage (with dbus API) of your choice as a standalone process.

There's however no way to do this in bash, but the linked daemon is capable of listening to the signal and execute a script that eg. compares the current activity and rotates the screen accordingly (using xrandr)
User avatar
Rewarp
Registered Member
Posts
70
Karma
0
OS
Thanks. Looks like I have some reading and experimenting to do.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]