MX 23 awesome xfce

Help on all MX Re-spins
Message
Author
User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

MX 23 awesome xfce

#1 Post by crackbarrel »

This is awesome window manager with xfce desktop manager. Awesome is good starter for tiling window manager and xfce brings it to a classic desktop experience. The xfce4-panel is able to display and locate all opened apps withing the different workspaces while the awesome bar display apps per workspace.

I have the whole step by step setup including some priorities to make this project shine and I also have released an iso below.

This is markdown, copy and paste into your favorite markdown app:

Code: Select all

# Setup
Install MX23 XFCE
`sudo apt update && sudo apt upgrade && sudo apt install awesome`
I have 2 ways of making this work. The first one currently works better
## 1) Launching XFCE AWM (XFCE with Awesome as a WM)
Create autostart for awesome:
		  In `~/.config/autostart/awesome.desktop` add:  
```
		  [Desktop Entry]
		  Encoding=UTF-8
		  Version=0.9.4
		  Type=Application
		  Name=awesome
		  Comment=
		  Exec=awesome
		  OnlyShowIn=XFCE;
		  RunHook=0
		  StartupNotify=false
		  Terminal=false
		  Hidden=false
```
OR create autostart from GUI:
			    
			  In Session and Startup -> Application autostart -> Add Awesome, command: `awesome`. Note that this step might not be necessary but does something that makes awesomewm available to start. It can be unchecked later.  
