Copyright | (c) Anton Pirogov 2014 |
---|---|
License | BSD3 |
Maintainer | Anton Pirogov <anton.pirogov@gmail.com> |
Stability | unstable |
Portability | unportable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Log hook which changes the wallpapers depending on visible workspaces.
Synopsis
- wallpaperSetter :: WallpaperConf -> X ()
- data WallpaperConf = WallpaperConf {}
- data Wallpaper
- newtype WallpaperList = WallpaperList [(WorkspaceId, Wallpaper)]
- defWallpaperConf :: WallpaperConf
- defWPNamesJpg :: [WorkspaceId] -> WallpaperList
- defWPNamesPng :: [WorkspaceId] -> WallpaperList
- defWPNames :: [WorkspaceId] -> WallpaperList
Usage
This module requires imagemagick and feh to be installed, as these are utilized for the required image transformations and the actual setting of the wallpaper.
This was especially tested with multi-head setups - if you have two monitors and swap the workspaces, the wallpapers will be swapped too, scaled accordingly and rotated if necessary (e.g. if you are using your monitor rotated but only have wide wallpapers).
Add a log hook like this:
myWorkspaces = ["1:main","2:misc","3","4"] ... main = xmonad $ def { logHook = wallpaperSetter defWallpaperConf { wallpapers = defWPNames myWorkspaces <> WallpaperList [("1:main",WallpaperDir "1")] } } ...
wallpaperSetter :: WallpaperConf -> X () Source #
Add this to your log hook with the workspace configuration as argument.
data WallpaperConf Source #
Complete wallpaper configuration passed to the hook
WallpaperConf | |
|
Instances
Read WallpaperConf Source # | |
Defined in XMonad.Hooks.WallpaperSetter readsPrec :: Int -> ReadS WallpaperConf # readList :: ReadS [WallpaperConf] # | |
Show WallpaperConf Source # | |
Defined in XMonad.Hooks.WallpaperSetter showsPrec :: Int -> WallpaperConf -> ShowS # show :: WallpaperConf -> String # showList :: [WallpaperConf] -> ShowS # | |
Default WallpaperConf Source # | |
Defined in XMonad.Hooks.WallpaperSetter def :: WallpaperConf # |
Represents a wallpaper
WallpaperFix FilePath | Single, fixed wallpaper |
WallpaperDir FilePath | Random wallpaper from this subdirectory |
newtype WallpaperList Source #
Instances
Monoid WallpaperList Source # | |
Defined in XMonad.Hooks.WallpaperSetter mempty :: WallpaperList # mappend :: WallpaperList -> WallpaperList -> WallpaperList # mconcat :: [WallpaperList] -> WallpaperList # | |
Semigroup WallpaperList Source # | |
Defined in XMonad.Hooks.WallpaperSetter (<>) :: WallpaperList -> WallpaperList -> WallpaperList # sconcat :: NonEmpty WallpaperList -> WallpaperList # stimes :: Integral b => b -> WallpaperList -> WallpaperList # | |
Read WallpaperList Source # | |
Defined in XMonad.Hooks.WallpaperSetter readsPrec :: Int -> ReadS WallpaperList # readList :: ReadS [WallpaperList] # | |
Show WallpaperList Source # | |
Defined in XMonad.Hooks.WallpaperSetter showsPrec :: Int -> WallpaperList -> ShowS # show :: WallpaperList -> String # showList :: [WallpaperList] -> ShowS # |
defWallpaperConf :: WallpaperConf Source #
default configuration. looks in ~/.wallpapers/ for WORKSPACEID.jpg
defWPNamesJpg :: [WorkspaceId] -> WallpaperList Source #
Return the default association list (maps name
to name.jpg
, non-alphanumeric characters are omitted)
defWPNamesPng :: [WorkspaceId] -> WallpaperList Source #
Like defWPNamesJpg
, but map name
to name.png
instead.
defWPNames :: [WorkspaceId] -> WallpaperList Source #
Deprecated: Use defWPNamesJpg instead
TODO
- implement a kind of image cache like in wallpaperd to remove or at least reduce the lag
- find out how to merge multiple images from stdin to one (-> for caching all pictures in memory)