How To: Awesome WM with Debian/Ubuntu


Recommended Posts

How to: Awesome WM 2.3.4 with Debian/Ubuntu/*buntu

First, install the awesome wm package ? apt-get install awesome (which will be the 2.3.4 version)

Once installation is complete, most of the customization will be done in the .awesomerc file.

This will be located in your ~/user directory

The default setup is simple to read, for the most part, and configuration parameters are plainly laid out.

To boot into your Awesome WM session, log out of your current desktop and you should be able to select it from your session menu. In my case, I edited the .Xsession file to include awesome and all relevant programs as my xclient session.

Here is my ~/.Xsession file:

gnome-power-manager &

nm-applet & 

gnome-screensaver &

feh --bg-scale /home/lance/images/wallpapers/shared/Geeky/1270448911455.jpg

sh /home/lance/.awesome/awesomeclock.sh &



exec awesome

The above file loads the gnome-power-manager for logouts and sleep mode, along with nm-applet for wireless networking. It also displays the default wallpaper using feh (which is installable by using apt-get install feh), and a script to display a clock with the current date.

The clock script is as follows:

#!/bin/sh

while true

do

    echo "0 widget_tell mystatusbar clock text " \

         "`date +"%A %B %d, %Y %l:%M %p"`" | awesome-client

    sleep 1

done

Paste the above text into a text file and save as awesomeclock.sh in your .awesome directory.

This is called by the .awesomerc config file, which I have added below. The statusbar section will call the widgets displayed. Paste this snippet at the bottom of the statusbar section to call the clock script. The .Xsession file will call the script at boot.

 textbox clock

        {

            text = "-"

            align = "right"

        }

     }

}

I have also installed dmenu, an application launcher that displays in your status bar. In my .awesomerc, I have set up the menu to launch using the Windows (Mod4) key +p. Just type the first few letters of the application to launch, and it will be displayed in the menu. Press Enter to execute.

I am still working on getting more widgets/status displays in the status bar to show cpu, mem, and disk space. Once I get it working, I will add it to this post.

BTW, visit http://awesome.naquadah.org/wiki/Main_Page for Awesome shortcuts and tips/tricks.

Also, to check that your .awesomerc file is correct, you can type awesome -k at the command prompt in the terminal. If it is not correct, errors will be displayed.

This is by no means an end-all-be-all intro to Awesome, just something to get your feet wet.

Here is my full .awesomerc:

screen 0
{
    styles
    {
        normal
        {
            font = "sans 7"
            fg = "#cccccc"
            bg = "#444444"
            border = "#555555"
        }
        focus
        {
            fg = "#000000"
            bg = "#666666"
            border = "#535d6c"
        }
        urgent
        {
            fg = "#111111"
            bg = "#ff4500"
        }
    }
    tags
    {
        tag main { }
        tag www{ }
        tag mail{ }
        tag media{ }
        tag term { }
        #tag  { }
        #tag 7 { }
        #tag 8 { }
        #tag 9 { }
    }
    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"
        height = "17"

        taglist mytaglist
        {
            mouse
            {
                button = "1"
                command = "tag_view"
            }
            mouse
            {
                button = "1"
                modkey = {"Mod4"}
                command = "client_tag"
            }
            mouse
            {
                button = "3"
                command = "tag_toggleview"
            }
            mouse
            {
                button = "3"
                modkey = {"Mod4"}
                command = "client_toggletag"
            }
            mouse
            {
                button = "4"
                command = "tag_viewnext"
            }
            mouse
            {
                button = "5"
                command = "tag_viewprev"
            }
        }
        layoutinfo mylayoutinfo
        {
            mouse
            {
                button = "1"
                command = "tag_setlayout"
                arg = "+1"
            }
            mouse
            {
                button = "4"
                command = "tag_setlayout"
                arg = "+1"
            }
            mouse
            {
                button = "3"
                command = "tag_setlayout"
                arg = "-1"
            }
            mouse
            {
                button = "5"
                command = "tag_setlayout"
                arg = "-1"
            }
        }
        tasklist mytasklist
        {
            show_icons = false

            mouse
            {
                button = "4"
                command = "client_focusnext"
            }
            mouse
            {
                button = "5"
                command = "client_focusprev"
            }
            mouse
            {
                modkey = {"Mod4"}
                button = "4"
                command = "client_swapnext"
            }
            mouse
            {
                modkey = {"Mod4"}
                button = "5"
                command = "client_swapprev"
            }
        }
        iconbox logo
        {
           image = "/usr/share/awesome/icons/awesome16.png"
            mouse
            {
                button = "1"
                command = "spawn"
                arg = "exec x-terminal-emulator -e man awesome"
           }
        }
        textbox clock
        {
            text = "-"
            align = "right"
        }
     }
}

rules
{
    rule { name = "Gimp" float = true }
    rule { name = "MPlayer" float = true }
    rule { name = "Acroread" float = true }
    rule { name = "pinentry" float = true }
    rule { name = "gedit" float = true }
    rule { name = "pidgin" float = true }
}

mouse
{
    root
    {
        button = "3"
        command = "spawn"
        arg = "exec x-terminal-emulator"
    }
    root
    {
        button = "4"
        command = "tag_viewnext"
    }
    root
    {
        button = "5"
        command = "tag_viewprev"
    }
    client
    {
        modkey = {"Mod4"}
        button = "1"
        command = "client_movemouse"
    }
    client
    {
        modkey = {"Mod4"}
        button = "2"
        command = "client_zoom"
    }
    client
    {
        modkey = {"Mod4"}
        button = "3"
        command = "client_resizemouse"
    }
    titlebar
    {
        button = "1"
        command = "client_movemouse"
    }
    titlebar
    {
        button = "3"
        command = "client_resizemouse"
    }
}

keys
{
    key
    {
        modkey = {"Mod4"}
        key = "F1"
        command = "spawn"
        arg = "exec x-terminal-emulator -e man `for i in /usr/share/man/man?;do ls $i; done | cut -d. -f1 | awesome-menu 'See manual page for:'`"
    }
    key
    {
        modkey = {"Mod4"}
        key = "F2"
        command = "spawn"
        arg = "exec find /usr/bin -type f -executable ! -empty | sed 's,.*/,,' | awesome-menu -e 'exec ' Execute:"
    }
    key
    {
        modkey = {"Mod4"}
        key = "F3"
        command = "spawn"
        arg = "exec x-terminal-emulator -e ssh `cut -d' ' -f1 ~/.ssh/known_hosts | cut -d, -f1 | awesome-menu 'ssh to:'`"
    }
    key
    {
        modkey = {"Mod4"}
        key = "Return"
        command = "spawn"
        arg = "exec x-terminal-emulator"
    }
    key
    {
        modkey = {"Mod4"}
        key = "space"
        command = "tag_setlayout"
        arg = "+1"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "space"
        command = "tag_setlayout"
        arg = "-1"
    }
    key
    {
        modkey = {"Mod4"}
        key = "b"
        command = "statusbar_toggle"
    }
    key
    {
        modkey = {"Mod4"}
        key = "j"
        command = "client_focusnext"
    }
    key
    {
        modkey = {"Mod4"}
        key = "k"
        command = "client_focusprev"
    }
    key
    {
        modkey = {"Mod4"}
        key = "p"
        command = "spawn"
        arg = "dmenu_path | awesome-menu -e 'exec ' Execute:"
    }
     key
    {
        modkey = {"Mod4"}
        key = "Tab"
        command = "focus_history"
        arg = "-1"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "j"
        command = "client_swapnext"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "k"
        command = "client_swapprev"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "j"
        command = "screen_focus"
        arg = "+1"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "k"
        command = "screen_focus"
        arg = "-1"
    }
    key
    {
        modkey = {"Mod4"}
        key = "h"
        command = "tag_setmwfact"
        arg = "-0.05"
    }
    key
    {
        modkey = {"Mod4"}
        key = "l"
        command = "tag_setmwfact"
        arg = "+0.05"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "h"
        command = "tag_setnmaster"
        arg = "+1"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "l"
        command = "tag_setnmaster"
        arg = "-1"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "h"
        command = "tag_setncol"
        arg = "+1"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "l"
        command = "tag_setncol"
        arg = "-1"
    }
    key
    {
        modkey = {"Mod4"}
        key = "Escape"
        command = "tag_prev_selected"
    }
    key
    {
        modkey = {"Mod4"}
        key = "Left"
        command = "tag_viewprev"
    }
    key
    {
        modkey = {"Mod4"}
        key = "Right"
        command = "tag_viewnext"
    }
    key
    {
        modkey = {"Mod4"}
        key = "m"
        command = "client_togglemax"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "Return"
        command = "client_zoom"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "space"
        command = "client_togglefloating"
    }
    key
    {
        modkey = {"Mod4"}
        key = "s"
        command = "client_togglescratch"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "s"
        command = "client_setscratch"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "c"
        command = "client_kill"
    }
    key
    {
        modkey = {"Mod4", "Shift"}
        key = "q"
        command = "quit"
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "r"
        command = "restart"
    }
    key  # dmenu launcher
    {
        modkey = {"Mod4", "Shift"}
        key = "p"
        command = "spawn"
        arg = "dmenu_path | awesome-menu -e 'exec ' Execute:"
    }
    key
    {
       modkey = {"Mod4"}
       key = "0"
       command = "tag_view"
    }
    keylist
    {
        modkey = {"Mod4"}
        command = "tag_view"
        keylist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
        arglist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
    }
    key
    {
        modkey = {"Mod4", "Control"}
        key = "0"
        command = "tag_toggleview"
    }
    keylist
    {
        modkey = {"Mod4", "Control"}
        command = "tag_toggleview"
        keylist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
        arglist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
    }

    key
    {
        modkey = {"Mod4", "Shift"}
        key = "0"
        command = "client_tag"
    }
    keylist
    {
        modkey = {"Mod4", "Shift"}
        command = "client_tag"
        keylist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
        arglist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
    }

    key
    {
        modkey = {"Mod4", "Shift", "Control"}
        key = "0"
        command = "client_toggletag"
    }
    keylist
    {
        modkey = {"Mod4", "Shift", "Control"}
        command = "client_toggletag"
        keylist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
        arglist = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
    }
   }