In `~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml`, replace everything by:
```
		  <?xml version="1.0" encoding="UTF-8"?>
		  
		  <channel name="xfce4-session" version="1.0">
		    <property name="general" type="empty">
		      <property name="FailsafeSessionName" type="empty"/>
		      <property name="SessionName" type="string" value="Default"/>
		      <property name="SaveOnExit" type="bool" value="false"/>
		    </property>
		    <property name="sessions" type="empty">
		      <property name="Failsafe" type="empty">
		  	<property name="IsFailsafe" type="bool" value="true"/>
		        <property name="Count" type="int" value="5"/>
		        <property name="Client0_Command" type="array">
		          <value type="string" value="awesome"/>
		        </property>
		        <property name="Client0_Priority" type="int" value="15"/>
		        <property name="Client0_PerScreen" type="bool" value="false"/>
		        <property name="Client1_Command" type="array">
		          <value type="string" value="xfsettingsd"/>
		          <value type="string" value="--disable-wm-check"/>
		        </property>
		        <property name="Client1_Priority" type="int" value="20"/>
		        <property name="Client1_PerScreen" type="bool" value="false"/>
		        <property name="Client2_Command" type="array">
		          <value type="string" value="xfce4-panel"/>
		          <value type="string" value="--disable-wm-check"/>
		        </property>
		        <property name="Client2_Priority" type="int" value="25"/>
		        <property name="Client2_PerScreen" type="bool" value="false"/>
		        <property name="Client3_Command" type="array">
		          <value type="string" value="Thunar"/>
		          <value type="string" value="--daemon"/>
		        </property>
		        <property name="Client3_Priority" type="int" value="30"/>
		        <property name="Client3_PerScreen" type="bool" value="false"/>
		        <property name="Client4_Command" type="array">
		          <value type="string" value="xfdesktop"/>
		          <value type="string" value="--disable-wm-check"/>
		        </property>
		        <property name="Client4_Priority" type="int" value="35"/>
		        <property name="Client4_PerScreen" type="bool" value="false"/>
		      </property>
		    </property>
		    <property name="splash" type="empty">
		      <property name="Engine" type="string" value=""/>
		      <property name="engines" type="empty">
		        <property name="simple" type="empty">
		          <property name="Font" type="string" value="Liberation Sans Bold 10"/>
		          <property name="BgColor" type="string" value="#000000"/>
		          <property name="FgColor" type="string" value="#ffffff"/>
		          <property name="Image" type="string" value=""/>
		        </property>
		      </property>
		    </property>
		    <property name="shutdown" type="empty">
		      <property name="ShowHibernate" type="bool" value="false"/>
		      <property name="ShowHybridSleep" type="bool" value="false"/>
		    </property>
		  </channel>
		  
```
Here are the changes to the original file:
```
			  <property name="IsFailsafe" type="bool" value="true"/>
			      <property name="Count" type="int" value="5"/>
			      <property name="Client0_Command" type="array">
			        <value type="string" value="awesome"/>
			      </property>
			      <property name="Client0_Priority" type="int" value="15"/>
			      <property name="Client0_PerScreen" type="bool" value="false"/>
			      <property name="Client1_Command" type="array">
			        <value type="string" value="xfsettingsd"/>
			        <value type="string" value="--disable-wm-check"/>
			      </property>
			      <property name="Client1_Priority" type="int" value="20"/>
			      <property name="Client1_PerScreen" type="bool" value="false"/>
			      <property name="Client2_Command" type="array">
			        <value type="string" value="xfce4-panel"/>
			        <value type="string" value="--disable-wm-check"/>
			      </property>
			      <property name="Client2_Priority" type="int" value="25"/>
			      <property name="Client2_PerScreen" type="bool" value="false"/>
			      <property name="Client3_Command" type="array">
			        <value type="string" value="Thunar"/>
			        <value type="string" value="--daemon"/>
			      </property>
			      <property name="Client3_Priority" type="int" value="30"/>
			      <property name="Client3_PerScreen" type="bool" value="false"/>
			      <property name="Client4_Command" type="array">
			        <value type="string" value="xfdesktop"/>
			        <value type="string" value="--disable-wm-check"/>
			      </property>
			      <property name="Client4_Priority" type="int" value="35"/>
			      <property name="Client4_PerScreen" type="bool" value="false"/>
```
*__Full rc.lua configuration__*
`mkdir ~/.config/awesome`
Add awesome-switcher (alt tab): `cd ~/.config/awesome/ && git clone https://github.com/troglobit/awesome-switcher.git awesome-switcher`
In `~/.config/awesome/rc.lua` paste:
```
				  -- 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")
				  
				  -- Load Debian menu entries
				  local debian = require("debian.menu")
				  local has_fdo, freedesktop = pcall(require, "freedesktop")
				  local switcher = require("awesome-switcher")
				  
				  
				  -- {{{ 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_themes_dir() .. "default/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.max,
				      awful.layout.suit.floating,
				      awful.layout.suit.tile,
				      awful.layout.suit.fair,
				      awful.layout.suit.fair.horizontal,
				      -- awful.layout.suit.tile.left,
				      -- awful.layout.suit.tile.bottom,
				      -- awful.layout.suit.tile.top,
				      -- awful.layout.suit.spiral,
				      -- awful.layout.suit.spiral.dwindle,
				      -- 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 }, -- FIXME: change for proper quit
				  }
				  
				  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
				  mykeyboardlayout = awful.widget.keyboardlayout()
				  
				  -- {{{ Wibar
				  -- Create a textclock widget
				  mytextclock = wibox.widget.textclock()
				  
				  -- 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.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.
				          awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
				  
				          -- 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,visible = true, })
				  
				          -- 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,
				                  mykeyboardlayout,
				                  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(
				  -- awesome-switcher alt tab
				      awful.key({ "Mod1",           }, "Tab",
				        function ()
				            switcher.switch( 1, "Mod1", "Alt_L", "Shift", "Tab")
				        end),
				  
				      awful.key({ "Mod1", "Shift"   }, "Tab",
				        function ()
				            switcher.switch(-1, "Mod1", "Alt_L", "Shift", "Tab")
				        end),
				  
				      awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
				          {description="show help", group="awesome"}),
				      awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
				          {description = "view previous", group = "tag"}),
				      awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
				          {description = "view next", group = "tag"}),
				      awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
				          {description = "go back", group = "tag"}),
				      awful.key({ modkey,           }, "Up",
				          function ()
				              awful.client.focus.byidx( 1)
				          end,
				          {description = "focus next by index", group = "client"}
				      ),
				      awful.key({ modkey,           }, "Down",
				          function ()
				              awful.client.focus.byidx(-1)
				          end,
				          {description = "focus previous by index", group = "client"}
				      ),
				  
				      awful.key({ modkey, "Shift"   }, "Up", function () awful.client.swap.byidx(  1)    end,
				          {description = "swap with next client by index", group = "client"}),
				      awful.key({ modkey, "Shift"   }, "Down", function () awful.client.swap.byidx( -1)    end,
				          {description = "swap with previous client by index", group = "client"}),
				      awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative( 1) end,
				          {description = "focus the next screen", group = "screen"}),
				      awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative(-1) end,
				          {description = "focus the previous screen", group = "screen"}),
				    
				  
				      -- vim style
				      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"}), -- FIXME: quit xfce
				  
				      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,   }, "i",     function () awful.tag.incnmaster( 1, nil, true) end,
				          {description = "increase the number of master clients", group = "layout"}),
				      awful.key({ modkey,   }, "d",     function () awful.tag.incnmaster(-1, nil, true) end,
				          {description = "decrease the number of master clients", group = "layout"}),
				      -- TODO: Find better keybinidng for column
				      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"}),
				  
				      -- Prompt
				      awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
				          {description = "run prompt", group = "launcher"}),
				  
				      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, "Control", "Shift" }, "Left",
				                  function (c) c:move_to_screen(c.screen.index - 1) end,
				                  {description = "move to screen left", group = "client"}),
				  
				      awful.key({ modkey, "Control", "Shift" }, "Right",
				                  function (c) c:move_to_screen(c.screen.index + 1) end,
				                  {description = "move to screen right", group = "client"}),
				          
				      -- vim style
				          awful.key({ modkey, "Control", "Shift" }, "k",
				                  function (c) c:move_to_screen(c.screen.index - 1) end,
				                  {description = "move to screen left", group = "client"}),
				  
				      awful.key({ modkey, "Control", "Shift" }, "j",
				                  function (c) c:move_to_screen(c.screen.index + 1) end,
				                  {description = "move to screen right", group = "client"}),
				  
				      -- Show/Hide Wibox wibar
				      awful.key({ modkey, "" }, "b", function ()
				              for s in screen do
				                  s.mywibox.visible = not s.mywibox.visible
				                  if s.mybottomwibox then
				                      s.mybottomwibox.visible = not s.mybottomwibox.visible
				                  end
				              end
				              awful.spawn.with_shell("/usr/local/bin/toggle-panel.sh")
				      end,
				          {description = "toggle wibox and xfce4-panel", group = "awesome"}),
				  
				      awful.key({ modkey, "Control" }, "b", function ()
				              awful.spawn.with_shell("/usr/local/bin/toggle-panel.sh")
				      end,
				          {description = "toggle xfce4-panel", group = "awesome"}),
				  
				      awful.key({ modkey, "Shift" }, "b", function ()
				              for s in screen do
				                  s.mywibox.visible = not s.mywibox.visible
				                  if s.mybottomwibox then
				                      s.mybottomwibox.visible = not s.mybottomwibox.visible
				                  end
				              end
				      end,
				          {description = "toggle wibox", group = "awesome"}),
				  
				      awful.key({ modkey,           }, "f",
				          function (c)
				              c.fullscreen = not c.fullscreen
				              c:raise()
				          end,
				          {description = "toggle fullscreen", group = "client"}),
				      awful.key({ modkey, "Shift"   }, "c",      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)
				  -- }}}
				      switcher.settings.cycle_all_clients  = false, --   cycle through all clients
				  
				  
				  awful.spawn.with_shell("xfce4-session") 
				  awful.spawn.with_shell("xfsettingsd --disable-wm-check") 
				  awful.spawn.with_shell("xfce4-panel --disable-wm-check")
				  awful.spawn.with_shell("thunar --daemon") 
				  awful.spawn.with_shell("xfdesktop --disable-wm-check")
				  
```
*__Basic rc.lua configuration__*
collapsed:: true
`mkdir ~/.config/awesome && cp /etc/xdg/awesome/rc.lua ~/.config/awesome`
			  To find where is rc.lua: `sudo find / -name rc.lua`  
