Random wallpaper
This commit is contained in:
parent
b5ed69f295
commit
4b64cb7b8e
Binary file not shown.
Before Width: | Height: | Size: 341 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.5 MiB |
Binary file not shown.
After Width: | Height: | Size: 3.1 MiB |
1
rc.lua
1
rc.lua
|
@ -1,5 +1,6 @@
|
||||||
local os = require('os')
|
local os = require('os')
|
||||||
local math = require('math')
|
local math = require('math')
|
||||||
|
math.randomseed(os.time())
|
||||||
|
|
||||||
-- Standard awesome library
|
-- Standard awesome library
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
|
|
|
@ -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_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.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:
|
-- You can use your own layout icons like this:
|
||||||
theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png"
|
theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png"
|
||||||
|
|
Loading…
Reference in New Issue