# vim: filetype=conf 

I may have left out something in this post. If there are any questions or you can't get something working, I'll try my best to answer. :)

  • Like 2
Link to comment
https://www.neowin.net/forum/topic/901758-how-to-awesome-wm-with-debianubuntu/
Share on other sites

Some common Awesome commands:

(Mod key - 'Windows' key)

Mod+space = rotate open screen layout

Mod+h or l = scale focused window left or right, makes the window larger or smaller

Right-click on the empty screen to launch terminal

Mod + F1 = terminal

Mod + F2 = Awesome Menu

Mod + b = statusbar toggle

Mod + Ctrl + R = Reload Awesome

Mod + Shift + Q = Quit to login screen

Those listed above are the ones I use the most. More shortcuts can be found in the 'key' section of the .awesomerc file.

Thanks for posting this (Y) As soon as I get some time I'll try it, I've never played with tiling wm's before.

No problem :). Ive been using Awesome off and on for a while - I seem to keep coming back to it. Hopefully my rudimentary guide will help out.

Awesome is an awesome window manager. Personally, I prefer dwm, though. (Y)

I like DWM as well. It is installed by default on #!, although I never could tweak it to my likings. I may give it another shot though - I have heard good things about it. Also Xmonad as well.

Love the background, but that's it. Sorry, looks a little too barebones for me! Thanks for the guide, though. A good learning experience!

