Last active
April 10, 2020 21:34
-
-
Save s-zeid/8a815ebbab3773e04969b820f57f1fd0 to your computer and use it in GitHub Desktop.
mpv + kwin - Hack to make the window translucent when there is no video track
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[kwin-translucent-hack] | |
# Hack to make the window translucent when there is no video track. | |
# | |
# * Set up 2 KWin window rules: | |
# * class: exact match `mpv`, title: regular expression `\x034f$` | |
# -> active/inactive opacity: force 50% | |
# * class: exact match `mpv`, title: regular expression `^[^\x034f]*$` | |
# -> active/inactive opacity: force 100% | |
# | |
# * U+034F is used because KWin strips non-printable characters and replaces | |
# whitespace sequences with single U+0020 spaces (using `QChar::isPrint()` | |
# and `QString::simplify()`, respectively), and U+034F survives those changes. | |
# | |
# * Make sure that there is a U+034F after `${?vid==no:` and | |
# the last `${?track-list/count==0:` below | |
# | |
title=${media-title:mpv}${!track-list/count==0:${?vid==no:͏}}${?track-list/count==0:͏} | |
# Alternative using U+FFFC: | |
#title=${media-title:mpv}${!track-list/count==0:${?vid==no:}}${?track-list/count==0:} | |
[example-profile] | |
force-window=immediate | |
profile=kwin-translucent-hack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment