Added transparent windows to Xmonad
This commit is contained in:
parent
e3638f6b9f
commit
b071206c87
|
@ -1,5 +1,9 @@
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Config.Desktop
|
import XMonad.Config.Desktop
|
||||||
|
import Data.Monoid
|
||||||
|
import Data.Word
|
||||||
|
import Graphics.X11.Xlib
|
||||||
|
import Graphics.X11.Xlib.Extras
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
import XMonad.Util.Run(spawnPipe)
|
import XMonad.Util.Run(spawnPipe)
|
||||||
|
@ -7,6 +11,16 @@ import XMonad.Util.EZConfig(additionalKeys)
|
||||||
--import XMonad.Util.SpawnOnce
|
--import XMonad.Util.SpawnOnce
|
||||||
import System.IO
|
import System.IO
|
||||||
|
|
||||||
|
-- Provide transparent widows for xmonad
|
||||||
|
setTransparentHook :: Event -> X All
|
||||||
|
setTransparentHook ConfigureEvent{ev_event_type = createNotify, ev_window = id} = do
|
||||||
|
setOpacity id opacity
|
||||||
|
return (All True) where
|
||||||
|
opacityFloat = 0.9
|
||||||
|
opacity = floor $ fromIntegral (maxBound :: Word32) * opacityFloat
|
||||||
|
setOpacity id op = spawn $ "xprop -id " ++ show id ++ " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY " ++ show op
|
||||||
|
setTransparentHook _ = return (All True)
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
-- Make sure that HDMI is turned off by default
|
-- Make sure that HDMI is turned off by default
|
||||||
spawn "xrandr --output HDMI1 --off"
|
spawn "xrandr --output HDMI1 --off"
|
||||||
|
@ -29,7 +43,8 @@ main = do
|
||||||
spawn "feh --bg-scale ~/Documents/Images/Posters/FuegoMilkyWay.jpg"
|
spawn "feh --bg-scale ~/Documents/Images/Posters/FuegoMilkyWay.jpg"
|
||||||
spawn "lxqt-notificationd"
|
spawn "lxqt-notificationd"
|
||||||
xmonad $ desktopConfig
|
xmonad $ desktopConfig
|
||||||
{ focusFollowsMouse = False
|
{ handleEventHook = setTransparentHook <+> handleEventHook def
|
||||||
|
, focusFollowsMouse = False
|
||||||
, terminal = "termonad"
|
, terminal = "termonad"
|
||||||
-- , manageHook = manageDocks <+> manageHook desktopConfig
|
-- , manageHook = manageDocks <+> manageHook desktopConfig
|
||||||
, layoutHook = avoidStruts $ layoutHook desktopConfig
|
, layoutHook = avoidStruts $ layoutHook desktopConfig
|
||||||
|
|
Loading…
Reference in a new issue