diff --git a/myrc/run_once.lua b/myrc/run_once.lua new file mode 100644 index 0000000..26a17ce --- /dev/null +++ b/myrc/run_once.lua @@ -0,0 +1,10 @@ +local awful = require("awful") + +function run_once(cmd) + findme = cmd + firstspace = cmd:find(" ") + if firstspace then + findme = cmd:sub(0, firstspace-1) + end + awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") +end diff --git a/rc.lua.blackburn b/rc.lua.blackburn index 699a54f..3c41205 100644 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -1,8 +1,8 @@ --[[ - - Blackburn Awesome WM config 2.0 - github.com/copycat-killer - + + Blackburn Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,20 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization diff --git a/rc.lua.copland b/rc.lua.copland index dcf3db6..b8824cf 100644 --- a/rc.lua.copland +++ b/rc.lua.copland @@ -1,8 +1,8 @@ --[[ - - Copland Awesome WM config - github.com/copycat-killer - + + Copland Awesome WM config + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -39,20 +39,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization @@ -244,7 +232,7 @@ settings = function() volicon:set_image(beautiful.vol) end end, -colors = +colors = { background = beautiful.bg_normal, mute = "#EB8F8F", diff --git a/rc.lua.dremora b/rc.lua.dremora index ff7daed..f786382 100644 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -1,8 +1,8 @@ --[[ - - Dremora Awesome WM config 2.0 - github.com/copycat-killer - + + Dremora Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,20 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization diff --git a/rc.lua.holo b/rc.lua.holo index 8594453..022d3cf 100644 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -1,8 +1,8 @@ --[[ - - Holo Awesome WM config 2.0 - github.com/copycat-killer - + + Holo Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,20 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization @@ -175,7 +163,7 @@ mpdwidget = lain.widgets.mpd({ mpd_now.artist = mpd_now.artist:upper():gsub("&.-;", string.lower) mpd_now.title = mpd_now.title:upper():gsub("&.-;", string.lower) widget:set_markup(markup.font("Tamsyn 4", " ") - .. markup.font("Tamsyn 8", + .. markup.font("Tamsyn 8", mpd_now.artist .. " - " .. mpd_now.title diff --git a/rc.lua.multicolor b/rc.lua.multicolor index 95c1ca1..186103c 100644 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -1,8 +1,8 @@ --[[ - - Multicolor Awesome WM config 2.0 - github.com/copycat-killer - + + Multicolor Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,19 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization @@ -198,7 +187,7 @@ volumewidget = lain.widgets.alsa({ end }) --- Net +-- Net netdownicon = wibox.widget.imagebox(beautiful.widget_netdown) --netdownicon.align = "middle" netdowninfo = wibox.widget.textbox() @@ -301,11 +290,11 @@ mytasklist.buttons = awful.util.table.join( end)) for s = 1, screen.count() do - + -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() - + -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( @@ -321,9 +310,9 @@ for s = 1, screen.count() do mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) -- Create the upper wibox - mywibox[s] = awful.wibox({ position = "top", screen = s, height = 20 }) + mywibox[s] = awful.wibox({ position = "top", screen = s, height = 20 }) --border_width = 0, height = 20 }) - + -- Widgets that are aligned to the upper left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(mytaglist[s]) @@ -362,20 +351,20 @@ for s = 1, screen.count() do layout:set_left(left_layout) --layout:set_middle(mytasklist[s]) layout:set_right(right_layout) - + mywibox[s]:set_widget(layout) -- Create the bottom wibox mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 20 }) --mybottomwibox[s].visible = false - + -- Widgets that are aligned to the bottom left bottom_left_layout = wibox.layout.fixed.horizontal() - + -- Widgets that are aligned to the bottom right bottom_right_layout = wibox.layout.fixed.horizontal() bottom_right_layout:add(mylayoutbox[s]) - + -- Now bring it all together (with the tasklist in the middle) bottom_layout = wibox.layout.align.horizontal() bottom_layout:set_left(bottom_left_layout) @@ -698,7 +687,7 @@ for s = 1, screen.count() do screen[s]:connect_signal("arrange", function () c.border_width = 0 elseif awful.client.floating.get(c) or layout == "floating" then c.border_width = beautiful.border_width - elseif #clients == 1 then + elseif #clients == 1 then clients[1].border_width = 0 if layout ~= "max" then awful.client.moveresize(0, 0, 2, 0, clients[1]) diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index c143005..3ff3a09 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -1,8 +1,8 @@ --[[ - - Powerarrow Darker Awesome WM config 2.0 - github.com/copycat-killer - + + Powerarrow Darker Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,19 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization diff --git a/rc.lua.rainbow b/rc.lua.rainbow index 9f58f3a..5dc3663 100644 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -1,8 +1,8 @@ --[[ - Rainbow Awesome WM config 2.0 - github.com/copycat-killer - + Rainbow Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,20 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization diff --git a/rc.lua.steamburn b/rc.lua.steamburn index f116819..b1feff5 100644 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -1,8 +1,8 @@ --[[ - - Steamburn Awesome WM config 3.0 - github.com/copycat-killer - + + Steamburn Awesome WM config 3.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -38,20 +38,8 @@ do end -- }}} --- {{{ Autostart applications -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - if firstspace then - findme = cmd:sub(0, firstspace-1) - end - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("urxvtd") -run_once("unclutter") -run_once("compton") --- }}} +-- STARTUP apps +require("settings.startup") -- {{{ Variable definitions -- localization diff --git a/settings/startup.lua b/settings/startup.lua new file mode 100644 index 0000000..fbc3d57 --- /dev/null +++ b/settings/startup.lua @@ -0,0 +1,9 @@ +-- {{{ Autostart applications + +require("myrc.run_once") + +run_once("urxvtd") +run_once("unclutter") +run_once("compton") + +-- }}}