I understand completely. I kept going more minimalistic in my DE/WMs, not sure you can go more minimalistic than this. ;)

I like minimal. I'm thinking I'll try this soon.

One question. In Ubuntu, Openbox has a feature I really like--holding down superkey brings up a little toggle where you can press the arrow keys to go through your open windows. I like avoiding the mouse as much as possible. Does Awesome do this, or at least can it be made to do this?

I like minimal. I'm thinking I'll try this soon.

One question. In Ubuntu, Openbox has a feature I really like--holding down superkey brings up a little toggle where you can press the arrow keys to go through your open windows. I like avoiding the mouse as much as possible. Does Awesome do this, or at least can it be made to do this?

Mod+J will change focus to the open windows, one by one. Mod + arrow keys will rotate through the different desktops.

I found some help on the interwebs about a load average/clock script that will display in the statusbar. For those that are unsure how a load average works, from our friends at wikipedia:

For example, one can interpret a load average of "1.73 0.50 7.98" on a single-CPU system as:

* during the last minute, the CPU was overloaded by 73% (1 CPU with 1.73 runnable processes, so that 0.73 processes had to wait for a turn)

* during the last 5 minutes, the CPU was underloaded 50% (no processes had to wait for a turn)

* during the last 15 minutes, the CPU was overloaded 698% (1 CPU with 7.98 runnable processes, so that 6.98 processes had to wait for a turn)

Add the following to the bottom of the 'statusbar' section in the .awesomerc

textbox uptime
        {
                style
                {
                    font = "sans 7"
                    fg = "#ffffff"
                }
                text = " 0.00 0.00 0.00 |"
                align = right
                text_align = right
                width = 0
                mouse
                {
                    button = "1"
                    command = "spawn"
                    arg = "exec x-terminal-emulator -e htop"
                }
        }
        textbox clock
        {
                style
                {
                    font = "sans 7"
                }
                text = " Day Mon 00, 00:00 "
                align = right
                text_align = left
                width = 0
        }

This will display the load average, and add a clock to the right of it. (this also adds a button that will launch htop, the process manager, when clicking on the load average)

The script that will pipe the information is:

#!/bin/sh
#
while true
do
    if [ -S ~/.awesome_ctl.0 ]; then
        while true
        do
            echo "0 widget_tell mystatusbar clock text `date +\"%a %b %d, %k:%M\"` "
            echo "0 widget_tell mystatusbar uptime text `uptime | sed 's/.*://; s/,//g'` "
            echo "" # an empty line flushes data inside awesome
            sleep 10
        done | awesome-client
    else
        sleep 1
    fi
done

Save this as .awesomeclock.sh (or whatever) and save it in the .awesome directory. Make sure to make it executable by running

chmod +x .awesomeclock.sh

from the terminal in the .awesome directory.

or

user@host:~/.awesome$ chmod +x .awesomeclock.sh

and add the following line to the .Xsession file

sh /home/lance/.awesome/awesomeclock.sh &

This will give the following result:

aetq9f.jpg

Hope this works...

  • 2 weeks later...

Since I have posted this hopefully helpful how-to, I have upgraded my Awesome setup from 2.3.4 to 3.4.1. This was a bigger chore than I had envisioned.

The config file itself went from an easy to understand text file to a config file driven by Lua. This brought some challenges, although the new config file allows for more customization and flexibility.

I had to use a user .ppa to upgrade the package itself, which once that was complete, my adventure began. After the installation was complete and I booted into my new Awesome setup, I had to start customizing. I found some very helpful tutorials on DesktopEvolution.org, posted by Darthlukan, which made the widget setup and statusbar customization fairly painless.

