MAURJDLJIL3B65RJA4C64F3MYJRPEMNB7ZDPLCIZZV4FVJAQ2ASQC
{ pkgs ? import <nixpkgs> {} }:
[
## Outils de base et shell
pkgs.fish
pkgs.git
pkgs.pijul
pkgs.openssh
pkgs.eza
pkgs.fd
pkgs.ripgrep
pkgs.bat
pkgs.zellij
pkgs.stow
pkgs.ranger
pkgs.zoxide
## Programmation
pkgs.roswell
## Paquets Emacs
(pkgs.emacsWithPackages (epkgs: with epkgs; [
evil
which-key
vertico
orderless
marginalia
consult
corfu
cape
dirvish
projectile
sly
general
solarized-theme
]))
]
;; Ceci est une configuration de système d'exploitation générée par
;; l'installateur graphique.
;;
;; Une fois l'installation terminée, vous pouvez apprendre à modifier
;; ce fichier pour ajuster la configuration du système et le passer à
;; la commande « guix system reconfigure » pour rendre vos changements
;; effectifs.
;; Indique quels modules importer pour accéder aux variables
;; utilisées dans cette configuration.
(use-modules (gnu)
(nongnu packages linux)
(gnu services nix)
(gnu packages shells))
(use-service-modules cups desktop networking ssh xorg)
(operating-system
(kernel linux)
(firmware (list linux-firmware))
(locale "fr_FR.utf8")
(timezone "Europe/Paris")
(keyboard-layout (keyboard-layout "fr" "bepo_afnor"))
(host-name "lenouveau")
;; La liste des comptes utilisateurs (« root » est implicite).
(users (cons* (user-account
(name "jc")
(comment "Jean-Christophe JAMEUX BERTHE")
(group "users")
(home-directory "/home/jc")
(shell (file-append fish "/bin/fish"))
(supplementary-groups '("wheel" "netdev" "audio" "video")))
%base-user-accounts))
;; Paquets installés pour tout le système. Les utilisateurs et utilisatrices peuvent
;; aussi installer des paquets sous leur propre compte : utilisez « guix search MOT-CLÉ »
;; pour chercher des paquets et « guix install PAQUET » pour installer un paquet.
(packages (append (list (specification->package "zsh")) %base-packages))
;; Voici la liste des services du système. Pour trouver les services
;; disponibles, lancez « guix system search MOT-CLÉ » dans un terminal.
(services
(append (list (service gnome-desktop-service-type)
(service bluetooth-service-type
(bluetooth-configuration
(auto-enable? #t)))
;; Pour configurer OpenSSH, passez un enregistrement « openssh-configuration »
;; en deuxième argument à « service » ci-dessous.
(service openssh-service-type)
(service tor-service-type)
(service cups-service-type)
(set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout)))
(service nix-service-type))
;; Voici la liste des services par défaut à laquelle nous
;; ajoutons nos propres services.
%desktop-services))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
"8d68a9eb-fd51-47ee-a37e-8e1a3bc745b7")))))
;; La liste des systèmes de fichiers qui seront « montés ». Les identifiants
;; de systèmes de fichiers uniques (« UUIDs ») qui se trouvent ici s'obtiennent
;; en exécutant « blkid » dans un terminal.
(file-systems (cons* (file-system
(mount-point "/boot/efi")
(device (uuid "F76A-B6B7"
'fat32))
(type "vfat"))
(file-system
(mount-point "/")
(device (uuid
"dec13dac-1afb-4560-86cb-4e305f5e84fa"
'ext4))
(type "ext4")) %base-file-systems)))
;; Ce fichier « home-environment » peut être passé à « guix home reconfigure »
;; pour reproduire le contenu de votre profil. Son contenu est « symbolique » :
;; il ne spécifie que les noms des paquets. Pour reproduire exactement le même
;; profil, vous devez aussi retenir les canaux utilisés, ceux renvoyés par
;; « guix describe ». Voir la section « Répliquer Guix » dans le manuel.
(use-modules (gnu home)
(gnu packages)
(gnu services)
(guix gexp)
(gnu home services dotfiles)
(gnu home services shells)
(gnu packages wm)
(gnu packages terminals)
(gnu packages xorg)
(gnu home services)
(guix gexp))
(home-environment
;; Ci-dessous se trouve la liste des paquets qui seront disponibles dans votre
;; profil personnel, dans ~/.guix-home/profile.
(packages (specifications->packages (list "curl"
"python"
"python-pytest"
"python-pip"
"python-isort"
"python-pyflakes"
"cabal-install"
"hoogle"
"ghc"
"bat"
"cmake"
"roswell"
"ocaml-ocp-indent"
"xclip"
"xdotool"
"xprop"
"xwininfo"
"shfmt"
"racket"
"python"
"gnuplot"
"wl-clipboard"
"ocaml-merlin"
"ocaml-utop"
"dune"
"ocamlformat"
"nixfmt"
;"grip"
"markdown"
"shellcheck"
"fd"
"ripgrep"
"tealdeer"
"libreoffice"
"xdg-utils"
"tree-sitter"
"git"
"font-fira-code"
"zsh"
"fish"
"ispell"
"emacs"
"emacs-guix"
"guix-icons"
"gtk+"
"gtk"
"pkg-config"
"openssl"
"rust"
"rust-cargo"
"zoxide"
"texmacs"
"texlive"
"gnome-shell-extension-paperwm"
"kmonad"
"eza"
"fzf-tab"
"fzf"
"zsh-completions"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"ranger"
"syncthing"
"curl"
"ispell"
"libinput"
"gnome-shell-extension-appindicator"
"stow"
"git-delta"
"evince"
"flatpak"
"glibc"
"ffmpeg"
"sox"
"fyi"
"xbindkeys"
"nix")))
;; Voici la liste des services personnels. Pour trouver les services
;; disponibles, lancez « guix home search MOT-CLÉ » dans un terminal.
(services
(list
(service home-fish-service-type
(home-fish-configuration
(config
(list
(plain-file "chemins"
"
if test -e $HOME/.nix-profile/etc/profile.d/nix.fish
source $HOME/.nix-profile/etc/profile.d/nix.fish
end
set -Ux NIX_PATH nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz
set -gx PATH $PATH $HOME/.nix-profile/bin
if test -e /var/lib/flatpak
set -gx FLATPAK_INSTALLATIONS_DIR /var/lib/flatpak
end
if test -e $HOME/.local/share/flatpak
set -gx PATH $PATH $HOME/.local/share/flatpak/exports/bin
set -gx PATH $PATH /var/lib/flatpak/exports/bin
set -gx XDG_DATA_DIRS $XDG_DATA_DIRS $HOME/.local/share/flatpak/exports/share
set -gx XDG_DATA_DIRS $XDG_DATA_DIRS /var/lib/flatpak/exports/share
end
if test -d $HOME/.local/bin
set -gx PATH $PATH $HOME/.local/bin
end")))))
;(service home-dotfiles-service-type
; (home-dotfiles-configuration
; (directories '("/home/jc/Documents/Git/Config/Guix/dotfiles"))))
)))
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq inhibit-startup-message t)
(prefer-coding-system 'utf-8)
(setq backup-directory-alist `(("." . "~/.emacs-saves")))
(setq auto-save-file-name-transforms `((".*" "~/.emacs-saves/" t)))
(make-directory "~/.emacs-saves" t)
(use-package vertico
:init (vertico-mode))
(use-package orderless
:custom (completion-styles '(orderless)))
(use-package marginalia
:init (marginalia-mode))
(use-package consult
:bind (("C-s" . consult-line)
("C-x b" . consult-buffer)
("M-g g" . consult-goto-line)
("M-g i" . consult-imenu)))
(use-package corfu
:custom
(corfu-auto t)
(corfu-cycle t)
:init
(global-corfu-mode))
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-symbol))
(setq inferior-lisp-program "ros run")
(use-package sly
:init (setq sly-lisp-implementations '((roswell ("ros" "run"))))
:config (setq sly-symbol-completion-mode t))
(use-package eglot
:hook ((python-mode . eglot-ensure)
(c-mode . eglot-ensure)
(c++-mode . eglot-ensure)))
(use-package which-key
:init (which-key-mode))
(use-package evil
:init (evil-mode 1))
(use-package general
:config
(general-create-definer my/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(my/leader-keys
"f" '(:ignore t :which-key "fichier")
"f f" '(find-file :which-key "ouvrir fichier")
"f s" '(save-buffer :which-key "sauver")
"b" '(:ignore t :which-key "buffer")
"b b" '(consult-buffer :which-key "changer buffer")
"w" '(:ignore t :which-key "fenêtres")
"w v" '(split-window-right :which-key "split vertical")
"w s" '(split-window-below :which-key "split horizontal")
"w d" '(delete-window :which-key "fermer fenêtre")
"h" '(:ignore t :which-key "aide")
"h f" '(describe-function :which-key "fonction")
"h v" '(describe-variable :which-key "variable")
"h k" '(describe-key :which-key "touche")
"p" '(:ignore t :which-key "projet")
"p p" '(projectile-switch-project :which-key "changer projet")
"d" '(:ignore t :which-key "Dired")
"d d" '(dirvish :which-key "ouvrir Dired")
"g" '(:ignore t :which-key "Magit")
"g g" '(magit-status :which-key "status git")))
(use-package projectile
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'default))
:bind-keymap ("C-c p" . projectile-command-map)
:init
(when (file-directory-p "~/projects")
(setq projectile-project-search-path '("~/projects")))
(setq projectile-switch-project-action #'projectile-dired))
(use-package dirvish
:init (dirvish-override-dired-mode))
(use-package solarized-theme)
(load-theme 'solarized-light t)
(defun toggle-solarized-theme ()
(interactive)
(let ((current (car custom-enabled-themes)))
(mapc #'disable-theme custom-enabled-themes)
(load-theme (if (eq current 'solarized-light)
'solarized-dark
'solarized-light) t)))
(global-set-key (kbd "<f6>") #'toggle-solarized-theme)
(use-package perspective
:custom
(persp-mode-prefix-key (kbd "C-c M-p"))
:init
(persp-mode)
:config
(setq persp-state-default-file "~/.emacs.d/perspectives")
(add-hook 'kill-emacs-hook #'persp-state-save))
(use-package org-auto-tangle
:hook (org-mode . org-auto-tangle-mode))
(message "✅ Emacs avec complétion moderne, workspaces, Solarized et raccourcis SPC")
(defcfg
input (device-file
"/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink
"Sortie Kmonad principale"
"sleep 1 && setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
(defalias
j (tap-hold-next-release 300 j rsft)
f (tap-hold-next-release 300 f lsft)
d (tap-hold-next-release 300 d lctl)
k (tap-hold-next-release 300 k lctl)
s (tap-hold-next-release 300 s lalt)
l (tap-hold-next-release 300 l lalt)
a (tap-hold-next-release 300 a ralt)
cps (tap-hold-next-release 300 caps lmet)
pv (tap-hold-next-release 300 ; ralt)
gll (tap-hold-next-release 300 ' lmet)
g (tap-hold-next-release 300 g lmet)
h (tap-hold-next-release 300 h lmet)
spc (tap-hold-next-release 300 spc (layer-toggle slayer))
fin #(ralt spc)
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
caps a s d f g h j k l ; ' \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl left up down right)
(deflayer main
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
@cps @a @s @d @f @g @h @j @k @l @pv @gll \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt @spc ralt rctl left up down right)
(deflayer slayer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ pgup _ _ _ _ _
esc S-5 S-6 S-7 S-8 S-9 _ _ up _ _ _ _ _
S-0 S-1 S-2 S-3 S-4 _ home left down rght rght end _
_ _ _ _ _ _ _ _ pgdn pgdn _ _ _
_ _ _ _ _ _ _ _ _ _
)
(defcfg
input (device-file "ADDR_CLAVIER")
output (uinput-sink
"Sortie Kmonad MX Keys"
"/usr/bin/sleep 1 && /usr/bin/setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
(defalias
j (tap-hold-next-release 300 j rsft)
f (tap-hold-next-release 300 f lsft)
d (tap-hold-next-release 300 d lctl)
k (tap-hold-next-release 300 k lctl)
s (tap-hold-next-release 300 s lalt)
l (tap-hold-next-release 300 l lalt)
a (tap-hold-next-release 300 a ralt)
cps (tap-hold-next-release 300 caps lmet)
pv (tap-hold-next-release 300 ; ralt)
gll (tap-hold-next-release 300 ' lmet)
g (tap-hold-next-release 300 g lmet)
h (tap-hold-next-release 300 h lmet)
spc (tap-hold-next-release 300 spc (layer-toggle slayer))
fin #(ralt spc)
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
caps a s d f g h j k l ; ' \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl left up down right)
(deflayer main
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
@cps @a @s @d @f @g @h @j @k @l @pv @gll \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt @spc ralt rctl left up down right)
(deflayer slayer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ pgup _ _ _ _ _
esc S-5 S-6 S-7 S-8 S-9 _ _ up _ _ _ _ _
S-0 S-1 S-2 S-3 S-4 _ home left down rght rght end _
_ _ _ _ _ _ _ _ pgdn pgdn _ _ _
_ _ _ _ _ _ _ _ _ _
)
(defcfg
input (device-file "ADDR_CLAVIER")
output (uinput-sink
"Sortie Kmonad Casa Keys"
"/usr/bin/sleep 1 && /usr/bin/setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
(defalias
j (tap-hold-next-release 300 j rsft)
f (tap-hold-next-release 300 f lsft)
d (tap-hold-next-release 300 d lctl)
k (tap-hold-next-release 300 k lctl)
s (tap-hold-next-release 300 s lalt)
l (tap-hold-next-release 300 l lalt)
a (tap-hold-next-release 300 a ralt)
cps (tap-hold-next-release 300 caps lmet)
pv (tap-hold-next-release 300 ; ralt)
gll (tap-hold-next-release 300 ' lmet)
g (tap-hold-next-release 300 g lmet)
h (tap-hold-next-release 300 h lmet)
spc (tap-hold-next-release 300 spc (layer-toggle slayer))
fin #(ralt spc)
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
caps a s d f g h j k l ; ' \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl left up down right)
(deflayer main
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
@cps @a @s @d @f @g @h @j @k @l @pv @gll \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt @spc ralt rctl left up down right)
(deflayer slayer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ pgup _ _ _ _ _
esc S-5 S-6 S-7 S-8 S-9 _ _ up _ _ _ _ _
S-0 S-1 S-2 S-3 S-4 _ home left down rght rght end _
_ _ _ _ _ _ _ _ pgdn pgdn _ _ _
_ _ _ _ _ _ _ _ _ _
)
#+begin_src emacs-lisp
truc
#+end_src
;; Ceci est une configuration de système d'exploitation générée par
;; l'installateur graphique.
;;
;; Une fois l'installation terminée, vous pouvez apprendre à modifier
;; ce fichier pour ajuster la configuration du système et le passer à
;; la commande « guix system reconfigure » pour rendre vos changements
;; effectifs.
;; Indique quels modules importer pour accéder aux variables
;; utilisées dans cette configuration.
(use-modules (gnu)
(nongnu packages linux)
(gnu packages shells))
(use-service-modules cups desktop networking ssh xorg)
(operating-system
(kernel linux)
(firmware (list linux-firmware))
(locale "fr_FR.utf8")
(timezone "Europe/Paris")
(keyboard-layout (keyboard-layout "fr" "bepo_afnor"))
(host-name "Papareil")
;; La liste des comptes utilisateurs (« root » est implicite).
(users (cons* (user-account
(name "jc")
(comment "Jean-Christophe JAMEUX BERTHE")
(group "users")
(home-directory "/home/jc")
(shell (file-append fish "/bin/fish"))
(supplementary-groups '("wheel" "netdev" "audio" "video")))
%base-user-accounts))
;; Voici la liste des services du système. Pour trouver les services
;; disponibles, lancez « guix system search MOT-CLÉ » dans un terminal.
(services
(append (list (service gnome-desktop-service-type)
(service bluetooth-service-type
(bluetooth-configuration
(auto-enable? #t)))
;; Pour configurer OpenSSH, passez un enregistrement « openssh-configuration »
;; en deuxième argument à « service » ci-dessous.
(service openssh-service-type)
(service tor-service-type)
(service cups-service-type)
(set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout))))
;; Voici la liste des services par défaut à laquelle nous
;; ajoutons nos propres services.
%desktop-services))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(initrd-modules (append '("vmd") %base-initrd-modules))
(mapped-devices (list (mapped-device
(source (uuid
"2d6b9a0b-5c61-4843-aa02-06b4b974906d"))
(target "Guix")
(type luks-device-mapping))))
;; La liste des systèmes de fichiers qui seront « montés ». Les identifiants
;; de systèmes de fichiers uniques (« UUIDs ») qui se trouvent ici s'obtiennent
;; en exécutant « blkid » dans un terminal.
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/Guix")
(type "ext4")
(dependencies mapped-devices))
(file-system
(mount-point "/mnt/dos")
(device (uuid "C4A0C709A0C70142"
'ntfs))
(type "ntfs"))
(file-system
(mount-point "/boot/efi")
(device (uuid "A4C6-AB5C"
'fat32))
(type "vfat")) %base-file-systems)))
#+title: Emacs Configuration
#+PROPERTY: header-args :tangle init.el
Les sections suivantes décrivent une configuration moderne et modulaire d'Emacs, adaptée aussi bien à un usage mobile que desktop, avec des raccourcis inspirés de Doom/SpaceMax et une expérience de complétion fluide et contextuelle.
* Interface minimale et UTF-8
Une interface épurée pour se concentrer sur l'essentiel.
#+begin_src emacs-lisp
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq inhibit-startup-message t)
(prefer-coding-system 'utf-8)
#+end_src
* Sauvegardes centralisées
Tous les fichiers de sauvegarde sont regroupés dans un même dossier.
#+begin_src emacs-lisp
(setq backup-directory-alist `(("." . "~/.emacs-saves")))
(setq auto-save-file-name-transforms `((".*" "~/.emacs-saves/" t)))
(make-directory "~/.emacs-saves" t)
#+end_src
* Complétion moderne
Cette section active une suite d’outils de complétion efficaces et modulaires :
- *Vertico* : interface minimale pour la complétion dans le minibuffer
- *Orderless* : permet une complétion dans n’importe quel ordre
- *Marginalia* : affiche des annotations contextuelles dans les listes de complétion
- *Consult* : utilitaires pour la navigation et la recherche
- *Corfu* : complétion inline (dans le buffer courant)
- *Cape* : ajoute des sources à la complétion comme les fichiers, symboles, etc.
#+begin_src emacs-lisp
(use-package vertico
:init (vertico-mode))
(use-package orderless
:custom (completion-styles '(orderless)))
(use-package marginalia
:init (marginalia-mode))
(use-package consult
:bind (("C-s" . consult-line)
("C-x b" . consult-buffer)
("M-g g" . consult-goto-line)
("M-g i" . consult-imenu)))
(use-package corfu
:custom
(corfu-auto t)
(corfu-cycle t)
:init
(global-corfu-mode))
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-symbol))
#+end_src
* Programmation Lisp
Utilisation de *SLY* avec Roswell pour interagir avec Common Lisp.
#+begin_src emacs-lisp
(setq inferior-lisp-program "ros run")
(use-package sly
:init (setq sly-lisp-implementations '((roswell ("ros" "run"))))
:config (setq sly-symbol-completion-mode t))
#+end_src
* Support LSP avec Eglot
Active *Eglot* pour plusieurs langages (C, C++, Python…) afin d'obtenir la complétion, la navigation et la documentation.
#+begin_src emacs-lisp
(use-package eglot
:hook ((python-mode . eglot-ensure)
(c-mode . eglot-ensure)
(c++-mode . eglot-ensure)))
#+end_src
* Ergonomie et raccourcis
- *Which-key* : aide à la découverte des raccourcis
- *Evil* : navigation façon Vim
- *General* : création de raccourcis cohérents autour de la touche SPC
#+begin_src emacs-lisp
(use-package which-key
:init (which-key-mode))
(use-package evil
:init (evil-mode 1))
(use-package general
:config
(general-create-definer my/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(my/leader-keys
"f" '(:ignore t :which-key "fichier")
"f f" '(find-file :which-key "ouvrir fichier")
"f s" '(save-buffer :which-key "sauver")
"b" '(:ignore t :which-key "buffer")
"b b" '(consult-buffer :which-key "changer buffer")
"w" '(:ignore t :which-key "fenêtres")
"w v" '(split-window-right :which-key "split vertical")
"w s" '(split-window-below :which-key "split horizontal")
"w d" '(delete-window :which-key "fermer fenêtre")
"h" '(:ignore t :which-key "aide")
"h f" '(describe-function :which-key "fonction")
"h v" '(describe-variable :which-key "variable")
"h k" '(describe-key :which-key "touche")
"p" '(:ignore t :which-key "projet")
"p p" '(projectile-switch-project :which-key "changer projet")
"d" '(:ignore t :which-key "Dired")
"d d" '(dirvish :which-key "ouvrir Dired")
"g" '(:ignore t :which-key "Magit")
"g g" '(magit-status :which-key "status git")))
#+end_src
* Gestion de projets
Avec *Projectile*, navigation rapide entre projets, fichiers, buffers, etc.
#+begin_src emacs-lisp
(use-package projectile
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'default))
:bind-keymap ("C-c p" . projectile-command-map)
:init
(when (file-directory-p "~/projects")
(setq projectile-project-search-path '("~/projects")))
(setq projectile-switch-project-action #'projectile-dired))
#+end_src
* Gestionnaire de fichiers
*Dirvish* est une surcouche moderne à Dired avec une interface à la Ranger.
#+begin_src emacs-lisp
(use-package dirvish
:init (dirvish-override-dired-mode))
#+end_src
* Thème et bascule jour/nuit
Utilise *solarized-theme*, avec une fonction de bascule entre clair et sombre (F6).
#+begin_src emacs-lisp
(use-package solarized-theme)
(load-theme 'solarized-light t)
(defun toggle-solarized-theme ()
(interactive)
(let ((current (car custom-enabled-themes)))
(mapc #'disable-theme custom-enabled-themes)
(load-theme (if (eq current 'solarized-light)
'solarized-dark
'solarized-light) t)))
(global-set-key (kbd "<f6>") #'toggle-solarized-theme)
#+end_src
* Workspaces persistants
Avec *Perspective*, on peut retrouver les fenêtres et buffers tels qu’on les avait laissés à la fermeture d’Emacs.
#+begin_src emacs-lisp
(use-package perspective
:custom
(persp-mode-prefix-key (kbd "C-c M-p"))
:init
(persp-mode)
:config
(setq persp-state-default-file "~/.emacs.d/perspectives")
(add-hook 'kill-emacs-hook #'persp-state-save))
#+end_src
* Auto-Tangle des fichiers Org
Active automatiquement le tangle (extraction du code) pour les fichiers contenant ~#+auto_tangle: t~.
#+begin_src emacs-lisp
(use-package org-auto-tangle
:hook (org-mode . org-auto-tangle-mode))
#+end_src
* Chargement terminé
#+begin_src emacs-lisp
(message "✅ Emacs avec complétion moderne, workspaces, Solarized et raccourcis SPC")
#+end_src
;; Ceci est une configuration de système d'exploitation générée par
;; l'installateur graphique.
;;
;; Une fois l'installation terminée, vous pouvez apprendre à modifier
;; ce fichier pour ajuster la configuration du système et le passer à
;; la commande « guix system reconfigure » pour rendre vos changements
;; effectifs.
;; Indique quels modules importer pour accéder aux variables
;; utilisées dans cette configuration.
(use-modules (gnu)
(nongnu packages linux)
(gnu packages shells))
(use-service-modules cups desktop networking ssh xorg)
(operating-system
(kernel linux)
(firmware (list linux-firmware))
(locale "fr_FR.utf8")
(timezone "Europe/Paris")
(keyboard-layout (keyboard-layout "fr" "bepo_afnor"))
(host-name "CoursThales")
;; La liste des comptes utilisateurs (« root » est implicite).
(users (cons* (user-account
(name "jc")
(comment "Jean-Christophe JANEUX BERTHE")
(group "users")
(home-directory "/home/jc")
(shell (file-append fish "/bin/fish"))
(supplementary-groups '("wheel" "netdev" "audio" "video")))
%base-user-accounts))
;; Paquets installés pour tout le système. Les utilisateurs et utilisatrices peuvent
;; aussi installer des paquets sous leur propre compte : utilisez « guix search MOT-CLÉ »
;; pour chercher des paquets et « guix install PAQUET » pour installer un paquet.
(packages (append (list (specification->package "zsh")) %base-packages))
;; Voici la liste des services du système. Pour trouver les services
;; disponibles, lancez « guix system search MOT-CLÉ » dans un terminal.
(services
(append (list (service gnome-desktop-service-type)
(service bluetooth-service-type
(bluetooth-configuration
(auto-enable? #t)))
;; Pour configurer OpenSSH, passez un enregistrement « openssh-configuration »
;; en deuxième argument à « service » ci-dessous.
(service openssh-service-type)
(service tor-service-type)
(service cups-service-type)
(set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout))))
;; Voici la liste des services par défaut à laquelle nous
;; ajoutons nos propres services.
%desktop-services))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(mapped-devices (list (mapped-device
(source (uuid
"52cf448f-df74-47ba-9091-14db17094221"))
(target "cryptroot")
(type luks-device-mapping))))
;; La liste des systèmes de fichiers qui seront « montés ». Les identifiants
;; de systèmes de fichiers uniques (« UUIDs ») qui se trouvent ici s'obtiennent
;; en exécutant « blkid » dans un terminal.
(file-systems (cons* (file-system
(mount-point "/boot/efi")
(device (uuid "A148-A386"
'fat32))
(type "vfat"))
(file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "ext4")
(dependencies mapped-devices)) %base-file-systems)))
#+TITLE: Configuration du clavier
#+AUTHOR: Jean-Chistophe JAMEUX BERTHE
#+DESCRIPTION: Raccourci divers pour le confort d’utilisation du clavier
#+PROPERTY: header-args :tangle no :results silent
* Paramètres KMonad
** Nom des touches pour l’option de setxkbmap :
| compose:ralt | Right Alt |
| compose:lwin | Left Win |
| compose:lwin-altgr | 3rd level of Left Win |
| compose:rwin | Right Win |
| compose:rwin-altgr | 3rd level of Right Win |
| compose:menu | Menu (compose in KMonad) |
| compose:menu-altgr | 3rd level of Menu |
| compose:lctrl | Left Ctrl |
| compose:lctrl-altgr | 3rd level of Left Ctrl |
| compose:rctrl | Right Ctrl |
| compose:rctrl-altgr | 3rd level of Right Ctrl |
| compose:caps | Caps Lock |
| compose:caps-altgr | 3rd level of Caps Lock |
| compose:102 | The "< >" key |
| compose:102-altgr | 3rd level of the "< >" key |
| compose:paus | Pause |
| compose:ins | Insert |
| compose:prsc | PrtSc |
** Initialisation
~cmp-seq-delay 5~ permet d’avoir 5ms de délai entre chaque suite de pression d’une compose-key.
La commande ~sudo libinput list-devices~ permet de lister les périphériques.
*** Clavier portable intégré
#+begin_src lisp :noweb yes :tangle home/.config/clavier.kbd
(defcfg
input (device-file
"/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink
"Sortie Kmonad principale"
"sleep 1 && setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
<<config>>
#+end_src
*** Clavier Casa Keys
#+begin_src bash :tangle home/.local/bin/clavier-casa-keys
#!/bin/bash
ADDR_CLAVIER=$(lsinput | grep -B 5 -m 1 "Casa Keys" | grep -m 1 "")
kmonad <(sed "s,ADDR_CLAVIER,$ADDR_CLAVIER," $HOME/.config/clavier-casa-keys.kbd)
#+end_src
#+begin_src lisp :noweb yes :tangle home/.config/clavier-casa-keys.kbd
(defcfg
input (device-file "ADDR_CLAVIER")
output (uinput-sink
"Sortie Kmonad Casa Keys"
"/usr/bin/sleep 1 && /usr/bin/setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
<<config>>
#+end_src
*** Clavier MX Keys
#+begin_src bash :tangle home/.local/bin/clavier-mx-keys
#!/bin/bash
ADDR_CLAVIER=$(lsinput | grep -B 5 -m 1 "MX Keys Mini Keyboard" | grep -m 1 "")
kmonad <(sed "s,ADDR_CLAVIER,$ADDR_CLAVIER," $HOME/.config/clavier-mx-keys.kbd)
#+end_src
#+begin_src lisp :noweb yes :tangle home/.config/clavier-mx-keys.kbd
(defcfg
input (device-file "ADDR_CLAVIER")
output (uinput-sink
"Sortie Kmonad MX Keys"
"/usr/bin/sleep 1 && /usr/bin/setxkbmap -option compose:paus")
cmp-seq pause
cmp-seq-delay 5
fallthrough true
allow-cmd true)
<<config>>
#+end_src
* Alias
s (tap-hold-next-release 300 s (layer-toggle nombres))
a (tap-hold-next-release 300 a (layer-toggle navigation))
nav (layer-add navigation)
unv (layer-rem navigation)
nbr (layer-add nombres)
unb (layer-rem nombres)
#+begin_src lisp :noweb-ref config
(defalias
j (tap-hold-next-release 300 j rsft)
f (tap-hold-next-release 300 f lsft)
d (tap-hold-next-release 300 d lctl)
k (tap-hold-next-release 300 k lctl)
s (tap-hold-next-release 300 s lalt)
l (tap-hold-next-release 300 l lalt)
a (tap-hold-next-release 300 a ralt)
cps (tap-hold-next-release 300 caps lmet)
pv (tap-hold-next-release 300 ; ralt)
gll (tap-hold-next-release 300 ' lmet)
g (tap-hold-next-release 300 g lmet)
h (tap-hold-next-release 300 h lmet)
spc (tap-hold-next-release 300 spc (layer-toggle slayer))
fin #(ralt spc)
)
#+end_src
* Disposition de base
#+begin_src lisp :noweb-ref config
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
caps a s d f g h j k l ; ' \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl left up down right)
#+end_src
(deflayer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _
)
* Disposition principale
#+begin_src lisp :noweb-ref config
(deflayer main
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins prnt del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
@cps @a @s @d @f @g @h @j @k @l @pv @gll \
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt @spc ralt rctl left up down right)
#+end_src
* Disposition sous l’espace
#+begin_src lisp :noweb-ref config
(deflayer slayer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ pgup _ _ _ _ _
esc S-5 S-6 S-7 S-8 S-9 _ _ up _ _ _ _ _
S-0 S-1 S-2 S-3 S-4 _ home left down rght rght end _
_ _ _ _ _ _ _ _ pgdn pgdn _ _ _
_ _ _ _ _ _ _ _ _ _
)
#+end_src
#+TITLE: Configuration d’Awesome
#+AUTHOR: Jean-Chistophe JAMEUX BERTHE
#+DESCRIPTION: Personnalisation de l’interface graphique
#+PROPERTY: header-args :tangle ~/.config/awesome/rc.lua
#+auto_tangle: t
* Configuration d’origine
#+begin_src lua
-- 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")
-- {{{ 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
-- }}}
#+end_src
* Thème
Themes define colours, icons, font and wallpapers.
#+begin_src lua
beautiful.init("/home/echophile/.config/awesome/default/theme.lua")
#+end_src
* Définitions de variables
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.
#+begin_src lua
terminal = "alacritty -e zellij a Zellij"
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
local l = awful.layout.suit
awful.layout.layouts = {
-- l.floating,
-- l.tile,
-- l.tile.left,
-- l.tile.bottom,
-- l.tile.top,
-- l.fair,
-- l.fair.horizontal,
-- l.spiral,
l.max,
l.spiral.dwindle,
-- l.max.fullscreen,
-- l.magnifier,
-- l.corner.nw,
-- l.corner.ne,
-- l.corner.sw,
-- l.corner.se,
}
#+end_src
* Menu
#+begin_src lua
-- 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 },
}
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)
#+end_src
* Wibar
#+begin_src lua
local apt_widget = require("awesome-wm-widgets.apt-widget.apt-widget")
local batteryarc_widget = require("awesome-wm-widgets.batteryarc-widget.batteryarc")
local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
local names = { "main", "notes", "www", "cons", "emacs", "chat", "nav", "média", "conf" }
awful.tag(names, 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 })
-- 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,
apt_widget(),
wibox.widget.systray(),
batteryarc_widget(),
volume_widget(),--{
--widget_type = 'icon_and_text'
--},
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(
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, }, "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"}),
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, "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, "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, "Shift" }, "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, }, "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
-- }}}
#+end_src
* Règles de fenêtres
Rules to apply to new clients (through the "manage" signal).
#+begin_src lua
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
}
},
{
rule = { class = "Syncthing" },
properties = { tag = "conf" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "conf")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "Emacs" },
properties = { tag = "emacs" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "emacs")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "Alacritty" },
properties = { tag = "cons" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "cons")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "Proton Pass" },
properties = { tag = "conf" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "conf")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "Brave-browser" },
properties = { tag = "www" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "www")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "discord" },
properties = { tag = "chat" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "chat")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { class = "Slack" },
properties = { tag = "chat" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "chat")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { name = "Outlook.*" },
properties = { tag = "chat" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "chat")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { name = "Thunar" },
properties = { tag = "nav" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "nav")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { name = "obsidian" },
properties = { tag = "notes" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "notes")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
{
rule = { name = "Proton Mail" },
properties = { tag = "chat" },
callback = function(c)
local t = awful.tag.find_by_name(c.screen, "chat")
if t then
awful.tag.viewmore({ t }, c.screen)
end
end
},
-- 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)
#+end_src
#+RESULTS:
* Souris
** Activer le clic par tapotement
~xinput list~ permet d’obtenir la liste des périphériques.
#+begin_src lua
awful.spawn.with_shell("xinput set-prop 'SYNA3297:00 06CB:CD50 Touchpad' 'libinput Tapping Enabled' 1")
awful.spawn.with_shell("xinput set-prop 'Casa Touch' 'libinput Tapping Enabled' 1")
#+end_src
** Inverser le scroll de la souris
#+begin_src lua
awful.spawn.with_shell("xinput set-prop 'SYNA3297:00 06CB:CD50 Touchpad' 'libinput Natural Scrolling Enabled' 1")
awful.spawn.with_shell("xinput set-prop 'Casa Touch' 'libinput Natural Scrolling Enabled' 1")
#+end_src
** Le focus suit la souris
#+begin_src lua
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)
#+end_src
** Vitesse de la souris
#+begin_src lua
awful.spawn.with_shell("xinput set-prop 'SYNA3297:00 06CB:CD50 Touchpad' 'libinput Accel Speed' 0.3")
awful.spawn.with_shell("xinput set-prop 'Casa Touch' 'libinput Accel Speed' 0.3")
#+end_src
* Clavier
** Configurer le clavier en Bépo Afnor
#+begin_src lua
awful.spawn.with_shell("setxkbmap fr bepo_afnor")
#+end_src
** Raccourcis clavier pour le volume et la luminosité
#+begin_src lua
-- Ajouter les nouvelles clés de volume et luminosité aux globalkeys
globalkeys = gears.table.join(
globalkeys,
-- Raccourcis volume
awful.key({ }, "XF86AudioMute", function ()
awful.spawn("amixer -q sset Master toggle")
end,
{description = "Couper / rétablir le son", group = "audio"}),
awful.key({ }, "XF86AudioRaiseVolume", function ()
awful.spawn("amixer -q sset Master 5%+")
end,
{description = "Augmenter le volume", group = "audio"}),
awful.key({ }, "XF86AudioLowerVolume", function ()
awful.spawn("amixer -q sset Master 5%-")
end,
{description = "Diminuer le volume", group = "audio"}),
awful.key({}, "XF86AudioRaiseVolume", function() volume_widget.inc() end),
awful.key({}, "XF86AudioLowerVolume", function() volume_widget.dec() end),
awful.key({}, "XF86AudioMute", function() volume_widget.toggle() end),
-- Media Keys
awful.key({}, "XF86AudioPlay", function()
awful.util.spawn("playerctl play-pause", false) end),
awful.key({}, "XF86AudioNext", function()
awful.util.spawn("playerctl next", false) end),
awful.key({}, "XF86AudioPrev", function()
awful.util.spawn("playerctl previous", false) end),
-- Raccourcis luminosité
awful.key({ }, "XF86MonBrightnessUp", function ()
awful.spawn("brightnessctl set +10%")
end,
{description = "Augmenter la luminosité", group = "brightness"}),
awful.key({ }, "XF86MonBrightnessDown", function ()
awful.spawn("brightnessctl set 10%-")
end,
{description = "Diminuer la luminosité", group = "brightness"})
)
#+end_src
** Raccourcis clavier pour le lancement de Rofi
#+begin_src lua
globalkeys = gears.table.join(
globalkeys,
awful.key({ modkey }, "r", function ()
awful.spawn("rofi -show drun -theme fancy")
end,
{description = "Lancer Rofi", group = "Outils"})
)
root.keys(globalkeys)
#+end_src
* Applications au démarrage
#+begin_src lua
awful.spawn.with_shell("nm-applet &")
awful.spawn.with_shell("blueman-applet &")
awful.spawn.with_shell("emacs --daemon &")
awful.spawn.with_shell("dropbox start &")
awful.spawn.with_shell("libinput-gestures-setup stop desktop autostart start")
awful.spawn.with_shell("syncthing-gtk &")
awful.spawn.with_shell("clavier-bluetooth")
#+end_src
.git/
old/
.roswell/
.local/