Announcement

Collapse
No announcement yet.

A keyboard shortcut to toggle an active window's opacity?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A keyboard shortcut to toggle an active window's opacity?

    I find the usual black text on white background a bit harsh to view. If I reduce the active window's opacity to say, 60%, the text is still clear but the white background is now less intense (because I have a plain dark desktop background).

    I can make the changes by right-clicking on the application's title bar and choosing more actions > specific application settings > appearance and fixes > active opacity. But that's a bit cumbersome in case I need to revert to 100% opacity for whatever reason.

    What I'm hoping for is a script which I can assign to a keyboard shortcut which will let me toggle the active window's opacity from 100% to 60% and back.

    I've used toggle scripts for other things hence my question:
    Code:
    #!/bin/bash
    
    TOGGLE=$HOME/.toggle
    
    if [ ! -e $TOGGLE ]; then
       touch $TOGGLE
       styles-on &
    else
       rm $TOGGLE
       styles-off &
    fi
    
    exit 0
    where "styles-on" and "styles-off" are two scripts.
    Kubuntu 20.04

    #2
    A toggle using xcalib may be an alternative.
    Kubuntu 20.04

    Comment


      #3
      Originally posted by chimak111 View Post
      I find the usual black text on white background a bit harsh to view. If I reduce the active window's opacity to say, 60%, the text is still clear but the white background is now less intense (because I have a plain dark desktop background)..
      An interesting solution to the problem of harsh white backgrounds. I use a combination of the Invert desktop effect, in app settings, and the "Dark Background and Light Text" firefox add-on.

      Have you checked out "Window Actions"? System settings->Window Management->Window Behaviour, Window Actions tab. You can set "Inner Window, Titlebar & Frame", "Mouse wheel" drop-down box to "Change Opacity". Then press and hold the modifier key (defaults to Alt) and move the mouse wheel. Not a toggle, but very easy.
      Regards, John Little

      Comment


        #4
        Originally posted by jlittle View Post
        ...
        Have you checked out "Window Actions"? System settings->Window Management->Window Behaviour, Window Actions tab. You can set "Inner Window, Titlebar & Frame", "Mouse wheel" drop-down box to "Change Opacity". Then press and hold the modifier key (defaults to Alt) and move the mouse wheel. Not a toggle, but very easy.
        Thanks! I'll be using it on Google Chrome pages when browsing incognito.
        Kubuntu 20.04

        Comment


          #5
          There's been something there since I don't know when.

          System settings > Shortcuts > Global Shortcuts > KWin: Decrease Opacity of Active Window by 5%
          Kubuntu 20.04

          Comment

          Working...
          X