In `~/.config/awesome/rc.lua` Add to the end: 
```
			  awful.spawn.with_shell("xfce4-session") --Not necessary but can be added
			  awful.spawn.with_shell("xfsettingsd --disable-wm-check") --Not necessary but can be added
			  awful.spawn.with_shell("xfce4-panel --disable-wm-check")
			  awful.spawn.with_shell("thunar --daemon") 
			  awful.spawn.with_shell("xfdesktop --disable-wm-check")
```
Logout then login
## Configs
In Mx Tweaks -> theme -> Select MX Dark in the drop down pane
`super + b`toggle xfce-pannel:
Create a scrip at `/usr/local/bin/toggle-panel.sh` with:
```
			  #!/bin/bash
			  
			  ##### EDIT these values to suit
			  # the panel to affect
			  PANEL=1
			  
			  # the hide behaviour setting (1=intelligently, 2=always)
			  HIDE=2
			  
			  ##### Don't edit anything below
			  # get the current setting
			  CURR=$(xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior)
			  
			  # show hidden or hide displayed
			  case $CURR in
			  		#currently visible, so hide it
			  	0) xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior -s $HIDE ;;
			  		# currently intelligent, set to visible
			  	1) xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior -s 0 ;;	
			  		# currently always hidden, set to visible
			  	2) xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior -s 0 ;;	
			  		# otherwise ignore
			  	*) ;;
			  esac
```
`sudo chmod +x /usr/local/bin/toggle-panel.sh`
In MX Tweak -> check Panel bottom
Right click panel -> Panel -> Panel preference -> Set Hide panel to Intelligently (this makes the script above work for unknown reason)
On xfce4-panel, Right click  workspaces -> remove
The `rc.lua` above contains the `/usr/local/bin/toggle-panel.sh` keybinding `super + b` that will hide `wibox` and xfce4-panel
## More personal configs
Flameshot screenshot utility
`sudo apt install flameshot`
In `Keyboard`, add shortcut: `/usr/bin/flameshot gui`
Indicator sound switcher, simple task bar sound input output switcher
`sudo apt-add-repository ppa:yktooo/ppa && sudo apt-get update; sudo apt-get install indicator-sound-switcher`/usr/bin/indicator-sound-switcher
In `~/.config/autostart/Indicator\ sound\ switcher.desktop` add the following:
```
			  [Desktop Entry]
			  Encoding=UTF-8
			  Version=0.9.4
			  Type=Application
			  Name=Indicator sound switcher
			  Comment=
			  Exec=/usr/bin/indicator-sound-switcher
			  OnlyShowIn=XFCE;
			  RunHook=0
			  StartupNotify=false
			  Terminal=false
			  Hidden=false
			  
```
OR In `Session and startup`-> Application autostart -> Add:
				  Name `Indicator sound switcher`  
				  Command `/usr/bin/indicator-sound-switcher`  
