Better rc.lua

This commit is contained in:
Thomas FORGIONE 2016-08-24 09:12:22 +02:00
parent 2cfef9c92e
commit c4b453901f
1 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,5 @@
os.setlocale("fr_FR.UTF-8")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
@ -21,7 +23,6 @@ local calendar = require("calendar")
home = "/home/thomas"
os.execute('xset m 16/1 0')
os.setlocale("fr_FR.UTF-8")
-- awful.util.spawn_with_shell("xcompmgr -cF &")
@ -63,8 +64,20 @@ end
-- Themes define colours, icons, font and wallpapers.
beautiful.init("~/.config/awesome/themes/default/theme.lua")
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function change_wallpaper(path)
theme.wallpaper = '/home/thomas/Pictures/Wallpapers/' .. path;
path = '/home/thomas/Pictures/Wallpapers/' .. path
if not file_exists(path) then
return
end
theme.wallpaper = path
if beautiful.wallpaper then
for s = 1, screen.count() do
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
@ -72,9 +85,7 @@ function change_wallpaper(path)
end
end
-- if os.execute('check isin') then
-- change_wallpaper('arch2.png');
-- end
change_wallpaper('1200custom.png')
-- This is used later as the default terminal and editor to run.
terminal = "terminator"