Vous n'êtes pas identifié(e).
L'icône rouge permet de télécharger chaque page du wiki visitée au format PDF et la grise au format ODT →
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
utilisateurs:arpinux:tutos:i3config [30/08/2020 13:17] arpinux créée |
utilisateurs:arpinux:tutos:i3config [15/02/2021 10:05] (Version actuelle) arpinux [Fichiers de configuration pour i3wm] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Fichier de configuration pour i3wm ====== | + | ====== Fichiers de configuration pour i3wm ====== |
- | * Objet : ma config i3wm | + | * objet : ma config i3wm |
+ | * logiciels utilisés : [[https://i3wm.org/|i3wm]], [[https://github.com/davatorium/rofi|rofi]], [[doc:systeme:terminal:urxvt|urxvt]], [[doc:environnements:lxde:transparence#compton|compton]], [[doc:media:feh|feh]] | ||
+ | * fonts utilisées : hack et forkawesome (dispo dans les dépôts debian) | ||
+ | * contenu : | ||
+ | * ~/.config/i3/config : fichier de configuration principal de i3wm | ||
+ | * ~/.config/i3/i3conkybar : lanceur pour placer le conky dans la barre | ||
+ | * ~/.config/i3/conkyrc : configuration de conky | ||
+ | * ~/.Xresources : configuration de rofi et de urxvt | ||
+ | * scripts utilisés pour la session | ||
+ | <note important>Pour tester i3wm & une configuration plus riche, je vous invite à essayer la [[https://nakedeb.arpinux.org/|distribution nakeDeb]] ou à fouiller dans [[https://framagit.org/3hg/nakedeb|les sources git]] de la distribution.</note> | ||
+ | |||
+ | {{https://debian-facile.org/images/file-R6f3aa3308b41e85b51d746ccced931be.png}} | ||
===== ~/.config/i3/config ===== | ===== ~/.config/i3/config ===== | ||
+ | note : j'utilise un clavier macbook pro, les raccourcis clavier peuvent différer selon votre clavier. | ||
+ | |||
<file config config> | <file config config> | ||
- | # This file has been auto-generated by i3-config-wizard(1). | ||
- | # It will not be overwritten, so edit it as you like. | ||
- | # | ||
- | # Should you change your keyboard layout some time, delete | ||
- | # this file and re-run i3-config-wizard(1). | ||
- | # | ||
- | |||
# i3 config file (v4) | # i3 config file (v4) | ||
# | # | ||
Ligne 211: | Ligne 217: | ||
bindsym $mod+parenright workspace $ws11 | bindsym $mod+parenright workspace $ws11 | ||
bindsym $mod+minus workspace $ws12 | bindsym $mod+minus workspace $ws12 | ||
- | |||
# move focused container to workspace | # move focused container to workspace | ||
Ligne 232: | Ligne 237: | ||
bindsym $mod+Shift+r restart | bindsym $mod+Shift+r restart | ||
# exit i3 (logs you out of your X session) | # exit i3 (logs you out of your X session) | ||
- | #bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" | ||
bindsym $mod+Shift+e exec ~/bin/i3quit | bindsym $mod+Shift+e exec ~/bin/i3quit | ||
Ligne 319: | Ligne 323: | ||
assign [class="^URxvt$" instance="^player$"] $ws12 | assign [class="^URxvt$" instance="^player$"] $ws12 | ||
+ | </file> | ||
+ | |||
+ | ===== ~/.config/i3/i3conkybar ===== | ||
+ | le petit script qui permet de lancer conky dans la barre de i3wm comme pour i3status. | ||
+ | <file bash i3conkybar> | ||
+ | #!/bin/sh | ||
+ | |||
+ | # Send the header so that i3bar knows we want to use JSON: | ||
+ | echo '{"version":1}' | ||
+ | |||
+ | # Begin the endless array. | ||
+ | echo '[' | ||
+ | |||
+ | # We send an empty first array of blocks to make the loop simpler: | ||
+ | echo '[],' | ||
+ | |||
+ | # Now send blocks with information forever: | ||
+ | exec conky -c $HOME/.config/i3/conkyrc | ||
+ | </file> | ||
+ | |||
+ | ===== ~/.config/i3/conkyrc ===== | ||
+ | le fichier de configuration pour conky qui utilise la font forkawesome. | ||
+ | <file lua conkyrc> | ||
+ | --[[ | ||
+ | i3wm conkyrc arpinux@2020©WTFPL | ||
+ | use with forkawesome fonts | ||
+ | nord colors : | ||
+ | #2e3440 – default dark background | ||
+ | #3b4252 – black | ||
+ | #434c5e - black lighter | ||
+ | #4c566a – bright black | ||
+ | #d8dee9 – default clear foreground | ||
+ | #e5e9f0 – white | ||
+ | #eceff4 – bright white | ||
+ | #8fbcbb – bright cyan | ||
+ | #88c0d0 – cyan | ||
+ | #81a1c1 – blue | ||
+ | #5e81ac - bright blue | ||
+ | #bf616a – red | ||
+ | #d08770 – orange | ||
+ | #ebcb8b – yellow | ||
+ | #a3be8c – green | ||
+ | #b48ead – purple8fbcbb | ||
+ | ]] | ||
+ | |||
+ | conky.config = { | ||
+ | out_to_x = false, | ||
+ | out_to_console = true, | ||
+ | background = false, | ||
+ | update_interval = 2.0, | ||
+ | total_run_times = 0, | ||
+ | top_name_width = 10, | ||
+ | use_spacer = 'none', | ||
+ | double_buffer = yes, | ||
+ | cpu_avg_samples = 2, | ||
+ | short_units = true, | ||
+ | text_buffer_size = 2048, | ||
+ | if_up_strictness = 'address' | ||
+ | } | ||
+ | |||
+ | conky.text = [[ | ||
+ | [ | ||
+ | { "full_text": "${font forkawesome:size=9}${if_mounted /media/arp/nak3dback} ${fs_used_perc /media/arp/nak3dback}%${endif}" , "color": "\#d8dee9" }, | ||
+ | { "full_text": "${font forkawesome:size=9} ${cpu cpu1}% ${cpu cpu2}% ${cpu cpu3}% ${cpu cpu4}%" ,\ | ||
+ | "color": ${if_match ${cpu}>80}"\#bf616a"${else}"\#81a1c1"${endif} }, | ||
+ | { "full_text": ">${loadavg 1}" , "color": "\#81a1c1" }, | ||
+ | { "full_text": "${font forkawesome:size=9} ${texeci 5 sensors|grep "Core 2"| awk '{print $3}'|cut -c2-}" ,\ | ||
+ | "color": ${if_match "${texeci 5 sensors|grep "Core 2"|awk '{print $3}'|cut -d"+" -f 2|sed s/.0°C//g}" > "75"}"\#bf616a"${else}"\#81a1c1"${endif} }, | ||
+ | { "full_text": " ${font forkawesome:size=9} ${memperc}% ${mem}" , "color": ${if_match ${memperc} > 50}"\#bf616a"${else}"\#a3be8c"${endif} }, | ||
+ | { "full_text": " ${font forkawesome:size=9} ${fs_used_perc /}% ${fs_free /}" , "color": "\#d08770" }, | ||
+ | { "full_text": " ${font forkawesome:size=9} ${fs_used_perc /media/arp/Xtra}% ${fs_free /media/arp/Xtra}" , "color": "\#d08770" }, | ||
+ | { "full_text": " ${font forkawesome:size=9}${if_up wlp3s0} ${upspeedf wlp3s0}k/s ${downspeedf wlp3s0}k/s${else}${if_up enp2s0} ${upspeedf enp2s0}k/s ${downspeedf enp2s0}k/s${else}net ${endif}${endif}" , "color": ${if_gw}"\#88c0d0"${else}"\#bf616a"${endif} }, | ||
+ | { "full_text": " ${font forkawesome:size=9}${if_match ${battery_percent}<5}${blink }${else}${if_match "${acpiacadapter}" == "on-line"} ${battery_percent}%${else} ${battery_percent}% ${battery_time}${endif}${endif}" , "color": ${if_match ${battery_percent}<10}"\#bf616a"${else}"\#ebcb8b"${endif} }, | ||
+ | { "full_text": " ${font forkawesome:size=9}${if_pa_sink_muted} x${else} ${pa_sink_volume}%${endif}" , "color": ${if_pa_sink_muted}"\#bf616a"${else}"\#b48ead"${endif} }, | ||
+ | { "full_text": " ${font forkawesome:size=9} ${uptime_short}" , "color": "\#81a1c1" }, | ||
+ | { "full_text": " ${font forkawesome:size=9} ${time %a%d/%m}" , "color": "\#d8dee9" }, | ||
+ | { "full_text": "${font forkawesome:size=9} ${time %I:%M}" , "color": "\#ffffff" }, | ||
+ | { "full_text": "${font forkawesome:size=9}${if_running redshift} ${else} ${endif}" , "color": "\#8fbcbb" } | ||
+ | ], | ||
+ | ]]; | ||
+ | </file> | ||
+ | |||
+ | ===== ~/.Xresources ===== | ||
+ | configuration de certaines applis, dont rofi et urxvt utilisés dans la session i3wm | ||
+ | <file config Xresources> | ||
+ | ! author: arpinux <https://arpinux.org> | ||
+ | ! ~/.Xresources configuration file | ||
+ | !----------------------------------------------------------------------- | ||
+ | |||
+ | ! nord inspired colors | ||
+ | ! black | ||
+ | *color0: #3B4252 | ||
+ | *color8: #4C566A | ||
+ | ! red | ||
+ | *color1: #BF616A | ||
+ | *color9: #BF616A | ||
+ | ! green | ||
+ | *color2: #A3BE8C | ||
+ | *color10: #A3BE8C | ||
+ | ! yellow | ||
+ | *color3: #EBCB8B | ||
+ | *color11: #EBCB8B | ||
+ | ! blue | ||
+ | *color4: #81A1C1 | ||
+ | *color12: #81A1C1 | ||
+ | ! purple | ||
+ | *color5: #B48EAD | ||
+ | *color13: #B48EAD | ||
+ | ! cyan | ||
+ | *color6: #88C0D0 | ||
+ | *color14: #8FBCBB | ||
+ | ! white | ||
+ | *color7: #E5E9F0 | ||
+ | *color15: #ECEFF4 | ||
+ | |||
+ | *background: #2E3440 | ||
+ | *foreground: #D8DEE9 | ||
+ | *fading: 40 | ||
+ | *fadeColor: #4C566A | ||
+ | *cursorColor: #D8DEE9 | ||
+ | *colorUL: #A3BE8C | ||
+ | |||
+ | ! dzen2 ---------------------------------------------------------------- | ||
+ | dzen2.font: Hack-9 | ||
+ | dzen2.foreground: #D8DEE9 | ||
+ | dzen2.background: #2E3440 | ||
+ | |||
+ | ! Xcursor settings ----------------------------------------------------- | ||
+ | Xcursor.theme: Adwaita | ||
+ | |||
+ | ! Xft settings --------------------------------------------------------- | ||
+ | Xft.dpi: 96 | ||
+ | Xft.autohint: 0 | ||
+ | Xft.lcdfilter: lcddefault | ||
+ | Xft.antialias: 1 | ||
+ | Xft.rgba: rgb | ||
+ | Xft.hinting: 1 | ||
+ | Xft.hintstyle: hintfull | ||
+ | |||
+ | ! urxvt ---------------------------------------------------------------- | ||
+ | URxvt.termName: rxvt-unicode | ||
+ | URxvt.imLocale: fr_FR.UTF-8 | ||
+ | URxvt.saveLines: 5000 | ||
+ | URxvt.cursorBlink: true | ||
+ | URxvt.foreground: #d8dee9 | ||
+ | URxvt.background: #2e3440 | ||
+ | URxvt.cursorColor: #d8dee9 | ||
+ | URxvt.throughColor: #4c566a | ||
+ | URxvt.highlightColor: #4c566a | ||
+ | URxvt.shading: 60 | ||
+ | URxvt.transparent: false | ||
+ | URxvt.tintColor: #5e81ac | ||
+ | URxvt.visualBell: false | ||
+ | URxvt.urgentOnBell: true | ||
+ | URxvt.font: xft:Hack:regular:size=9 | ||
+ | URxvt.boldFont: xft:Hack:bold:size=9 | ||
+ | URxvt.scrollBar: false | ||
+ | URxvt.scrollBar_right: false | ||
+ | URxvt.urlLauncher: w3m | ||
+ | URxvt.matcher.button: 1 | ||
+ | URxvt.perl-ext-common: default,matcher | ||
+ | !URxvt.perl-ext-common: default,tabbed,matcher !uncomment = autotabs in URxvt | ||
+ | URxvt.tabbed.tabbar-fg: 4 | ||
+ | URxvt.tabbed.tabbar-bg: 0 | ||
+ | URxvt.tabbed.tab-fg: 7 | ||
+ | URxvt.tabbed.tab-bg: 4 | ||
+ | |||
+ | |||
+ | ! xterm ---------------------------------------------------------------- | ||
+ | xterm*saveLines: 4096 | ||
+ | xterm*AllowIconInput: on | ||
+ | xterm*background: #2E3440 | ||
+ | xterm*foreground: #D8DEE9 | ||
+ | xterm*border: #D8DEE9 | ||
+ | xterm*faceName: Hack | ||
+ | xterm*Font: Hack | ||
+ | xterm*allowBoldFonts: false | ||
+ | xterm*renderFont: true | ||
+ | xterm*faceSize: 9 | ||
+ | xterm*InternalBorder: 0 | ||
+ | xterm*MarginBell: off | ||
+ | xterm*MenuFont: fixed8 | ||
+ | xterm*Mouse: yellow | ||
+ | xterm*TitleFont: vtbold | ||
+ | xterm*charClass: 33:48,37:48,45-47:48,64:48 | ||
+ | xterm*colorAttrMode: true | ||
+ | xterm*colorULMode: true | ||
+ | !xterm*colorUL: green | ||
+ | xterm*curses: on | ||
+ | xterm*cutNewline: off | ||
+ | xterm*jumpScroll: on | ||
+ | xterm*multiClickTime: 500 | ||
+ | xterm*multiScroll: on | ||
+ | xterm*reverseWrap: off | ||
+ | xterm*scrollBar: off | ||
+ | xterm*reverseVideo: off | ||
+ | xterm*VT100.Translations: #override \ | ||
+ | Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\ | ||
+ | Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ | ||
+ | Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY) | ||
+ | |||
+ | ! xmessage ------------------------------------------------------------- | ||
+ | Xmessage.form.okay.shapeStyle: rectangle | ||
+ | Xmessage.center: TRUE | ||
+ | Xmessage*buttons: OK | ||
+ | Xmessage*defaultButton: OK | ||
+ | Xmessage.form.message.Scroll: WhenNeeded | ||
+ | Xmessage*borderWidth: 0 | ||
+ | Xmessage*Text.borderWidth: 0 | ||
+ | Xmessage*Command.borderWidth: 0 | ||
+ | Xmessage*Command.shapeStyle: rectangle | ||
+ | Xmessage*Command.highlightThickness: 2 | ||
+ | Xmessage*Command.internalWidth: 5 | ||
+ | Xmessage*Command.internalHeight: 1 | ||
+ | Xmessage*message.scrollHorizontal: Never | ||
+ | Xmessage*message.scrollVertical: Never | ||
+ | Xmessage.form.Command.background: #2e3440 | ||
+ | Xmessage.form.Command.foreground: #d8dee9 | ||
+ | |||
+ | |||
+ | ! rofi ----------------------------------------------------------------- | ||
+ | rofi.fullscreen: true | ||
+ | rofi.color-enabled: true | ||
+ | rofi.color-window: argb:e8222D32,argb:00292f37,#EBCB8B | ||
+ | rofi.color-normal: argb:02000000,#D8DEE9,argb:02000000,argb:02000000,#EBCB8B | ||
+ | rofi.color-active: argb:02000000,#D8DEE9,argb:02000000,argb:02000000,#D8DEE9 | ||
+ | rofi.color-urgent: argb:02000000,#D8DEE9,argb:02000000,argb:02000000,#D8DEE9 | ||
+ | |||
+ | rofi.font: Hack 12 | ||
+ | rofi.eh: 1 | ||
+ | rofi.line-margin: 20 | ||
+ | rofi.separator-style: solid | ||
+ | rofi.hide-scrollbar: true | ||
+ | rofi.lines: 3 | ||
+ | rofi.width: 100 | ||
+ | rofi.padding: 200 | ||
+ | rofi.bw: 0 | ||
+ | rofi.location: 4 | ||
+ | rofi.modi: window,run,drun,ssh | ||
+ | !eof ------------------------------------------------------------------ | ||
+ | </file> | ||
+ | |||
+ | ===== scripts ===== | ||
+ | les scripts appelés par la session. | ||
+ | |||
+ | === i3quit === | ||
+ | lanceur pour logout/shutdown/suspend/reboot. | ||
+ | <file bash i3quit> | ||
+ | #!/bin/bash | ||
+ | # a simple logout dialog | ||
+ | |||
+ | # launch exit menu | ||
+ | choice=`echo -e "0: Logout\n1: Shutdown\n2: Suspend\n3: Reboot\n4: Cancel" | rofi -dmenu -p "select an action" | cut -d ':' -f 1` | ||
+ | |||
+ | # execute the choice in background | ||
+ | case "$choice" in | ||
+ | 0) i3-msg exit & ;; | ||
+ | 1) systemctl poweroff & ;; | ||
+ | 2) systemctl suspend & ;; | ||
+ | 3) systemctl reboot & ;; | ||
+ | 4) exit ;; | ||
+ | esac | ||
+ | </file> | ||
+ | |||
+ | === randomwall === | ||
+ | fond d'écran aléatoire : pensez à éditer le chemin vers le dossier des walls. | ||
+ | <file bash randomwall> | ||
+ | #!/bin/bash | ||
+ | cd /usr/share/backgrounds/ | ||
+ | ls | xargs feh -q -z --bg-fill "$@" & | ||
+ | exit 0 | ||
+ | </file> | ||
+ | |||
+ | === touchpadtap === | ||
+ | configuration du touchpad sur macbook. fonctionne aussi avec d'autres touchpad :P | ||
+ | <file bash touchpadtap> | ||
+ | #!/bin/bash | ||
+ | # configuration du touchpad sur macbook | ||
+ | |||
+ | #syndaemon -t -i 2 -K -R & # désactiver le taptoclick si le clavier est utilisé | ||
+ | |||
+ | synclient TouchPadOff=0 & # activation du touchpad | ||
+ | synclient TapButton1=1 & # clic-gauche avec 1 doigt | ||
+ | synclient TapButton2=3 & # clic-central avec 3 doigts | ||
+ | synclient TapButton3=2 & # clic-droit avec 2 doigts | ||
+ | |||
+ | synclient VertTwoFingerScroll=1 & # défilement vertical avec 2 doigts | ||
+ | synclient HorizTwoFingerScroll=1 & # défilement horizontal avec 2 doigts | ||
+ | |||
+ | synclient FingerHigh=150 & # réduire la sensibilité | ||
+ | synclient PalmDetect=1 & # détecter la main | ||
+ | synclient AccelFactor=0.030 & # facteur d'accélaration élevé | ||
+ | |||
+ | exit 0 | ||
+ | </file> | ||
+ | |||
+ | === eyecandy === | ||
+ | configuration de compton pour la transparence. | ||
+ | <file bash eyecandy> | ||
+ | #!/bin/bash | ||
+ | # composite level selector | ||
+ | # arpinux 2020 <https://arpinux.org> | ||
+ | |||
+ | # options - see 'man compton' | ||
+ | LIGHT="--shadow \ | ||
+ | --no-dock-shadow \ | ||
+ | --inactive-opacity .8 \ | ||
+ | --inactive-opacity-override \ | ||
+ | --detect-transient \ | ||
+ | --detect-client-leader" | ||
+ | FULL="--shadow \ | ||
+ | --no-dock-shadow \ | ||
+ | --fading \ | ||
+ | --active-opacity 1 \ | ||
+ | --inactive-opacity .6 \ | ||
+ | --inactive-opacity-override \ | ||
+ | --menu-opacity .9 \ | ||
+ | --frame-opacity .9 \ | ||
+ | --no-fading-destroyed-argb \ | ||
+ | --detect-transient \ | ||
+ | --detect-client-leader" | ||
+ | |||
+ | # with args > just exec | ||
+ | if [ "$1" == "-s" ]; then | ||
+ | pkill -9 compton | ||
+ | exit 0 | ||
+ | elif [ "$1" == "-l" ]; then | ||
+ | pkill -9 compton | ||
+ | sleep 1s | ||
+ | compton $LIGHT & | ||
+ | exit 0 | ||
+ | elif [ "$1" == "-f" ]; then | ||
+ | pkill -9 compton | ||
+ | sleep 1s | ||
+ | compton $FULL & | ||
+ | exit 0 | ||
+ | else | ||
+ | # no args or wrong args > show dmenu | ||
+ | choice=`echo -e "light\nfull\nstop\ncancel" | \ | ||
+ | rofi -dmenu \ | ||
+ | -p "composite level selector >> "` | ||
+ | |||
+ | case "$choice" in | ||
+ | light) pkill -9 compton | ||
+ | sleep 1s | ||
+ | compton $LIGHT & ;; | ||
+ | full) pkill -9 compton | ||
+ | sleep 1s | ||
+ | compton $FULL & ;; | ||
+ | stop) pkill -9 compton & ;; | ||
+ | cancel) exit ;; | ||
+ | esac | ||
+ | fi | ||
</file> | </file> |