Nico Trebbin | 18 Sep 10:52 2014
Picon

Rule to start application on screen 1 using Awesome 2.3.6 on SLES 11

Hello everyone,

I have a problem starting an application on an second screen.
My setup consists of 2 GPU's, 4 Monitors and a Dual-Twinview setup.

Therefore I have a DISPLAY :0.0 and DISPLAY :0.1 each spanning over two monitors. The setup of tags and two screens works fine, but I can't figure out how to start an application on the tag on screen 0. Below please find my configuration:

screen 0
{
    general
    {
    new_get_focus = true
    new_become_master = true
    sloppy_focus_raise = true
    }
    styles
    {
        normal
        {
            font = "sans 8"
            fg = "#dddddd"
            bg = "#444444"
            border = "#555555"
        }
        focus
        {
            fg = "#000000"
            bg = "#535d6c"
            border = "#535d6c"
        }
        urgent
        {
            fg = "#111111"
            bg = "#ff4500"
        }
    }
    tags
    {
        tag TEST_1 { }
        tag TEST_2 { }
    }
    layouts
    {
        layout tile { image = "/usr/share/awesome/icons/layouts/tilew.png" }
        layout tileleft { image = "/usr/share/awesome/icons/layouts/tileleftw.png" }
        layout tilebottom { image = "/usr/share/awesome/icons/layouts/tilebottomw.png" }
        layout tiletop { image = "/usr/share/awesome/icons/layouts/tiletopw.png" }
        layout max { image = "/usr/share/awesome/icons/layouts/maxw.png" }
        layout spiral { image = "/usr/share/awesome/icons/layouts/spiralw.png" }
        layout dwindle { image = "/usr/share/awesome/icons/layouts/dwindlew.png" }
        layout floating { image = "/usr/share/awesome/icons/layouts/floatingw.png" }
    }
    statusbar mystatusbar
    {
        position = "top"

        taglist mytaglist
        {
            mouse
            {
                button = "1"
                command = "tag_view"
            }
        }
    }
}

screen 1
{
    general
    {
    new_get_focus = true
    new_become_master = true
    sloppy_focus_raise = true
    }
    styles
    {
        normal
        {
            font = "sans 8"
            fg = "#dddddd"
            bg = "#444444"
            border = "#555555"
        }
        focus
        {
            fg = "#000000"
            bg = "#535d6c"
            border = "#535d6c"
        }
        urgent
        {
            fg = "#111111"
            bg = "#ff4500"
        }
    }
    tags
    {
        tag TEST_CLI { }
    }
    layouts
    {
        layout tile { image = "/usr/share/awesome/icons/layouts/tilew.png" }
        layout tileleft { image = "/usr/share/awesome/icons/layouts/tileleftw.png" }
        layout tilebottom { image = "/usr/share/awesome/icons/layouts/tilebottomw.png" }
        layout tiletop { image = "/usr/share/awesome/icons/layouts/tiletopw.png" }
        layout max { image = "/usr/share/awesome/icons/layouts/maxw.png" }
        layout spiral { image = "/usr/share/awesome/icons/layouts/spiralw.png" }
        layout dwindle { image = "/usr/share/awesome/icons/layouts/dwindlew.png" }
        layout floating { image = "/usr/share/awesome/icons/layouts/floatingw.png" }
    }
    statusbar mystatusbar1
    {
        position = "top"

        taglist mytaglist1
        {
            mouse
            {
                button = "1"
                command = "tag_view"
            }
        }
    }
}

rules
{
    rule {
    name = "wks"
    tags = "TEST_2"
    float = false
     }
    rule {
    name = "cli"
    tags = "TEST_CLI"
    float = false
     }
    rule {
    name = "epb"
    tags = "TEST_1"
    float = false
     }
    rule {
    name = "login_script.py"
    tags = "TEST_1"
    float = true
     }
    rule {
    name = "config.py"
    tags = "TEST_1"
    float = true
     }
}

keys
{
   key
   {
    modkey = { "Control" }
    key = "t"
        command = "spawn"
        arg = "exec xterm"
   }
   key
   {
    modkey = { "Control", "Shift" }
    key = "left"
        command = "tag_viewprev"
   }
   key
   {
    modkey = { "Control", "Shift" }
    key = "right"
        command = "tag_viewnext"
   }
   key
   {
    modkey = { "Control", "Shift" }
    key = "a"
        command = "spawn"
        arg = "config.py"
   }
}

