« Awesome » : différence entre les versions

De Disposition de clavier bépo
Ligne 19 : Ligne 19 :
== configuration pour awesome 3.1 ==
== configuration pour awesome 3.1 ==


Sous archlinux le fichier de configuration est dans ~/.config/awesome/rc.lua
Sous archlinux, le fichier de configuration est {{c|~/.config/awesome/rc.lua}}.


En gras vous avez mes changements opérés dans la partie Key bindings du fichier de configuration. ATTENTION, ceci n'est pas le fichier de configuration complet mais juste la partie Key bindings !
En gras, vous trouverez nos modifications par rapport à une version standard de ce fichier, opérés dans la partie ''Key bindings''. Aussi, '''attention''' : ce qui suit n'est pas le fichier de configuration complet, mais juste la partie ''Key bindings'' à remplacer !


<source lang="lua">


-- {{{ Key bindings
-- {{{ Key bindings
-- Bind keyboard digits
-- 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
 
'''local bepo_numkeys = {'''
  '''[0]="asterisk", "quotedbl", "guillemotleft", "guillemotright", "parenleft", "parenright", "at", "plus", "minus", "slash"'''
'''}'''   
    
    
-- Bind keyboard digits
for i = 1, keynumber do
-- Compute the maximum number of digit we need, limited to 9 keynumber = 0
  keybinding({ modkey }, '''bepo_numkeys[i]''',
for s = 1, screen.count() do
                  function ()
  keynumber = math.min(9, math.max(#tags[s], keynumber));
                      local screen = mouse.screen
end
                      if tags[screen][i] then
   
                          awful.tag.viewonly(tags[screen][i])
'''local bepo_numkeys = {'''
                      end
    '''[0]="asterisk", "quotedbl", "guillemotleft", "guillemotright", "parenleft", "parenright", "at", "plus", "minus", "slash"'''
                  end):add()
  '''}'''   
  keybinding({ modkey, "Control" }, '''bepo_numkeys[i]''',
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          tags[screen][i].selected = not tags[screen][i].selected
                      end
                  end):add()
  keybinding({ modkey, "Shift" }, '''bepo_numkeys[i]''',
                  function ()
                      if client.focus then
                          if tags[client.focus.screen][i] then
                              awful.client.movetotag(tags[client.focus.screen][i])
                          end
                      end
                  end):add()
  keybinding({ modkey, "Control", "Shift" }, '''bepo_numkeys[i]''',
                  function ()
                      if client.focus then
                          if tags[client.focus.screen][i] then
                              awful.client.toggletag(tags[client.focus.screen][i])
                          end
                      end
                  end):add()
end
 
keybinding({ modkey }, "Left", awful.tag.viewprev):add()
keybinding({ modkey }, "Right", awful.tag.viewnext):add()
keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
      
      
for i = 1, keynumber do
-- Standard program
    keybinding({ modkey }, '''bepo_numkeys[i]''',
keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add()
                    function ()
 
                        local screen = mouse.screen
keybinding({ modkey, "Control" }, "'''h'''", function ()
                        if tags[screen][i] then
                                          mypromptbox[mouse.screen].text =
                            awful.tag.viewonly(tags[screen][i])
                                              awful.util.escape(awful.util.restart())
                        end
                                      end):add()
                    end):add()
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
    keybinding({ modkey, "Control" }, '''bepo_numkeys[i]''',
                    function ()
                        local screen = mouse.screen
                        if tags[screen][i] then
                            tags[screen][i].selected = not tags[screen][i].selected
                        end
                    end):add()
    keybinding({ modkey, "Shift" }, '''bepo_numkeys[i]''',
                    function ()
                        if client.focus then
                            if tags[client.focus.screen][i] then
                                awful.client.movetotag(tags[client.focus.screen][i])
                            end
                        end
                    end):add()
    keybinding({ modkey, "Control", "Shift" }, '''bepo_numkeys[i]''',
                    function ()
                        if client.focus then
                            if tags[client.focus.screen][i] then
                                awful.client.toggletag(tags[client.focus.screen][i])
                            end
                        end
                    end):add()
end
   
keybinding({ modkey }, "Left", awful.tag.viewprev):add()
keybinding({ modkey }, "Right", awful.tag.viewnext):add()
keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
     
-- Standard program
keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add()
   
keybinding({ modkey, "Control" }, "'''h'''", function ()
                                            mypromptbox[mouse.screen].text =
                                                awful.util.escape(awful.util.restart())
                                        end):add()
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
     
-- Client manipulation
keybinding({ modkey }, "m", awful.client.maximize):add()
keybinding({ modkey }, "f", function () if client.focus then client.focus.fullscreen = not client.focus.fullscreen end end):add()
keybinding({ modkey, "Shift" }, '''"x"''', function () if client.focus then client.focus:kill() end end):add()
keybinding({ modkey }, '''"t"''', function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add()
keybinding({ modkey }, '''"s"''', function () awful.client.focus.byidx(-1);  if client.focus then client.focus:raise() end end):add()
keybinding({ modkey, "Shift" }, '''"t"''', function () awful.client.swap.byidx(1) end):add()
keybinding({ modkey, "Shift" }, '''"s"''', function () awful.client.swap.byidx(-1) end):add()
keybinding({ modkey, "Control" }, '''"t"''', function () awful.screen.focus(1) end):add()
keybinding({ modkey, "Control" }, '''"s"''', function () awful.screen.focus(-1) end):add()
keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
keybinding({ modkey, "Control" }, "Return", function () if client.focus then client.focus:swap(awful.client.getmaster()) end end):add()
keybinding({ modkey }, "o", awful.client.movetoscreen):add()
keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
keybinding({ modkey, "Shift" }, '''"h"''', function () if client.focus then client.focus:redraw() end end):add()
     
-- Layout manipulation
keybinding({ modkey }, '''"r"''', function () awful.tag.incmwfact(0.05) end):add()
keybinding({ modkey }, '''"c"''', function () awful.tag.incmwfact(-0.05) end):add()
keybinding({ modkey, "Shift" }, '''"c"''', function () awful.tag.incnmaster(1) end):add()
keybinding({ modkey, "Shift" }, '''"r"''', function () awful.tag.incnmaster(-1) end):add()
keybinding({ modkey, "Control" }, '''"c"''', function () awful.tag.incncol(1) end):add()
keybinding({ modkey, "Control" }, '''"r"''', function () awful.tag.incncol(-1) end):add()
keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
   
-- Prompt
keybinding({ modkey }, "F1", function ()
                                  awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen], awful.util.spawn, awful.completion.bash,
                                                  awful.util.getdir("cache") .. "/history")
                              end):add()
keybinding({ modkey }, "F4", function ()
                                  awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen], awful.util.eval, awful.prompt.bash,
                                                  awful.util.getdir("cache") .. "/history_eval")
                              end):add()
      
      
keybinding({ modkey, "Ctrl" }, "i", function ()
-- Client manipulation
                                        local s = mouse.screen
keybinding({ modkey }, "m", awful.client.maximize):add()
                                        if mypromptbox[s].text then
keybinding({ modkey }, "f", function () if client.focus then client.focus.fullscreen = not client.focus.fullscreen end end):add()
                                            mypromptbox[s].text = nil
keybinding({ modkey, "Shift" }, '''"x"''', function () if client.focus then client.focus:kill() end end):add()
                                        elseif client.focus then
keybinding({ modkey }, '''"t"''', function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add()
                                            mypromptbox[s].text = nil
keybinding({ modkey }, '''"s"''', function () awful.client.focus.byidx(-1);  if client.focus then client.focus:raise() end end):add()
                                            if client.focus.class then
keybinding({ modkey, "Shift" }, '''"t"''', function () awful.client.swap.byidx(1) end):add()
                                                mypromptbox[s].text = "Class: " .. client.focus.class .. " "
keybinding({ modkey, "Shift" }, '''"s"''', function () awful.client.swap.byidx(-1) end):add()
                                            end
keybinding({ modkey, "Control" }, '''"t"''', function () awful.screen.focus(1) end):add()
                                            if client.focus.instance then
keybinding({ modkey, "Control" }, '''"s"''', function () awful.screen.focus(-1) end):add()
                                                mypromptbox[s].text = mypromptbox[s].text .. "Instance: ".. client.focus.instance .. " "
keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
                                            end
keybinding({ modkey, "Control" }, "Return", function () if client.focus then client.focus:swap(awful.client.getmaster()) end end):add()
                                            if client.focus.role then
keybinding({ modkey }, "o", awful.client.movetoscreen):add()
                                                mypromptbox[s].text = mypromptbox[s].text .. "Role: ".. client.focus.role
keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
                                            end
keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
                                        end
keybinding({ modkey, "Shift" }, '''"h"''', function () if client.focus then client.focus:redraw() end end):add()
                                    end):add()
      
      
-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
-- Layout manipulation
keybinding({ modkey }, '''"j"''', awful.client.togglemarked):add()  
keybinding({ modkey }, '''"r"''', function () awful.tag.incmwfact(0.05) end):add()
   
keybinding({ modkey }, '''"c"''', function () awful.tag.incmwfact(-0.05) end):add()
for i = 1, keynumber do
keybinding({ modkey, "Shift" }, '''"c"''', function () awful.tag.incnmaster(1) end):add()
    keybinding({ modkey, "Shift" }, "F" .. i,
keybinding({ modkey, "Shift" }, '''"r"''', function () awful.tag.incnmaster(-1) end):add()
                    function ()
keybinding({ modkey, "Control" }, '''"c"''', function () awful.tag.incncol(1) end):add()
                        local screen = mouse.screen
keybinding({ modkey, "Control" }, '''"r"''', function () awful.tag.incncol(-1) end):add()
                        if tags[screen][i] then
keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
                            for k, c in pairs(awful.client.getmarked()) do
keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
                                awful.client.movetotag(tags[screen][i], c)
 
                            end
-- Prompt
                        end
keybinding({ modkey }, "F1", function ()
                    end):add()
                                awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen], awful.util.spawn, awful.completion.bash,
end
                                                awful.util.getdir("cache") .. "/history")
-- }}}
                            end):add()
keybinding({ modkey }, "F4", function ()
                                awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen], awful.util.eval, awful.prompt.bash,
                                                awful.util.getdir("cache") .. "/history_eval")
                            end):add()
 
