diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/errors.lua | 35 | ||||
| -rw-r--r-- | lib/manage.lua | 15 | ||||
| -rw-r--r-- | lib/screen.lua | 8 | 
3 files changed, 58 insertions, 0 deletions
diff --git a/lib/errors.lua b/lib/errors.lua new file mode 100644 index 0000000..2079c0e --- /dev/null +++ b/lib/errors.lua @@ -0,0 +1,35 @@ +local awful = require("awful") +-- require("awful.autofocus") +-- Widget and layout library +-- Notification library +local naughty = require("naughty") + +-- {{{ 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) +if awesome.startup_errors then +	naughty.notify({ +		preset = naughty.config.presets.critical, +		title = "Oops, there were errors during startup!", +		text = awesome.startup_errors +	}) +end + +-- Handle runtime errors after startup +do +	local in_error = false +	awesome.connect_signal("debug::error", function (err) +		-- Make sure we don't go into an endless error loop +		if in_error then +			return +		end +		in_error = true + +		naughty.notify({ +			preset = naughty.config.presets.critical, +			title = "Oops, an error happened!", +			text = tostring(err) +		}) +		in_error = false +	end) +end diff --git a/lib/manage.lua b/lib/manage.lua new file mode 100644 index 0000000..5b1bd40 --- /dev/null +++ b/lib/manage.lua @@ -0,0 +1,15 @@ +local awful = require("awful") + +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c) +	-- Set the windows at the slave, +	-- i.e. put it at the end of others instead of setting it master. +	if not awesome.startup then +		awful.client.setslave(c) +	end + +	if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then +		-- Prevent clients from being unreachable after screen count changes. +		awful.placement.no_offscreen(c) +	end +end) diff --git a/lib/screen.lua b/lib/screen.lua new file mode 100644 index 0000000..3cca05d --- /dev/null +++ b/lib/screen.lua @@ -0,0 +1,8 @@ +local awful = require("awful") + +function seasonalwallpaper() +	awful.spawn("seasonalwallpaper", false) -- if not false then spinner will always spin on desktop +end + +awesome.connect_signal("startup", seasonalwallpaper) +screen.connect_signal("property::geometry", seasonalwallpaper)  | 