The start of wks and epb on screen 0 and their assignment to their specified tag works fine. But the start of cli fails, and the application opens on screen 0 MCS_1, which might be a default behavior of awesome. Do I miss some screen variable? I tried:

    rule {
    name = "cli"
    tags = "MCS_CLI"
    screen = 1
    float = false
     }
    rule {
    name = "cli"
    tags = [1][1]
    float = false
     }

but the application is still showing up on the first tag of screen 0.

Any help on this issue is much appreciated!

Unfortunately there is no awesome 3 available for SLES 11, which forced me to use awesome 2.
Fabian Furger | 18 Sep 09:49 2014
Picon

Shortcut to clear "urgent"-flag

Hello everyone

I'm attempting to create a shortcut key that removes all tags that are marked in red (tags that contain urgent clients, as I understand it). This is useful for example when launching a music player and starting last time's playlist with a media key. Then, hitting one shortcut to clear the urgent flag is easier than Mod4-u, Mod4-Esc. To that end, I assumed I should use client.urgent.delete(client). Since my initial attempt seemed to have no effect, I tried the following:

local cc = awful.client.urgent.get()
if (cc ~= nil) then
    urgent = tostring(cc.urgent)
        naughty.notify({ text = cc.name .. urgent })
        awesome.client.urgent.delete(cc)
        urgent = tostring(cc.urgent)
        naughty.notify({ text = cc.name .. urgent })
end

Judging by the notifications, awesome.client.urgent.delete(client) doesn't seem to do anything to the client's urgent flag. Both notifications contain the name of the first urgent client as well as "true" for their urgent-value. Same result when re-assigning "cc" after "awesome.client.urgent.delete(cc)" has been executed.

Am I using the wrong command or is it possibly not working? I'm running awesome 3.5.5 as well as Shifty from git.

Thanks for your time and have a nice day!


Joren Heit | 17 Sep 22:11 2014
Picon

awful.client.focus.history

Hi all,

I'm experiencing weird problems with the focus history while implementing Alt-Tab in Awesome 3.5.5. While alt-tabbing, the script is cycling through a table containing the history, constructed like this:

   local idx = 0
   local c = awful.client.focus.history.get(s, idx)

   while c do
      table.insert(altTabTable, c)
      idx = idx + 1
      c = awful.client.focus.history.get(s, idx)
   end

For some reason, the minimized clients are not contained at all in the history, so afterwards I have to iterate through the list of all clients (client.get()) to add those to my altTabTable as well.

When the user (me) releases the Alt-key, the currently selected window is set as focussed and is raised on top of the other ones. However, this messes up the history. For example, if I have three windows open in the current tag, say
  1. Iceweasel
  2. Terminal
  3. Chromium

where #1 is focussed, and I Alt-Tab my way to Chromium (raising but not focussing the terminal on the way there), I would expect the new order to be like this:

  1. Chromium
  2. Iceweasel
  3. Terminal

