refactor(fws-keys): make keyboard shortcuts tool universal for hyprland and i3
Rename fws-hypr-keys to fws-keys and extend it to support both Hyprland and i3 desktop environments. The tool now detects the session type and uses appropriate methods: - Hyprland: queries hyprctl binds for real loaded bindings (wofi dmenu) - i3: parses ~/.config/i3/config with variable resolution (rofi dmenu) Update all references in configs and templates. Add VM detection warning in fws-vr-setup to prevent VR attempts in virtual machines where GPU/USB access is unavailable. Add ttf-liberation font dependency for Steam UI stability on minimal installations and improve error guidance for Steam crashes.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Les raccourcis sont déclarés avec « bindd » (bind + description) : la
|
||||
# description alimente l'écran « Raccourcis clavier » (bouton ⌨ de la barre
|
||||
# ou SUPER+K → fws-hypr-keys, qui lit les binds RÉELS via hyprctl). Ajoute
|
||||
# ou SUPER+K → fws-keys, qui lit les binds RÉELS via hyprctl). Ajoute
|
||||
# tes propres bindd : ils apparaîtront automatiquement dans la liste.
|
||||
# ⚠ Pas de virgule dans les descriptions (séparateur de champs Hyprland).
|
||||
|
||||
@@ -81,7 +81,7 @@ bindd = $mod SHIFT, Return, Terminal flottant, exec, kitty --class floating-term
|
||||
bindd = $mod, R, Menu des applications, exec, wofi --show drun
|
||||
bindd = $mod, E, Gestionnaire de fichiers, exec, thunar
|
||||
bindd = $mod, B, Ouvrir Firefox, exec, firefox
|
||||
bindd = $mod, K, Afficher les raccourcis clavier, exec, fws-hypr-keys
|
||||
bindd = $mod, K, Afficher les raccourcis clavier, exec, fws-keys
|
||||
|
||||
# --- Fenêtres ---------------------------------------------------------------
|
||||
bindd = $mod, Q, Fermer la fenêtre, killactive,
|
||||
|
||||
@@ -41,6 +41,8 @@ bindsym $mod+e exec $filemanager
|
||||
bindsym $mod+b exec $browser
|
||||
# VR : installation des drivers/runtimes casque (HTC Vive, Index, Quest…)
|
||||
bindsym $mod+Shift+v exec kitty -e fws-vr-setup
|
||||
# Panneau des raccourcis clavier (aussi via le bouton ⌌ de la barre)
|
||||
bindsym $mod+k exec fws-keys
|
||||
|
||||
##############
|
||||
## FENETRES ##
|
||||
@@ -133,23 +135,16 @@ for_window [title="Picture-in-Picture"] floating enable
|
||||
###########
|
||||
## BARRE ##
|
||||
###########
|
||||
bar {
|
||||
status_command i3status
|
||||
position top
|
||||
colors {
|
||||
background $base
|
||||
statusline $text
|
||||
separator $surface0
|
||||
# classe bordure fond texte
|
||||
focused_workspace $blue $blue $base
|
||||
inactive_workspace $surface0 $base $text
|
||||
urgent_workspace $red $red $base
|
||||
}
|
||||
}
|
||||
# Polybar (config ~/.config/polybar/config.ini) : clone visuel de la waybar
|
||||
# Hyprland FWS — pilules, icônes, horloge+date au centre, bouton Raccourcis.
|
||||
# exec_always + pkill : la barre survit proprement aux reload ($mod+Shift+c).
|
||||
exec_always --no-startup-id sh -c 'pkill -x polybar; sleep 0.3; exec polybar -q fws'
|
||||
|
||||
###############
|
||||
## AUTOSTART ##
|
||||
###############
|
||||
# picom : coins arrondis (parité visuelle avec Hyprland) — config FWS légère.
|
||||
exec --no-startup-id picom --config ~/.config/picom.conf
|
||||
exec --no-startup-id dunst
|
||||
exec --no-startup-id nm-applet
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# FWS — picom minimal (session i3) : coins arrondis comme sous Hyprland.
|
||||
# xrender : fiable partout, y compris en VM (rendu logiciel) ; pas de flou ni
|
||||
# d'ombres (parité avec la config Hyprland FWS, et léger pour la VR).
|
||||
backend = "xrender";
|
||||
vsync = true;
|
||||
|
||||
corner-radius = 8;
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'dock'", # polybar gère son propre arrondi
|
||||
"class_g = 'i3-frame'"
|
||||
];
|
||||
|
||||
shadow = false;
|
||||
fading = true;
|
||||
fade-in-step = 0.08;
|
||||
fade-out-step = 0.08;
|
||||
|
||||
# VR / jeux plein écran : ne pas composer par-dessus (latence).
|
||||
unredir-if-possible = true;
|
||||
@@ -0,0 +1,156 @@
|
||||
; FWS — polybar (session i3) : clone visuel de la waybar Hyprland.
|
||||
; Barre flottante arrondie, modules en « pilules » Catppuccin Mocha,
|
||||
; icônes Nerd Font (ttf-nerd-fonts-symbols). Horloge + date au centre,
|
||||
; bouton « ⌌ Raccourcis » (fws-keys), volume/réseau/CPU/RAM/tray à droite.
|
||||
|
||||
[colors]
|
||||
base = #E01e1e2e
|
||||
surface0 = #313244
|
||||
text = #cdd6f4
|
||||
subtext = #a6adc8
|
||||
blue = #89b4fa
|
||||
sapphire = #74c7ec
|
||||
teal = #94e2d5
|
||||
mauve = #cba6f7
|
||||
maroon = #eba0ac
|
||||
yellow = #f9e2af
|
||||
red = #f38ba8
|
||||
darkbase = #1e1e2e
|
||||
|
||||
[bar/fws]
|
||||
monitor = ${env:MONITOR:}
|
||||
width = 100%:-20
|
||||
offset-x = 10
|
||||
offset-y = 6
|
||||
height = 36
|
||||
radius = 14
|
||||
background = ${colors.base}
|
||||
foreground = ${colors.text}
|
||||
border-size = 1
|
||||
border-color = #5989b4fa
|
||||
padding-left = 1
|
||||
padding-right = 1
|
||||
module-margin = 1
|
||||
line-size = 0
|
||||
font-0 = Noto Sans:size=10;2
|
||||
font-1 = Symbols Nerd Font:size=12;3
|
||||
font-2 = Noto Sans:weight=bold:size=10;2
|
||||
modules-left = i3 xwindow
|
||||
modules-center = date
|
||||
modules-right = keyhelp backlight pulseaudio network cpu memory tray
|
||||
enable-ipc = true
|
||||
wm-restack = i3
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
pin-workspaces = true
|
||||
show-urgent = true
|
||||
strip-wsnumbers = false
|
||||
format = <label-state> <label-mode>
|
||||
label-focused = %name%
|
||||
label-focused-background = ${colors.blue}
|
||||
label-focused-foreground = ${colors.darkbase}
|
||||
label-focused-padding = 2
|
||||
label-unfocused = %name%
|
||||
label-unfocused-background = ${colors.surface0}
|
||||
label-unfocused-foreground = ${colors.subtext}
|
||||
label-unfocused-padding = 2
|
||||
label-visible = %name%
|
||||
label-visible-background = ${colors.surface0}
|
||||
label-visible-padding = 2
|
||||
label-urgent = %name%
|
||||
label-urgent-background = ${colors.red}
|
||||
label-urgent-foreground = ${colors.darkbase}
|
||||
label-urgent-padding = 2
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title:0:45:…%
|
||||
label-foreground = ${colors.subtext}
|
||||
format-padding = 1
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
date = %A %d %B %Y
|
||||
time = %H:%M
|
||||
label = %time% %date%
|
||||
label-font = 3
|
||||
format-background = ${colors.surface0}
|
||||
format-padding = 3
|
||||
|
||||
[module/keyhelp]
|
||||
type = custom/script
|
||||
exec = echo " Raccourcis"
|
||||
interval = 3600
|
||||
click-left = fws-keys
|
||||
format-background = ${colors.blue}
|
||||
format-foreground = ${colors.darkbase}
|
||||
format-padding = 2
|
||||
label-font = 3
|
||||
|
||||
[module/backlight]
|
||||
type = internal/backlight
|
||||
enable-scroll = true
|
||||
format = <label>
|
||||
label = %percentage%%
|
||||
format-background = ${colors.surface0}
|
||||
format-foreground = ${colors.yellow}
|
||||
format-padding = 2
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
use-ui-max = false
|
||||
click-right = pavucontrol
|
||||
format-volume = <label-volume>
|
||||
label-volume = %percentage%%
|
||||
format-volume-background = ${colors.surface0}
|
||||
format-volume-foreground = ${colors.blue}
|
||||
format-volume-padding = 2
|
||||
label-muted = muet
|
||||
format-muted-background = ${colors.surface0}
|
||||
format-muted-foreground = ${colors.subtext}
|
||||
format-muted-padding = 2
|
||||
|
||||
[module/network]
|
||||
type = internal/network
|
||||
interface-type = wired
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
label-connected = %local_ip%
|
||||
format-connected-background = ${colors.surface0}
|
||||
format-connected-foreground = ${colors.teal}
|
||||
format-connected-padding = 2
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = hors ligne
|
||||
format-disconnected-background = ${colors.surface0}
|
||||
format-disconnected-foreground = ${colors.red}
|
||||
format-disconnected-padding = 2
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 3
|
||||
label = %percentage%%
|
||||
format-background = ${colors.surface0}
|
||||
format-foreground = ${colors.mauve}
|
||||
format-padding = 2
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 3
|
||||
label = %percentage_used%%
|
||||
format-background = ${colors.surface0}
|
||||
format-foreground = ${colors.maroon}
|
||||
format-padding = 2
|
||||
|
||||
[module/tray]
|
||||
type = internal/tray
|
||||
format = <tray>
|
||||
format-background = ${colors.surface0}
|
||||
format-padding = 1
|
||||
tray-spacing = 8px
|
||||
tray-size = 16px
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = false
|
||||
@@ -33,7 +33,7 @@
|
||||
"custom/keyhelp": {
|
||||
"format": " Raccourcis",
|
||||
"tooltip-format": "Raccourcis clavier (SUPER+K)",
|
||||
"on-click": "fws-hypr-keys"
|
||||
"on-click": "fws-keys"
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{icon} {percent}%",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* FWS — style du panneau « Raccourcis clavier » (fws-hypr-keys).
|
||||
/* FWS — style du panneau « Raccourcis clavier » (fws-keys).
|
||||
Même palette que le menu wofi, mais police MONOSPACE : les colonnes
|
||||
combinaison/description sont alignées par des espaces. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user