-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
per monitor background image #16
Comments
It wouldn't be too hard to implement per monitor bg, I'll get to it. |
Per monitor background would have more practical use i'd imagine, although more configuration. I don't mind taking screenshots per monitor :) |
I added monitor names to windows so you can set backgrounds per monitor now using css. The only issue is that GTK doesn't offer an API to access output names such as DP-1 and HDMI-A-1 (it's deprecated) so I'm using monitor model names instead. You can list out connected monitors by running |
The needed GDK method isn't publicly visible (gdk_monitor_get_connector). The method for getting the connection name is deprecated (gdk_screen_get_monitor_plug_name) in favor of gdk_monitor_get_model which doesn't even return the connection name, it returns the model. I'd use the deprecated option. It's not like GTK3 is getting updated with breaking features/updates right? Maybe we should open an issue or even a MR about this? Edit: Opened an issue |
Yeah, you're right. I added use of the deprecated function and a pragma to hide the compiler warning. Per monitor background are now possible using a CSS selector such as |
Here is an example of how i use it now. lock.sh #! /bin/bash
outputs=(HDMI-A-2 DP-1 eDP-1)
for o in ${outputs[@]}; do
grim -o $o /tmp/$o.png
corrupter -mag 1 -boffset 3 -meanabber 5 /tmp/$o.png /tmp/$o.png &
done
wait < <(jobs -p)
gtklock -d -s ~/.config/gtklock/style.css style.css window {
background-size: contain;
background-repeat: no-repeat;
background-position: center;
background-color: black;
}
window#HDMI-A-2 {
background-image: url("/tmp/HDMI-A-2.png");
}
window#DP-1 {
background-image: url("/tmp/DP-1.png");
}
window#eDP-1 {
background-image: url("/tmp/eDP-1.png");
} |
@Hippo0o Do you mind if I use your example in the wiki? |
@jovanlanik please do |
Is there a way to define a background image per monitor?
Like so in css:
window#DP-1 {}
orwindow.HDMI-A-1 {}
Or a way for a single background to span across monitors. So you could do smth like this:
The text was updated successfully, but these errors were encountered: