2025-10-03 13:16:10 +03:30
from libqtile import bar , layout , qtile , widget , hook
from libqtile . config import Click , Drag , Group , Key , Match , Screen
from libqtile . lazy import lazy
from libqtile . utils import guess_terminal
from libqtile . bar import Bar , Gap
import subprocess
2025-10-09 12:38:42 +03:30
from libqtile . widget . cpu import CPU
from libqtile . widget . memory import Memory
2025-10-03 13:16:10 +03:30
2025-10-03 17:11:00 +03:30
subprocess . run ( " /home/coast/.local/src/local/bin/start_qtile.sh " )
2025-10-03 13:16:10 +03:30
mod = " mod4 "
terminal = " footclient "
keys = [
Key ( [ mod ] , " h " , lazy . layout . left ( ) , desc = " Move focus to left " ) ,
Key ( [ mod ] , " j " , lazy . layout . right ( ) , desc = " Move focus to right " ) ,
Key ( [ mod ] , " k " , lazy . layout . down ( ) , desc = " Move focus down " ) ,
Key ( [ mod ] , " l " , lazy . layout . up ( ) , desc = " Move focus up " ) ,
Key ( [ mod ] , " space " , lazy . layout . next ( ) , desc = " Move window focus to other window " ) ,
Key ( [ mod , " shift " ] , " h " , lazy . layout . shuffle_left ( ) , desc = " Move window to the left " ) ,
Key ( [ mod , " shift " ] , " l " , lazy . layout . shuffle_right ( ) , desc = " Move window to the right " ) ,
Key ( [ mod , " shift " ] , " j " , lazy . layout . shuffle_down ( ) , desc = " Move window down " ) ,
Key ( [ mod , " shift " ] , " k " , lazy . layout . shuffle_up ( ) , desc = " Move window up " ) ,
Key ( [ mod , " control " ] , " h " , lazy . layout . grow_left ( ) , desc = " Grow window to the left " ) ,
Key ( [ mod , " control " ] , " l " , lazy . layout . grow_right ( ) , desc = " Grow window to the right " ) ,
Key ( [ mod , " control " ] , " j " , lazy . layout . grow_down ( ) , desc = " Grow window down " ) ,
Key ( [ mod , " control " ] , " k " , lazy . layout . grow_up ( ) , desc = " Grow window up " ) ,
Key ( [ mod ] , " n " , lazy . layout . normalize ( ) , desc = " Reset all window sizes " ) ,
2025-10-05 03:57:37 +03:30
Key ( [ mod , " shift " ] , " Return " , lazy . layout . toggle_split ( ) , desc = " Toggle between split and unsplit sides of stack " ) ,
2025-10-03 17:11:00 +03:30
Key ( [ mod ] , " Return " , lazy . spawn ( terminal ) , desc = " Launch foot " ) ,
2025-10-03 13:16:10 +03:30
Key ( [ mod ] , " Tab " , lazy . next_layout ( ) , desc = " Toggle between layouts " ) ,
Key ( [ mod ] , " s " , lazy . window . kill ( ) , desc = " Kill focused window " ) ,
2025-10-07 17:23:57 +03:30
Key ( [ mod ] , " w " , lazy . window . toggle_fullscreen ( ) , desc = " Toggle fullscreen on the focused window " ) ,
2025-10-03 17:11:00 +03:30
Key ( [ mod ] , " space " , lazy . window . toggle_floating ( ) , desc = " Toggle floating on the focused window " ) ,
2025-10-03 13:16:10 +03:30
Key ( [ mod , " control " ] , " r " , lazy . reload_config ( ) , desc = " Reload the config " ) ,
Key ( [ mod , " shift " ] , " q " , lazy . shutdown ( ) , desc = " Shutdown Qtile " ) ,
2025-10-09 12:38:42 +03:30
Key ( [ mod ] , " r " , lazy . spawn ( " wmenu-run -f \" Maple Mono 10 \" -N #000000 -n #ffffff -M #aeaeae -S #aeaeae -s #000000 " ) , desc = " Spawn a command using wmenu " ) ,
2025-10-04 17:47:25 +03:30
Key ( [ mod ] , " Print " , lazy . spawn ( " /home/coast/.local/src/local/bin/screenie-wlr " ) ) ,
2025-10-07 17:23:57 +03:30
Key ( [ mod , " shift " ] , " Print " , lazy . spawn ( " /usr/bin/grim " ) ) ,
2025-10-05 03:57:37 +03:30
Key ( [ mod ] , " Left " , lazy . window . move_floating ( - 20 , 0 ) ) ,
Key ( [ mod ] , " Right " , lazy . window . move_floating ( 20 , 0 ) ) ,
Key ( [ mod ] , " Up " , lazy . window . move_floating ( 0 , - 20 ) ) ,
Key ( [ mod ] , " Down " , lazy . window . move_floating ( 0 , 20 ) ) ,
Key ( [ mod , " shift " ] , " Left " , lazy . window . resize_floating ( - 20 , 0 ) ) ,
Key ( [ mod , " shift " ] , " Right " , lazy . window . resize_floating ( 20 , 0 ) ) ,
Key ( [ mod , " shift " ] , " Up " , lazy . window . resize_floating ( 0 , - 20 ) ) ,
Key ( [ mod , " shift " ] , " Down " , lazy . window . resize_floating ( 0 , 20 ) ) ,
2025-10-07 07:04:00 +03:30
Key ( [ mod , " shift " ] , " i " , lazy . spawn ( " pcmanfm " ) ) ,
Key ( [ mod , " shift " ] , " b " , lazy . spawn ( " firefox-bin " ) ) ,
2025-10-07 17:23:57 +03:30
Key ( [ mod , " shift " ] , " v " , lazy . spawn ( " vesktop-bin " ) ) ,
2025-10-03 13:16:10 +03:30
]
for vt in range ( 1 , 8 ) :
2025-10-03 17:11:00 +03:30
keys . append ( Key ( [ " control " , " mod1 " ] , f " f { vt } " , lazy . core . change_vt ( vt ) . when ( func = lambda : qtile . core . name == " wayland " ) , desc = f " Switch to VT { vt } " ) )
2025-10-03 13:16:10 +03:30
groups = [ Group ( i ) for i in " 123456789 " ]
for i in groups :
keys . extend (
[
Key (
[ mod ] ,
i . name ,
lazy . group [ i . name ] . toscreen ( ) ,
desc = f " Switch to group { i . name } " ,
) ,
Key (
[ mod , " shift " ] ,
i . name ,
lazy . window . togroup ( i . name , switch_group = True ) ,
desc = f " Switch to & move focused window to group { i . name } " ,
) ,
]
)
layouts = [
2025-10-09 12:38:42 +03:30
layout . MonadTall ( font = " Maple Mono " , margin = 8 , border_focus = [ " #454545 " ] , border_width = 4 , border_normal = [ " #1c1c1c " ] ) ,
2025-10-03 13:16:10 +03:30
# Try more layouts by unleashing below layouts.
# layout.Stack(num_stacks=2),
# layout.Bsp(),
# layout.Matrix(),
2025-10-09 12:38:42 +03:30
#layout.MonadWide(font = "Maple Mono", margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
#layout.RatioTile(font = "Maple Mono", margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
2025-10-03 13:16:10 +03:30
# layout.Tile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
2025-10-09 12:38:42 +03:30
widget_defaults = dict ( font = " sans " , fontsize = 20 , padding = 3 )
2025-10-03 13:16:10 +03:30
extension_defaults = widget_defaults . copy ( )
2025-10-09 12:38:42 +03:30
class CenteredWindowName ( widget . WindowName ) :
def draw ( self ) :
self . layout . text = self . text
text_width , _ = self . layout . size
x = ( self . bar . width - text_width ) / 2
y = ( self . bar . height - self . layout . height ) / 2
self . drawer . clear ( self . background or self . bar . background )
self . layout . draw ( int ( x ) , int ( y ) )
self . drawer . draw ( offsetx = 0 , width = self . bar . width )
2025-10-03 13:16:10 +03:30
screens = [
Screen (
2025-10-09 12:38:42 +03:30
top = bar . Bar
( [ widget . Spacer ( length = 3 ) ,
widget . TextBox ( text = " " , fontsize = 16 ) ,
widget . Spacer ( length = 3 ) ,
widget . GroupBox ( font = ' MapleMono ' , borderwidth = 1 , padding = 6 , rounded = False , highlight_method = ' block ' , this_current_screen_border = ' #3a3a3a ' , foreground = ' #ffffff ' , active = ' #ffffff ' , inactive = ' #ffffff ' , hide_unused = True , fontsize = 16 ) ,
widget . TextBox ( text = ' [ ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . WindowName ( font = " Maple Mono " , foreground = [ " #ffffff " ] , fontsize = 16 , ) ,
widget . TextBox ( text = ' ] ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . TextBox ( text = ' [ ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . Memory ( foreground = " #ffffff " , font = " MapleMono " , fontsize = 16 , padding = 1 , mouse_callbacks = { ' Button1 ' : lambda : qtile . cmd_spawn ( terminal + ' -e htop ' ) } , format = ' {MemPercent} % ' ) ,
widget . TextBox ( text = ' ] ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . TextBox ( text = ' [ ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . CPU ( font = " MapleMono " , fontsize = 16 , foreground = " #ffffff " , padding = 1 , mouse_callbacks = { ' Button1 ' : lambda : qtile . cmd_spawn ( terminal + ' -e htop ' ) } , format = ' {load_percent} % ' ) ,
widget . TextBox ( text = ' ] ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . TextBox ( text = ' [ ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ,
widget . Clock ( format = " % I: % M % p " , font = " Maple Mono " , padding = 1 , foreground = [ " #ffffff " ] , fontsize = 16 , mouse_callbacks = { ' Button1 ' : lambda : qtile . cmd_spawn ( ' eww open calendar ' ) , ' Button3 ' : lambda : qtile . cmd_spawn ( ' eww close calendar ' ) } ) ,
widget . TextBox ( text = ' ] ' , font = " Maple Mono " , padding = 1 , foreground = [ " #1e1e1e " ] , fontsize = 16 ) ] ,
24 ) ) ]
2025-10-03 13:16:10 +03:30
mouse = [
Drag ( [ mod ] , " Button1 " , lazy . window . set_position_floating ( ) , start = lazy . window . get_position ( ) ) ,
2025-10-09 12:38:42 +03:30
Drag ( [ mod ] , " Button3 " , lazy . window . set_size_floating ( ) , start = lazy . window . get_size ( ) ) ]
2025-10-03 13:16:10 +03:30
dgroups_key_binder = None
dgroups_app_rules = [ ]
follow_mouse_focus = True
bring_front_click = False
floats_kept_above = True
cursor_warp = False
floating_layout = layout . Floating (
2025-10-05 03:57:37 +03:30
border_focus = " #454545 " ,
border_normal = " #1c1c1c " ,
border_width = 4 ,
2025-10-03 13:16:10 +03:30
float_rules = [
* layout . Floating . default_float_rules ,
Match ( wm_class = " confirmreset " ) ,
Match ( wm_class = " makebranch " ) ,
Match ( wm_class = " maketag " ) ,
Match ( wm_class = " ssh-askpass " ) ,
Match ( title = " branchdialog " ) ,
2025-10-09 12:38:42 +03:30
Match ( title = " pinentry " ) ] )
2025-10-03 13:16:10 +03:30
auto_fullscreen = True
focus_on_window_activation = " smart "
reconfigure_screens = True
auto_minimize = True
wl_input_rules = None
wl_xcursor_theme = " Adwaita "
wl_xcursor_size = 24
wmname = " LG3D "