You are not logged in.

#1 2013-12-18 05:13:06

lykwydchykyn
Member
Registered: 2013-07-11
Posts: 91

Awesome 3.5 + drop-down terminal

Since moving to Arch, and thus awesome 3.5, my beloved Yakuake terminal has stopping displaying properly.  Instead of dropping down from the top of the screen, it drops down sometimes from the middle, sometimes only half-width, and sometimes covers the whole screen even though it's not supposed to.  Basically, this bug: https://awesome.naquadah.org/bugs/index … sk_id=1144

I've tried tilda with the same result.  Does anyone know of a similar drop-down terminal application that works properly in Awesome 3.5, or of a way to work around this?

Offline

#2 2013-12-18 06:08:42

wesleyac
Member
Registered: 2013-08-27
Posts: 80

Re: Awesome 3.5 + drop-down terminal

I just made a ghetto drop-down terminal using liyterm, maybe it'll help you?

In ~/.config/awesome/ror.lua:

table5={
  ["z"]={"lilyterm -T Quake", "Quake", "name"},
}

In ~/.config/awesome/aweror.lua:

require("ror")

local awful= require("awful")
local client=client
local pairs=pairs
local table=table
local allt1=table5
local print=print
local USE_T = true
--local USE_T = false

local aweror = {}

function aweror.run_or_raise(cmd, properties)
   local clients = client.get()
   local focused = awful.client.next(0)
   local findex = 0
   local matched_clients = {}
   local n = 0
   for i, c in pairs(clients) do
      --make an array of matched clients
      if match(properties, c) then
         n = n + 1
         matched_clients[n] = c
         if c == focused then
            findex = n
         end
      end
   end
   if n > 0 then
      local c = matched_clients[1]
      --awful.rules.apply(c)
      -- if the focused window matched switch focus to next in list
      if 0 < findex and findex < n then
         c = matched_clients[findex+1]
      end
      local ctags = c:tags()
      if #ctags == 0 then
         -- ctags is empty, show client on current tag
         local curtag = awful.tag.selected()
         awful.client.movetotag(curtag, c)
      elseif ctags[1] == awful.tag.selected() then
         c:tags({})
      else
         -- awful.tag.viewonly(ctags[1])
         local curtag = awful.tag.selected()
         awful.client.movetotag(curtag, c)
      end
      -- And then focus the client
      client.focus = c
      c:raise()
      return
   end
   awful.util.spawn(cmd)
end

-- Returns true if all pairs in table1 are present in table2
function match (table1, table2)
   for k, v in pairs(table1) do
      if table2[k] == nil or (table2[k] ~= v and not table2[k]:find(v)) then
         return false
      end
   end
   return true
end

function genfun(t3)
   local cmd=t3[1]
   local rule=t3[2]
   local flag=t3[3]
   local table1={}
   s1="class"
   if flag then
     s1=flag
   end
   table1[s1]=rule
   return function()
     aweror.run_or_raise(cmd,table1)
   end
end

function aweror.genkeys(mod4)
   rorkeys = awful.util.table.join()
  for i,v in pairs(allt1) do
   rorkeys = awful.util.table.join(rorkeys,
    awful.key({ mod4,}, i, genfun(v))
    )
  end
  return rorkeys
end

return aweror

in ~/.config/awesome/rc.lua:

Just before "root.keys(globalkeys)" add:

local ror = require("aweror")
globalkeys = awful.util.table.join(globalkeys, ror.genkeys(modkey))

And in awful.rules:

{ rule = { name = "Quake" }, -- Dropdown terminal settings (Hack)
    properties = {
        floating = true,
        width = 920,
        height = 275,
        x = 52,
        y = 0,
} },

Reload and press Mod4 + z!  You will need lilyterm. (Although you can probably replace lilyterm with another emulator.)

Let me know if you need any help setting it up!

Offline

#3 2013-12-19 08:07:34

crazymonmon
Member
Registered: 2013-12-08
Posts: 23

Re: Awesome 3.5 + drop-down terminal

I have used Guake. May it will work for you too.

