LINUX.ORG.RU

История изменений

Исправление dissident, (текущая версия) :

Я просто добавил:

local function isrunning(pname)
    -- The process name used for matching is  limited  to  the  15  characters (c) man pgrep
    pname = pname:sub(1, 15)
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o " .. pname)
    local pid = fpid:read("*n")
    fpid:close()

    if pid == nil or pid == "" then
        return false
    end

    return true
end

local function spawn(pname, cmd, once, sn_rules)
    if not cmd then
        cmd = pname
    end

    if not (once and isrunning(pname)) then
        awful.spawn(cmd, sn_rules)
    end
end
 
local function spawn_once(pname, cmd, sn_rules)
    if not cmd then
        cmd = pname
    end

    spawn(pname, cmd, true, sn_rules)
end

spawn_once("/usr/bin/urxvtd -q -f -o")

в rc.lua (у меня awesome-wm)

PS Еще здесь много инфы: https://wiki.archlinux.org/index.php/Rxvt-unicode_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)

И уже в упомянутом тут: https://wiki.archlinux.org/index.php/Rxvt-unicode_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)/Tips_and_tricks_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)#%D0%9F%D0%BE%D0%B2%D1%8B%D1%88%D0%B5%D0%BD%D0%B8%D0%B5_%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8

И я таки хочу guake. У него свой терминал или он умеет запускать urxvt?

Исправление dissident, :

Я просто добавил:

local function isrunning(pname)
    -- The process name used for matching is  limited  to  the  15  characters (c) man pgrep
    pname = pname:sub(1, 15)
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o " .. pname)
    local pid = fpid:read("*n")
    fpid:close()

    if pid == nil or pid == "" then
        return false
    end

    return true
end

local function spawn(pname, cmd, once, sn_rules)
    if not cmd then
        cmd = pname
    end

    if not (once and isrunning(pname)) then
        awful.spawn(cmd, sn_rules)
    end
end
 
local function spawn_once(pname, cmd, sn_rules)
    if not cmd then
        cmd = pname
    end

    spawn(pname, cmd, true, sn_rules)
end

spawn_once("/usr/bin/urxvtd -q -f -o")

в rc.lua (у меня awesome-wm)

PS Еще здесь много инфы: https://wiki.archlinux.org/index.php/Rxvt-unicode_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)

И я таки хочу guake. У него свой терминал или он умеет запускать urxvt?

Исправление dissident, :

Я просто добавил:

local function isrunning(pname)
    -- The process name used for matching is  limited  to  the  15  characters (c) man pgrep
    pname = pname:sub(1, 15)
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o " .. pname)
    local pid = fpid:read("*n")
    fpid:close()

    if pid == nil or pid == "" then
        return false
    end

    return true
end

local function spawn(pname, cmd, once, sn_rules)
    if not cmd then
        cmd = pname
    end

    if not (once and isrunning(pname)) then
        awful.spawn(cmd, sn_rules)
    end
end
 
local function spawn_once(pname, cmd, sn_rules)
    if not cmd then
        cmd = pname
    end

    spawn(pname, cmd, true, sn_rules)
end

spawn_once("/usr/bin/urxvtd -q -f -o")

в rc.lua (у меня awesome-wm)

Исходная версия dissident, :

Я просто добавил:

local function isrunning(pname)
    -- The process name used for matching is  limited  to  the  15  characters (c) man pgrep
    pname = pname:sub(1, 15)
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o " .. pname)
    local pid = fpid:read("*n")
    fpid:close()

    if pid == nil or pid == "" then
        return false
    end

    return true
end
 
local function spawn_once(pname, cmd, sn_rules)
    if not cmd then
        cmd = pname
    end

    spawn(pname, cmd, true, sn_rules)
end

local function spawn(pname, cmd, once, sn_rules)
    if not cmd then
        cmd = pname
    end

    if not (once and isrunning(pname)) then
        awful.spawn(cmd, sn_rules)
    end
end


spawn_once("/usr/bin/urxvtd -q -f -o")

в rc.lua (у меня awesome-wm)