From 76e4fa8a7864ed8c2d6a2c5a9443b9acfbd64832 Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Fri, 21 Jan 2022 11:10:40 +0100 Subject: [PATCH] ADD i3 config file --- nixpkgs/configs/i3config | 144 +++++++++++++++++++++++++++++++++++++++ nixpkgs/home.nix | 3 + 2 files changed, 147 insertions(+) create mode 100644 nixpkgs/configs/i3config diff --git a/nixpkgs/configs/i3config b/nixpkgs/configs/i3config new file mode 100644 index 0000000..f0cf354 --- /dev/null +++ b/nixpkgs/configs/i3config @@ -0,0 +1,144 @@ +# version : 20220121 + +set $mod Mod4 +set $ALT Mod1 + +# Couleurs barre de titre et contour des fenetres +set $blue #005588 +set $gray1 #484848 +set $gray2 #333333 + +set $ws1 "1: console" +set $ws2 "2: office" +set $ws3 "3: web" + +# Couleur des fenetres avec et sans focus +client.focused $gray1 $gray1 #FFFFFF #333333 +client.focused_inactive $gray2 $gray2 #FFFFFF #000000 +client.unfocused $gray2 $gray2 #FFFFFF #000000 + +# Police de caracteres pour les titres des fenetres. ISO 10646 = Unicode +font pango:Hack 10 + +# wallpaper +exec --no-startup-id feh --bg-scale /home/alexandre/images/SF.jpg + +# Redimensionnement de fenetres +mode "resize" { + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + # Retour au mode normal: Enter ou Escape ou q ou ^[ + bindsym Return mode "default" + bindsym q mode "default" + bindsym Escape mode "default" + bindcode Control+34 mode "default" +} +bindsym $mod+s mode "resize" + +# Tue la fenetre avec le focus +bindsym $mod+Shift+A kill + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+p layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle +# +# # change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle +# +# # focus the parent container +bindsym $mod+a focus parent +# +# Change la fenetre ayant le focus +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# Met la fenetre avec le focus en mode plein écran +bindsym $mod+f fullscreen + +# Deplacement entre les bureaux +bindsym $mod+ampersand workspace $ws1 +bindsym $mod+eacute workspace $ws2 +bindsym $mod+quotedbl workspace $ws3 +bindsym $mod+apostrophe workspace 4 +bindsym $mod+parenleft workspace 5 +bindsym $mod+minus workspace 6 +bindsym $mod+egrave workspace 7 +bindsym $mod+underscore workspace 8 +bindsym $mod+ccedilla workspace 9 +bindsym $mod+agrave workspace 10 + +# Déplacement de la fenetre ayant le focus d'un bureau à l'autre +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# Recharge le fichier de configuration +bindsym $mod+Shift+C reload + +# Redemarre i3 mais concerve ce qui est lancé. Utilisable pour les MAJ +bindsym $mod+Shift+R restart + +# sort d'i3 +bindsym $mod+Shift+E exit + +# lance dmenu (le lanceur de pgm. la barre de dmenu est noir) +bindsym $mod+d exec rofi -show drun -show-icons -modi drun + +# status bar +bar { + font pango:DejaVu Sans Mono, FontAwesome 12 + position top + status_command i3status-rs ~/.config/i3status-rust/config-bottom.toml + colors { + separator #666666 + background #222222 + statusline #dddddd + focused_workspace #0088CC #0088CC #ffffff + active_workspace #333333 #333333 #ffffff + inactive_workspace #333333 #333333 #888888 + urgent_workspace #2f343a #900000 #ffffff + } +} + +# alt+win+l : verouille la session, image de : +bindsym $mod+$ALT+l exec i3lock -ti ~/images/coffee_time.png + +# blocage automatique de l'ecran en cas d'inactivité +exec xautolock -detectsleep -locker 'i3lock -ti ~/images/coffee_time.png' + +# Capture d'ecran +bindsym Print exec scrot -u '%Y-%m-%d-%T_$wx$h_scrot.png' -e 'mv $f ~/Screenshots/' + +# start a terminal +bindsym $mod+Return exec "LIBGL_ALWAYS_SOFTWARE=1 alacritty" +bindsym $mod+m exec "i3-sensible-terminal -e ncmpcpp" + +# Assigne les applications aux workspaces +assign [class="firefox"] $ws3 +assign [class="emacs"] $ws2 + +# programmes au démarrage +exec --no-startup-id nm-applet +exec --no-startup-id nextcloud diff --git a/nixpkgs/home.nix b/nixpkgs/home.nix index 8fd1fb1..708b877 100644 --- a/nixpkgs/home.nix +++ b/nixpkgs/home.nix @@ -13,4 +13,7 @@ layout = "fr"; variant = "bepo"; }; + xdg.configFile = { + "i3/config".source = ./configs/i3config; + }; }