keybinding({ modkey, "Ctrl" }, "i", function ()
                                      local s = mouse.screen
                                      if mypromptbox[s].text then
                                          mypromptbox[s].text = nil
                                      elseif client.focus then
                                          mypromptbox[s].text = nil
                                          if client.focus.class then
                                              mypromptbox[s].text = "Class: " .. client.focus.class .. " "
                                          end
                                          if client.focus.instance then
                                              mypromptbox[s].text = mypromptbox[s].text .. "Instance: ".. client.focus.instance .. " "
                                          end
                                          if client.focus.role then
                                              mypromptbox[s].text = mypromptbox[s].text .. "Role: ".. client.focus.role
                                          end
                                      end
                                  end):add()
 
-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
keybinding({ modkey }, '''"j"''', awful.client.togglemarked):add()  
 
for i = 1, keynumber do
  keybinding({ modkey, "Shift" }, "F" .. i,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          for k, c in pairs(awful.client.getmarked()) do
                              awful.client.movetotag(tags[screen][i], c)
                          end
                      end
                  end):add()
end
-- }}}
</source>


== liens ==
== liens ==

Version du 4 septembre 2009 à 23:28

awesome est un gestionnaire de fenêtres libre fonctionnant au dessus de X Window System sur les machines de type UNIX. Son objectif est de rester très petit et de proposer plusieurs dispositions des fenêtres (maximisation, flottante, placées automatiquement comme Ion).
L'article awesome sur wikipédia.

