Skip to content

Commit

Permalink
refactor: set wallpaper for all monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
windvalley committed Dec 23, 2022
1 parent c7c48ae commit 518c9c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.3.1

### Changed

Set wallpaper for main monitor -> Set wallpaper for all monitors.

### Fixed

- Fix bug for `Move to Next Monitor`

## v0.3.0

### Added
Expand Down
8 changes: 7 additions & 1 deletion bing_daily_wallpaper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ local function curl_callback(exitCode, stdOut, stdErr)
_M.last_pic = hs.http.urlParts(_M.full_url).lastPathComponent

local localpath = os.getenv("HOME") .. "/.Trash/" .. hs.http.urlParts(_M.full_url).lastPathComponent
hs.screen.mainScreen():desktopImageURL("file://" .. localpath)

-- 为每个显示器都设置壁纸(注意不是macOS新建的其他桌面, 而是扩展显示器)
local screens = hs.screen.allScreens()
for _, screen in ipairs(screens) do
print("[INFO] set wallpaper for ", screen)
screen:desktopImageURL("file://" .. localpath)
end
else
print(stdOut, stdErr)
end
Expand Down
2 changes: 1 addition & 1 deletion shortcuts_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ _M.windows = {
},
to_next_screen = {
prefix = {"Ctrl", "Option"},
key = "space",
key = "space", -- 扩展显示器比较少的情况只用这个就可以.
message = "Move to Next Monitor"
},
-- **********************************
Expand Down

0 comments on commit 518c9c7

Please sign in to comment.