/r/awesomewm

Photograph via snooOG

Subreddit dedicated to the Awesome Window Manager (AwesomeWM)

This subreddit is dedicated to the awesome window manager framework

Post awesome news, rc.lua hacks and other awesome posts

/r/awesomewm

11,271 Subscribers

1

Awesome tag switching takes significant amount of time

I have had this issue for while where over time switching between tags takes longer and longer over time, in alot of cases, reloading awesome immediately fixes this issue, but its often too late and just doing anything at all with awesome takes upwards of 15 minutes.

This issue is fully independent of resource usage, i could have everything maxed out and switching would still work fine, or i could have close to nothing open and it still takes really REALLY long to switch.

This has only seemed to happen recently, or more specifically, after i decided to fix alot of issues in my setup, which included alot of things in my awesome config.

9 Comments
2024/11/07
06:47 UTC

4

Trying to add seconds to my clock...

Solved: Solution at bottom and in messages

So, someone posted this in another subreddit but never got their answer. Basically, I'm wanting to add seconds to my clock.

Looking at my theme.lua in the textclock section, there is nothing there for seconds display. Here is that section of code.

local markup = lain.util.markup

-- Textclock
os.setlocale(os.getenv("LANG")) -- to localize the clock
local clockicon = wibox.widget.imagebox(theme.widget_clock)
local mytextclock = wibox.widget.textclock(markup("#7788af", "%A %d %B %r %S ") .. markup("#535f7a", ">") .. markup("#de5e1e", " %H:%M:%S "))
mytextclock.font = theme.font

-- Calendar
--local cal = wibox.widget.calendar.month(
--    os.date('*t'), 'sans 8')
theme.cal = lain.widget.cal({
  attach_to = { mytextclock },
--local cal = wibox.widget.calendar.month(os.date('*t'))
    notification_preset = {
        font = "Noto Sans Mono Medium 12",
        fg   = theme.fg_normal,
        bg   = theme.bg_normal
    }
})

I added Calendar section just so you can see everything I have in my textclock section.

So, I've added the :%S there after %H:%M and it does display the seconds. Like if I login at 3:05:27, it will display 03:05:27 but that's it. When it changes to 03:06 it will display 3:06:00 until the next minute rolls around 60 seconds later. Then it will show 03:07:00 and so on.

So I'm looking here and I see I need to somehow add refresh in there somewhere. But I can't for the life of me figure out where to put that. My guess is refresh needs to be set to 01 so the seconds will change every second but where and how do I tell it to do that?

Any help would be appreciated.

Also, I'm using a theming system which, I'm not sure where I got it anymore. But I like the look of it. So, it's not the original theme.lua that comes with AwesomeWM.

Solution: Add a comma then a 1 after " %H:%M:%S ") so that whole line will look like this:

local mytextclock = wibox.widget.textclock(markup("#7788af", "%A %d %B %r %S ") .. markup("#535f7a", ">") .. markup("#de5e1e", " %H:%M:%S "), 1)
13 Comments
2024/11/03
15:42 UTC

1

Awesome WM Keybinding Issue - Cannot Launch Thorium Browser

I’m having trouble getting a custom keybinding to launch the Thorium browser in Awesome WM. When I run the command manually in the terminal, like this:

It works perfectly, and the browser opens without any issues. However, when I add the same command to my Awesome WM configuration file (rc.lua) as a keybinding, nothing happens when I press the key combination.

Here’s the keybinding I’ve added to my config:

    os.execute("~/Packages/thorium/thorium")
end, {description = "open Thorium browser", group = "launcher"})
9 Comments
2024/10/31
16:56 UTC

1

How to switch between keyboard layouts with a keyboard shortcut in Awesome WM?

Context

I can't switch between keyboard layouts with Alt+CapsLock with Awesome WM (v4.3) on Debian 12.

I would like to use a French layout and the Programmer Dvorak layout (dvp).

I succeed to use these two layouts with the keyboard_layout extension by adding the following lines into my awesome config file rc.lua:

-- Keyboard map indicator and switcher
local keyboard_layout = require("keyboard_layout")

-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()

-- Create keyboard layout text label
local kbdcfg = keyboard_layout.kbdcfg({type = "tui"})
kbdcfg.add_primary_layout("Français", "FR", "fr")
kbdcfg.add_primary_layout("English", "US", "dvp")
kbdcfg.bind()


-- Mouse bindings keyboard layout 
kbdcfg.widget:buttons(
 awful.util.table.join(awful.button({ }, 1, function () kbdcfg.switch_next() end),
                       awful.button({ }, 3, function () kbdcfg.menu:toggle() end))
)

-- Switching keyboard layout shortcut
globalkeys = awful.util.table.join(globalkeys,
    -- CapsLock-Alt to change keyboard layout (from https://github.com/echuraev/keyboard_layout/issues/7#issuecomment-442742606)
    awful.key({"Caps_Lock"}, "Alt_L", function () kbdcfg.switch_next() end),
    -- Alt-CapsLock to change keyboard layout
    awful.key({"Mod1"}, "Caps_Lock", function () kbdcfg.switch_next() end) 
)

I am able to switch between layouts by clicking on the FR or US icon on the top right corner.

However, the keyboard shortcut Alt+CapsLock for switching between layouts does noting.

Question

How to set up a keyboard shortcut Alt+CapsLock for switching between layouts?

I managed to set up the layouts with the keyboard_layout extension but I'm completely open to solutions without this extension.

Attempts

  • I've tried with other layouts than dvp.
  • I've tried with other shortcut: CapsLock alone and Alt+*
  • I've tried to set "XkbOptions" "grp:alt_caps_toggle" (removing caps:none) in my X11 config file (i.e. /etc/X11/xorg.conf.d), see "Additional materials" section below.

None of this attempts permits to switch between layouts with a keyboard shortcut.

Additional materials

  • Content of my X11 config file (i.e. /etc/X11/xorg.conf.d) but it seems that it is completely ignored by Awesome:
Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "fr,us"
    Option "XkbModel" "pc105"
    Option "XkbVariant" ",dvp"
    Option "XkbOptions" "grp:alt_caps_toggle,caps:none"
EndSection
wget http://www.kaufmann.no/downloads/linux/kbddvp-1_2_1-src-linux.tgz
DVP_DIR=$(mktemp -t -d kbddvp.XXXXXX)
cat kbddvp-1_2_1-src-linux.tgz | gzip -d | tar xf - -C $DVP_DIR
pushd $DVP_DIR/kbddvp-1.2
chmod +x dvp.install.sh 
chmod +x dvp.postinst.sh 
sudo ./dvp.install.sh && sudo ./dvp.postinst.sh
  • Here is my entire rc.lua config file of Awesome WM:
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")

-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")

local tyrannical = require("tyrannical")

-- Load Debian menu entries
local debian = require("debian.menu")
local has_fdo, freedesktop = pcall(require, "freedesktop")

-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
    naughty.notify({ preset = naughty.config.presets.critical,
                     title = "Oops, there were errors during startup!",
                     text = awesome.startup_errors })
end

-- Handle runtime errors after startup
do
    local in_error = false
    awesome.connect_signal("debug::error", function (err)
        -- Make sure we don't go into an endless error loop
        if in_error then return end
        in_error = true

        naughty.notify({ preset = naughty.config.presets.critical,
                         title = "Oops, an error happened!",
                         text = tostring(err) })
        in_error = false
    end)
end
-- }}}

-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua")

-- This is used later as the default terminal and editor to run.
terminal = "x-terminal-emulator"
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"

-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
    awful.layout.suit.tile,
    awful.layout.suit.floating,
    awful.layout.suit.tile.left,
    awful.layout.suit.tile.bottom,
    awful.layout.suit.tile.top,
    --awful.layout.suit.fair,
    --awful.layout.suit.fair.horizontal,
    --awful.layout.suit.spiral,
    --awful.layout.suit.spiral.dwindle,
    awful.layout.suit.max,
    --awful.layout.suit.max.fullscreen,
    awful.layout.suit.magnifier,
    --awful.layout.suit.corner.nw,
    -- awful.layout.suit.corner.ne,
    -- awful.layout.suit.corner.sw,
    -- awful.layout.suit.corner.se,
}
-- }}}


-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
   { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awesome.conffile },
   { "restart", awesome.restart },
   { "quit", function() awesome.quit() end },
}

local menu_awesome = { "awesome", myawesomemenu, beautiful.awesome_icon }
local menu_terminal = { "open terminal", terminal }

if has_fdo then
    mymainmenu = freedesktop.menu.build({
        before = { menu_awesome },
        after =  { menu_terminal }
    })
else
    mymainmenu = awful.menu({
        items = {
                  menu_awesome,
                  { "Debian", debian.menu.Debian_menu.Debian },
                  menu_terminal,
                }
    })
end


mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
                                     menu = mymainmenu })

-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}

-- Keyboard map indicator and switcher
local keyboard_layout = require("keyboard_layout")

-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()

-- Create keyboard layout text label
local kbdcfg = keyboard_layout.kbdcfg({type = "tui"})
kbdcfg.add_primary_layout("Français", "FR", "fr")
kbdcfg.add_primary_layout("English", "US", "dvp")
kbdcfg.bind()


-- Mouse bindings keyboard layout 
kbdcfg.widget:buttons(
 awful.util.table.join(awful.button({ }, 1, function () kbdcfg.switch_next() end),
                       awful.button({ }, 3, function () kbdcfg.menu:toggle() end))
)

-- Switching keyboard layout shortcut
globalkeys = awful.util.table.join(globalkeys,
    -- CapsLock-Alt to change keyboard layout (from https://github.com/echuraev/keyboard_layout/issues/7#issuecomment-442742606)
    awful.key({"Caps_Lock"}, "Alt_L", function () kbdcfg.switch_next() end),
    -- Alt-CapsLock to change keyboard layout
    awful.key({"Mod1"}, "Caps_Lock", function () kbdcfg.switch_next() end) 
)

-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
                    awful.button({ }, 1, function(t) t:view_only() end),
                    awful.button({ modkey }, 1, function(t)
                                              if client.focus then
                                                  client.focus:move_to_tag(t)
                                              end
                                          end),
                    awful.button({ }, 3, awful.tag.viewtoggle),
                    awful.button({ modkey }, 3, function(t)
                                              if client.focus then
                                                  client.focus:toggle_tag(t)
                                              end
                                          end),
                    awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
                    awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
                )

local tasklist_buttons = gears.table.join(
                     awful.button({ }, 1, function (c)
                                              if c == client.focus then
                                                  c.minimized = true
                                              else
                                                  c:emit_signal(
                                                      "request::activate",
                                                      "tasklist",
                                                      {raise = true}
                                                  )
                                              end
                                          end),
                     awful.button({ }, 3, function()
                                              awful.menu.client_list({ theme = { width = 250 } })
                                          end),
                     awful.button({ }, 4, function ()
                                              awful.client.focus.byidx(1)
                                          end),
                     awful.button({ }, 5, function ()
                                              awful.client.focus.byidx(-1)
                                          end))

local function set_wallpaper(s)
    -- Wallpaper
    if beautiful.wallpaper then
        local wallpaper = beautiful.wallpaper
        -- If wallpaper is a function, call it with the screen
        if type(wallpaper) == "function" then
            wallpaper = wallpaper(s)
        end
        gears.wallpaper.set("#400000")
        -- gears.wallpaper.maximized(wallpaper, s, true)
    end
end

-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)

awful.screen.connect_for_each_screen(function(s)
    -- Wallpaper
    set_wallpaper(s)

    -- Each screen has its own tag table.


    -- Create a promptbox for each screen
    s.mypromptbox = awful.widget.prompt()
    -- Create an imagebox widget which will contain an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    s.mylayoutbox = awful.widget.layoutbox(s)
    s.mylayoutbox:buttons(gears.table.join(
                           awful.button({ }, 1, function () awful.layout.inc( 1) end),
                           awful.button({ }, 3, function () awful.layout.inc(-1) end),
                           awful.button({ }, 4, function () awful.layout.inc( 1) end),
                           awful.button({ }, 5, function () awful.layout.inc(-1) end)))
    -- Create a taglist widget
    s.mytaglist = awful.widget.taglist {
        screen  = s,
        filter  = awful.widget.taglist.filter.all,
        buttons = taglist_buttons
    }

    -- Create a tasklist widget
    s.mytasklist = awful.widget.tasklist {
        screen  = s,
        filter  = awful.widget.tasklist.filter.currenttags,
        buttons = tasklist_buttons
    }

    -- Create the wibox
    s.mywibox = awful.wibar({ position = "top", screen = s })

    -- Add widgets to the wibox
    s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            layout = wibox.layout.fixed.horizontal,
            mylauncher,
            s.mytaglist,
            s.mypromptbox,
        },
        s.mytasklist, -- Middle widget
        { -- Right widgets
            layout = wibox.layout.fixed.horizontal,
            kbdcfg.widget,
            wibox.widget.systray(),
            mytextclock,
            s.mylayoutbox,
        },
    }
end)
-- }}}


