1
0
Fork 0
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:
Luca CPZ 2018-06-06 12:05:29 +02:00
parent 4e01272133
commit 18918df4e9
3 changed files with 19 additions and 11 deletions

View file

@ -44,18 +44,26 @@ end
-- }}}
-- {{{ Autostart windowless processes
-- This function will run once every time Awesome is started
local function run_once(cmd_arr)
for _, cmd in ipairs(cmd_arr) do
findme = 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))
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
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

View file

@ -135,11 +135,11 @@ theme.mpd = lain.widget.mpd({
settings = function()
if mpd_now.state == "play" then
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)
elseif mpd_now.state == "pause" then
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)
else
title = ""
@ -285,7 +285,7 @@ theme.weather = lain.widget.weather({
local first = wibox.widget.textbox(markup.font("Tamzen 3", " "))
local spr = wibox.widget.textbox(' ')
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
local orig_filter = awful.widget.taglist.filter.all