@ -18,9 +18,11 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget
-- Check if awesome encountered an error during startup and fell back to
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
if awesome.startup_errors then
naughty.notify ( { preset = naughty.config . presets.critical ,
naughty.notify ( {
title = " Oops, there were errors during startup! " ,
preset = naughty.config . presets.critical ,
text = awesome.startup_errors } )
title = " Oops, there were errors during startup! " ,
text = awesome.startup_errors
} )
end
end
-- Handle runtime errors after startup
-- Handle runtime errors after startup
@ -31,9 +33,11 @@ do
if in_error then return end
if in_error then return end
in_error = true
in_error = true
naughty.notify ( { preset = naughty.config . presets.critical ,
naughty.notify ( {
title = " Oops, an error happened! " ,
preset = naughty.config . presets.critical ,
text = tostring ( err ) } )
title = " Oops, an error happened! " ,
text = tostring ( err )
} )
in_error = false
in_error = false
end )
end )
end
end
@ -95,20 +99,24 @@ end
-- {{{ Menu
-- {{{ Menu
-- Create a launcher widget and a main menu
-- Create a launcher widget and a main menu
myawesomemenu = {
myawesomemenu = {
{ " hotkeys " , function ( ) return false , hotkeys_popup.show_help end } ,
{ " hotkeys " , function ( ) return false , hotkeys_popup.show_help end } ,
{ " manual " , terminal .. " -e man awesome " } ,
{ " manual " , terminal .. " -e man awesome " } ,
{ " edit config " , editor_cmd .. " " .. awesome.conffile } ,
{ " edit config " , editor_cmd .. " " .. awesome.conffile } ,
{ " restart " , awesome.restart } ,
{ " restart " , awesome.restart } ,
{ " quit " , function ( ) awesome.quit ( ) end }
{ " quit " , function ( ) awesome.quit ( ) end }
}
}
mymainmenu = awful.menu ( { items = { { " awesome " , myawesomemenu , beautiful.awesome_icon } ,
mymainmenu = awful.menu ( {
{ " open terminal " , terminal }
items = {
}
{ " awesome " , myawesomemenu , beautiful.awesome_icon } ,
} )
{ " open terminal " , terminal }
}
} )
mylauncher = awful.widget . launcher ( { image = beautiful.awesome_icon ,
mylauncher = awful.widget . launcher ( {
menu = mymainmenu } )
image = beautiful.awesome_icon ,
menu = mymainmenu
} )
-- Menubar configuration
-- Menubar configuration
menubar.utils . terminal = terminal -- Set the terminal for applications that require it
menubar.utils . terminal = terminal -- Set the terminal for applications that require it
@ -123,46 +131,87 @@ mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
-- Create a wibox for each screen and add it
local taglist_buttons = awful.util . table.join (
local taglist_buttons = awful.util . table.join (
awful.button ( { } , 1 , function ( t ) t : view_only ( ) end ) ,
awful.button (
awful.button ( { modkey } , 1 , function ( t )
{ } ,
if client.focus then
1 ,
client.focus : move_to_tag ( t )
function ( t ) t : view_only ( ) end
end
) ,
end ) ,
awful.button (
awful.button ( { } , 3 , awful.tag . viewtoggle ) ,
{ modkey } ,
awful.button ( { modkey } , 3 , function ( t )
1 ,
if client.focus then
function ( t )
client.focus : toggle_tag ( t )
if client.focus then
end
client.focus : move_to_tag ( t )
end ) ,
end
awful.button ( { } , 4 , function ( t ) awful.tag . viewnext ( t.screen ) end ) ,
end
awful.button ( { } , 5 , function ( t ) awful.tag . viewprev ( t.screen ) 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 = awful.util . table.join (
local tasklist_buttons = awful.util . table.join (
awful.button ( { } , 1 , function ( c )
awful.button (
if c == client.focus then
{ } ,
c.minimized = true
1 ,
else
function ( c )
-- Without this, the following
if c == client.focus then
-- :isvisible() makes no sense
c.minimized = true
c.minimized = false
else
if not c : isvisible ( ) and c.first_tag then
-- Without this, the following
c.first_tag : view_only ( )
-- :isvisible() makes no sense
end
c.minimized = false
-- This will also un-minimize
if not c : isvisible ( ) and c.first_tag then
-- the client, if needed
c.first_tag : view_only ( )
client.focus = c
end
c : raise ( )
-- This will also un-minimize
end
-- the client, if needed
end ) ,
client.focus = c
awful.button ( { } , 3 , client_menu_toggle_fn ( ) ) ,
c : raise ( )
awful.button ( { } , 4 , function ( )
end
awful.client . focus.byidx ( 1 )
end
end ) ,
) ,
awful.button ( { } , 5 , function ( )
awful.button (
awful.client . focus.byidx ( - 1 )
{ } ,
end ) )
3 ,
client_menu_toggle_fn ( )
) ,
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 )
local function set_wallpaper ( s )
-- Wallpaper
-- Wallpaper
@ -179,51 +228,54 @@ end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal ( " property::geometry " , set_wallpaper )
screen.connect_signal ( " property::geometry " , set_wallpaper )
awful.screen . connect_for_each_screen ( function ( s )
awful.screen . connect_for_each_screen (
-- Wallpaper
function ( s )
set_wallpaper ( 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 ] )
-- 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 a promptbox for each screen
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
s.mypromptbox = awful.widget . prompt ( )
-- We need one layoutbox per screen.
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
s.mylayoutbox = awful.widget . layoutbox ( s )
-- We need one layoutbox per screen.
s.mylayoutbox : buttons ( awful.util . table.join (
s.mylayoutbox = awful.widget . layoutbox ( s )
awful.button ( { } , 1 , function ( ) awful.layout . inc ( 1 ) end ) ,
s.mylayoutbox : buttons ( awful.util . table.join (
awful.button ( { } , 3 , function ( ) awful.layout . inc ( - 1 ) end ) ,
awful.button ( { } , 1 , function ( ) awful.layout . inc ( 1 ) end ) ,
awful.button ( { } , 4 , function ( ) awful.layout . inc ( 1 ) end ) ,
awful.button ( { } , 3 , function ( ) awful.layout . inc ( - 1 ) end ) ,
awful.button ( { } , 5 , function ( ) awful.layout . inc ( - 1 ) end ) ) )
awful.button ( { } , 4 , function ( ) awful.layout . inc ( 1 ) end ) ,
-- Create a taglist widget
awful.button ( { } , 5 , function ( ) awful.layout . inc ( - 1 ) end )
s.mytaglist = awful.widget . taglist ( s , awful.widget . taglist.filter . all , taglist_buttons )
) )
-- Create a taglist widget
-- Create a tasklist widget
s.mytaglist = awful.widget . taglist ( s , awful.widget . taglist.filter . all , taglist_buttons )
s.mytasklist = awful.widget . tasklist ( s , awful.widget . tasklist.filter . currenttags , tasklist_buttons )
-- Create a tasklist widget
-- Create the wibox
s.mytasklist = awful.widget . tasklist ( s , awful.widget . tasklist.filter . currenttags , tasklist_buttons )
s.mywibox = awful.wibar ( { position = " top " , screen = s } )
-- Create the wibox
-- Add widgets to the wibox
s.mywibox = awful.wibar ( { position = " top " , screen = s } )
s.mywibox : setup {
layout = wibox.layout . align.horizontal ,
-- Add widgets to the wibox
{ -- Left widgets
s.mywibox : setup {
layout = wibox.layout . fixed.horizontal ,
layout = wibox.layout . align.horizontal ,
mylauncher ,
{ -- Left widgets
s.mytaglist ,
layout = wibox.layout . fixed.horizontal ,
s.mypromptbox ,
mylauncher ,
} ,
s.mytaglist ,
s.mytasklist , -- Middle widget
s.mypromptbox
{ -- Right widgets
} ,
layout = wibox.layout . fixed.horizontal ,
s.mytasklist , -- Middle widget
mykeyboardlayout ,
{ -- Right widgets
wibox.widget . systray ( ) ,
layout = wibox.layout . fixed.horizontal ,
mytextclock ,
mykeyboardlayout ,
s.mylayoutbox ,
wibox.widget . systray ( ) ,
} ,
mytextclock ,
}
s.mylayoutbox
end )
}
}
end
)
-- }}}
-- }}}
-- {{{ Mouse bindings
-- {{{ Mouse bindings
@ -236,208 +288,153 @@ root.buttons(awful.util.table.join(
-- {{{ Key bindings
-- {{{ Key bindings
globalkeys = awful.util . table.join (
globalkeys = awful.util . table.join (
awful.key ( { modkey , } , " s " , hotkeys_popup.show_help ,
awful.key ( { modkey , } , " s " , hotkeys_popup.show_help , { description = " show help " , group = " awesome " } ) ,
{ description = " show help " , group = " awesome " } ) ,
awful.key ( { modkey , } , " Left " , awful.tag . viewprev , { description = " view previous " , group = " tag " } ) ,
awful.key ( { modkey , } , " Left " , awful.tag . viewprev ,
awful.key ( { modkey , } , " Right " , awful.tag . viewnext , { description = " view next " , group = " tag " } ) ,
{ description = " view previous " , group = " tag " } ) ,
awful.key ( { modkey , } , " Escape " , awful.tag . history.restore , { description = " go back " , group = " tag " } ) ,
awful.key ( { modkey , } , " Right " , awful.tag . viewnext ,
{ description = " view next " , group = " tag " } ) ,
awful.key ( { modkey , } , " j " , function ( ) awful.client . focus.byidx ( 1 ) end , { description = " focus next by index " , group = " client " } ) ,
awful.key ( { modkey , } , " Escape " , awful.tag . history.restore ,
awful.key ( { modkey , } , " k " , function ( ) awful.client . focus.byidx ( - 1 ) end , { description = " focus previous by index " , group = " client " } ) ,
{ description = " go back " , group = " tag " } ) ,
awful.key ( { modkey , } , " w " , function ( ) mymainmenu : show ( ) end , { description = " show main menu " , group = " awesome " } ) ,
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
-- Layout manipulation
awful.key ( { modkey , " Shift " } , " j " , function ( ) awful.client . swap.byidx ( 1 ) end ,
awful.key ( { modkey , " Shift " } , " j " , function ( ) awful.client . swap.byidx ( 1 ) end , { description = " swap with next client by index " , group = " client " } ) ,
{ 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 , " Shift " } , " k " , function ( ) awful.client . swap.byidx ( - 1 ) end ,
awful.key ( { modkey , " Control " } , " j " , function ( ) awful.screen . focus_relative ( 1 ) end , { description = " focus the next screen " , group = " screen " } ) ,
{ description = " swap with previous client by index " , group = " client " } ) ,
awful.key ( { modkey , " Control " } , " k " , function ( ) awful.screen . focus_relative ( - 1 ) end , { description = " focus the previous screen " , group = " screen " } ) ,
awful.key ( { modkey , " Control " } , " j " , function ( ) awful.screen . focus_relative ( 1 ) end ,
awful.key ( { modkey , } , " u " , awful.client . urgent.jumpto , { description = " jump to urgent client " , group = " client " } ) ,
{ description = " focus the next screen " , group = " screen " } ) ,
awful.key ( { modkey , } , " Tab " , function ( ) awful.client . focus.history . previous ( ) if client.focus then client.focus : raise ( ) end end ,
awful.key ( { modkey , " Control " } , " k " , function ( ) awful.screen . focus_relative ( - 1 ) end ,
{ description = " go back " , group = " client " } ) ,
{ 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
-- Standard program
awful.key ( { modkey , } , " Return " , function ( ) awful.spawn ( terminal ) end ,
awful.key ( { modkey , } , " Return " , function ( ) awful.spawn ( terminal ) end , { description = " open a terminal " , group = " launcher " } ) ,
{ description = " open a terminal " , group = " launcher " } ) ,
awful.key ( { modkey , " Control " } , " r " , awesome.restart , { description = " reload awesome " , group = " awesome " } ) ,
awful.key ( { modkey , " Control " } , " r " , awesome.restart ,
awful.key ( { modkey , " Shift " } , " q " , awesome.quit , { description = " quit awesome " , group = " awesome " } ) ,
{ description = " reload awesome " , group = " awesome " } ) ,
awful.key ( { modkey , } , " l " , function ( ) awful.tag . incmwfact ( 0.05 ) end , { description = " increase master width factor " , group = " layout " } ) ,
awful.key ( { modkey , " Shift " } , " q " , awesome.quit ,
awful.key ( { modkey , } , " h " , function ( ) awful.tag . incmwfact ( - 0.05 ) end , { description = " decrease master width factor " , group = " layout " } ) ,
{ description = " quit awesome " , group = " awesome " } ) ,
awful.key ( { modkey , " Shift " } , " h " , function ( ) awful.tag . incnmaster ( 1 , nil , true ) end , { description = " increase the number of master clients " , group = " layout " } ) ,
awful.key ( { modkey , " Shift " } , " l " , function ( ) awful.tag . incnmaster ( - 1 , nil , true ) end , { description = " decrease the number of master clients " , group = " layout " } ) ,
awful.key ( { modkey , } , " l " , function ( ) awful.tag . incmwfact ( 0.05 ) end ,
awful.key ( { modkey , " Control " } , " h " , function ( ) awful.tag . incncol ( 1 , nil , true ) end , { description = " increase the number of columns " , group = " layout " } ) ,
{ description = " increase master width factor " , 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 , } , " h " , function ( ) awful.tag . incmwfact ( - 0.05 ) end ,
awful.key ( { modkey , } , " space " , function ( ) awful.layout . inc ( 1 ) end , { description = " select next " , group = " layout " } ) ,
{ description = " decrease master width factor " , group = " layout " } ) ,
awful.key ( { modkey , " Shift " } , " space " , function ( ) awful.layout . inc ( - 1 ) end , { description = " select previous " , group = " layout " } ) ,
awful.key ( { modkey , " Shift " } , " h " , function ( ) awful.tag . incnmaster ( 1 , nil , true ) end ,
{ description = " increase the number of master clients " , group = " layout " } ) ,
awful.key ( { modkey , " Control " } , " n " , function ( ) local c = awful.client . restore ( ) --[[ Focus restored client ]] if c then client.focus = c c : raise ( ) end end ,
awful.key ( { modkey , " Shift " } , " l " , function ( ) awful.tag . incnmaster ( - 1 , nil , true ) end ,
{ description = " restore minimized " , group = " client " } ) ,
{ description = " decrease the number of master clients " , group = " layout " } ) ,
awful.key ( { modkey , " Control " } , " h " , function ( ) awful.tag . incncol ( 1 , nil , true ) end ,
{ description = " increase the number of columns " , group = " layout " } ) ,
awful.key ( { modkey , " Control " } , " l " , function ( ) awful.tag . incncol ( - 1 , nil , true ) end ,
{ description = " decrease the number of columns " , group = " layout " } ) ,
awful.key ( { modkey , } , " space " , function ( ) awful.layout . inc ( 1 ) end ,
{ description = " select next " , group = " layout " } ) ,
awful.key ( { modkey , " Shift " } , " space " , function ( ) awful.layout . inc ( - 1 ) end ,
{ description = " select previous " , group = " layout " } ) ,
awful.key ( { modkey , " Control " } , " n " ,
function ( )
local c = awful.client . restore ( )
-- Focus restored client
if c then
client.focus = c
c : raise ( )
end
end ,
{ description = " restore minimized " , group = " client " } ) ,
-- Prompt
-- Prompt
awful.key ( { modkey } , " r " , function ( ) awful.screen . focused ( ) . mypromptbox : run ( ) end ,
awful.key ( { modkey } , " r " , function ( ) awful.screen . focused ( ) . mypromptbox : run ( ) end , { description = " run prompt " , group = " launcher " } ) ,
{ description = " run prompt " , group = " launcher " } ) ,
awful.key ( { modkey } , " x " ,
awful.key ( { modkey } , " x " ,
function ( )
function ( )
awful.prompt . run {
awful.prompt . run {
prompt = " Run Lua code: " ,
prompt = " Run Lua code: " ,
textbox = awful.screen . focused ( ) . mypromptbox.widget ,
textbox = awful.screen . focused ( ) . mypromptbox.widget ,
exe_callback = awful.util . eval ,
exe_callback = awful.util . eval ,
history_path = awful.util . get_cache_dir ( ) .. " /history_eval "
history_path = awful.util . get_cache_dir ( ) .. " /history_eval "
}
}
end ,
end ,
{ description = " lua execute prompt " , group = " awesome " } ) ,
{ description = " lua execute prompt " , group = " awesome " } ) ,
-- Menubar
-- Menubar
awful.key ( { modkey } , " p " , function ( ) menubar.show ( ) end ,
awful.key ( { modkey } , " p " , function ( ) menubar.show ( ) end , { description = " show the menubar " , group = " launcher " } ) ,
{ description = " show the menubar " , group = " launcher " } ) ,
-- Lanceurs perso
awful.key ( { modkey } , " F1 " , function ( ) awful.util . spawn ( " firefox " ) end ) ,
awful.key ( { modkey } , " F2 " , function ( ) awful.util . spawn ( " firefox " ) end ) ,
-- awful.key({ modkey }, "F3", function () awful.util.spawn("") end),
awful.key ( { modkey } , " F4 " , function ( ) awful.util . spawn ( " chromium " ) end ) ,
awful.key ( { modkey } , " F5 " , function ( ) awful.util . spawn ( " spacefm " ) end ) ,
awful.key ( { modkey } , " F6 " , function ( ) awful.util . spawn ( " vlc " ) end ) ,
awful.key ( { modkey } , " F7 " , function ( ) awful.util . spawn ( " claws-mail " ) end ) ,
awful.key ( { modkey } , " F11 " , function ( ) awful.util . spawn ( " xrandr-auto " ) end ) ,
awful.key ( { modkey } , " F12 " , function ( ) awful.util . spawn ( " slock " ) end ) ,
awful.key ( { modkey , " Shift " } , " F1 " , function ( ) awful.util . spawn ( " claws-mail " ) end ) ,
awful.key ( { modkey , " Shift " } , " F3 " , function ( ) awful.util . spawn ( " pcmanfm " ) end ) ,
awful.key ( { modkey , " Shift " } , " F6 " , function ( ) awful.util . spawn ( " clementine " ) end ) ,
awful.key ( { modkey , " Shift " } , " F11 " , function ( ) awful.util . spawn ( " xrandr-auto-2 " ) end )
-- awful.key({ modkey, "Shift" }, "F11", function () awful.util.spawn("/home/taeradan/bin/xrandr-left") end),
-- awful.key({ modkey, "Control" }, "F11", function () awful.util.spawn("/home/taeradan/bin/xrandr-right") end),
-- Lanceurs perso
awful.key ( { modkey } , " F1 " , function ( ) awful.util . spawn ( " firefox " ) end , { description = " Lance Firefox " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F2 " , function ( ) awful.util . spawn ( " firefox " ) end , { description = " Lance Firefox " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F3 " , function ( ) awful.util . spawn ( " gqrx " ) end , { description = " Lance gqrx " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F4 " , function ( ) awful.util . spawn ( " chromium " ) end , { description = " Lance Chromium " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F5 " , function ( ) awful.util . spawn ( " spacefm " ) end , { description = " Lance spacefm " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F6 " , function ( ) awful.util . spawn ( " vlc " ) end , { description = " Lance vlc " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F7 " , function ( ) awful.util . spawn ( " claws-mail " ) end , { description = " Lance claws " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F11 " , function ( ) awful.util . spawn ( " xrandr-auto " ) end , { description = " Lance le script xrandr-auto " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey } , " F12 " , function ( ) awful.util . spawn ( " slock " ) end , { description = " Verouille la session avec slock " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey , " Shift " } , " F1 " , function ( ) awful.util . spawn ( " claws-mail " ) end , { description = " Lance claws " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey , " Shift " } , " F3 " , function ( ) awful.util . spawn ( " pcmanfm " ) end , { description = " Lance pcmanfm " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey , " Shift " } , " F6 " , function ( ) awful.util . spawn ( " clementine " ) end , { description = " Lance clementine " , group = " Lanceurs personnels " } ) ,
awful.key ( { modkey , " Shift " } , " F11 " , function ( ) awful.util . spawn ( " xrandr-auto-2 " ) end , { description = " Lance le script xrandr-auto-2 " , group = " Lanceurs personnels " } )
-- awful.key({ modkey, "Shift" }, "F11", function () awful.util.spawn("/home/taeradan/bin/xrandr-left") end),
-- awful.key({ modkey, "Control" }, "F11", function () awful.util.spawn("/home/taeradan/bin/xrandr-right") end),
)
)
clientkeys = awful.util . table.join (
clientkeys = awful.util . table.join (
awful.key ( { modkey , } , " f " ,
awful.key ( { modkey , } , " f " , function ( c ) c.fullscreen = not c.fullscreen c : raise ( ) end , { description = " toggle fullscreen " , group = " client " } ) ,
function ( c )
awful.key ( { modkey , " Shift " } , " c " , function ( c ) c : kill ( ) end , { description = " close " , group = " client " } ) ,
c.fullscreen = not c.fullscreen
awful.key ( { modkey , " Control " } , " space " , awful.client . floating.toggle , { description = " toggle floating " , group = " client " } ) ,
c : raise ( )
awful.key ( { modkey , " Control " } , " Return " , function ( c ) c : swap ( awful.client . getmaster ( ) ) end , { description = " move to master " , group = " client " } ) ,
end ,
awful.key ( { modkey , } , " o " , function ( c ) c : move_to_screen ( ) end , { description = " move to screen " , group = " client " } ) ,
{ description = " toggle fullscreen " , group = " client " } ) ,
awful.key ( { modkey , } , " t " , function ( c ) c.ontop = not c.ontop end , { description = " toggle keep on top " , group = " client " } ) ,
awful.key ( { modkey , " Shift " } , " c " , function ( c ) c : kill ( ) end ,
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 = " close " , group = " client " } ) ,
{ description = " minimize " , group = " client " } ) ,
awful.key ( { modkey , " Control " } , " space " , awful.client . floating.toggle ,
awful.key ( { modkey , } , " m " , function ( c ) c.maximized = not c.maximized c : raise ( ) end , { description = " maximize " , group = " client " } )
{ 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 = " maximize " , group = " client " } )
)
)
-- Bind all key numbers to tags.
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- 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.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1 , 9 do
for i = 1 , 9 do
globalkeys = awful.util . table.join ( globalkeys ,
globalkeys = awful.util . table.join (
globalkeys ,
-- View tag only.
-- View tag only.
awful.key ( { modkey } , " # " .. i + 9 ,
awful.key (
function ( )
{ modkey } ,
local screen = awful.screen . focused ( )
" # " .. i + 9 ,
local tag = screen.tags [ i ]
function ( )
if tag then
local screen = awful.screen . focused ( )
tag : view_only ( )
local tag = screen.tags [ i ]
end
if tag then
end ,
tag : view_only ( )
{ description = " view tag # " .. i , group = " tag " } ) ,
end
end ,
{ description = " view tag # " .. i , group = " tag " }
) ,
-- Toggle tag display.
-- Toggle tag display.
awful.key ( { modkey , " Control " } , " # " .. i + 9 ,
awful.key (
function ( )
{ modkey , " Control " } ,
local screen = awful.screen . focused ( )
" # " .. i + 9 ,
local tag = screen.tags [ i ]
function ( )
if tag then
local screen = awful.screen . focused ( )
awful.tag . viewtoggle ( tag )
local tag = screen.tags [ i ]
end
if tag then
end ,
awful.tag . viewtoggle ( tag )
{ description = " toggle tag # " .. i , group = " tag " } ) ,
end
end ,
{ description = " toggle tag # " .. i , group = " tag " }
) ,
-- Move client to tag.
-- Move client to tag.
awful.key ( { modkey , " Shift " } , " # " .. i + 9 ,
awful.key (
function ( )
{ modkey , " Shift " } ,
if client.focus then
" # " .. i + 9 ,
local tag = client.focus . screen.tags [ i ]
function ( )
if tag then
if client.focus then
client.focus : move_to_tag ( tag )
local tag = client.focus . screen.tags [ i ]
end
if tag then
end
client.focus : move_to_tag ( tag )
end ,
end
{ description = " move focused client to tag # " .. i , group = " tag " } ) ,
end
end ,
{ description = " move focused client to tag # " .. i , group = " tag " }
) ,
-- Toggle tag on focused client.
-- Toggle tag on focused client.
awful.key ( { modkey , " Control " , " Shift " } , " # " .. i + 9 ,
awful.key (
function ( )
{ modkey , " Control " , " Shift " } ,
if client.focus then
" # " .. i + 9 ,
local tag = client.focus . screen.tags [ i ]
function ( )
if tag then
if client.focus then
client.focus : toggle_tag ( tag )
local tag = client.focus . screen.tags [ i ]
end
if tag then
end
client.focus : toggle_tag ( tag )
end ,
end
{ description = " toggle focused client on tag # " .. i , group = " tag " } )
end
end ,
{ description = " toggle focused client on tag # " .. i , group = " tag " }
)
)
)
end
end
clientbuttons = awful.util . table.join (
clientbuttons = awful.util . table.join (
awful.button ( { } , 1 , function ( c ) client.focus = c ; c : raise ( ) end ) ,
awful.button ( { } , 1 , function ( c ) client.focus = c ; c : raise ( ) end ) ,
awful.button ( { modkey } , 1 , awful.mouse . client.move ) ,
awful.button ( { modkey } , 1 , awful.mouse . client.move ) ,
awful.button ( { modkey } , 3 , awful.mouse . client.resize ) )
awful.button ( { modkey } , 3 , awful.mouse . client.resize ) )
-- Set keys
-- Set keys
root.keys ( globalkeys )
root.keys ( globalkeys )
@ -447,119 +444,142 @@ root.keys(globalkeys)
-- Rules to apply to new clients (through the "manage" signal).
-- Rules to apply to new clients (through the "manage" signal).
awful.rules . rules = {
awful.rules . rules = {
-- All clients will match this rule.
-- All clients will match this rule.
{ rule = { } ,
{
properties = { border_width = beautiful.border_width ,
rule = { } ,
border_color = beautiful.border_normal ,
properties = {
focus = awful.client . focus.filter ,
border_width = beautiful.border_width ,
raise = true ,
border_color = beautiful.border_normal ,
keys = clientkeys ,
focus = awful.client . focus.filter ,
buttons = clientbuttons ,
raise = true ,
screen = awful.screen . preferred ,
keys = clientkeys ,
placement = awful.placement . no_overlap + awful.placement . no_offscreen
buttons = clientbuttons ,
}
screen = awful.screen . preferred ,
} ,
placement = awful.placement . no_overlap + awful.placement . no_offscreen
}
-- Floating clients.
} ,
{ rule_any = {
-- Floating clients.
instance = {
{
" DTA " , -- Firefox addon DownThemAll.
rule_any = {
" copyq " , -- Includes session name in class.
instance = {
} ,
" DTA " , -- Firefox addon DownThemAll.
class = {
" copyq " , -- Includes session name in class.
" Arandr " ,
} ,
" Gpick " ,
class = {
" Kruler " ,
" Arandr " ,
" MessageWin " , -- kalarm.
" Gpick " ,
" Sxiv " ,
" Kruler " ,
" Wpa_gui " ,
" MessageWin " , -- kalarm.
" pinentry " ,
" Sxiv " ,
" veromix " ,
" Wpa_gui " ,
" xtightvncviewer " } ,
" pinentry " ,
" veromix " ,
name = {
" xtightvncviewer "
" Event Tester " , -- xev.
} ,
} ,
name = {
role = {
" Event Tester " , -- xev.
" AlarmWindow " , -- Thunderbird's calendar.
} ,
" pop-up " , -- e.g. Google Chrome's (detached) Developer Tools.
role = {
}
" AlarmWindow " , -- Thunderbird's calendar.
} , properties = { floating = true } } ,
" pop-up " , -- e.g. Google Chrome's (detached) Developer Tools.
}
-- Add titlebars to normal clients and dialogs
} ,
{ rule_any = { type = { " normal " , " dialog " }
properties = { floating = true }
} , properties = { titlebars_enabled = false }
} ,
} ,
-- Add titlebars to normal clients and dialogs
-- Set Firefox to always map on the tag named "2" on screen 1.
{
-- { rule = { class = "Firefox" },
rule_any = {
-- properties = { screen = 1, tag = "2" } },
type = { " normal " , " dialog " }
} ,
properties = { titlebars_enabled = false }
} ,
-- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } },
}
}
-- }}}
-- }}}
-- {{{ Signals
-- {{{ Signals
-- Signal function to execute when a new client appears.
-- Signal function to execute when a new client appears.
client.connect_signal ( " manage " , function ( c )
client.connect_signal (
-- Set the windows at the slave,
" manage " ,
-- i.e. put it at the end of others instead of setting it master.
function ( c )
-- if not awesome.startup then awful.client.setslave(c) end
--[[ 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
if awesome.startup and
and not c.size_hints . program_position then
not c.size_hints . user_position
-- Prevent clients from being unreachable after screen count changes.
and not c.size_hints . program_position then
awful.placement . no_offscreen ( c )
--[[ Prevent clients from being unreachable after screen count changes.]]
awful.placement . no_offscreen ( c )
end
end
end
end )
)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal ( " request::titlebars " , function ( c )
client.connect_signal (
-- buttons for the titlebar
" request::titlebars " ,
local buttons = awful.util . table.join (
function ( c )
awful.button ( { } , 1 , function ( )
-- buttons for the titlebar
client.focus = c
local buttons = awful.util . table.join (
c : raise ( )
awful.button (
awful.mouse . client.move ( c )
{ } ,
end ) ,
1 ,
awful.button ( { } , 3 , function ( )
function ( )
client.focus = c
client.focus = c
c : raise ( )
c : raise ( )
awful.mouse . client.resize ( c )
awful.mouse . client.move ( c )
end )
end
)
) ,
awful.button (
awful.titlebar ( c ) : setup {
{ } ,
{ -- Left
3 ,
awful.titlebar . widget.iconwidget ( c ) ,
function ( )
buttons = buttons ,
client.focus = c
layout = wibox.layout . fixed.horizontal
c : raise ( )
} ,
awful.mouse . client.resize ( c )
{ -- Middle
end
{ -- Title
)
align = " center " ,
)
widget = awful.titlebar . widget.titlewidget ( c )
awful.titlebar ( c ) : setup {
{ -- Left
awful.titlebar . widget.iconwidget ( c ) ,
buttons = buttons ,
layout = wibox.layout . fixed.horizontal
} ,
} ,
buttons = buttons ,
{ -- Middle
layout = wibox.layout . flex.horizontal
{ -- Title
} ,
align = " center " ,
{ -- Right
widget = awful.titlebar . widget.titlewidget ( c )
awful.titlebar . widget.floatingbutton ( c ) ,
} ,
awful.titlebar . widget.maximizedbutton ( c ) ,
buttons = buttons ,
awful.titlebar . widget.stickybutton ( c ) ,
layout = wibox.layout . flex.horizontal
awful.titlebar . widget.ontopbutton ( c ) ,
} ,
awful.titlebar . widget.closebutton ( c ) ,
{ -- Right
layout = wibox.layout . fixed.horizontal ( )
awful.titlebar . widget.floatingbutton ( c ) ,
} ,
awful.titlebar . widget.maximizedbutton ( c ) ,
layout = wibox.layout . align.horizontal
awful.titlebar . widget.stickybutton ( c ) ,
}
awful.titlebar . widget.ontopbutton ( c ) ,
end )
awful.titlebar . widget.closebutton ( c ) ,
layout = wibox.layout . fixed.horizontal ( )
} ,
layout = wibox.layout . align.horizontal
}
end
)
-- Enable sloppy focus, so that focus follows mouse.
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal ( " mouse::enter " , function ( c )
client.connect_signal (
if awful.layout . get ( c.screen ) ~= awful.layout . suit.magnifier
" mouse::enter " ,
function ( c )
if awful.layout . get ( c.screen ) ~= awful.layout . suit.magnifier
and awful.client . focus.filter ( c ) then
and awful.client . focus.filter ( c ) then
client.focus = c
client.focus = c
end
end
end
end )
)
client.connect_signal ( " focus " , function ( c ) c.border_color = beautiful.border_focus 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 )
client.connect_signal ( " unfocus " , function ( c ) c.border_color = beautiful.border_normal end )