Last edited by crazymonmon (2013-12-19 08:09:05)

Offline

#4 2013-12-19 15:20:07

lykwydchykyn
Member
Registered: 2013-07-11
Posts: 91

Re: Awesome 3.5 + drop-down terminal

I tried Guake, it seems to have its own set of craziness (every time I dropped it down the height would change dramatically).

I will have to tinker around with your approach, wesleyac.

Offline

#5 2013-12-19 15:40:26

lykwydchykyn
Member
Registered: 2013-07-11
Posts: 91

Re: Awesome 3.5 + drop-down terminal

wesleyac:  I tried your approach, and after some tinkering got it to respond to F12 like Guake/Yakuake.  Works a treat.  The only problem I'm having is that when I first log in, the size is all wrong and I have to restart awesome to get it corrected.  Any idea why that would happen?

Thanks.

EDIT: well, I got a workaround anyway; if I specify geometry both in the lilyterm command and the rules, it starts at the correct size.  Works great so far, thanks!!

Last edited by lykwydchykyn (2013-12-19 15:51:27)

Offline

#6 2013-12-19 19:51:46

wesleyac
Member
Registered: 2013-08-27
Posts: 80

Re: Awesome 3.5 + drop-down terminal

lykwydchykyn wrote:

wesleyac:  I tried your approach, and after some tinkering got it to respond to F12 like Guake/Yakuake.  Works a treat.  The only problem I'm having is that when I first log in, the size is all wrong and I have to restart awesome to get it corrected.  Any idea why that would happen?

Thanks.

EDIT: well, I got a workaround anyway; if I specify geometry both in the lilyterm command and the rules, it starts at the correct size.  Works great so far, thanks!!

That happens to me as well sometimes, hopefully the geometry option will fix it smile

BTW, it looks like the -T option is standard for most terminal emulators, so if you want to replace lilyterm with something else, it'll probably work, but I'd read the man page first.

Last edited by wesleyac (2013-12-19 19:54:36)

Offline

#7 2013-12-19 21:28:56

lykwydchykyn
Member
Registered: 2013-07-11
Posts: 91

Re: Awesome 3.5 + drop-down terminal

wesleyac wrote:

BTW, it looks like the -T option is standard for most terminal emulators, so if you want to replace lilyterm with something else, it'll probably work, but I'd read the man page first.

I'm quite favorably impressed with lilyterm so far, actually; I was just using lxterminal 'cause it gets the job done, but decided to swap my default to lilyterm.  I like configurable things smile.

Offline

#8 2013-12-19 21:41:41

wesleyac
Member
Registered: 2013-08-27
Posts: 80

Re: Awesome 3.5 + drop-down terminal

lykwydchykyn wrote:

I'm quite favorably impressed with lilyterm so far, actually; I was just using lxterminal 'cause it gets the job done, but decided to swap my default to lilyterm.  I like configurable things smile.

Haha, I actually had the same sort of experience.  There is a strange bug in many X terminals that my graphics driver (?) triggers, but all VTE based terminals work fine.  Lilyterm was the go-to  VTE based terminal, but now I wouldn't switch back!

Offline

#9 2013-12-23 00:55:33

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Awesome 3.5 + drop-down terminal

use the scratchpad manager. it's awesome ... tongue

the upside is, you can "dropdown" anything and you can customize the behavior a lot. For instance you can drop it in from the side or the bottom or just center it in the middle of the screen and give it a specific size etc. Besides dropdown-terminals i manage my notekeeping app, clipboard-manager, gmpc/spotify and similar like that, so i can quickly toggle them anywhere i am, really useful!

cheers

//edit:

you might have to use this version which definately works with 3.5
http://a.pomf.se/bctlxj.tar
then

local drop      = require("scratchdrop")
    awful.key(..., "s",      function () drop("urxvt -name urxvt_drop -e tmux", "bottom", "center", 1, 0.35) end),

for example

Last edited by demian (2013-12-23 01:08:11)


no place like /home
github

Offline

Board footer

Powered by FluxBB