The .ppa is located here: http://ppa.launchpad.net/aguignard/ppa/ubuntu. Once enabled, update Synaptic and install Awesome 3.4.1.

To customize the statusbar to enable the cpu, mem, etc. widgets, follow the instructions laid out in Darthlukan's posts. He has made it very easy to follow. After all the widgets were installed and I almost achieved my customization goals, I still had one issue that bothered me. The open programs would display their icons in the status bar. I posed my question in several IRC and forum threads with no luck. I finally posted on Linuxquestions.org and was responded to by antegallya, which solved my issue. The following code had to be 'patched' into the /usr/share/awesom/lib/awful/widget/tasklist.lua file:

@@ -95,6 +95,10 @@
     local text = "<span font_desc='"..font.."'>"
     local name
     local status_image
+    local c_icon
+    if not args.hide_icon then
+        c_icon = c.icon
+    end
     if client.floating.get(c) and floating_icon then
         status_image = capi.image(floating_icon)
     end

@@ -120,7 +124,7 @@
         text = text .. name
     end
     text = text .. "</span>"
-    return text, bg, status_image, c.icon
+    return text, bg, status_image, c_icon
 end

To patch the file, add the code where there is a + symbol, and replace the code where the - symbol is.

For help, here is my .rc.lua, which was copied from /etc/xdg/awesome/rc.lua -

-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
-- Widget library
require("vicious")

-- Load Debian menu entries
require("debian.menu")

-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
beautiful.init("/home/lance/.config/awesome/theme.lua")

-- This is used later as the default terminal and editor to run.
terminal = "terminator"
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.
layouts =
{
    awful.layout.suit.tile,
    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.floating
}
-- }}}

-- {{{ Tags
-- Define a tag table which hold all screen tags.
tags = {}
tagnames = { "fm", "net", "irc", "editor", "term" }
taglayouts = {
        awful.layout.suit.tile.left,
        awful.layout.suit.max,
        awful.layout.suit.max,
        awful.layout.suit.floating,
        awful.layout.suit.max }
for s = 1, screen.count() do
    -- Each screen has its own tag table.
    tags[s] = {}
    for tagnumber = 1, 5 do
        -- Add tags and name them.
        tags[s][tagnumber] = tag(tagnames[tagnumber])
        -- Add tags to screen one by one, giving them their layouts at the same time.
        tags[s][tagnumber].screen = s
        awful.layout.set(taglayouts[tagnumber], tags[s][tagnumber])
    end
    -- I'm sure you want to see at least one tag.
    tags[s][1].selected = true
end

-- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
   { "restart", awesome.restart },
   { "quit", awesome.quit }
}

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "Debian", debian.menu.Debian_menu.Debian },
                                    { "open terminal", terminal }
                                  }
                        })

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

--Separators
spacer    = widget({ type = "textbox"})
separator = widget({ type = "textbox"})
spacer.text     =" "
separator.text  ="."

-- {{{ Wibox

-- Create a cpuwidget (usage%)
cpuicon = widget({ type= "imagebox" })
cpuicon.image = image("/home/lance/.config/awesome/icons/cpu.png")
-- Initialize widget
cpuwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(cpuwidget, vicious.widgets.cpu, "cpu-$1%", 2)

-- Create a memwidget (usage$ usedMB/TotalMB)
memicon = widget({ type =  "imagebox" })
memicon.image = image("/home/lance/.config/awesome/icons/mem.png")
-- Initialize widget
memwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(memwidget, vicious.widgets.mem, "mem-$1% ($2MB/$3MB)", 13)

-- Create a batwidget (status chrg%)
baticon = widget({ type = "imagebox" })
baticon.image = image("/home/lance/.config/awesome/icons/bat.png")
-- Initialize widget
batwidget = widget({ type = "imagebox" })
-- Register widget
vicious.register(batwidget, vicious.widgets.bat, "$1$2%", 31, "BAT0")

-- Create a textclock widget
clockicon = widget({ type = "imagebox" })
clockicon.image = image("/home/lance/.config/awesome/icons/time.png")
mytextclock = awful.widget.textclock({ align = "right" })

--Create a netwidget (usage)
dnicon = widget({ type = "imagebox" })
upicon = widget({ type = "imagebox" })
dnicon.image = image("/home/lance/.config/awesome/icons/down.png")
upicon.image = image("/home/lance/.config/awesome/icons/up.png")
-- Initialize widget
netwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(netwidget, vicious.widgets.net, "up-${eth1 up_kb}kb/s / down-${eth1 down_kb}kb/s", 1)


-- Create a fswidget (usage)
fsicon = widget({ type = "imagebox" })
fsicon.image = image("/home/lance/.config/awesome/icons/disk.png")
-- Initialize widget
fswidget = widget({ type = "textbox" })
-- Register widget
vicious.register(fswidget, vicious.widgets.fs, "root- ${/ used_gb}gb / ${/ avail_gb}gb", 37)
-- Create a systray
--mysystray = widget({ type = "systray" })

-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(
                    awful.button({ }, 1, awful.tag.viewonly),
                    awful.button({ modkey }, 1, awful.client.movetotag),
                    awful.button({ }, 3, awful.tag.viewtoggle),
                    awful.button({ modkey }, 3, awful.client.toggletag),
                    awful.button({ }, 4, awful.tag.viewnext),
                    awful.button({ }, 5, awful.tag.viewprev)
                    )
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
                     awful.button({ }, 1, function (c)
                                              if not c:isvisible() then
                                                  awful.tag.viewonly(c:tags()[1])
                                              end
                                              client.focus = c
                                              c:raise()
                                          end),
                     awful.button({ }, 3, function ()
                                              if instance then
                                                  instance:hide()
                                                  instance = nil
                                              else
                                                  instance = awful.menu.clients({ width=250 })
                                              end
                                          end),
                     awful.button({ }, 4, function ()
                                              awful.client.focus.byidx(1)
                                              if client.focus then client.focus:raise() end
                                          end),
                     awful.button({ }, 5, function ()
                                              awful.client.focus.byidx(-1)
                                              if client.focus then client.focus:raise() end
                                          end))

for s = 1, screen.count() do
    -- Create a promptbox for each screen
    mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    mylayoutbox[s] = awful.widget.layoutbox(s)
    mylayoutbox[s]:buttons(awful.util.table.join(
                           awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
                           awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
                           awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
                           awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
    -- Create a taglist widget
    mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all,mytaglist.buttons)

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist(function(c)
                                              return awful.widget.tasklist.label.currenttags(c, s, { hide_icon = true })
                                          end, mytasklist.buttons)

    -- Create the wibox
    mywibox[s] = awful.wibox({ position = "top", height = "15", screen = s })
    -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
        {
            mylauncher,
            mytaglist[s],
            mypromptbox[s],
            layout = awful.widget.layout.horizontal.leftright
        },                                                                                                       
        mylayoutbox[s],
        mytextclock, spacer, clockicon,                 
        separator, spacer, cpuwidget, spacer, cpuicon, separator,
        spacer, memwidget, spacer, memicon, separator,
        spacer, netwidget, spacer, separator,
        spacer, fswidget, spacer, separator,
        s == 1 and mysystray or nil,
        mytasklist[s],
        layout = awful.widget.layout.horizontal.rightleft
    }
end
-- }}}

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

