diff --git a/myrc/errors.lua b/myrc/errors.lua new file mode 100644 index 0000000..af969cb --- /dev/null +++ b/myrc/errors.lua @@ -0,0 +1,22 @@ +local naughty = require("naughty") + +-- {{{ Error handling +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} diff --git a/rc.lua.blackburn b/rc.lua.blackburn index 05569d4..49bd70b 100644 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.copland b/rc.lua.copland index 632e274..d653cc1 100644 --- a/rc.lua.copland +++ b/rc.lua.copland @@ -18,26 +18,8 @@ local lain = require("lain") local eminent = require("eminent") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.dremora b/rc.lua.dremora index 42f3344..0179cb3 100644 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.holo b/rc.lua.holo index 505ff71..357ed27 100644 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.multicolor b/rc.lua.multicolor index 2c56adf..f933076 100644 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 1391990..c32e580 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.rainbow b/rc.lua.rainbow index 389026c..473268d 100644 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup") diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 91f8d47..87962b4 100644 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -17,26 +17,8 @@ local drop = require("scratchdrop") local lain = require("lain") -- }}} --- {{{ Error handling -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} +-- Error handling +require("myrc.errors") -- STARTUP apps require("settings.startup")