-- {{{ Mouse bindings
root.buttons(gears.table.join(
    awful.button({ }, 3, function () mymainmenu:toggle() end),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}

-- {{{ Key bindings
globalkeys = gears.table.join(
    awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
              {description="show help", group="awesome"}),
    awful.key({ modkey,           }, ",",   awful.tag.viewprev,
              {description = "view previous", group = "tag"}),
    awful.key({ modkey,           }, ";",  awful.tag.viewnext,
              {description = "view next", group = "tag"}),
    awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
              {description = "go back", group = "tag"}),

    awful.key({ modkey,           }, "j",
        function ()
            awful.client.focus.byidx( 1)
        end,
        {description = "focus next by index", group = "client"}
    ),
    awful.key({ modkey,           }, "k",
        function ()
            awful.client.focus.byidx(-1)
        end,
        {description = "focus previous by index", group = "client"}
    ),
    awful.key({ modkey,           }, "w", function () mymainmenu:show() end,
              {description = "show main menu", group = "awesome"}),

    -- Layout manipulation
    awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
              {description = "swap with next client by index", group = "client"}),
    awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
              {description = "swap with previous client by index", group = "client"}),
    awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
              {description = "focus the next screen", group = "screen"}),
    awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
              {description = "focus the previous screen", group = "screen"}),
    awful.key({ modkey,           }, "u", awful.client.urgent.jumpto,
              {description = "jump to urgent client", group = "client"}),
    awful.key({ modkey,           }, "Tab",
        function ()
            awful.client.focus.history.previous()
            if client.focus then
                client.focus:raise()
            end
        end,
        {description = "go back", group = "client"}),

    -- Standard program
    awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end,
              {description = "open a terminal", group = "launcher"}),
    awful.key({ modkey, "Control" }, "r", awesome.restart,
              {description = "reload awesome", group = "awesome"}),
    awful.key({ modkey, "Shift"   }, "q", awesome.quit,
              {description = "quit awesome", group = "awesome"}),

    awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
              {description = "increase master width factor", group = "layout"}),
    awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
              {description = "decrease master width factor", group = "layout"}),
    awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
              {description = "increase the number of master clients", group = "layout"}),
    awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
              {description = "decrease the number of master clients", group = "layout"}),
    awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
              {description = "increase the number of columns", group = "layout"}),
    awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
              {description = "decrease the number of columns", group = "layout"}),
    awful.key({ modkey,           }, "space", function () awful.layout.inc( 1)                end,
              {description = "select next", group = "layout"}),
    awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(-1)                end,
              {description = "select previous", group = "layout"}),

    awful.key({ modkey, "Control" }, "n",
              function ()
                  local c = awful.client.restore()
                  -- Focus restored client
                  if c then
                    c:emit_signal(
                        "request::activate", "key.unminimize", {raise = true}
                    )
                  end
              end,
              {description = "restore minimized", group = "client"}),

    -- Dmenu
    awful.key({ modkey },            "r",     function () 
              awful.util.spawn("dmenu_run") end,
              {description = "run dmenu", group = "launcher"}),
              
    -- Firefox
    awful.key({ modkey },            "b",     function () 
              awful.util.spawn("firefox") end,
              {description = "firefox", group = "applications"}),

    awful.key({ modkey }, "x",
              function ()
                  awful.prompt.run {
                    prompt       = "Run Lua code: ",
                    textbox      = awful.screen.focused().mypromptbox.widget,
                    exe_callback = awful.util.eval,
                    history_path = awful.util.get_cache_dir() .. "/history_eval"
                  }
              end,
              {description = "lua execute prompt", group = "awesome"}),
    -- Menubar
    awful.key({ modkey }, "p", function() menubar.show() end,
              {description = "show the menubar", group = "launcher"})
)

clientkeys = gears.table.join(
    awful.key({ modkey,           }, "f",
        function (c)
            c.fullscreen = not c.fullscreen
            c:raise()
        end,
        {description = "toggle fullscreen", group = "client"}),
    awful.key({ modkey,  }, "q",      function (c) c:kill()                         end,
              {description = "close", group = "client"}),
    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
              {description = "toggle floating", group = "client"}),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
              {description = "move to master", group = "client"}),
    awful.key({ modkey,           }, "o",      function (c) c:move_to_screen()               end,
              {description = "move to screen", group = "client"}),
    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
              {description = "toggle keep on top", group = "client"}),
    awful.key({ modkey,           }, "n",
        function (c)
            -- The client currently has the input focus, so it cannot be
            -- minimized, since minimized clients can't have the focus.
            c.minimized = true
        end ,
        {description = "minimize", group = "client"}),
    awful.key({ modkey,           }, "m",
        function (c)
            c.maximized = not c.maximized
            c:raise()
        end ,
        {description = "(un)maximize", group = "client"}),
    awful.key({ modkey, "Control" }, "m",
        function (c)
            c.maximized_vertical = not c.maximized_vertical
            c:raise()
        end ,
        {description = "(un)maximize vertically", group = "client"}),
    awful.key({ modkey, "Shift"   }, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c:raise()
        end ,
        {description = "(un)maximize horizontally", group = "client"})
)

-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
    globalkeys = gears.table.join(globalkeys,
        -- View tag only.
        awful.key({ modkey }, "#" .. i + 9,
                  function ()
                        local screen = awful.screen.focused()
                        local tag = screen.tags[i]
                        if tag then
                           tag:view_only()
                        end
                  end,
                  {description = "view tag #"..i, group = "tag"}),
        -- Toggle tag display.
        awful.key({ modkey, "Control" }, "#" .. i + 9,
                  function ()
                      local screen = awful.screen.focused()
                      local tag = screen.tags[i]
                      if tag then
                         awful.tag.viewtoggle(tag)
                      end
                  end,
                  {description = "toggle tag #" .. i, group = "tag"}),
        -- Move client to tag.
        awful.key({ modkey, "Shift" }, "#" .. i + 9,
                  function ()
                      if client.focus then
                          local tag = client.focus.screen.tags[i]
                          if tag then
                              client.focus:move_to_tag(tag)
                          end
                     end
                  end,
                  {description = "move focused client to tag #"..i, group = "tag"}),
        -- Toggle tag on focused client.
        awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
                  function ()
                      if client.focus then
                          local tag = client.focus.screen.tags[i]
                          if tag then
                              client.focus:toggle_tag(tag)
                          end
                      end
                  end,
                  {description = "toggle focused client on tag #" .. i, group = "tag"})
    )