-- {{{ Key bindings
globalkeys = awful.util.table.join(
    awful.key({ modkey,           }, "Left",   awful.tag.viewprev       ),
    awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
    awful.key({ modkey,           }, "Escape", awful.tag.history.restore),

    awful.key({ modkey,           }, "j",
        function ()
            awful.client.focus.byidx( 1)
            if client.focus then client.focus:raise() end
        end),
    awful.key({ modkey,           }, "k",
        function ()
            awful.client.focus.byidx(-1)
            if client.focus then client.focus:raise() end
        end),
    awful.key({ modkey,           }, "w", function () mymainmenu:show(true)        end),

    -- Layout manipulation
    awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
    awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end),
    awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
    awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
    awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
    awful.key({ modkey,           }, "Tab",
        function ()
            awful.client.focus.history.previous()
            if client.focus then
                client.focus:raise()
            end
        end),

    -- Standard program
    awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end),
    awful.key({ modkey, "Control" }, "r", awesome.restart),
    awful.key({ modkey, "Shift"   }, "q", awesome.quit),

    awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)    end),
    awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)    end),
    awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1)      end),
    awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1)      end),
    awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1)         end),
    awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1)         end),
    awful.key({ modkey,           }, "space", function () awful.layout.inc(layouts,  1) end),
    awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(layouts, -1) end),

    -- Prompt
    awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),

    awful.key({ modkey }, "x",
              function ()
                  awful.prompt.run({ prompt = "Run Lua code: " },
                  mypromptbox[mouse.screen].widget,
                  awful.util.eval, nil,
                  awful.util.getdir("cache") .. "/history_eval")
              end)
)

clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
    awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
    awful.key({ modkey, "Shift"   }, "r",      function (c) c:redraw()                       end),
    awful.key({ modkey,           }, "n",      function (c) c.minimized = not c.minimized    end),
    awful.key({ modkey,           }, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c.maximized_vertical   = not c.maximized_vertical
        end)
)

-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
   keynumber = math.min(9, math.max(#tags[s], keynumber));
end

-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, keynumber do
    globalkeys = awful.util.table.join(globalkeys,
        awful.key({ modkey }, "#" .. i + 9,
                  function ()
                        local screen = mouse.screen
                        if tags[screen][i] then
                            awful.tag.viewonly(tags[screen][i])
                        end
                  end),
        awful.key({ modkey, "Control" }, "#" .. i + 9,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          awful.tag.viewtoggle(tags[screen][i])
                      end
                  end),
        awful.key({ modkey, "Shift" }, "#" .. i + 9,
                  function ()
                      if client.focus and tags[client.focus.screen][i] then
                          awful.client.movetotag(tags[client.focus.screen][i])
                      end
                  end),
        awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
                  function ()
                      if client.focus and tags[client.focus.screen][i] then
                          awful.client.toggletag(tags[client.focus.screen][i])
                      end
                  end))
end

clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    awful.button({ modkey }, 1, awful.mouse.client.move),
    awful.button({ modkey }, 3, awful.mouse.client.resize))

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