## Commands for porting configs through ISO
For ISO:
```
	  sudo cp -r ~/.config/awesome /etc/skel/.config
	  sudo cp ~/.config/autostart/awesome.desktop /etc/skel/.config/autostart
	  sudo cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
	  sudo cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
	  # Personal config
	  sudo cp ~/.config/autostart/Indicator\ sound\ switcher.desktop /etc/skel/.config/autostart/Indicator\ sound\ switcher.desktop
	  sudo cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
```
## 2) Launching Awesome then XFCE
collapsed:: true
It is exactly the same as above, except xfce4-session and xfsettingsd need to be launched.
In `~/.config/awesome/rc.lua`
Add to the end: 
```
		  awful.spawn.with_shell("xfce4-session") 
		  awful.spawn.with_shell("xfsettingsd --disable-wm-check")
		  awful.spawn.with_shell("xfce4-panel --disable-wm-check")
		  awful.spawn.with_shell("thunar --daemon") 
		  awful.spawn.with_shell("xfdesktop --disable-wm-check")
```
Logout, select awesome, login
## Todo
I've added a prefix (XFCE awm, Awesome) depending on the way it is launched.
### High priority
In float layout, Add swap to pane leftg/rigth/top/bottom
~~Test move to screen keybinding (super + o by default)~~
~~Check if multi display is well supported~~
~~XFCE AWM - Shutdown and restart are greyed out~~
~~XFCE AWM- Long delay on login. It takes more that twice the time with regular XFCE~~
~~XFCE xdg autostart~~
~~For reason I don't understand, spice-agent (for virtual machine) doesn't work properly. I need to login, wait that everything load (once background become mx) logout and login, then it works. Sometimes it seems to work fine.~~
~~The xfce4-panel takes a long time before showing up. It should be instant~~
### Medium priority
For some reason, spice-vdagent is not working properly for display resolution after snapshot
~~Bring back alt + tab~~
~~Shortcut to hide Awesome and xfce4-panel~~
~~Enable global dark theme~~
### Low priority
Awesome - Fix logout from xfce4-panel
Find a way to change default apps for iso
Make sure logout kill user process to prevent greyed shutdown/restart button (probably an XFCE bug)
XFCE AWM Fix awesome quit
(on virtual machine) When shutting down live boot (not installed), it requires force shutdown to poweroff
Fix conky for awesome
Change background images
Maybe hide stuff that are related to xfwm in whisker like window manager
On iso, workspace name won't stick. The first 4 needs to be renamed. Not a problem if not using xfce4-panel workspaces
Edit: Last update 08-04-2024

