瀏覽代碼

Hooks.WallpaperSetter: Preserve aspect ratio while scaling images

master^2
Alex Griffin 5 月之前
父節點
當前提交
fcced8991a
共有 2 個檔案被更改,包括 8 行新增2 行删除
  1. 6
    0
      CHANGES.md
  2. 2
    2
      XMonad/Hooks/WallpaperSetter.hs

+ 6
- 0
CHANGES.md 查看文件

@@ -71,6 +71,12 @@
Add a utility function `isOnAnyVisibleWS :: Query Bool` to allow easy
cycling between all windows on all visible workspaces.

* `XMonad.Hooks.WallpaperSetter`

Preserve the aspect ratio of wallpapers that xmonad sets. When previous
versions would distort images to fit the screen size, it will now find a
best fit by cropping instead.


## 0.15


+ 2
- 2
XMonad/Hooks/WallpaperSetter.hs 查看文件

@@ -221,7 +221,7 @@ layerCommand (rect, path) = do
res <- getPicRes path
return $ case needsRotation rect <$> res of
Nothing -> ""
Just rotate ->
Just rotate -> let size = show (rect_width rect) ++ "x" ++ show (rect_height rect) in
" \\( '"++path++"' "++(if rotate then "-rotate 90 " else "")
++ " -scale "++(show$rect_width rect)++"x"++(show$rect_height rect)++"! \\)"
++ " -scale "++size++"^ -gravity center -extent "++size++" +gravity \\)"
++ " -geometry +"++(show$rect_x rect)++"+"++(show$rect_y rect)++" -composite "

Loading…
取消
儲存