-- {{{ Rules
awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = true,
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
      properties = { floating = true } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    -- { rule = { class = "Firefox" },
    --   properties = { tag = tags[1][2] } },
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.add_signal("manage", function (c, startup)
    -- Add a titlebar
    -- awful.titlebar.add(c, { modkey = modkey })

    -- Enable sloppy focus
    c:add_signal("mouse::enter", function(c)
        if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
            and awful.client.focus.filter(c) then
            client.focus = c
        end
    end)

    if not startup then
        -- Set the windows at the slave,
        -- i.e. put it at the end of others instead of setting it master.
        -- awful.client.setslave(c)

        -- Put windows in a smart way, only if they does not set an initial position.
        if not c.size_hints.user_position and not c.size_hints.program_position then
            awful.placement.no_overlap(c)
            awful.placement.no_offscreen(c)
        end
    end
end)

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

Hopefully, some will make the attempt to try a tiling WM, as I've never felt that I've had more control over my system. If there are any questions, feel free to post here again, and I will try to help to the best of my (limited) abilities.

BTW, here is a screenie of my statusbar with the widgets and icons disabled:

5xq2c5.jpg

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Why you need to take back control of your synced passwords and how to go about doing that by Paul Hill Credit: Pixabay Last month, when Google decided to introduce daily and weekly caps for Gemini, it reignited an anxiety of mine, that you can’t really depend on service providers to maintain features forever, and it got me looking into free software (as in freedom) in other areas too. One app I quickly came across was KeePassXC on desktop and KeePassDX on Android as an alternative to password manager lock-in within the Chrome or Firefox ecosystems. I personally like to switch around with browsers, and using either password manager is inconvenient, so something like KeePassXC was interesting to me. The main issue with it now is syncing; I was not sure how to do that. After a bit of research, I came across Syncthing, a tool I was vaguely familiar with but had never used because it seemed complicated. However, I was completely wrong, and honestly, I think everyone should use it if they use multiple devices. It essentially lets you share folders peer to peer across all of your devices, no cloud services that you don’t control necessary! And it was fairly simple to set up, if not a bit clunky. Since setting it up, I’ve also started using Syncthing to back up other apps too, so don’t think it’s limited to just saving password databases. You can use it for pretty much anything you use Dropbox or Google Drive for. Before continuing to talk about those apps a bit more, let’s walk back a bit and talk about browser sync. Ever since the late 2000s and early 2010s, really, since we have been using smartphones, browser sync has been a necessity of life. I don’t know about you, but I have hundreds of passwords saved. For the most part, they’re all unique, so I don’t remember them and rely on software to manage them for me. Until recently, I’ve relied on password managers in Chrome and Firefox, but what I always found annoying was that it can be hard to transfer them between browsers. Sure, on Windows it is simple enough, but on Linux, exporting bookmarks has been temperamental. It works OK nowadays, but not too long ago, Chrome required you to enable exporting passwords in chrome://flags. The situation is even worse on mobile; there is no exporting or importing of passwords of any kind. You literally have to do it on a desktop, which is incredibly annoying in our mobile-first world. Sync also lets us take out bookmarks, history, tabs, and autofill data easily. To enable sync, it’s just a matter of signing into the browser once, and it handles the rest. It’s nice and easy. Obviously, all this has some issues, including those I’ve outlined above about it being hard to transfer data between browsers, but also things such as account suspension, lost account passwords, and other lock-in mechanisms, such as passkeys, being tied to a specific browser. On a sidenote, I have just removed all of my passkeys because they can make it harder to move browsers. I think the biggest threat to your synced passwords, especially if doing this with Google, is having your account suspended. I don’t ever expect mine to be suspended, but you do hear horror stories on Reddit where people lose access to their Google accounts. Imagine if you have hundreds of passwords, then suddenly lose access to them because Google froze your account, what would you do? So yes, it can be nice to use these syncing services for their convenience, but they also have risks. You may have seen me going on about free software quite a bit in my editorials. It’s essentially a concept championed by the Free Software Foundation. It’s software under particular licenses that grant you four freedoms: run the program for any purpose (0), study and change the source code (1), redistribute copies to others (2), and the freedom to distribute modified copies to others (3). For example, if there is an app I use and one day it gets abandoned by the developer, I can keep running it or even clone the software and continue developing it. Look at the myriad of cool services Google has run over the years before killing them. You can’t take the source code for those because they are proprietary, for the most part. Both KeePassXC and Syncthing are free software, so I get the freedoms listed above. In my use case where I’m syncing a database full of my passwords, I also get proper ownership over my data, there is no losing access to the database due to a frozen account, I can access the code of the tools I’m using, and I can get support from real people online if I run into issues, rather than having to consult a vague help page from an opaque company. With the KeePassXC password manager, you create a .kdbx file, which is what will be synced between devices. KeePassXC has cross-platform apps and also has browser extensions so that the browser can fetch passwords from the database once it is unlocked. Meanwhile, Syncthing is a peer-to-peer file sync tool where you can select folders to sync between your devices. Just pop files in the folders you choose, and then they will be available across your other devices whenever they come online. Syncthing is resilient as it works over both LAN and the internet and only ever sends content between your devices, never to a third-party server somewhere else. By combining these two pieces of software, you can essentially replicate the browser sync functionality. I have had a weird, conflicting issue where a new file is appearing, but it doesn’t seem to be impacting my main password database, which is updating between devices just fine. If you want to get a setup similar to what I have, you will need to go here to download KeePassXC for your computer. Once you have that, you will need to download your passwords from your web browser to a CSV file. In Chrome, you can type chrome://password-manager/settings into the URL bar, and you should see an option to download your passwords under Export Passwords. This will give you the CSV file you need for importing into KeePassXC. If you use a different browser, just use a search engine and type “browser-name export passwords” and muddle along. In KeePassXC, you’ll want to press Import File from the home screen, select the CSV file, and create a new database from it. On one of the screens of the wizard, there will be a Title field with a drop-down selected to none. Change this to Title and continue. You’ll select a name for the database, the encryption level (the defaults are fine), and then you will pick a password. I would choose four unrelated words that are easy for you to remember, as you’ll be typing them fairly often to access your passwords. When you have all your passwords in your new database, you will want to set up the browser extension so that your browser can fetch passwords from KeePassXC. Rather than explain how to do that here, refer to KeePassXC’s guide on how to set it up properly. Once you’ve got that set up, you want to install KeePassDX on Android. You can grab it on the F-Droid store and the Google Play Store. For iPhone users, there are other .kdbx-supporting apps, but I haven’t tried any of them, so have a look around and use what suits you. Once you have that done, you will want to install Syncthing on your computer and find a third-party app for your mobile device. On Android, I use an app called BasicSync; there are also options for iOS, but again, I’ve not tried these. Once you’ve got SyncThing, you’ll want to set it up and connect all of your devices together and share a folder between your gadgets. PCWorld has a good tutorial on setting up a synchronized file between your devices using SyncThing. Once you’ve set it up, congrats, you’ll never have to touch that stuff again except for adding or removing devices. I’ll be honest, I didn’t particularly like setting up Syncthing. It didn’t take me a massive amount of time, but I think I had to check online because I found it a bit confusing. That said, I’ve had it running for several weeks now and never need to touch the Syncthing settings, so that’s very nice. I also mentioned a conflicting file. I’m not sure why this is appearing, but the main .kdbx file seems to be updating and syncing just fine. What’s nice is that both KeePassXC and Syncthing are free software, so they won’t just vanish one day; you can take the code and fork the project or use a range of alternative implementations that others have made. It’s also nice that it works over LAN, so even if your ISP is having problems, your passwords will still sync. One area where you will want to be a bit more careful with this setup is if you only have one device. I am OK because I have a computer and two phones, all synced up. If you just have one device, you will probably want to store a backup of your .kdbx file somewhere else. Obviously, you’ll also want to remember your password really well, too. If you get locked out, it's game over. Overall, if you want to take back control of your computing from big tech, taking control of your passwords is an important part of this. You don’t need to immediately clear out your browser’s password manager; try running KeePassXC and the password manager concurrently for a while to see if you run into any problems. If you do try this out, let us know some other creative ways to use Syncthing. I haven’t really come up with a solution about what to do with my bookmarks, for example.
    • If the price was a dollar, someone would complain "Why isn't it free?" If it was free, someone would complain they weren't being paid to play it.
    • That lens of history will burn if you hold it at the right angle... Warn users too late: Shame, Microsoft! That extremely minor update to an obscure Control Panel widget required 2 years of warning. Warn users too early: Shame, Microsoft! We've got better things to do. Pipeline and process be damned, we'll just always be disappointed, eh?
    • Microsoft Paint used to be my favorite Windows app as a kid, and it's still pretty good by Usama Jawad I have been using Windows since the early 2000s, when I was around 10 years old or so. I vaguely remember playing around with Windows 98 and Windows 2000, but that may have been on school PCs which had old operating systems installed. My main OS on the home PC, and the one I recall spending most time with, was Windows XP. At that time, I used the home PC to create Word and PowerPoint documents for school, but a lot of the time, I simply used it to play games. My dad would bring game discs which we would try and install on the PC, sometimes unsuccessfully, and sometimes, we would rely on flash games in the browser, like Bubble Trouble on Miniclip. However, the problem with the latter approach was the internet speed. On a good day, our dial-up internet would offer us speeds of 56 kbps, but on most days, it was closer to 33 kbps. This did not facilitate online gaming as I would often have to wait minutes for a game to load or "draw" on the screen, and trying to download pirated games wasn't simple either. I remember getting tired of waiting for online games to load and just downloading simulator games from the Big Fish Games website instead, only to be disappointed after finding out that I was just being given access to trial versions of the title, and I needed to fork out money to pay for the full version. All of this is to say that it wasn't very easy to find entertainment options on the home PC when I was a kid, due to a number of reasons, mostly outside of my control. This situation pushed me towards a rather unconventional ally: Microsoft Paint. Whenever the internet wasn't working as good as I expected, I would simply spin up Paint and draw complete rubbish on the canvas. Of course, that wasn't always the intention, but it usually happened when I messed up drawing a straight line or something, and then I would give up on that particular piece and simply draw a random collection of objects. Microsoft Paint was extremely accessible and easy to use. Even if you weren't an artist, you could quickly understand the tools at your disposal and how to leverage them on a canvas. The absolute breadth on offer ensured that each painting was truly unique, as you could utilize various combinations of tools like the pencil, paint, spray paint, and more to truly personalize your creation. Since I wasn't particularly good at drawing both on digital screen or a physical screen, I remember that my main style of art would be to insert a bunch of randomly intersecting lines and then fill them with random colors through the paint can. I have trying to replicate that art style in the latest version of Paint below, and as you can see, it's truly Pablo Picasso-esque. The human imagination truly knows no bounds Microsoft Paint kept me occupied for hours and was my best friend when video games on the home PC were inaccessible for one reason or the other. There was no academic or professional reason for which I would need to use Paint, but I still loved using it in my personal time, even if what I created wasn't worth being shown to anyone. It was simply fun. Fast-forward to today, and the situation is mostly the same. Now that I am almost 29 years old, and I still have no reason to use Microsoft Paint in a professional capacity. In fact, I don't even use it in a personal capacity, except to dabble with it from time to time, just to see if core functionalities are still intact. And I'm happy to say that I think Microsoft Paint still offers the same accessibility and inviting experience that it did to me a couple of decades ago, even though its UX has been refreshed and it's been integrated with Copilot features. Interestingly, things could have been a lot different, had Microsoft had its way. Microsoft Paint was marked for deprecation with the Windows 10 Fall Creators Update in 2017, and even began displaying a product retirement alert, urging customers to shift to Paint 3D instead. Fortunately, after consumer backlash, Microsoft reversed course on this decision, and Paint continues to be a native app inside Windows installations that can also be updated quite frequently through the Microsoft Store. Instead, Paint 3D ended up on the chopping block, which is for the better, I think. I have intermittently played around with Microsoft's refreshed Paint experience in the past few years, and I do think it has received worthwhile upgrades. the UI and the UX has been modernized while retaining core functionality, and the app is still fairly easy to use. It doesn't meet any of my use-cases, but I've never really had any use-cases ever, as described previously. Of course, the elephant in the room is the Copilot integration. Personally, I believe that this is one place where Copilot does make sense, environmental concerns aside. I know that a lot of creatives use AI to generate images, and while some may be using professional alternatives, Paint still offers a decent casual experience, with the power of Copilot. Of course, you do need to have a valid Microsoft 365 Copilot license and available credits to use it, but even if you don't, you still get the big Copilot button in the toolbar, unfortunately. All in all, I am glad that Microsoft Paint continues to be a native feature in Windows 11, and a piece of software that has evolved to meet modern needs without cutting off its own roots. It's just an iconic piece of Windows history that was an essential part of my childhood, and while I don't use it anymore, I'm just glad it is still there.
    • 2TB WD_Black SN7100 PCIe Gen4 NVMe SSD drops to its lowest price in over three months by Fiza Ali Amazon is currently offering the 2TB WD_Black SN7100 internal solid-state drive at its lowest price in over three months, so you may want to check it out, if you have been considering a storage upgrade, before the deal dries up (purchase link is toward the end of the article). Featuring a PCIe Gen 4.0 interface and M.2 2280 form factor, the SN7100 promises to deliver sequential read speeds of up to 7,250MB/s and sequential write speeds reaching 6,900MB/s, offering as much as a 35% improvement in performance compared with the previous generation. It also achieves random read speeds of 1,000,000 IOPS and random write speeds of 1,400,000 IOPS. The drive uses Western Digital’s TLC 3D NAND technology for reliable performance and is further supported by a five-year limited warranty. It also offers strong endurance, rated at up to 1,200TBW, making it suitable for demanding workloads such as gaming, content creation, and high-speed recording. Moreover, its DRAM-less architecture claims to improve power efficiency (the SSD relies on system memory for caching via HMB), while the WD_Black Dashboard software enables users to monitor drive health, install firmware updates, and activate Game Mode for potentially better performance. Finally, it operates within an operating temperature range of 0°C to 85°C, and can withstand storage temperatures from -40°C to 85°C. 2TB WD_Black SN7100 PCIe Gen4 NVMe SSD: $242.96 (Amazon US) Check this deal out if you want a 4TB option. Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Week One Done
      Supreme Spray LV earned a badge
      Week One Done
    • One Month Later
      Genuinetonerink- Dubai earned a badge
      One Month Later
    • Week One Done
      Genuinetonerink- Dubai earned a badge
      Week One Done
    • One Year In
      hhgygy earned a badge
      One Year In
    • Week One Done
      AMV earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      514
    2. 2
      +Edouard
      163
    3. 3
      PsYcHoKiLLa
      87
    4. 4
      Steven P.
      74
    5. 5
      Michael Scrip
      73
  • Tell a friend

    Love Neowin? Tell a friend!