Unfortunately, this is not the case. Instead, #2 and #3 have swapped positions. I have no idea why, but I thought I might be able to get around this by just clearing the entire history and reinserting clients in the order I want. Something like this:

   -- delete all clients from history
   for i = 1, #altTabTable do
      awful.client.focus.history.delete(altTabTable[i])
   end

   -- reinsert every client in reverse order
   for i = 0, #altTabTable - 1 do
       if i ~= altTabIndex then -- skip selected window
           awful.client.focus.history.add(altTabTable[#altTabTable - i])
       end
   end

This code assumes that the history is some sort of LIFO container (a stack basically), where you can add and remove things onto/from the top. However, it doesn't work. To be honest, it's hard to explain what happens. After struggling with this for over an hour, I can't find the patience anymore to figure out what kind of effect this exactly had, or what the logic behind it was. By now, I have tried so many different solutions, some of which even crashed Awesome. Things that didn't work:

  1. The above
  2. Deleting and adding (in that order) the selected client. One might expect that this would cause the client to move to the top of the stack. Nope.
  3. Iterating over the history using get, then deleting
  4. The above, but reinserting in current order
Does anyone have guidelines on how to use this whole history thing? It's one of the many frustratingly poorly documented features of Awesome... :-(
Honestly, better documentation is what would be really Awesome!

Thanks in advance,
Joren
Adam Nielsen | 16 Sep 14:18 2014
Picon

How to bind to nonstandard keys

Hi all,

Further to my last post, I am trying to have certain behaviour bound to
specific keys.

I have redefined my keyboard such that the F1 key (among others)
produces they same key code but a different keysym.  Pressing my F1 key
now acts as if F21 is pressed.

However I cannot correctly bind to this key in Awesome.  If I run xev
and press F1, it tells me I have pressed F21.  If I tell Awesome to
bind to F21, then when I press the key xev tells me it is bound to
another program (good) but Awesome does nothing (bad).

Worse still, if I tell Awesome to bind an action to F1, then it does
the action even when I am pressing what is supposed to be the F21 key.
(This means I can't actually press F1 because Awesome has stolen that
key.)

How can I tell Awesome to respect the XKB keyboard mapping and perform
an action on the keys it has bound?  Currently it binds to the correct
key but fails to act on it.

Many thanks,
Adam.

Adam Nielsen | 16 Sep 06:08 2014
Picon

Bind key to switch to specific app on any desktop/monitor

Hi all,

I'm wondering whether it's possible to write a Lua function that
switches focus to a specific app, such as Firefox or a terminal.

The reason I ask is that I have redefined my keyboard mapping so that
the F1 to F12 keys generate keycodes for F21 to F32.  (If I hold Caps
Lock while pressing the keys I get the original F1 to F12 back again.)

I would like to assign for example F21 to focus my web browser, F22 to
focus my e-mail client, F23 to focus the active chat window, etc.  This
way I can make better use of my muscle memory and quickly switch
between apps without having to remember what monitor I am currently on
and what desktop the app is on.  I frequently forget and end up
switching desktop on the wrong monitor, so I am hoping this will fix
the problem.

The trick is I don't want to focus a specific desktop on a specific
screen, because I tend to move the apps between monitors depending on
which ones I want to view all at once.  So this function would need to:

 1. Find a window based on some criteria (class, title, etc.)  It would
    be great if this was a function parameter so some keys could search
    for a window by title, but others by class or role.

 2. Focus whichever monitor the window resides on.

 3. Switch to whichever desktop the window is on.

 4. Focus the window.

Is this something that's possible to do with Awesome?  Is anyone able
to give me a hand with this?

Many thanks,
Adam.

Joren Heit | 15 Sep 21:58 2014
Picon

Weird terminator behavior

Hi guys,

I wrote some simple routines to enable tiling in a floating environment. It works fine with, for example, an iceweasel window but I get really weird behavior with my terminal emulator: Terminator.

When I open a fresh window and try to tile it e.g. to the left, the window starts resizing automagically. However, when I have dragged/resized it prior to tiling, everything works as expected.

To illustrate this, I've uploaded a demo to youtube: https://www.youtube.com/watch?v=a5wgCw01kkE
Does anyone have any idea what's going on? Here's the most important piece of the lua code:

function tile(c, dir)

   if c == nil then return end

   if not floatTile[c] then
      resetFloatTile(c)
   end

   c.maximized = false
   c.minimized = false

   local s = mouse.screen
   local cg = c:geometry()
   local sg = screen[s].workarea

   local x, y, width, height

   if dir == "left" then
      x,y,width,height = tileLeft(c, cg, sg)
   elseif dir == "right" then
      x,y,width,height = tileRight(c, cg, sg)
   elseif dir == "up" then
      x,y,width,height = tileUp(c, cg, sg)
   elseif dir == "down" then
      x,y,width,height = tileDown(c, cg, sg)
   elseif dir == "full" then
      x,y,width,height = tileFull(c, sg)
   end

   c:geometry({x = x, y = y, width = width, height = height})
end


I think the only relevant piece of the code above is the change in geometry.
By the way, other windows sometimes don't get drawn properly after tiling. I remember in 3.4 that we could force a redraw of a client, but I couldn't find anything anymore in the docs.

Thanks,
Joren

Matija Žeželj | 15 Sep 18:06 2014
Picon

lain, widget update and dual screen issues

Hi list,

I use Lain and vicious to display widgets in awesome and i have dual screen setup; my notebook screen is used as secondary display and external, hdmi screen is used as primary.
On primary and secondary monitors same wibox is displayed but only on primary(external) monitor there is systray and i like it that way. But i came across he problem with lain widgets - they are not updating on external monitor.
My rc.lua is attached so you can see how i call the widgets.
other then that i had no issues and this rc.lua works great just in order to refresh the widgets on main screen i need to restart awesome :)

Thx in advance,
--
Matija Žeželj
Attachment (rc.lua): text/x-lua, 34 KiB
Zum Testen | 15 Sep 12:39 2014
Picon

Adjust screen brightness with launcher

I want to change the brightness of my screen with awful.widget.launcher. The launcher should contain an
icon, indicating the actual brightness. Clicking on the launcher should open a menu to choose the
brightness value in percent.

Problem: When clicking on the launcher, the icon is changing immediately to the icon, which was first
loaded after starting awesome, ignoring the actual brightness. Choosing a value from the list of the menu
will update the icon properly. But if cancelling the menu, the wrong icon will remain.

For example, the brightness was 30% when starting awesome. I change the brightness with the launcher to
100%. No problem. But now I click on the launcher again: the launcher will show the 30% icon, despite the
fact that I have not chosen a value from the menu. Pressing Escape will cancel the menu, but the wrong icon
still remains: The brightness is 100% but the icon shows 30%.

mybrightness.lua (the global mybrightness_launcher will be added to my wibox):

local awful = require("awful")

local mybrightness_menu = awful.menu({ items = 
    {{"100%", function() awful.util.pread("xbacklight -time 0 -set 100"); brightness_update() end},
     {" 30%", function() awful.util.pread("xbacklight -time 0 -set  30"); brightness_update() end}}})
mybrightness_launcher = awful.widget.launcher({image = "bright100.png", menu = mybrightness_menu})

function brightness_update()
    local max_brightness = awful.util.pread('cat /sys/class/backlight/intel_backlight/max_brightness')
    local actual_brightness = awful.util.pread('cat /sys/class/backlight/intel_backlight/actual_brightness')
    local brightness_percent = 0
    if max_brightness ~= nil and actual_brightness ~= nil then
        brightness_percent = actual_brightness * 100 / max_brightness
    end

    if brightness_percent > 50 then
        brightness_icon = "bright100.png"
    else
        brightness_icon = "bright030.png"
    end
    mybrightness_launcher:set_image(brightness_icon)
end

brightness_update()

Kevin Clay | 14 Sep 10:46 2014
Picon

Awesome Menu Applicaions

I have been through the wiki on installing Awesome for the first time 
and I see screenshots in which the awesome menu has categorized lists of 
applications. The wiki doesn't explain how to do this or if it supposed 
to do this automagically. My menu doesn't show any applicaions and I was 
wondering how to get it to do this.

Thanks.

Paul Jolly | 7 Sep 09:24 2014
Picon

PID of active window

Hi - this will I'm sure be a fairly basic question. 

I have a keyboard shortcut to launch a urxvt:

terminal = "urxvt"
-- ...
awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end)

