You are not logged in.

#1 2016-09-19 17:12:26

miyavi
Member
Registered: 2016-09-19
Posts: 2

[SOLVED] Transparent xterm using xcompmgr on awesome WM

Hi, I tried to make xterm transparent by using xcompmgr in lua file on awesome WM. Here is a part of my rc.lua.

-- Hook function to execute when focusing a client---------------------------------------------------
awful.hooks.focus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_focus
       if c.class == "XTerm" then c.opacity = 0.7 end
    end
end)

-- Hook function to execute when unfocusing a client-----------------------------------------------
awful.hooks.unfocus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_normal
       if c.class == "XTerm" then c.opacity = 0.6 end
    end
end)

But I received an error: attempt to index a nil value (field "hooks").
I'm new to lua code and awesome. Anyone have any idea how to fix it? Or anyone have any other ideas to make xterm transparent?

Last edited by miyavi (2016-09-23 18:20:45)

Offline

#2 2016-09-21 18:27:18

jethronsun7
Member
Registered: 2016-04-29
Posts: 44
Website

Re: [SOLVED] Transparent xterm using xcompmgr on awesome WM

I am not good at lua either, but I got my terminal things working on my env. What I have in rc.lua is

awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     keys = clientkeys,
                     buttons = clientbuttons,
		     size_hints_honor = false,
		     opacity = 0.8 } },
    {
}

I also put them on github, welcome to check out and find a way to solve your problem: https://github.com/shwsun/awesome

Offline

#3 2016-09-23 18:16:12

miyavi
Member
Registered: 2016-09-19
Posts: 2

Re: [SOLVED] Transparent xterm using xcompmgr on awesome WM

jethronsun7, thank you for your reply, and I'm so sorry for not replying sooner...

Based on your hint, I added a rule to my own rules in rc.lua. What I added is last one in following.

awful.rules.rules = {
    -- All clients will match this rule.
   { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     raise = true,
                     keys = clientkeys,
                     buttons = clientbuttons} },
........

    { rule = { class = "XTerm" },
    properties = { opacity = 0.75 } },
}

It makes only xterm transparent. Thank you so much for your great hint!

Offline

#4 2016-09-24 16:09:57

jethronsun7
Member
Registered: 2016-04-29
Posts: 44
Website

Re: [SOLVED] Transparent xterm using xcompmgr on awesome WM

You are welcome, have fun!

Offline

Board footer

Powered by FluxBB