Skip to content

Commit

Permalink
implement ability to set different wallpapers for each tag (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
TanvirOnGH committed Sep 25, 2024
1 parent 3266c98 commit a783bdf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
10 changes: 9 additions & 1 deletion common/env.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ end
-- Common functions
-- Wallpaper setup
env.wallpaper = function(s)
if beautiful.wallpaper then
local selected_tag = s.selected_tag

if selected_tag and beautiful.wallpapers[selected_tag.name] then
gears.wallpaper.maximized(beautiful.wallpapers[selected_tag.name], s, true)
elseif beautiful.wallpaper then
if not env.desktop_autohide and awful.util.file_readable(beautiful.wallpaper) then
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
else
Expand All @@ -58,6 +62,10 @@ env.wallpaper = function(s)
end
end

screen.connect_signal("tag::history::update", function(s)
env.wallpaper(s)
end)

-- Tag tooltip text generation
env.tagtip = function(t)
local layname = awful.layout.getname(awful.tag.getproperty(t, "layout"))
Expand Down
15 changes: 13 additions & 2 deletions themes/colorless/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,19 @@ theme.panel_height = 40 -- panel height
theme.border_width = 0 -- window border width
theme.useless_gap = 5 -- useless gap
theme.cellnum = { x = 96, y = 58 } -- grid layout property
theme.wallpaper = awful.util.get_configuration_dir() .. "wallpapers/RosyBrown.png"

theme.wallpapers = {
["1:1"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrown.png",
["1:2"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownApple.png",
["1:3"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownBoy.png",
["1:4"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownMan.png",
["1:5"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownGun.png",

["2:1"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownSword.png",
["2:2"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownSword2.png",
["2:3"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownNix.png",
["2:4"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownGirl.png",
["2:5"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownTree.png",
}
-- Fonts
theme.fonts = {
main = "Fira Code 12", -- main font
Expand Down
16 changes: 14 additions & 2 deletions themes/rosybrown/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ theme.path = awful.util.get_configuration_dir() .. "themes/rosybrown"

-- Main config
theme.panel_height = 38 -- panel height
theme.wallpaper = awful.util.get_configuration_dir() .. "wallpapers/RosyBrown.png"
theme.desktopbg = theme.wallpaper
-- theme.desktopbg = theme.wallpapers["1:1"]
theme.wallpapers = {
["1:1"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrown.png",
["1:2"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownApple.png",
["1:3"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownBoy.png",
["1:4"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownMan.png",
["1:5"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownGun.png",

["2:1"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownSword.png",
["2:2"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownSword2.png",
["2:3"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownNix.png",
["2:4"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownGirl.png",
["2:5"] = awful.util.get_configuration_dir() .. "wallpapers/RosyBrownTree.png",
}

-- Setup parent theme settings
theme:update()
Expand Down

0 comments on commit a783bdf

Please sign in to comment.