Second release 07-04-2024

I probably forgot to add updated files to the ISO, so the xfce4-session.xml and rc.lua needs to be updated with the above. I'll try to make the ISO again.

Some configs needs to be added again after installing.
  • sudo chmod +x /usr/local/bin/toggle-panel.sh
    Right click panel -> panel -> Panel config -> set to hide intelligently
    Use super + b to toggle bars (default key binding in rc.lua)
  • In MX tweak, Set panel to bottom and set theme to dark
  • When booting from usb, use `sudo minstall` to start installation
  • In virtual machine, poweroff live usb needs a forced poweroff. This go away once installed.
https://ln5.sync.com/dl/565d95b40/jf98n ... z-md9dk6kn

Size: 2.2Go
Last edited by crackbarrel on Mon Apr 08, 2024 7:01 pm, edited 29 times in total.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#2 Post by crackbarrel »

Ok fixed the slow part. That brings new problems. It seems like xfce start without any configs. For instance, dark theme is gone and spice-agent doesn't launch.

Changed in rc.lua (~/.config/awesome):
awful.spawn.with_shell("startxfce4 --disable-wm-check")
For:
awful.spawn.with_shell("xfce4-panel --disable-wm-check")
awful.spawn.with_shell("fdesktop --disable-wm-check")

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#3 Post by crackbarrel »

Fixed lot of issues like spice-vdagent with xdg-autostart.

Changes:
sudo apt update && sudo apt upgrade && sudo apt install awesome obsession

rc.lua (end):
awful.spawn.with_shell("xdg-autostart")
awful.spawn.with_shell("xfce4-panel --disable-wm-check")
awful.spawn.with_shell("fdesktop --disable-wm-check")

TODO:
Now trying to fix the logout from xfce4-panel.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#4 Post by crackbarrel »

I think the theme is fixed now. Logout seems to quit xfce4-session instead of login out, but now the panel appear.

Changes:

sudo apt install awesome
Removed obsession. Autostart is no longer needed with xfce4-session

rc.lua

awful.spawn.with_shell("xfce4-session")
awful.spawn.with_shell("xfce4-panel --disable-wm-check")
awful.spawn.with_shell("fdesktop --disable-wm-check")

Removed awful.spawn.with_shell("xdg-autostart")

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#5 Post by crackbarrel »

I've found another way to launch awesome that solve the logout problem, but then I get a long delay on login for some reason (at least twice the time as regular XFCE login).

I've added the following:

## 1) Launching XFCE AWM (XFCE with Awesome as a WM)
In `~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml`, replace:
`<property name="Client0_Command" type="empty"/>`
by:
```
<property name="Client0_Command" type="array">
<value type"string" value="awesome"/>
</property>
```
In Session and Startup -> Application autostart -> Add Awesome, command: `awesome`
Logout then login

No need to change lua.rc with this method.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#6 Post by crackbarrel »

I've found out that by adding lua.rc settings like in awesome launching, I can get faster launch. But now shutdown and restart are greyed.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#7 Post by crackbarrel »

