mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-22 11:12:31 +00:00
rc.lua.template: add command for replicating XDG autostart (commented by default); closes #234
This commit is contained in:
parent
4e01272133
commit
18918df4e9
|
@ -44,18 +44,26 @@ end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Autostart windowless processes
|
-- {{{ Autostart windowless processes
|
||||||
|
|
||||||
|
-- This function will run once every time Awesome is started
|
||||||
local function run_once(cmd_arr)
|
local function run_once(cmd_arr)
|
||||||
for _, cmd in ipairs(cmd_arr) do
|
for _, cmd in ipairs(cmd_arr) do
|
||||||
findme = cmd
|
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
|
||||||
firstspace = cmd:find(" ")
|
|
||||||
if firstspace then
|
|
||||||
findme = cmd:sub(0, firstspace-1)
|
|
||||||
end
|
|
||||||
awful.spawn.with_shell(string.format("pgrep -u $USER -x %s > /dev/null || (%s)", findme, cmd))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
run_once({ "urxvtd", "unclutter -root" }) -- entries must be comma-separated
|
||||||
|
|
||||||
|
-- This function implements the XDG autostart specification
|
||||||
|
--[[
|
||||||
|
awful.spawn.with_shell(
|
||||||
|
'if (xrdb -query | grep --quiet "^awesome\\.started:\\s*true$"); then; exit; fi;' ..
|
||||||
|
'xrdb -merge <<< "awesome.started:true";' ..
|
||||||
|
-- list each of your autostart commands, followed by ; inside single quotes, followed by ..
|
||||||
|
'dex --environment Awesome --autostart --search-paths "$XDG_CONFIG_DIRS/autostart:$XDG_CONFIG_HOME/autostart"' -- https://github.com/jceb/dex
|
||||||
|
)
|
||||||
|
--]]
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Variable definitions
|
-- {{{ Variable definitions
|
||||||
|
|
|
@ -135,11 +135,11 @@ theme.mpd = lain.widget.mpd({
|
||||||
settings = function()
|
settings = function()
|
||||||
if mpd_now.state == "play" then
|
if mpd_now.state == "play" then
|
||||||
title = mpd_now.title
|
title = mpd_now.title
|
||||||
artist = " " .. mpd_now.artist .. markup("#333333", " <span font='Tamzen 2'> </span>|<span font='Tamzen 5'> </span>")
|
artist = " " .. mpd_now.artist .. markup("#777777", " <span font='Tamzen 2'> </span>|<span font='Tamzen 5'> </span>")
|
||||||
mpdicon:set_image(theme.play)
|
mpdicon:set_image(theme.play)
|
||||||
elseif mpd_now.state == "pause" then
|
elseif mpd_now.state == "pause" then
|
||||||
title = "mpd "
|
title = "mpd "
|
||||||
artist = "paused" .. markup("#333333", " |<span font='Tamzen 5'> </span>")
|
artist = "paused" .. markup("#777777", " |<span font='Tamzen 5'> </span>")
|
||||||
mpdicon:set_image(theme.pause)
|
mpdicon:set_image(theme.pause)
|
||||||
else
|
else
|
||||||
title = ""
|
title = ""
|
||||||
|
@ -285,7 +285,7 @@ theme.weather = lain.widget.weather({
|
||||||
local first = wibox.widget.textbox(markup.font("Tamzen 3", " "))
|
local first = wibox.widget.textbox(markup.font("Tamzen 3", " "))
|
||||||
local spr = wibox.widget.textbox(' ')
|
local spr = wibox.widget.textbox(' ')
|
||||||
local small_spr = wibox.widget.textbox(markup.font("Tamzen 4", " "))
|
local small_spr = wibox.widget.textbox(markup.font("Tamzen 4", " "))
|
||||||
local bar_spr = wibox.widget.textbox(markup.font("Tamzen 3", " ") .. markup.fontfg(theme.font, "#333333", "|") .. markup.font("Tamzen 5", " "))
|
local bar_spr = wibox.widget.textbox(markup.font("Tamzen 3", " ") .. markup.fontfg(theme.font, "#777777", "|") .. markup.font("Tamzen 5", " "))
|
||||||
|
|
||||||
-- Eminent-like task filtering
|
-- Eminent-like task filtering
|
||||||
local orig_filter = awful.widget.taglist.filter.all
|
local orig_filter = awful.widget.taglist.filter.all
|
||||||
|
|
|
@ -359,7 +359,7 @@ function theme.vertical_wibox(s)
|
||||||
end)
|
end)
|
||||||
tag.connect_signal("property::selected", function(t)
|
tag.connect_signal("property::selected", function(t)
|
||||||
local s = t.screen or awful.screen.focused()
|
local s = t.screen or awful.screen.focused()
|
||||||
s.myleftwibox.width = 38
|
s.myleftwibox.width = 38
|
||||||
s.layoutb.visible = true
|
s.layoutb.visible = true
|
||||||
mylauncher.visible = true
|
mylauncher.visible = true
|
||||||
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
||||||
|
|
Loading…
Reference in a new issue