From ae45f7619179e52a530b3912a41199b7cccd7e7f Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Tue, 7 Jul 2015 03:42:27 +0200 Subject: [PATCH] setting the background image in rc.lua now. if not set the default wil be used --- .config/awesome/rc.lua | 18 ++++++++++++++++++ .config/awesome/themes/hanez/theme.lua | 9 +-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 2dd22cc1..6b0e0a26 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -13,6 +13,13 @@ local menubar = require("menubar") require('naughty') vicious = require("vicious") + +function file_exists(name) + local f=io.open(name,"r") + if f~=nil then io.close(f) return true else return false end + end + + -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) @@ -42,6 +49,17 @@ end -- Themes define colours, icons, font and wallpapers. beautiful.init(".config/awesome/themes/hanez/theme.lua") +-- I Don't add wallpapers to the theme because of licensing issues; you need to set +-- this yourself. I recommend to symlink your wallpaper image to +-- ~/images/background.png. I will change this at some time to become more +-- flexible. If you do not add this symlink or file, the awesome's default background +-- image will be used. +name = os.getenv("HOME").."/images/background.png" +if file_exists(name) then + beautiful.wallpaper = name +end + + -- This is used later as the default terminal and editor to run. terminal = "uxterm -bg black -fg grey -sb -leftbar -si -bc -cr orange" editor = "/usr/bin/vim" diff --git a/.config/awesome/themes/hanez/theme.lua b/.config/awesome/themes/hanez/theme.lua index 359efbe3..aa2355f5 100644 --- a/.config/awesome/themes/hanez/theme.lua +++ b/.config/awesome/themes/hanez/theme.lua @@ -1,11 +1,6 @@ ------------------------- -- Hanez awesome theme -- ------------------------- -function file_exists(name) - local f=io.open(name,"r") - if f~=nil then io.close(f) return true else return false end -end - theme = {} theme.font = "sans 8" @@ -82,9 +77,7 @@ theme.titlebar_maximized_button_focus_inactive = "~/.config/awesome/themes/hane theme.titlebar_maximized_button_normal_active = "~/.config/awesome/themes/hanez/titlebar/maximized_normal_active.png" theme.titlebar_maximized_button_focus_active = "~/.config/awesome/themes/hanez/titlebar/maximized_focus_active.png" --- I Don't add wallpapers to the repo because of licensing issues; you need to set --- this yourself. -theme.wallpaper = "~/images/background.jpg" +theme.wallpaper = "/usr/share/awesome/themes/default/background.png" -- You can use your own layout icons like this: theme.layout_fairh = "~/.config/awesome/themes/hanez/layouts/fairhw.png"