Ok, it seems like the greyed out shutdown/restart doesn't happen if I don't logout. But even if I logout, it sometimes won't happen. I suppose this might be because there's some user process still active from a previous session.

The current setup for XFCE AWM seems good enough. I'll probably get going with that. I suppose it would be great to have awesome and xfce available from the login screen.

Changes:


Edit:No change.

Adding awesome from autostart make it available. I suppose it is only needed to create a .desktop file so XFCE can launch it. I think it can be removed afterward.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#8 Post by crackbarrel »

I've updated the above. I've made change that I've removed but actually stayed while testing.

The following prevent slowdown:

In `~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml`, replace:
```
<property name="IsFailsafe" type="empty"/>
<property name="Count" type="empty"/>
<property name="Client0_Command" type="empty"/>
<property name="Client0_Priority" type="empty"/>
<property name="Client0_PerScreen" type="empty"/>
<property name="Client1_Command" type="empty"/>
<property name="Client1_Priority" type="empty"/>
<property name="Client1_PerScreen" type="empty"/>
<property name="Client2_Command" type="empty"/>
<property name="Client2_Priority" type="empty"/>
<property name="Client2_PerScreen" type="empty"/>
<property name="Client3_Command" type="empty"/>
<property name="Client3_Priority" type="empty"/>
<property name="Client3_PerScreen" type="empty"/>
<property name="Client4_Command" type="empty"/>
<property name="Client4_Priority" type="empty"/>
<property name="Client4_PerScreen" type="empty"/>
```
by:
```
<property name="IsFailsafe" type="bool" value="true"/>
<property name="Count" type="int" value="5"/>
<property name="Client0_Command" type="array">
<value type="string" value="awesome"/>
</property>
<property name="Client0_Priority" type="int" value="15"/>
<property name="Client0_PerScreen" type="bool" value="false"/>
<property name="Client1_Command" type="array">
<value type="string" value="xfsettingsd"/>
<value type="string" value="--disable-wm-check"/>
</property>
<property name="Client1_Priority" type="int" value="20"/>
<property name="Client1_PerScreen" type="bool" value="false"/>
<property name="Client2_Command" type="array">
<value type="string" value="xfce4-panel"/>
<value type="string" value="--disable-wm-check"/>
</property>
<property name="Client2_Priority" type="int" value="25"/>
<property name="Client2_PerScreen" type="bool" value="false"/>
<property name="Client3_Command" type="array">
<value type="string" value="Thunar"/>
<value type="string" value="--daemon"/>
</property>
<property name="Client3_Priority" type="int" value="30"/>
<property name="Client3_PerScreen" type="bool" value="false"/>
<property name="Client4_Command" type="array">
<value type="string" value="xfdesktop"/>
<value type="string" value="--disable-wm-check"/>
</property>
<property name="Client4_Priority" type="int" value="35"/>
<property name="Client4_PerScreen" type="bool" value="false"/>

```

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#9 Post by crackbarrel »

I've added a few configs and I'm currently making a snapshot that I will test on virtual machine.

User avatar
crackbarrel
Posts: 75
Joined: Sun Mar 24, 2024 11:11 am

Re: MX 23 awesome xfce

#10 Post by crackbarrel »

First release

Size: 2.8Go

Alright, I've made it and it works (on vm). This is basically the steps above plus Librewolf, Brave, krita, inkscape, zsh (the next release won't have these installed) and I've changed the panel.There's also a few awesome keybindings I've added.

I wonder why is default snapshot compression is lz4? Is it because xz is too slow for some hardware? Because lz4 gave me >10Go iso so I thought I wouldn't be able to share an iso with that. xz wasn't that slow and well compressed. I really like this snapshot utility, this makes it easy to test on new devices.

Bugs:
  • Workspaces 1-4 comes with name workspace. Simple fix is to rename them (right click -> Workspace settings). I don't know where these namespaces are set.
  • Use `sudo minstall` to start installation
  • In virtual machine, poweroff live usb needs a forced poweroff. This go away once installed.
  • I couldn't find how to change default apps for the snapshot process.
Last edited by crackbarrel on Sun Apr 07, 2024 3:37 pm, edited 1 time in total.

Post Reply

Return to “MX Respins”