end

clientbuttons = gears.table.join(
    awful.button({ }, 1, function (c)
        c:emit_signal("request::activate", "mouse_click", {raise = true})
    end),
    awful.button({ modkey }, 1, function (c)
        c:emit_signal("request::activate", "mouse_click", {raise = true})
        awful.mouse.client.move(c)
    end),
    awful.button({ modkey }, 3, function (c)
        c:emit_signal("request::activate", "mouse_click", {raise = true})
        awful.mouse.client.resize(c)
    end)
)

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
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,
                     screen = awful.screen.preferred,
                     placement = awful.placement.no_overlap+awful.placement.no_offscreen
     }
    },

    -- Floating clients.
    { rule_any = {
        instance = {
          "DTA",  -- Firefox addon DownThemAll.
          "copyq",  -- Includes session name in class.
          "pinentry",
        },
        class = {
          "Arandr",
          "Blueman-manager",
          "Gpick",
          "Kruler",
          "MessageWin",  -- kalarm.
          "Sxiv",
          "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
          "Wpa_gui",
          "veromix",
          "xtightvncviewer"},

        -- Note that the name property shown in xprop might be set slightly after creation of the client
        -- and the name shown there might not match defined rules here.
        name = {
          "Event Tester",  -- xev.
        },
        role = {
          "AlarmWindow",  -- Thunderbird's calendar.
          "ConfigManager",  -- Thunderbird's about:config.
          "pop-up",       -- e.g. Google Chrome's (detached) Developer Tools.
        }
      }, properties = { floating = true }},

    -- Add titlebars to normal clients and dialogs
    { rule_any = {type = { "normal", "dialog" }
      }, properties = { titlebars_enabled = true }
    },

    -- Set Firefox to always map on the tag named "2" on screen 1.
    -- { rule = { class = "Firefox" },
    --   properties = { screen = 1, tag = "2" } },
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
    -- Set the windows at the slave,
    -- i.e. put it at the end of others instead of setting it master.
    -- if not awesome.startup then awful.client.setslave(c) end

    if awesome.startup
      and not c.size_hints.user_position
      and not c.size_hints.program_position then
        -- Prevent clients from being unreachable after screen count changes.
        awful.placement.no_offscreen(c)
    end
end)

-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
    -- buttons for the titlebar
    local buttons = gears.table.join(
        awful.button({ }, 1, function()
            c:emit_signal("request::activate", "titlebar", {raise = true})
            awful.mouse.client.move(c)
        end),
        awful.button({ }, 3, function()
            c:emit_signal("request::activate", "titlebar", {raise = true})
            awful.mouse.client.resize(c)
        end)
    )

    awful.titlebar(c) : setup {
        { -- Left
            awful.titlebar.widget.iconwidget(c),
            buttons = buttons,
            layout  = wibox.layout.fixed.horizontal
        },
        { -- Middle
            { -- Title
                align  = "center",
                widget = awful.titlebar.widget.titlewidget(c)
            },
            buttons = buttons,
            layout  = wibox.layout.flex.horizontal
        },
        { -- Right
            awful.titlebar.widget.floatingbutton (c),
            awful.titlebar.widget.maximizedbutton(c),
            awful.titlebar.widget.stickybutton   (c),
            awful.titlebar.widget.ontopbutton    (c),
            awful.titlebar.widget.closebutton    (c),
            layout = wibox.layout.fixed.horizontal()
        },
        layout = wibox.layout.align.horizontal
    }
end)

-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
    c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)

client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}


-- Windows border gaps
beautiful.useless_gap = 5

-- autostart apps
awful.util.spawn("firefox")


-- Collision plugin
require("collision")()
  • I am using a Typmatrix 2030 keyboard.

FYI: Question originally asked on Codidact

16 Comments
2024/10/26
13:38 UTC

3

Focus client on tasklist hover

Is it possible to focus client when i hover over its name in tasklist widget?

Tried "mouse::enter" but cant get client name under cursor, only tasklist object...

1 Comment
2024/10/23
23:38 UTC

2

How to make tasklist width to get all available space?

How can i make my tasklist not to cut off client names when it have free enough space to render them full?