What I'm now looking to do is setup another key binding that, given the currently active window, a urxvt instance, launches another instance which uses the same CWD. 

Has anyone done this before?

If I can can the PID of the current window that will be enough to then use pwdx or similar approaches. 

Other thoughts/approaches?

Thanks,


Paul
Andre Naujoks | 1 Sep 11:15 2014
Picon

Windows opening on wrong screen

Hi.

I am just giving awesome a try and like it so far. I am on a debian sid
with awesome version 3.4.15-1+b1.

It has one quirk, where I think it is a bug.

When I open a window (say a terminal with Mod4 + Return, but the
application does not matter.), the window should apear on the current
active screen. This works for two of my three screens, but not for the
third. The same happens when I open a window via the right-mouse-click
menu from the desktop, or when I use the top left button to bring up the
menu.

- I select the screen by either moving the mouse into it, or Mod4+Ctrl+j/k.
- I start an application on my right-most screen and the window opens on
my primary/center screen.

I attached a screenshot of my layout, so you get an idea of what I am
talking about. (the black stripes above the left and right screen are
unused, i.e. the monitors end where the menu-bar is)

As mentioned it works for the left and the center screen, but not for
the right one.

Am I doing something wrong or is this a bug? I am not familiar enough
with lua or window managers at all to try my hand at this, but I can
test and try patches.

Regards
  Andre

Gmane