Random wallpaper

This commit is contained in:
Thomas Forgione 2023-07-15 22:02:25 +02:00
parent b5ed69f295
commit 4b64cb7b8e
5 changed files with 15 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

BIN
Wallpapers/toilet-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

1
rc.lua
View File

@ -1,5 +1,6 @@
local os = require('os')
local math = require('math')
math.randomseed(os.time())
-- Standard awesome library
local gears = require("gears")

View File

@ -76,7 +76,20 @@ theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/def
theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png"
theme.wallpaper = os.getenv('HOME') .. "/.config/awesome/Wallpapers/kuala.png"
function getrandomwallpaper()
local wallpaperdir = os.getenv('HOME') .. '/.config/awesome/Wallpapers/'
local i, t, popen = 0, {}, io.popen
local pfile = popen('ls -a "'.. wallpaperdir .. '"')
for filename in pfile:lines() do
i = i + 1
t[i] = filename
end
pfile:close()
return wallpaperdir .. t[math.random(1, i)]
end
theme.wallpaper = getrandomwallpaper()
-- theme.wallpaper = os.getenv('HOME') .. "/.config/awesome/Wallpapers/kuala.png"
-- You can use your own layout icons like this:
theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png"