My current widget code:

    }    s.mytasklist = awful.widget.tasklist {
        screen   = s,
        filter   = awful.widget.tasklist.filter.currenttags,
        buttons  = awful.util.tasklist_buttons,
        layout   = {
            spacing = 30,
            layout  = wibox.layout.flex.horizontal
        },
    }

I tried to use "wibox.layout.fixed.horizontal", it works, but than i have problem with tags don't fit in my task list (when they have long names). And in these cases some tags are not visible in tasklist at all...

https://preview.redd.it/bhcjue8x4lwd1.jpg?width=1920&format=pjpg&auto=webp&s=25594750e43e8bea71b12379b57a1b617b6dfcfa

1 Comment
2024/10/23
22:47 UTC

4

Cool things to use ctrl+x/run lua code for ?

Hi,

I have been using awesome for more than a decade and a half and only recently found out about super+p.

Which led me to super+x. I never used it for anything. What kind of cool things are people using it for ?

1 Comment
2024/10/20
19:08 UTC

1

Weird bug: sometimes super+shift+2 (also +5 sometimes) just doesn't work.

Hi,

I have had this bug for years now. From time to time it's impossible to move window to tag number 2 (sometimes 5) by using super+shift+2. I check with xev that key 2 is working, other tags work but tag number 2 is stubborn.

Any idea what could cause that ? There isn't anything specific about that tag in my config, no auto tag, just standard 1,2,3.

3 Comments
2024/10/20
19:06 UTC

2

Question about modifying configs (and text editors)

I've started using awesomewm for almost a year now, and i have yet to find a fix for this (or i just suck a googling) so i guess ill just make a post myself

When editing awesomewm configs, rc.lua and such, how do i get not shit support (with vscode, that is)

it constantly gets mad cause theres non-defined globals, and get autocomplete is completely out of the question

I know that there *has* to be a way to get this to work, i just cant figure out out

1 Comment
2024/10/20
07:36 UTC

1

Client spawns on wrong tag

I have setup in rc.lua to spawn firefox client on screen 3 and tag 1, and when i create new clients they spawn properly. But when client spawns on awesome restart (tried with console script and with awful.spawn.once) it spawns on tag where i placed it last time.

For example: i spawn firefox - it spawns on tag 1, than i move it to tag 3 and close.
Than restart awesome and it spawns at tag 3 (or maybe it spawns on tag 1 and immediatly moves to tag 3)

Is it normal or bug?

{ 
   rule_any = { class = {"Firefox", "firefox-esr"} },
   properties = { screen = 3, tag = "1" } 
}, 

awful.spawn.once("firefox-esr", {
    screen = 3, tag = "1"
})
2 Comments
2024/10/19
23:33 UTC

2

Is there a way to keep my tag setup when switching screens?

Part of my odyssey to convert my desktop workflow to the laptop :)

I would like to use awesome with two different setups:

  • When my laptop is docked (90+% of the time), I exclusively use the external monitor. The laptop monitor is turned off, the lid is closed.
  • When I unplug, I will obviously use the laptop screen.

Now, I've managed to get that working with a simple script that parses xrandr and runs one of two possible xrandr incantations. I'm fine doing this manually as I only need it every few days, no big deal.

The issue is that switching monitors like this moves all of my windows to tag 1 of the new monitor, which forces me to redo whatever setup I had. Is there any way to avoid this? I'd like the new screen to have the same tag-client association as before.

Thanks in advance!

2 Comments
2024/10/17
14:17 UTC

2

Tried compiling and running picom-jonaburg on fedora, and Kitty broke / got corrupted.

How kitty appears now

I'm running AwesomeWM on Fedora, and i added this to my rc.lua to get picom to run on startup, but when i opened Kitty, it showed some weird symbol along with the battery level? I have no idea what the error is, any ideas on how to fix this?

local handle = io.popen("pgrep -f " .. cmd)
    local result = handle:read("*a")
    handle:close()
    if result == "" then
        awful.spawn.with_shell("picom --experimental-backend --config ~/.config/picom/picom.conf")
endlocal

2 Comments
2024/10/16
08:01 UTC

2

Titlebars not working the way I think they should

I am not sure if I am misunderstanding how titlebars should be working or not.

I am using a default rc.lua file. with version 4.3

awesome v4.3 (Too long)
 • Compiled against Lua 5.3.6 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.6
 • LGI version: 0.9.2

In my config file I have tried setting up a rule for my wezterm to have a titlebar:

awful.rules.rules = {    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
      properties = { floating = true } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
    { rule = { class = "org.wezfurlong.wezterm" },
      properties = { floating = true, titlebars_enabled = true, } },
}

later in the file i have set local titlebars_enabled = false

When I restart awesome and load wezterm, there are no titlebars. Is this not how this is supposed to work ? I have tried other applications there also like kitty, firefox, etc with the same results. Is there something I am missing ?

