xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) Anton Pirogov 2014
License | BSD3
Maintainer | Anton Pirogov <anton.pirogov@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Hooks.WallpaperSetter

Contents

- Usage
- TODO

Description

Log hook which changes the wallpapers depending on visible workspaces.

Synopsis

- wallpaperSetter :: WallpaperConf -> X ()
- data WallpaperConf = WallpaperConf {
  - wallpaperBaseDir :: FilePath
  - wallpapers :: WallpaperList
  }
- data Wallpaper
  - = WallpaperFix FilePath
  - | WallpaperDir FilePath
- 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

Constructors

WallpaperConf |

Fields

- wallpaperBaseDir :: FilePath

  Where the wallpapers reside (if empty, will look in ~/.wallpapers/)

- wallpapers :: WallpaperList

  List of the wallpaper associations for workspaces

#### Instances

Instances details

Default WallpaperConf Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods def :: WallpaperConf #
Read WallpaperConf Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods readsPrec :: Int -> ReadS WallpaperConf Source # readList :: ReadS [WallpaperConf] Source # readPrec :: ReadPrec WallpaperConf Source # readListPrec :: ReadPrec [WallpaperConf] Source #
Show WallpaperConf Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods showsPrec :: Int -> WallpaperConf -> ShowS Source # show :: WallpaperConf -> String Source # showList :: [WallpaperConf] -> ShowS Source #

data Wallpaper Source #

Represents a wallpaper

Constructors

WallpaperFix FilePath | Single, fixed wallpaper
WallpaperDir FilePath | Random wallpaper from this subdirectory

#### Instances

Instances details

Read Wallpaper Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods readsPrec :: Int -> ReadS Wallpaper Source # readList :: ReadS [Wallpaper] Source # readPrec :: ReadPrec Wallpaper Source # readListPrec :: ReadPrec [Wallpaper] Source #
Show Wallpaper Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods showsPrec :: Int -> Wallpaper -> ShowS Source # show :: Wallpaper -> String Source # showList :: [Wallpaper] -> ShowS Source #
Eq Wallpaper Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods (==) :: Wallpaper -> Wallpaper -> Bool Source # (/=) :: Wallpaper -> Wallpaper -> Bool Source #

newtype WallpaperList Source #

Constructors

WallpaperList [(WorkspaceId, Wallpaper)] |

#### Instances

Instances details

Monoid WallpaperList Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods mempty :: WallpaperList Source # mappend :: WallpaperList -> WallpaperList -> WallpaperList Source # mconcat :: [WallpaperList] -> WallpaperList Source #
Semigroup WallpaperList Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods (<>) :: WallpaperList -> WallpaperList -> WallpaperList Source # sconcat :: NonEmpty WallpaperList -> WallpaperList Source # stimes :: Integral b => b -> WallpaperList -> WallpaperList Source #
Read WallpaperList Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods readsPrec :: Int -> ReadS WallpaperList Source # readList :: ReadS [WallpaperList] Source # readPrec :: ReadPrec WallpaperList Source # readListPrec :: ReadPrec [WallpaperList] Source #
Show WallpaperList Source # |
Instance details Defined in XMonad.Hooks.WallpaperSetter Methods showsPrec :: Int -> WallpaperList -> ShowS Source # show :: WallpaperList -> String Source # showList :: [WallpaperList] -> ShowS Source #

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)