adaptation au bépo

Awesome utilise les touches HJKL pour se déplacer et modifier la taille des fenêtres. Ces touches ont une position physique important et on se doit de retranscrire le même comportement d'où un changement des touches :

  • H -> C
  • J -> T
  • K -> S
  • L -> R

Malheureusement CTR sont utilisés pour faire d'autres choses sur awesome, donc je vais les réassigner à des places libres :

  • C -> X (pour avoir la même place physique et pouvoir fermer une fenêtre à une seule main)
  • T -> J (c'est le même changement que dans vim et vimperator)
  • R -> H (pas vraiment de logique…)

Awesome utilise aussi les chiffres pour changer de bureau, c'est très pratique en qwerty mais nous n'avons pas les chiffres en accès direct. J'ai utilisé la FAQ Française pour une solution.

configuration pour awesome 3.1

Sous archlinux, le fichier de configuration est ~/.config/awesome/rc.lua.

En gras, vous trouverez nos modifications par rapport à une version standard de ce fichier, opérés dans la partie Key bindings. Aussi, attention : ce qui suit n'est pas le fichier de configuration complet, mais juste la partie Key bindings à remplacer !

-- {{{ Key bindings
 
-- Bind keyboard digits
-- 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
  
'''local bepo_numkeys = {'''
   '''[0]="asterisk", "quotedbl", "guillemotleft", "guillemotright", "parenleft", "parenright", "at", "plus", "minus", "slash"'''
'''}'''    
   
for i = 1, keynumber do
   keybinding({ modkey }, '''bepo_numkeys[i]''',
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          awful.tag.viewonly(tags[screen][i])
                      end
                  end):add()
   keybinding({ modkey, "Control" }, '''bepo_numkeys[i]''',
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          tags[screen][i].selected = not tags[screen][i].selected
                      end
                  end):add()
   keybinding({ modkey, "Shift" }, '''bepo_numkeys[i]''',
                  function ()
                      if client.focus then
                          if tags[client.focus.screen][i] then
                              awful.client.movetotag(tags[client.focus.screen][i])
                          end
                      end
                  end):add()
   keybinding({ modkey, "Control", "Shift" }, '''bepo_numkeys[i]''',
                  function ()
                      if client.focus then
                          if tags[client.focus.screen][i] then
                              awful.client.toggletag(tags[client.focus.screen][i])
                          end
                      end
                  end):add()
end
   
keybinding({ modkey }, "Left", awful.tag.viewprev):add()
keybinding({ modkey }, "Right", awful.tag.viewnext):add()
keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
     
-- Standard program
keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add()
   
keybinding({ modkey, "Control" }, "'''h'''", function ()
                                          mypromptbox[mouse.screen].text =
                                              awful.util.escape(awful.util.restart())
                                       end):add()
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
    
-- Client manipulation
keybinding({ modkey }, "m", awful.client.maximize):add()
keybinding({ modkey }, "f", function () if client.focus then client.focus.fullscreen = not client.focus.fullscreen end end):add()
keybinding({ modkey, "Shift" }, '''"x"''', function () if client.focus then client.focus:kill() end end):add()
keybinding({ modkey }, '''"t"''', function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add()
keybinding({ modkey }, '''"s"''', function () awful.client.focus.byidx(-1);  if client.focus then client.focus:raise() end end):add()
keybinding({ modkey, "Shift" }, '''"t"''', function () awful.client.swap.byidx(1) end):add()
keybinding({ modkey, "Shift" }, '''"s"''', function () awful.client.swap.byidx(-1) end):add()
keybinding({ modkey, "Control" }, '''"t"''', function () awful.screen.focus(1) end):add()
keybinding({ modkey, "Control" }, '''"s"''', function () awful.screen.focus(-1) end):add()
keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
keybinding({ modkey, "Control" }, "Return", function () if client.focus then client.focus:swap(awful.client.getmaster()) end end):add()
keybinding({ modkey }, "o", awful.client.movetoscreen):add()
keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
keybinding({ modkey, "Shift" }, '''"h"''', function () if client.focus then client.focus:redraw() end end):add()
    
-- Layout manipulation
keybinding({ modkey }, '''"r"''', function () awful.tag.incmwfact(0.05) end):add()
keybinding({ modkey }, '''"c"''', function () awful.tag.incmwfact(-0.05) end):add()
keybinding({ modkey, "Shift" }, '''"c"''', function () awful.tag.incnmaster(1) end):add()
keybinding({ modkey, "Shift" }, '''"r"''', function () awful.tag.incnmaster(-1) end):add()
keybinding({ modkey, "Control" }, '''"c"''', function () awful.tag.incncol(1) end):add()
keybinding({ modkey, "Control" }, '''"r"''', function () awful.tag.incncol(-1) end):add()
keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
   
-- Prompt
keybinding({ modkey }, "F1", function ()
                                awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen], awful.util.spawn, awful.completion.bash,
                                                 awful.util.getdir("cache") .. "/history")
                            end):add()
keybinding({ modkey }, "F4", function ()
                                awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen], awful.util.eval, awful.prompt.bash,
                                                 awful.util.getdir("cache") .. "/history_eval")
                            end):add()
  
keybinding({ modkey, "Ctrl" }, "i", function ()
                                       local s = mouse.screen
                                       if mypromptbox[s].text then
                                           mypromptbox[s].text = nil
                                       elseif client.focus then
                                           mypromptbox[s].text = nil
                                           if client.focus.class then
                                               mypromptbox[s].text = "Class: " .. client.focus.class .. " "
                                           end
                                           if client.focus.instance then
                                               mypromptbox[s].text = mypromptbox[s].text .. "Instance: ".. client.focus.instance .. " "
                                           end
                                           if client.focus.role then
                                               mypromptbox[s].text = mypromptbox[s].text .. "Role: ".. client.focus.role
                                           end
                                       end
                                   end):add()
  
-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
keybinding({ modkey }, '''"j"''', awful.client.togglemarked):add() 
  
for i = 1, keynumber do
   keybinding({ modkey, "Shift" }, "F" .. i,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          for k, c in pairs(awful.client.getmarked()) do
                              awful.client.movetotag(tags[screen][i], c)
                          end
                      end
                  end):add()
end
-- }}}

liens