4 Comments
2024/10/14
17:30 UTC

2

Prompt with tab autocomplete

Currently working on creating a prompt widget that has tab autocompletion: when the "tab" key is pressed, the text should update with the first command that matches the substring. Although, I'm stuck with getting the prompt textbox to actually display the new text. Currently, I have this:

-- Make a console the user can type commands into. 
local function command_prompt() 
    awful.prompt.run {
        prompt = "<b>$ </b>", 
        text = "", 
        bg_cursor = "#000000", 
        textbox = mouse.screen.mypromptbox.widget, 
        exe_callback = function(input) 
            if not input or #input == 0 then return end 
            command = "bash -c '" .. input .. "'" 
            awful.spawn.easy_async(command, function() end) 
        end, 
        keypressed_callback = function(mod, key, command) 
            if key == 'Tab' then
                -- Get the list of files in /usr/bin
                for dir in io.popen([[ls -pa /usr/bin | grep -v /]]):lines() do 
                    if string.sub(dir, 1, string.len(command)) == command then 
                        mouse.screen.mypromptbox.widget.text = dir
                        break 
                    end
                end 
            end
        end
    }
end 

Basically, exe_callback runs the command with bash, and keypressed_callback attempts to replace the incomplete text with a full command if a command in /usr/bin begins with the incomplete text. The problem is that setting the prompt widget text to the new text (mouse.screen.mypromptbox.widget.text = dir) does not persist outside of the function. In other words, widget.text is getting re-set somewhere outside of the function.

Is there another way of auto-completing the prompt with the tab key? Thanks for the help! :+)

1 Comment
2024/10/13
15:40 UTC

2

Are these work styles possible with a tiling WM?

Hi, I've been considering switching to a tiling window manager for a while now, but since I don't have much time to install and experiment with them, I've been reading articles and watching videos before making the leap.

Currently, I'm using a combination of some half-baked Gnome extensions that allow me to tile windows manually.

I’m curious if the following work scenarios are possible with a true tiling WM:

1) Always knowing where your windows are is often advertised as one of the main benefits of tiling WMs. I understand that users of tiling WMs typically organize their applications across multiple workspaces, assigning specific apps to specific spaces. For example, Firefox on workspace #1, Spotify on #2, etc.

My workflow is a bit different. I often work with applications in pairs. For instance, when reading a web article and taking notes, I place Firefox on the left side and Obsidian on the right. When programming, I use VS Code on the left and Firefox (for Python documentation) on the right. Similarly, I might have VS Code on the left and a Git client on the right.

Is it possible to set up workspaces where I have Firefox + Obsidian on one, VS Code + Firefox on another, and VS Code + Git on yet another? I realize I could open multiple main windows of Firefox and VS Code, but I’d prefer to “mirror” the same window across multiple workspaces.

Can the WM automatically arrange these windows when the apps are launched?

2) Since some apps take a considerable amount of time to start, I prefer to keep them running even when I'm not actively interacting with them. In a stacking WM, these apps naturally "fall behind" and get obscured by other windows. However, from what I understand, tiling WMs tend to keep all windows visible at all times.

How is this issue typically managed in tiling WMs?

3) I don’t like certain apps, like VS Code or the terminal, to take up the whole screen. I have a wide 33" monitor, and when VS Code is maximized, it shows a relatively narrow 120 columns wide stripe of code on the left, while the Ctrl+F search dialog ends up way over on the right. (Yes, it’s pretty ridiculous.) So, I’d prefer to have the window occupy only half the screen upon launch, leaving the other half of the desktop empty.

Are there tiling WMs that can automatically manage window placement in this way, or do windows always take up the entire screen if no other window is open?

4 Comments
2024/10/11
09:21 UTC

3

can't access wibox.container.arcchart value field and redraw it

Im trying to create volume widget which will be controlled by mouse wheel. Also i want it to change arcchart value when volume changes. After trying many ways to acces value field idk what to do because it always says that im trying to change nil value

https://preview.redd.it/6brt7u78rytd1.png?width=175&format=png&auto=webp&s=466e033b962c6e486fc30d4e1a074f6fb785297e

https://preview.redd.it/64bm6serqytd1.png?width=1411&format=png&auto=webp&s=315d06bad1838d4ec4367290748ca394d3184250

https://preview.redd.it/m3lx1b0grytd1.png?width=734&format=png&auto=webp&s=323bc52f9de3ceb09ecf68557549ab7a692c12d3

help plz

5 Comments
2024/10/10
17:27 UTC

3

Windows misbehaving at startup

Hi all,

I'm finding it rather difficult to describe this problem (and Google doesn't seem to help), so please bare with me.

Some of the windows I start are misbehaving in Awesome:

  • At least Firefox and Chrome always start up as maximized, floating, and I can't seem to get them to tile. I've "solved" this by logging back into Ubuntu's default window manager, unmaximizing them, closing them, then restarting Awesome and, lo and behold, they are now being tiled.
  • Similarly, Firefox always starts on tag 2, presumably because I had it on virtual desktop 2 in the other wm. The same trick didn't work here: I went back, moved Firefox back to virtual desktop 1, closed it, restarted Awesome, but Firefox still obstinately starts on tag 2.

What are possible leads I can follow to debug this? I've been very happily using tiling WMs for many years, but I don't know where to start debugging, awesome has always done the right thing.

Thanks in advance!

4 Comments
2024/10/10
09:11 UTC

2

Awesome git not starting

Has built latest awesome-git with cmake as deb package (running Debian 12), removed awesome 4.3 (apt remove awesome) and installed git version via apt. And after restarting awesome i have black screen and nothing is working(

I can switch to tty2, kill xorg, then restart x and have the same result - black screen.

If i remove awesome-git (apt remove) and install awesome from repo - all working again.

Tried with default config (no rc.lua in .config) - same result, nothing working.

All dependencies should be in place as i built git version on this system

Where can i look for some logs/errors? In docs they say that all info should go in stderr, but after i killing x from tty2, there is no info related to awesome in tty1, only standart xorg logs...

7 Comments
2024/10/09
13:22 UTC

4

Tabbed Layout

I really want to implement a tabbed layout (similar to the tabs on a web browser). I don't like when windows are on top of one another and depending on my work flow I don't really like master/slave and many other layouts. The tabbed view is similar to having windows stacked but at least you have a better idea where each of them are. I know many people might recommend using i3 or another WM but I really like AwesomeWM for a lot of the other features and some custom features I implemented. What's the best way to implement a tabbed layout? I searched the sub but couldn't find much that was useful.

4 Comments
2024/10/08
23:43 UTC

3

Show Client Icons in the Taglist?

I'm trying to modify the taglist in a way that it show the application Icons for all Clients on that specific tag. In the documentation for the taglist i haven't found anything that makes that information available.

Any hints on how i could do this?

4 Comments
2024/10/08
08:41 UTC

4

4k monitor tips

Anyone have any tips to make make using linux on HiDPI monitors, everything is so tiny in awesome. Changing my dpi fixes some stuff like status bar but things like firefox and the terminal are tiny. I could change the font size in my terminal but idk about firefox, is there a universal way to change it like in desktop managers?

6 Comments
2024/10/05
23:20 UTC

1

Fullscreen steam games starting misaligned.

Hello. I have an issue where steam games starting in fullscreen are placed below the wibar.

I'm struggling to find the correct rule properties to fix this. Of course, if I just set x=0, y=0, it works, but I don't want to put non-fullscreen windows there.

Any hints?

6 Comments
2024/10/05
10:03 UTC

3

Wanting to set some behaviors around vlc, would this be done via rules?

I have two types of behaviors I am interested in configuring, or implementing if necessary.

Sometimes when a a new video plays in a playlist in VLC at fullscreen, the mouse cursor will not show above it unless I move t another screen and back, or minimize and the restore vlc. Are rules the type of thing that could solve this behavior, by setting a rule to always have the cursor in front of vlc? Basically, cursor always on top property for certain windows?

Or is there a better way to solve that?

Similar kind of issue, some media titles are so long that the right side panel with icons (e.g. minizmie, maximize, restore) can not be without resizing the window to be long enough.

Is there also any way to setup a rule so that the title bar icons would always be shown no matter what? If this is not a rule of config option, would it be necessary to patch the code?

8 Comments
2024/10/04
21:43 UTC

4

Can AwesomeWM be controlled from CLI/script

Hi :)

I am doing some research to have to setup a UI workflow where I only can control the WM through scripts that are triggered on keypresses.

I think AwesomeWM looks amazing and I love configuring via lua.

Can all parts of AwesomeWM be controlled from CLI scripts/commands?

Eg. do whatever with currently focused window..?

2 Comments
2024/10/02
13:49 UTC

0

Bluetooth does not work in the git version of Awesome

Guys, I'm having a hard time activating Bluetooth in Awesome-git version. In the normal version of the Arch repository or any other WM or DE, it is quite simple to activate (I've done innumerary) but I am difficult to activate in Awesome-git ... I have activated Bluetooth, Bluez, Bluez-Obx and nothing It works. Someone can help me solve this;-;

9 Comments
2024/09/30
22:19 UTC

1

having trouble creating my own wibox widget

I am having trouble making my own wibox widget. I want it to spawn a widget.textbox() with a countdown that refreshes every minute.

There isn't really any good boilerplate template resources for making plugins in awesome (as far as I've seen). Any help is appreciated :)

1 Comment
2024/09/29
14:26 UTC

Back To Top