Vous n'êtes pas identifié(e).
Modification de la configuration de spectrwm dans la Livarp_041-fr
Plan :
Introduction
1 / Bogue dans la spectrwm_statusbar
2 / Présentation des fichiers de configurations de spectrwm, façon Livarp_041-fr
* livarp_0.4 spectrwm start-up script
* fichier spectrwm.conf
3 / Recherche du fichier « initscreen.sh » sur le HDD
4 / Recherche d’un exemple du fichier initsreen.sh sur le web
5 / Création du ficher initscreen.sh
6 / Rendre le script « .initscreen.sh » exécutable
7 / Intégration du fichier initscreen.sh dans le fichier spectrwm.conf du Livarp_041-fr
8 / Recherche et configuration d’un exemple du fichier spectrwm_status.sh
9 / Résultat final
10 / écran screenfetch
11 / Raccourcis clavier/souris les plus usuels
Conclusion
P.S.
Sources - bibliographie
Annexe : manpage de Spectrwm
Introduction :
La Livarp_041-fr propose 12 sessions : awesome, dvtm, dwm, dwm_reloaded, evilwm, fluxbox, openbox, pekwm, ratpoison, spectrwm, vtwm et wfms2.
Les sources du Livarp_041-fr se téléchargent à l’adresse suivante :
https://github.com/machinebacon/livarp
L’iso se télécharge à l’adresse suivante :
https://arpinux.org/isos/livarp/livarp_041-fr.iso
Il existe un torrent à l’adresse suivante :
https://torrentdownloads.torrentzmirror … rp_041+iso
que je n’ai jamais utilisé à ce jour. Je le cite pour votre information. Il existe également d’autres torrents. A titre personnel, je préfère télécharger sur le site de l’auteur de ce dérivé Debian. Merci Arpinux !
Ici je traite de la session spectrwm.
Gestionnaire des fenêtres écrit par des hackers pour des hackers, spectrwm constitue un gestionnaire de fenêtres de type mosaïcal.
L’affichage des fenêtres occupera la totalité de la surface de l’écran (ou des écrans…).
La session spectrwm du Livarp se conpose de 5 éléments :
- le wm proprement dit,
- la statusbar, voir plus bas,
- le menu spectrwm, en fait le menu classique du Livarp...
- le conky affiché dans la statusbar, configuré depuis le fichier [code).spectrwm_statusbar.sh[/code)
- le fbpanel, configuré depuis le fichier ~/.config/fbpanel/default.
Je ne m’intéresserai ici qu’à la configuration modifiée/améliorée de la statusbar.
1 / Bogue dans la spectrwm_statusbar :
En effet, comme vous avez pu vous en rendre compte si vous utilisez comme moi la livarp041-fr sur une de vos machines, vous avez constaté que la session spectrwm présente un bogue quant à l’affichage de la statusbar.
Un message baroque apparaît en haut de l’écran, en lieu et place des informations habituellement disponibles à partir d’un conky « normal » dans ce type de situation !.
Le message est le suivant :
total exceptions : , first exception : could not find iniscreen.sh
Ce qui donne ceci :
En d’autres termes, le fichier « initscreen.sh » nécessaire à l’affichage des informations précitées a disparu ou n’existe pas.
Il convient donc de :
- vérifier l’état réel de la configuration de spectrwm,
- de modifier si nécessaire cette configuration,
- de créer si nécessaire le fichier initscreen.sh et lui donner une adresse reconnaissable par ces fichiers de configurations.
Assez parlé : au travail !
2 / Présentation des fichiers de configurations de spectrwm, façon Livarp_041-fr
Le spectrwm est configuré par le fichier . »spectrwm.conf ».
Le gestionnaire spectrwm se lance à l’aide du fichier :
* livarp_0.4 spectrwm start-up script :
#! /bin/bash
# livarp_0.4 spectrwm start-up script
#####################################
## post-install script ## ----------------------------------------------
## safe to remove after execution
if ! [ -d /home/human ]; then
if ! [ -e /usr/share/livarp/livarpfirstlog ]; then
(sleep 10s && urxvtcd -e su-to-root -c /usr/local/bin/livarp_postinstall.sh) &
fi
fi
## launch mail-checker ## edit if needed -------------------------------
#if ping -c 1 -w 1 194.2.0.20 &>/dev/null; then
# sleep 5 && claws-mail &
#fi
## change caps_lock into super key - for old laptop --------------------
#xmodmap ~/.Xmodmap
## launch composite manager --------------------------------------------
xcompmgr_livarp -l &
## launch panel --------------------------------------------------------
sleep 1 && fbpanel &
## setup auto-mounting -------------------------------------------------
sleep 10 && udisks-glue --session &
## set spectrwm wallpaper ----------------------------------------------
#nitrogen --restore ## uncomment to display your favorite wallpaper
#/usr/share/backgrounds/randwalls.sh & ## uncomment for a random system wall
feh --no-xinerama --bg-fill /usr/share/backgrounds/livarp_04.png
## setup network -------------------------------------------------------
nm-applet &
## launch spectrwm -----------------------------------------------------
exec spectrwm
* fichier spectrwm.conf :
La session SpectrWM se configure à l’aide du fichier spectrwm.conf.
Voici le fichier d’origine de Livarp_041-fr :
# PLEASE READ THE MAN PAGE BEFORE EDITING THIS FILE!
# [url]http://opensource.conformal.com/cgi-bin/man-cgi?spectrwm[/url]
# colors for focussed and unfocussed window borders
# NOTE: all colors in this file are in hex! see XQueryColor for examples
# couleur de la bordure du client ayant le focus
color_focus = rgb:0/68/8b
# couleur de la bordure des clients en arrière plan
color_unfocus = rgb:24/24/24
## bar settings
# afficher la barre
bar_enabled = 1
# épaisseur de la bordure de la status bar. pas de bordure si 0
bar_border_width = 0
# couleur de la bordure de la status bar sur l'écran x
bar_border[1] = rgb:0/68/8b
# couleur de fond de la status bar sur l'écran x
bar_color[1] = grey12
# couleur de la police de la status bar pour l'écran x
bar_font_color[1] = rgb:0/68/8b
# police utilisée pour la status bar. format Xft ou X Logical Font Description(XLFD).
# vous pouvez spécifier plusieurs polices séparées par ”,”.
# si une des polices est en XFT, elle sera utilisée par défaut.
# notez que dmenu n'utilise pas les polices XFT
bar_font = snap
# script externe à lancer pour un affichage dans la status bar
bar_action = spectrwm_status.sh
# temps de rafraichissement de la barre
bar_delay = 1
# alignement du texte de la status bar. valeurs: left, center, et right
bar_justify = left
# place la status bar en bas de l'écran
bar_at_bottom = 0
# afficher la disposition dans la status bar
stack_enabled = 1
# affiche l'heure dans la status bar
clock_enabled = 0
# format d'affichage de l'heure
clock_format = %a %d/%m %I:%M %P
# afficher le titre du client dans la status bar
title_name_enabled = 1
# afficher la class du client dans la status bar
title_class_enabled = 0
# affiche le nom du client, limité à 64 caractères
window_name_enabled = 0
# précise l'affiche de la disposition dans la status bar
verbose_layout = 0
# mode du focus. valeurs: default, follow et manual
focus_mode = default
# n'affiche pas la bordure si la status bar est masquée et qu'il n'y a qu'un seul client
disable_border = 1
# épaisseur de la bordure des clients. pas de bordures si 0
border_width = 1
# notification des clients urgents
urgent_enabled = 0
# spawn app
program[term] = urxvtcd
program[screenshot_all] = screenshot -a
program[screenshot_wind] = screenshot -w
program[lock] = xscreensaver-command -lock
program[initscr] = initscreen.sh
program[menu] = dmenu_run -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_font_color -sf $bar_color -p exec:
spawn_term = urxvtcd
# dialog box size ratio .3 >= r < 1
dialog_ratio = 0.3
# Split a non-Xrandr dual head setup into one region per monitor
# (non-standard driver-based multihead is not seen by spectrwm)
# region = screen[1]:1280x1024+0+0
# region = screen[1]:1280x1024+1280+0
# Launch applications in a workspace of choice
# autorun = ws[1]:x-terminal-emulator
# autorun = ws[2]:xxxterm http://www.openbsd.org
# workspace layout
# layout = ws[1]:4:0:0:0:vertical
# layout = ws[2]:0:0:0:0:horizontal
# layout = ws[3]:0:0:0:0:fullscreen
# mod key, (windows key is Mod4) (apple key on OSX is Mod2)
# modkey = Mod1
# Clear key bindings and load new key bindings from the specified file.
# This allows you to load pre-defined key bindings for your keyboard layout.
#keyboard_mapping = ~/.spectrwm_fr.conf
# quirks
# remove with: quirk[class:name] = NONE
# quirk[MPlayer:xv] = FLOAT + FULLSCREEN + FOCUSPREV
# quirk[OpenOffice.org 2.4:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.0:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.1:VCLSalFrame] = FLOAT
# quirk[Firefox-bin:firefox-bin] = TRANSSZ
# quirk[Firefox:Dialog] = FLOAT
# quirk[Gimp:gimp] = FLOAT + ANYWHERE
# quirk[XTerm:xterm] = XTERM_FONTADJ
# quirk[xine:Xine Window] = FLOAT + ANYWHERE
# quirk[Xitk:Xitk Combo] = FLOAT + ANYWHERE
# quirk[xine:xine Panel] = FLOAT + ANYWHERE
# quirk[Xitk:Xine Window] = FLOAT + ANYWHERE
# quirk[xine:xine Video Fullscreen Window] = FULLSCREEN + FLOAT
# quirk[pcb:pcb] = FLOAT
# EXAMPLE: define firefox program and bind to key
# program[firefox] = firefox http://spectrwm.org/
# bind[firefox] = MOD+Shift+b
# livarp default keybinds
program[firefox] = firefox http://arpinux.org/livarp_start
program[ranger] = urxvtcd -e ranger
program[rox] = rox-filer
program[vim] = urxvtcd -e vim
program[geany] = geany
program[mocp] = urxvtcd -e mocp
program[mixer] = urxvtcd -e alsamixer
program[help] = urxvtcd -e spectrwm_keys.sh
bind[firefox] = Mod4+w
bind[ranger] = Mod4+r
bind[rox] = Mod4+Shift+r
bind[vim] = Mod4+e
bind[geany] = Mod4+Shift+e
bind[mocp] = Mod4+z
bind[mixer] = Mod4+v
bind[help] = Mod4+h
Le fauteur de trouble se situe à la ligne 64 :
program[initscr] = initscreen.sh
3 / Recherche du fichier « initscreen.sh » sur le HDD :
Avec le terminal, recherchons ce fichier initscreen.sh sur le disque dur :
14:13 stevie > find initscreen.sh < Host-001:pts/1:~
find: ‘initscreen.sh’: Aucun fichier ou dossier de ce type
14:13 stevie >
Rien, il n’existe donc pas dans le home, ni ailleurs…
Il nous faut donc le créer au pied levé.
4 / Recherche d’un exemple du fichier initsreen.sh sur le web :
Note ami (/ennemi?) internet va nous aider.
Logiquement tout programme informatique de type encodé ou disponible sous la forme d’un fichier source généralement décompressible se trouve soit sur le site github, soit sous sur son consin gitlab.
Avec votre navigateur et un moteur de recherche de type startpage ou duck duck go (..) vous obtenez la réponse suivante :
https://github.com/conformal/spectrwm
Vous pouvez télécharger le fichier source dénommé « spectrwm.git », téléchargeable à l’adresse https://github.com/conformal/spectrwm.git
8 / Recherche et configuration d’un exemple du fichier spectrwm_status.sh :
Le fichier « spectrwm_status.sh » configure la statusbar.
Le voici :
#! /bin/bash
# status script for spectrwm
# sources : https://github.com/xorg62/wmfs/wiki/statusbar
########################################################################
# power - BAT0 #########################################################
pwr(){
if [ -e /sys/class/power_supply/BAT0 ];then
pwrsta="$(cat /sys/class/power_supply/AC/online)"
if [ "$pwrsta" == "0" ];then
state="-"
else
state="+"
fi
pwrperc="$(awk 'sub(/,/,"") {print $4}' <(acpi -b) | cut -d , -f 1 $1 | tail -n1)"
if [ "$pwrperc" == "F" ];then
perc="F"
else
perc="$pwrperc"
fi
echo "[bat $state$pwrperc]"
else
echo ""
fi
}
# cpu section ##########################################################
cpu(){
cpu="$(eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4;
eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat);
intervaltotal=$((total-${prevtotal:-0}));
echo "$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))")"
echo "[cpu $cpu %]"
}
# mem section ##########################################################
mem(){
memu="$(free -m | sed -n 's|^-.*:[ \t]*\([0-9]*\) .*|\1|gp')"
memt="$(free -m | sed -n 's|^M.*:[ \t]*\([0-9]*\) .*|\1|gp')"
memperc="$(( ((100*$memu)) / $memt))"
echo "[mem $memperc%]"
}
# hdd section - only for / #############################################
hdd(){
hdd="$(df -h|grep "rootfs "|awk '{print $5}')"
echo "[hdd $hdd]"
}
# internet section - eth0/wlan0 ########################################
int(){
if [ -e /sys/class/net/eth0 ];then
RXB="$(cat /sys/class/net/eth0/statistics/rx_bytes)"
TXB="$(cat /sys/class/net/eth0/statistics/tx_bytes)"
sleep 2
RXBN="$(cat /sys/class/net/eth0/statistics/rx_bytes)"
TXBN="$(cat /sys/class/net/eth0/statistics/tx_bytes)"
RXDIF="$(echo $((RXBN - RXB)) )"
TXDIF="$(echo $((TXBN - TXB)) )"
echo "[dl $((RXDIF / 1024 / 2))k/s up $((TXDIF / 1024 / 2))k/s]"
elif [ -e /sys/class/net/wlan0 ];then
RXB="$(cat /sys/class/net/wlan0/statistics/rx_bytes)"
TXB="$(cat /sys/class/net/wlan0/statistics/tx_bytes)"
sleep 2
RXBN="$(cat /sys/class/net/wlan0/statistics/rx_bytes)"
TXBN="$(cat /sys/class/net/wlan0/statistics/tx_bytes)"
RXDIF="$(echo $((RXBN - RXB)) )"
TXDIF="$(echo $((TXBN - TXB)) )"
echo "[dl $((RXDIF / 1024 / 2))k/s up $((TXDIF / 1024 / 2))k/s]"
else
echo ""
fi
}
# date/time section ####################################################
dte(){
dte="$(date +"%a %d/%m %H:%M")"
echo "[$dte]"
}
# reload interval ######################################################
TIMING=1
# set output ###########################################################
statustext(){
echo "$(pwr) $(cpu) $(mem) $(hdd) $(int) $(dte)"
}
# run it ###############################################################
while true;
do
statustext
sleep $TIMING
done
# eof ##################################################################
5 / Création du ficher initscreen.sh :
En surfant sur le web, vous trouvez à la page
https://github.com/conformal/spectrwm/blob/master/initscreen.sh
un exemple de fichier « initscreen.sh ». Il s’agit de le copier tel quel à l’aide d’un éditeur de texte (vim, nano, geany,leafpad, mousepad, …), et de le placer à l’endroit que vous voulez, chez moi dans le home pour faire simple.
Fichier « initscreen.sh » :
#!/bin/sh
#
# Example xrandr multiscreen init
xrandr --output LVDS --auto
xrandr --output VGA --auto --right-of LVDS
6 / Rendre le script « .initscreen.sh » exécutable :
Il convient de rendre exécutable ce bout de code afin d’aboutir dans notre démarche.
15:52 stevie > chmod +x .initscreen.sh < Host-001:pts/0:~
15:54 stevie > < Host-001:pts/0:~
Sinon le message d’erreur sera le suivant :
total exceptions : , first exception : could not find /home/stevie/.iniscreen.sh
!
Comme suit :
7 / Intégration du fichier initscreen.sh dans le fichier spectrwm.conf du Livarp_041-fr :
Il convient donx de donner une adresse à ce fjchier, adresse reconnaisable par le fichier spectrwm.conf.
Retournons à la ligne 64 de notre fameux fichier et modifiions cette ligne :
La ligne
program[initscr] = initscreen.sh
devient
program[initscr] = /chemin/vers/votre/fichier/initscreen.sh
ou
program[initscr] = //home/user//initscreen.sh
soit chez moi :
program[initscr] = /home/stevie/.initscreen.sh
Cela constitue un adressage assez simpliste, mais efficace. c’est tout ce qui compte !
Le fichier spectrcwm.conf du Livarp_041-fr devient donc chez moi :
# PLEASE READ THE MAN PAGE BEFORE EDITING THIS FILE!
# [url]http://opensource.conformal.com/cgi-bin/man-cgi?spectrwm[/url]
# colors for focussed and unfocussed window borders
# NOTE: all colors in this file are in hex! see XQueryColor for examples
# couleur de la bordure du client ayant le focus
color_focus = rgb:0/68/8b
# couleur de la bordure des clients en arrière plan
color_unfocus = rgb:24/24/24
## bar settings
# afficher la barre
bar_enabled = 1
# épaisseur de la bordure de la status bar. pas de bordure si 0
bar_border_width = 0
# couleur de la bordure de la status bar sur l'écran x
bar_border[1] = rgb:0/68/8b
# couleur de fond de la status bar sur l'écran x
bar_color[1] = grey12
# couleur de la police de la status bar pour l'écran x
bar_font_color[1] = rgb:0/68/8b
# police utilisée pour la status bar. format Xft ou X Logical Font Description(XLFD).
# vous pouvez spécifier plusieurs polices séparées par ”,”.
# si une des polices est en XFT, elle sera utilisée par défaut.
# notez que dmenu n'utilise pas les polices XFT
bar_font = snap
# script externe à lancer pour un affichage dans la status bar
bar_action = spectrwm_status.sh
# temps de rafraichissement de la barre
bar_delay = 1
# alignement du texte de la status bar. valeurs: left, center, et right
bar_justify = left
# place la status bar en bas de l'écran
bar_at_bottom = 0
# afficher la disposition dans la status bar
stack_enabled = 1
# affiche l'heure dans la status bar
clock_enabled = 0
# format d'affichage de l'heure
clock_format = %a %d/%m %I:%M %P
# afficher le titre du client dans la status bar
title_name_enabled = 1
# afficher la class du client dans la status bar
title_class_enabled = 0
# affiche le nom du client, limité à 64 caractères
window_name_enabled = 0
# précise l'affiche de la disposition dans la status bar
verbose_layout = 0
# mode du focus. valeurs: default, follow et manual
focus_mode = default
# n'affiche pas la bordure si la status bar est masquée et qu'il n'y a qu'un seul client
disable_border = 1
# épaisseur de la bordure des clients. pas de bordures si 0
border_width = 1
# notification des clients urgents
urgent_enabled = 0
# spawn app
program[term] = urxvtcd
program[screenshot_all] = screenshot -a
program[screenshot_wind] = screenshot -w
program[lock] = xscreensaver-command -lock
program[initscr] = /home/stevie/.initscreen.sh
program[menu] = dmenu_run -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_font_color -sf $bar_color -p exec:
spawn_term = urxvtcd
# dialog box size ratio .3 >= r < 1
dialog_ratio = 0.3
# Split a non-Xrandr dual head setup into one region per monitor
# (non-standard driver-based multihead is not seen by spectrwm)
# region = screen[1]:1280x1024+0+0
# region = screen[1]:1280x1024+1280+0
# Launch applications in a workspace of choice
# autorun = ws[1]:x-terminal-emulator
# autorun = ws[2]:xxxterm http://www.openbsd.org
# workspace layout
# layout = ws[1]:4:0:0:0:vertical
# layout = ws[2]:0:0:0:0:horizontal
# layout = ws[3]:0:0:0:0:fullscreen
# mod key, (windows key is Mod4) (apple key on OSX is Mod2)
# modkey = Mod1
# Clear key bindings and load new key bindings from the specified file.
# This allows you to load pre-defined key bindings for your keyboard layout.
#keyboard_mapping = ~/.spectrwm_fr.conf
# quirks
# remove with: quirk[class:name] = NONE
# quirk[MPlayer:xv] = FLOAT + FULLSCREEN + FOCUSPREV
# quirk[OpenOffice.org 2.4:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.0:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.1:VCLSalFrame] = FLOAT
# quirk[Firefox-bin:firefox-bin] = TRANSSZ
# quirk[Firefox:Dialog] = FLOAT
# quirk[Gimp:gimp] = FLOAT + ANYWHERE
# quirk[XTerm:xterm] = XTERM_FONTADJ
# quirk[xine:Xine Window] = FLOAT + ANYWHERE
# quirk[Xitk:Xitk Combo] = FLOAT + ANYWHERE
# quirk[xine:xine Panel] = FLOAT + ANYWHERE
# quirk[Xitk:Xine Window] = FLOAT + ANYWHERE
# quirk[xine:xine Video Fullscreen Window] = FULLSCREEN + FLOAT
# quirk[pcb:pcb] = FLOAT
# EXAMPLE: define firefox program and bind to key
# program[firefox] = firefox http://spectrwm.org/
# bind[firefox] = MOD+Shift+b
# livarp default keybinds
program[firefox] = firefox http://arpinux.org/livarp_start
program[ranger] = urxvtcd -e ranger
program[rox] = rox-filer
program[vim] = urxvtcd -e vim
program[geany] = geany
program[mocp] = urxvtcd -e mocp
program[mixer] = urxvtcd -e alsamixer
program[help] = urxvtcd -e spectrwm_keys.sh
bind[firefox] = Mod4+w
bind[ranger] = Mod4+r
bind[rox] = Mod4+Shift+r
bind[vim] = Mod4+e
bind[geany] = Mod4+Shift+e
bind[mocp] = Mod4+z
bind[mixer] = Mod4+v
bind[help] = Mod4+h
8 / Recherche et configuration d’un exemple du fichier spectrwm_status.sh :
Le fichier « spectrwm_status.sh » configure la statusbar.
Le voici :
#! /bin/bash
# status script for spectrwm
# sources : [url]https://github.com/xorg62/wmfs/wiki/statusbar[/url]
########################################################################
# power - BAT0 #########################################################
pwr(){
if [ -e /sys/class/power_supply/BAT0 ];then
pwrsta="$(cat /sys/class/power_supply/AC/online)"
if [ "$pwrsta" == "0" ];then
state="-"
else
state="+"
fi
pwrperc="$(awk 'sub(/,/,"") {print $4}' <(acpi -b) | cut -d , -f 1 $1 | tail -n1)"
if [ "$pwrperc" == "F" ];then
perc="F"
else
perc="$pwrperc"
fi
echo "[bat $state$pwrperc]"
else
echo ""
fi
}
# cpu section ##########################################################
cpu(){
cpu="$(eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4;
eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat);
intervaltotal=$((total-${prevtotal:-0}));
echo "$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))")"
echo "[cpu $cpu %]"
}
# mem section ##########################################################
mem(){
memu="$(free -m | sed -n 's|^-.*:[ \t]*\([0-9]*\) .*|\1|gp')"
memt="$(free -m | sed -n 's|^M.*:[ \t]*\([0-9]*\) .*|\1|gp')"
memperc="$(( ((100*$memu)) / $memt))"
echo "[mem $memperc%]"
}
# hdd section - only for / #############################################
hdd(){
hdd="$(df -h|grep "rootfs "|awk '{print $5}')"
echo "[hdd $hdd]"
}
# internet section - eth0/wlan0 ########################################
int(){
if [ -e /sys/class/net/eth0 ];then
RXB="$(cat /sys/class/net/eth0/statistics/rx_bytes)"
TXB="$(cat /sys/class/net/eth0/statistics/tx_bytes)"
sleep 2
RXBN="$(cat /sys/class/net/eth0/statistics/rx_bytes)"
TXBN="$(cat /sys/class/net/eth0/statistics/tx_bytes)"
RXDIF="$(echo $((RXBN - RXB)) )"
TXDIF="$(echo $((TXBN - TXB)) )"
echo "[dl $((RXDIF / 1024 / 2))k/s up $((TXDIF / 1024 / 2))k/s]"
elif [ -e /sys/class/net/wlan0 ];then
RXB="$(cat /sys/class/net/wlan0/statistics/rx_bytes)"
TXB="$(cat /sys/class/net/wlan0/statistics/tx_bytes)"
sleep 2
RXBN="$(cat /sys/class/net/wlan0/statistics/rx_bytes)"
TXBN="$(cat /sys/class/net/wlan0/statistics/tx_bytes)"
RXDIF="$(echo $((RXBN - RXB)) )"
TXDIF="$(echo $((TXBN - TXB)) )"
echoModification de la configuration de spectrwm dans la Livarp_041-frbiblio
"[dl $((RXDIF / 1024 / 2))k/s up $((TXDIF / 1024 / 2))k/s]"
else
echo ""
fi
}
# date/time section ####################################################
dte(){
dte="$(date +"%a %d/%m %H:%M")"
echo "[$dte]"
}
# reload interval ######################################################
TIMING=1
# set output ###########################################################
statustext(){
echo "$(pwr) $(cpu) $(mem) $(hdd) $(int) $(dte)"
}
# run it ###############################################################
while true;
do
statustext
sleep $TIMING
done
# eof ##################################################################
9 / Résultat final
Voici la copie écran d’accueil de notre session spectrwm de Livarp_041-fr :
10 / écran screenfetch :
Voir :
11 / Raccourcis clavier/souris les plus usuels :
Ceux-ci vous rendront service dans le cadre d’une utilisation de ce gestionnaire de fenêtres avec ou sans Livarp/KisssOS, soit dans mon cas sur une autre machine une « KissArp ».
En voici les principaux, accessibles par la commande
spectrwm_keys.sh
17:27 stevie > spectrwm_keys.sh
< Host-001:pts/1:~
livarp 0.4 - raccourcis spectrwm
relancer spectrwm Alt + q
quitter spectrwm Alt + Shift + q
fermer le client Alt + x
tuer le client Alt + Shift + x
lancer dmenu Alt + p
ouvrir un terminal Alt + Shift + Return
ouvrir rox-filer Super + Shift + r
ouvrir ranger Super + r
ouvrir firefox Super + w
ouvrir vim Super + e
ouvrir geany Super + Shift + e
lecteur de musique Super + z
contrôle du volume Super + v
aide Super + h
chande de disposition Alt + space
client préc/suiv Alt + k/j or Tab
tag occupé préc/suiv Alt + Left/Right
tag préc/suiv Alt + Up/Down
dernier tag occupé Alt + a
envoyer au tag 'n' Alt + Shift + [1..n]
aller au tag 'n' Alt + [1..n]
changer de region Alt + Shift + Left/Right
libère/tile le client Alt + t
minimise le client Alt + w
rétablit le client Alt + Shift + w
recherche un client Alt + f
manuel complet avec [man spectrwm]
presser Enter pour quitter...
Ce qui nous donne :
- relancer spectrwm Alt + q
- quitter spectrwm Alt + Shift + q
- fermer le client Alt + x
- tuer le client Alt + Shift + x
- lancer dmenu Alt + p
- ouvrir un terminal Alt + Shift + Return
- ouvrir rox-filer Super + Shift + r
- ouvrir ranger Super + r
- ouvrir firefox Super + w
- ouvrir vim Super + e
- ouvrir geany Super + Shift + e
- lecteur de musique Super + z
- contrôle du volume Super + v
- aide Super + h
- change de disposition Alt + space
- client préc/suiv Alt + k/j or Tab
- tag occupé préc/suiv Alt + Left/Right
- tag préc/suiv Alt + Up/Down
- dernier tag occupé Alt + a
- envoyer au tag 'n' Alt + Shift + [1..n]
- aller au tag 'n' Alt + [1..n]
- changer de region Alt + Shift + Left/Right
- libère/tile le client Alt + t
- minimise le client Alt + w
- rétablit le client Alt + Shift + w
- recherche un client Alt + f
Conclusion
SpectrWM constitue un gestionnaire de fenêtres de type mosaïcal assez simple à configurer, pas le plus compliqué et sûrement une très bonne entrée en matière avant d’aborder des gestionnaires plus complexes du type wmfs par exemple.
P.S. : Je n’ai pas testé Livarp in english, aussi je ne peux affirmer que le problème évoqué dans le corps principal de ce tutoriel s’y reproduit. Vous adapterez ce tuto si nécessaire.
Bien à vous.
Mr S.
Sources – bibliographie :
* Debian
https://cdimage.debian.org/debian-cd/cu … 6/iso-dvd/ , page de téléchargement des isos DVD debian stables
https://www.debian.org/devel/wnpp/orphaned.fr.html , page d'accueil des paquets abandonnés de debian : une vrai mine pour les fanas de vieux paquets tels que le menu automatisé en CLI "pdmenu" ou du traitement de texte "abiword" par exemple !
* Livarp041 - arpinux.org
https://arpinux.org/livarp/livarp04/index-fr.html , page d'accueil du projet Livarp04
https://arpinux.org/livarp/livarp04/hel … ctrwm.html , page de présentation de la session spectrwm
https://arpinux.org/isos/livarp/livarp_041-fr.iso , lien de téléchargement de l'iso Livarp041-fr
https://arpinux.org/isos/livarp/livarp_041.iso , lien de téléchargement de l'iso Livarp041 anglaise
https://arpinux.org/livarp/livarp-story … story.html , page de lecture de l'histoire de Livarp
* Livarp - gitlab
https://git.framasoft.org/livarp , page d'accueil du projet Livarp sur le site Gitlab
https://git.framasoft.org/livarp/livarp_04-fr , page d'accueil du dérivé debian Livarp041-fr sur le site Gitlab
https://git.framasoft.org/livarp/livarp … master.zip , lien de téléchargement des sources du dérivé debian Livarp041-fr sur le site Gitlab
https://git.framasoft.org/livarp/livarp … ter.tar.gz , lien de téléchargement des sources du dérivé debian Livarp041-fr sur le site Gitlab
https://git.framasoft.org/livarp/livarp … er.tar.bz2 , lien de téléchargement des sources du dérivé debian Livarp041-fr sur le site Gitlab
https://git.framasoft.org/livarp/livarp … master.tar , lien de téléchargement des sources du dérivé debian Livarp041-fr sur le site Gitlab
https://git.framasoft.org/livarp/livarp_04_help-center , page d'accueil du projet livarp_04_help-center sur le site Gitlab
https://git.framasoft.org/livarp/livarp … master.zip , Lien de téléchargement du projet livarp_04_help-center sur le site Gitlab
https://git.framasoft.org/livarp/livarp … ter.tar.gz , Lien de téléchargement du projet livarp_04_help-center sur le site Gitlab
https://git.framasoft.org/livarp/livarp … er.tar.bz2 , Lien de téléchargement du projet livarp_04_help-center sur le site Gitlab
https://git.framasoft.org/livarp/livarp … master.tar , Lien de téléchargement du projet livarp_04_help-center sur le site Gitlab
* Spectrwm - site officiel
https://github.com/conformal/spectrwm , page d'accueil du site officiel de Spectrwm
https://htmlpreview.github.io/?https:// … ctrwm.html , page de consultation du de la manpage de spectrwm
https://github.com/conformal/spectrwm.git : lien de téléchargement du fichier source dénommé « spectrwm.git »,
* Spectrwm - Archlinux
https://wiki.archlinux.org/index.php/Spectrwm , page de présentation du gestionnaire de fenêtres spectrwm sur le site d'Archlinux
* Spectrwm - arpinux.org
https://arpinux.org/public/index.php?cm … OTJmOGZiNQ , lien de téléchargement d'une fiche de présentation et de configuration du gestionnaire de fenêtres spectrwm - document à lire absolument avant de vous lancer car très précis et didactique en même temps
###############
Annexe : manpage de Spectrwm
https://htmlpreview.github.io/?https:// … ctrwm.html , page de consultation du de la manpage de spectrwm
SPECTRWM(1) General Commands Manual SPECTRWM(1)
NAME
spectrwm — window manager for X11
SYNOPSIS
spectrwm
DESCRIPTION
spectrwm is a minimalistic window manager that tries to stay out of the way so that valuable screen real estate can be used for much more important stuff. It has sane defaults and does not require one to learn a language to do any configuration. It was written by hackers for hackers and it strives to be small, compact and fast.
When spectrwm starts up, it reads settings from its configuration file, spectrwm.conf. See the CONFIGURATION FILES section below.
The following notation is used throughout this page:
M
Meta
S
Shift
⟨Name⟩
Named key or button
spectrwm is very simple in its use. Most of the actions are initiated via key or pointer bindings. See the BINDINGS section below for defaults and customizations.
CONFIGURATION FILES
spectrwm first tries to open the user specific file, ~/.spectrwm.conf. If that file is unavailable, it then tries to open the global configuration file /etc/spectrwm.conf.
The format of the file is
keyword = setting
For example:
color_focus = red
Enabling or disabling an option is done by using 1 or 0 respectively.
Colors need to be specified per the XQueryColor(3) specification.
Comments begin with a #. When a literal ‘#’ is desired in an option, then it must be escaped with a backslash, i.e. \#
The file supports the following keywords:
autorun
Launch an application in a specified workspace at start-of-day. Defined in the format ws[idx]:application, e.g. ws[2]:xterm launches an xterm(1) in workspace 2.
Note that workspace mapping is handled via libswmhack.so. When autorun spawns windows via a daemon, ensure the daemon is started with the correct LD_PRELOAD in its environment.
For example, starting urxvtd(1) via xinit(1):
LD_PRELOAD=/usr/lib/libswmhack.so.0.0 urxvtd -q -o -f
Spawned programs automatically have LD_PRELOAD set when executed.
bar_action
External script that populates additional information in the status bar, such as battery life.
bar_at_bottom
Place the statusbar at the bottom of each region instead of the top.
bar_border[x]
Border color of the status bar(s) in screen x.
bar_border_unfocus[x]
Border color of the status bar(s) on unfocused region(s) in screen x.
bar_border_width
Set status bar border thickness in pixels. Disable border by setting to 0.
bar_color[x]
Background color of the status bar(s) in screen x.
bar_enabled
Set default bar_toggle state; default is 1.
bar_enabled_ws[x]
Set default bar_toggle_ws state on workspace x; default is 1.
bar_font
Font used in the status bar. Either Xft or X Logical Font Description (XLFD) may be used to specify fonts. Fallback fonts may be specified by separating each font with a comma. If all entries are in XLFD syntax, font set will be used. If at least one entry is Xft, Xft will be used. Note that if Xft is in use, only the first font that successfully loads will be used regardless of missing glyphs. The default is to use font set. Also note that dmenu(1) does not support Xft fonts.
Xft examples:
bar_font = Terminus:style=Regular:pixelsize=14:antialias=true
bar_font = -*-profont-medium-*-*-*-11-*-*-*-*-*-*-*,Terminus:pixelsize=14,-*-clean-medium-*-*-*-12-*-*-*-*-*-*-*
Font set examples:
bar_font = -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*
bar_font = -*-profont-medium-*-*-*-11-*-*-*-*-*-*-*,-*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*,-*-clean-medium-*-*-*-12-*-*-*-*-*-*-*
To list the available fonts in your system see fc-list(1) or xlsfonts(1) manpages. The xfontsel(1) application can help with the XLFD setting.
bar_font_color[x]
Color of the font in status bar in screen x.
bar_format
Set the bar format string, overriding clock_format and all of the enabled options. The format is passed through strftime(3) before being used. It may contain the following character sequences:
Character sequence Replaced with
+< Pad with a space
+A Output of the external script
+C Window class (from WM_CLASS)
+D Workspace name
+F Floating indicator
+I Workspace index
+M Number of iconic (minimized) windows in workspace
+N Screen number
+P Window class and instance separated by a colon
+S Stacking algorithm
+T Window instance (from WM_CLASS)
+U Urgency hint
+V Program version
+W Window name (from _NET_WM_NAME/WM_NAME)
++ A literal ‘+’
All character sequences may limit its output to a specific length, for example +64A. Any characters that don't match the specification are copied as-is.
bar_justify
Justify the status bar text. Possible values are left, center, and right.
Note that if the output is not left justified, it may not be properly aligned in some circumstances, due to the white-spaces in the default static format. See the bar_format option for more details.
bind[x]
Bind key or button combo to action x. See the BINDINGS section below.
border_width
Set window border thickness in pixels. Disable all borders by setting to 0.
boundary_width
Set region containment boundary width in pixels. This is how far a window must be dragged/resized (with the pointer) beyond the region edge before it is allowed outside the region. Disable the window containment effect by setting to 0.
clock_enabled
Enable or disable displaying the clock in the status bar. Disable by setting to 0 so a custom clock could be used in the bar_action script.
iconic_enabled
Display the number of iconic (minimized) windows in the status bar. Enable by setting to 1.
color_focus
Border color of the currently focused window. Default is red.
color_focus_maximized
Border color of the currently focused, maximized window. Defaults to the value of color_focus.
color_unfocus
Border color of unfocused windows, default is rgb:88/88/88.
color_unfocus_maximized
Border color of unfocused, maximized windows. Defaults to the value of color_unfocus.
dialog_ratio
Some applications have dialogue windows that are too small to be useful. This ratio is the screen size to what they will be resized. For example, 0.6 is 60% of the physical screen size.
disable_border
Remove border when bar is disabled and there is only one window on the region.
focus_close
Window to put focus when the focused window is closed. Possible values are first, next, previous (default) and last. next and previous are relative to the window that is closed.
focus_close_wrap
Whether to allow the focus to jump to the last window when the first window is closed or vice versa. Disable by setting to 0.
focus_default
Window to put focus when no window has been focused. Possible values are first and last (default).
focus_mode
Window focus behavior with respect to the pointer. Possible values:
default
Set window focus on border crossings caused by cursor motion and window interaction.
follow
Set window focus on all cursor border crossings, including workspace switches and changes to layout.
manual
Set window focus on window interaction only.
maximize_hide_bar
When set to 1, maximize_toggle will also hide/restore the bar visibility of the affected workspace. Defaults to 0.
java_workaround
Workaround a Java GUI rendering issue on non-reparenting window managers by impersonating the LG3D window manager, written by Sun. Default is 1.
keyboard_mapping
Clear all key bindings (not button bindings) and load new bindings from the specified file. This allows you to load pre-defined key bindings for your keyboard layout. See the KEYBOARD MAPPING FILES section below for a list of keyboard mapping files that have been provided for several keyboard layouts.
layout
Select layout to use at start-of-day. Defined in the format ws[idx]:master_grow:master_add:stack_inc:always_raise:stack_mode, e.g. ws[2]:-4:0:1:0:horizontal sets worskspace 2 to the horizontal stack mode, shrinks the master area by 4 ticks and adds one window to the stack, while maintaining default floating window behavior. Possible stack_mode values are vertical, vertical_flip, horizontal, horizontal_flip and fullscreen.
See master_grow, master_shrink, master_add, master_del, stack_inc, stack_dec, stack_balance, and always_raise for more information. Note that the stacking options are complicated and have side-effects. One should familiarize oneself with these commands before experimenting with the layout option.
This setting is not retained at restart.
modkey
Change mod key. Mod1 is generally the ALT key and Mod4 is the windows key on a PC.
name
Set the name of a workspace at start-of-day. Defined in the format ws[idx]:name, e.g. ws[1]:Console sets the name of workspace 1 to “Console”.
program[p]
Define new action to spawn a program p. See the PROGRAMS section below.
quirk[c:i:n]
Add "quirk" for windows with class c, instance i and name n. See the QUIRKS section below.
region
Allocates a custom region, removing any autodetected regions which occupy the same space on the screen. Defined in the format screen[idx]:widthxheight+x+y, e.g. screen[1]:800x1200+0+0.
To make a region span multiple monitors, create a region big enough to cover them all, e.g. screen[1]:2048x768+0+0 makes the region span two monitors with 1024x768 resolution sitting one next to the other.
region_padding
Pixel width of empty space within region borders. Disable by setting to 0.
spawn_position
Position in stack to place newly spawned windows. Possible values are first, next, previous and last (default). next and previous are relative to the focused window.
stack_enabled
Enable or disable displaying the current stacking algorithm in the status bar.
term_width
Set a preferred minimum width for the terminal. If this value is greater than 0, spectrwm will attempt to adjust the font sizes in the terminal to keep the terminal width above this number as the window is resized. Only xterm(1) is currently supported. The xterm(1) binary must not be setuid or setgid, which it is by default on most systems. Users may need to set program[term] (see the PROGRAMS section) to use an alternate copy of the xterm(1) binary without the setgid bit set.
tile_gap
Pixel width of empty space between tiled windows. Negative values cause overlap. Set this to the opposite of border_width to collapse the border between tiles. Disable by setting to 0.
urgent_collapse
Minimizes the space consumed by the urgency hint indicator by removing the placeholders for non-urgent workspaces, the trailing space when there are urgent windows and the default leading space. Enable by setting to 1.
urgent_enabled
Enable or disable the urgency hint indicator in the status bar. Note that many terminal emulators require an explicit setting for the bell character to trigger urgency on the window. In xterm(1), for example, one needs to add the following line to .Xdefaults:
xterm.bellIsUrgent: true
verbose_layout
Enable or disable displaying the current master window count and stack column/row count in the status bar. Enable by setting to 1. See master_add, master_del, stack_inc and stack_dec for more information.
workspace_clamp
Prevents workspaces from being swapped when attempting to switch to a workspace that is mapped to another region. Use warp_focus if you want to focus on the region containing the workspace and warp_pointer if you want to also send the pointer. Enable by setting to 1.
window_class_enabled
Enable or disable displaying the window class name (from WM_CLASS) in the status bar. Enable by setting to 1.
window_instance_enabled
Enable or disable displaying the window instance name (from WM_CLASS) in the status bar. Enable by setting to 1.
window_name_enabled
Enable or disable displaying the window display name (from _NET_WM_NAME/WM_NAME) in the status bar. Enable by setting to 1.
To prevent excessively large window names from pushing the remaining text off the bar, it's limited to 64 characters, by default. See the bar_format option for more details.
warp_focus
Focus on the target window/workspace/region when clamped. For example, when attempting to switch to a workspace that is mapped on another region and workspace_clamp is enabled, focus on the region with the target workspace. Enable by setting to 1.
warp_pointer
Centers the pointer on the focused window when using bindings to change focus, switch workspaces, change regions, etc. Enable by setting to 1.
workspace_limit
Set the total number of workspaces available. Minimum is 1, maximum is 22, default is 10.
PROGRAMS
spectrwm allows you to define custom actions to launch programs of your choice and then bind them the same as with built-in actions. See the BINDINGS section below.
Custom programs in the configuration file are specified as follows:
program[action] = progpath [arg [arg ...]]
action is any identifier that does not conflict with a built-in action or keyword, progpath is the desired program, and arg is zero or more arguments to the program.
Remember that when using ‘#’ in your program call, it must be escaped with a backslash, i.e. \#
The following argument variables will be substituted for values at the time the program is spawned:
$bar_border
$bar_color
$bar_font
$bar_font_color
$color_focus
$color_unfocus
$dmenu_bottom
-b if bar_at_bottom is enabled.
$region_index
$workspace_index
Example:
program[ff] = /usr/local/bin/firefox http://spectrwm.org/
bind[ff] = MOD+Shift+b # Now M-S-b launches firefox
To cancel the previous, unbind it:
bind[] = MOD+Shift+b
Default programs:
lock
xlock
menu
dmenu_run $dmenu_bottom -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_border -sf $bar_color
term
xterm
initscr
initscreen.sh # optional
screenshot_all
screenshot.sh full # optional
screenshot_wind
screenshot.sh window # optional
Note that optional default programs will not be validated unless overridden. If a default program fails validation, you can resolve the exception by installing the program, modifying the program call or disabling the program by freeing the respective binding.
For example, to override lock:
program[lock] = xscreensaver-command -lock
To unbind lock and prevent it from being validated:
bind[] = MOD+Shift+Delete
BINDINGS
spectrwm provides many functions (or actions) accessed via key or pointer bindings.
The default bindings are listed below:
⟨Button1⟩
focus
M-⟨Button1⟩
move
M-⟨Button3⟩
resize
M-S-⟨Button3⟩
resize_centered
M-S-⟨Return⟩
term
M-p
menu
M-S-q
quit
M-q
restart
M-⟨Space⟩
cycle_layout
M-S-\
flip_layout
M-S-⟨Space⟩
stack_reset
⟨unbound⟩
stack_balance
M-h
master_shrink
M-l
master_grow
M-,
master_add
M-.
master_del
M-S-,
stack_inc
M-S-.
stack_dec
M-⟨Return⟩
swap_main
M-j, M-⟨TAB⟩
focus_next
M-k, M-S-⟨TAB⟩
focus_prev
M-m
focus_main
M-u
focus_urgent
M-S-j
swap_next
M-S-k
swap_prev
M-b
bar_toggle
M-S-b
bar_toggle_ws
M-x
wind_del
M-S-x
wind_kill
M-⟨1-9,0,F1-F12⟩
ws_⟨1-22⟩
M-S-⟨1-9,0,F1-F12⟩
mvws_⟨1-22⟩
M-⟨Keypad 1-9⟩
rg_⟨1-9⟩
M-S-⟨Keypad 1-9⟩
mvrg_⟨1-9⟩
⟨unbound⟩
mvrg_next
⟨unbound⟩
mvrg_prev
M-⟨Right⟩
ws_next
M-⟨Left⟩
ws_prev
M-⟨Up⟩
ws_next_all
M-⟨Down⟩
ws_prev_all
M-a
ws_prior
M-S-⟨Down⟩
ws_prev_move
M-S-⟨Up⟩
ws_next_move
M-S-⟨Right⟩
rg_next
M-S-⟨Left⟩
rg_prev
⟨unbound⟩
rg_move_next
⟨unbound⟩
rg_move_prev
M-s
screenshot_all
M-S-s
screenshot_wind
M-S-v
version
M-t
float_toggle
M-S-⟨Delete⟩
lock
M-S-i
initscr
M-w
iconify
M-S-w
uniconify
M-e
maximize_toggle
M-S-e
fullscreen_toggle
M-r
raise
M-S-r
always_raise
M-v
button2
M--
width_shrink
M-=
width_grow
M-S--
height_shrink
M-S-=
height_grow
M-[
move_left
M-]
move_right
M-S-[
move_up
M-S-]
move_down
M-S-/
name_workspace
M-/
search_workspace
M-f
search_win
The action names and descriptions are listed below:
focus
Focus window/region under pointer.
move
Move window with pointer while binding is pressed.
resize
Resize window with pointer while binding is pressed.
resize_centered
Same as resize but keep window centered.
term
Spawn a new terminal (see PROGRAMS above).
menu
Menu (see PROGRAMS above).
quit
Quit spectrwm.
restart
Restart spectrwm.
cycle_layout
Cycle layout.
flip_layout
Swap the master and stacking areas.
stack_reset
Reset layout.
stack_balance
Balance master/stacking area.
master_shrink
Shrink master area.
master_grow
Grow master area.
master_add
Add windows to master area.
master_del
Remove windows from master area.
stack_inc
Add columns/rows to stacking area.
stack_dec
Remove columns/rows from stacking area.
swap_main
Move current window to master area.
focus_next
Focus next window in workspace.
focus_prev
Focus previous window in workspace.
focus_main
Focus on main window in workspace.
focus_urgent
Focus on next window with the urgency hint flag set. The workspace is switched if needed.
swap_next
Swap with next window in workspace.
swap_prev
Swap with previous window in workspace.
bar_toggle
Toggle overall visibility of status bars.
bar_toggle_ws
Toggle status bar on current workspace.
wind_del
Delete current window in workspace.
wind_kill
Destroy current window in workspace.
ws_n
Switch to workspace n, where n is 1 through workspace_limit.
mvws_n
Move current window to workspace n, where n is 1 through workspace_limit.
rg_n
Focus on region n, where n is 1 through 9.
mvrg_n
Move current window to region n, where n is 1 through 9.
mvrg_next
Move current window to workspace in next region.
mvrg_prev
Move current window to workspace in previous region.
ws_next
Switch to next workspace with a window in it.
ws_prev
Switch to previous workspace with a window in it.
ws_next_all
Switch to next workspace.
ws_prev_all
Switch to previous workspace.
ws_next_move
Switch to next workspace with the current window.
ws_prev_move
Switch to previous workspace with the current window.
ws_prior
Switch to last visited workspace.
rg_next
Switch to next region.
rg_prev
Switch to previous region.
rg_move_next
Switch region to next screen.
rg_move_prev
Switch region to previous screen.
screenshot_all
Take screenshot of entire screen (if enabled) (see PROGRAMS above).
screenshot_wind
Take screenshot of selected window (if enabled) (see PROGRAMS above).
version
Toggle version in status bar.
float_toggle
Toggle focused window between tiled and floating.
lock
Lock screen (see PROGRAMS above).
initscr
Reinitialize physical screens (see PROGRAMS above).
iconify
Minimize (unmap) currently focused window.
uniconify
Restore (map) window returned by dmenu(1) selection.
maximize_toggle
Toggle maximization of focused window.
fullscreen_toggle
Toggle fullscreen state of focused window.
raise
Raise the current window.
always_raise
When set tiled windows are allowed to obscure floating windows.
button2
Fake a middle mouse button click (Button2).
width_shrink
Shrink the width of a floating window.
width_grow
Grow the width of a floating window.
height_shrink
Shrink the height of a floating window.
height_grow
Grow the height of a floating window.
move_left
Move a floating window a step to the left.
move_right
Move a floating window a step to the right.
move_up
Move a floating window a step upwards.
move_down
Move a floating window a step downwards.
name_workspace
Name the current workspace.
search_workspace
Search for a workspace.
search_win
Search the windows in the current workspace.
Custom bindings in the configuration file are specified as follows:
bind[action] = combo
action is one of the actions listed above (or empty to unbind) and combo is in the form of zero or more modifier keys and/or special arguments (Mod1, Shift, MOD, etc.) and a normal key (b, Space, etc.) or a button (Button1 .. Button255), separated by ‘+’. Multiple key/button combinations may be bound to the same action.
Special arguments:
MOD
Substituted for the currently defined modkey.
ANYMOD
Select all modifier combinations not handled by another binding.
REPLAY
Reprocess binding press/release events for other programs to handle. Unavailable for move, resize and resize_centered.
MOD example:
bind[reset] = Mod4+q # bind Windows-key + q to reset
bind[] = Mod1+q # unbind Alt + q
bind[move] = MOD+Button3 # Bind move to M-Button3
bind[] = MOD+Button1 # Unbind default move binding.
ANYMOD example:
bind[focus] = ANYMOD+Button3
bind[move] = MOD+Button3
In the above example, M-⟨Button3⟩ initiates move and ⟨Button3⟩ pressed with any other combination of modifiers sets focus to the window/region under the pointer.
REPLAY example:
bind[focus] = REPLAY+Button3
In the above example, when ⟨Button3⟩ is pressed without any modifier(s), focus is set to the window under the pointer and the button press is passed to the window.
To bind non-latin characters such as å or π you must enter the xkb character name instead of the character itself. Run xev(1), focus the window and press the specific key and in the terminal output read the symbol name. In the following example for å:
KeyPress event, serial 41, synthetic NO, window 0x2600001,
root 0x15a, subw 0x0, time 106213808, (11,5), root:(359,823),
state 0x0, keycode 24 (keysym 0xe5, aring), same_screen YES,
XLookupString gives 2 bytes: (c3 a5) "å"
XmbLookupString gives 2 bytes: (c3 a5) "å"
XFilterEvent returns: False
The xkb name is aring. In other words, in spectrwm.conf add:
bind[program] = MOD+aring
KEYBOARD MAPPING FILES
Keyboard mapping files for several keyboard layouts are listed below. These files can be used with the keyboard_mapping setting to load pre-defined key bindings for the specified keyboard layout.
spectrwm_cz.conf
Czech Republic keyboard layout
spectrwm_es.conf
Spanish keyboard layout
spectrwm_fr.conf
French keyboard layout
spectrwm_fr_ch.conf
Swiss French keyboard layout
spectrwm_se.conf
Swedish keyboard layout
spectrwm_us.conf
United States keyboard layout
QUIRKS
spectrwm provides "quirks" which handle windows that must be treated specially in a tiling window manager, such as some dialogs and fullscreen apps.
The default quirks are described below:
Firefox-bin:firefox-bin
TRANSSZ
Firefox:Dialog
FLOAT
Gimp:gimp
FLOAT + ANYWHERE
MPlayer:xv
FLOAT + FULLSCREEN + FOCUSPREV
OpenOffice.org 2.4:VCLSalFrame
FLOAT
OpenOffice.org 3.1:VCLSalFrame
FLOAT
pcb:pcb
FLOAT
xine:Xine Window
FLOAT + ANYWHERE
xine:xine Panel
FLOAT + ANYWHERE
xine:xine Video Fullscreen Window
FULLSCREEN + FLOAT
Xitk:Xitk Combo
FLOAT + ANYWHERE
Xitk:Xine Window
FLOAT + ANYWHERE
XTerm:xterm
XTERM_FONTADJ
The quirks themselves are described below:
ANYWHERE
Allow window to position itself, uncentered.
FLOAT
This window should not be tiled, but allowed to float freely.
FOCUSONMAP_SINGLE
When the window first appears on the screen, change focus to the window if there are no other windows on the workspace with the same WM_CLASS class/instance value. Has no effect when focus_mode is set to follow.
FOCUSPREV
On exit force focus on previously focused application not previous application in the stack.
FULLSCREEN
Remove border to allow window to use full region size.
IGNOREPID
Ignore the PID when determining the initial workspace for a new window. Especially useful for terminal windows that share a process.
IGNORESPAWNWS
Ignore the spawn workspace when determining the initial workspace for a new window.
MINIMALBORDER
Remove border when window is unfocused and floating.
NOFOCUSCYCLE
Remove from normal focus cycle (focus_prev or focus_next). The window can still be focused using search_win.
NOFOCUSONMAP
Don't change focus to the window when it first appears on the screen. Has no effect when focus_mode is set to follow.
OBEYAPPFOCUSREQ
When an application requests focus on the window via a _NET_ACTIVE_WINDOW client message (source indication of 1), comply with the request. Note that a source indication of 0 (unspecified) or 2 (pager) are always obeyed.
TRANSSZ
Adjusts size on transient windows that are too small using dialog_ratio (see CONFIGURATION FILES).
WS[n]
Force a new window to appear on workspace n.
XTERM_FONTADJ
Adjust xterm(1) fonts when resizing.
Custom quirks in the configuration file are specified as follows:
quirk[class[:instance[:name]]] = quirk [+ quirk ...]
class, instance (optional) and name (optional) are patterns used to determine which window(s) the quirk(s) apply to and quirk is one of the quirks from the list above.
Note that patterns are interpreted as POSIX Extended Regular Expressions. Any ':', '[' or ']' must be escaped with '\'. See regex(7) for more information on POSIX Extended Regular Expressions.
For example:
quirk[MPlayer] = FLOAT + FULLSCREEN + FOCUSPREV # Float all windows having a class of 'MPlayer'
quirk[.*] = FLOAT # Float all windows by default.
quirk[.*:.*:.*] = FLOAT # Same as above.
quirk[Firefox:Navigator] = FLOAT # Float all Firefox browser windows.
quirk[::Console] = FLOAT # Float windows with WM_CLASS not set and a window name of 'Console'.
quirk[\[0-9\].*:.*:\[\[\:alnum\:\]\]*] = FLOAT # Float windows with WM_CLASS class beginning with a number, any WM_CLASS instance and a _NET_WM_NAME/WM_NAME either blank or containing alphanumeric characters without spaces.
quirk[pcb:pcb] = NONE # remove existing quirk
You can obtain class, instance and name by running xprop(1) and then clicking on the desired window. In the following example the main window of Firefox was clicked:
$ xprop | grep -E "^(WM_CLASS|_NET_WM_NAME|WM_NAME)"
WM_CLASS(STRING) = "Navigator", "Firefox"
WM_NAME(STRING) = "spectrwm - ConformalOpenSource"
_NET_WM_NAME(UTF8_STRING) = "spectrwm - ConformalOpenSource"
Note that xprop(1) displays WM_CLASS as:
WM_CLASS(STRING) = "<instance>", "<class>"
In the example above the quirk entry would be:
quirk[Firefox:Navigator] = FLOAT
spectrwm also automatically assigns quirks to windows based on the value of the window's _NET_WM_WINDOW_TYPE property as follows:
_NET_WM_WINDOW_TYPE_DOCK
FLOAT + ANYWHERE
_NET_WM_WINDOW_TYPE_TOOLBAR
FLOAT + ANYWHERE
_NET_WM_WINDOW_TYPE_UTILITY
FLOAT + ANYWHERE
_NET_WM_WINDOW_TYPE_SPLASH
FLOAT
_NET_WM_WINDOW_TYPE_DIALOG
FLOAT
In all other cases, no automatic quirks are assigned to the window. Quirks specified in the configuration file override the automatic quirks.
EWMH
spectrwm partially implements the Extended Window Manager Hints (EWMH) specification. This enables controlling windows as well as spectrwm itself from external scripts and programs. This is achieved by spectrwm responding to certain ClientMessage events. From the terminal these events can be conveniently sent using tools such as wmctrl(1) and xdotool(1). For the actual format of these ClientMessage events, see the EWMH specification.
The id of the currently focused window is stored in the _NET_ACTIVE_WINDOW property of the root window. This can be used for example to retrieve the title of the currently active window with xprop(1) and grep(1):
$ WINDOWID=`xprop -root _NET_ACTIVE_WINDOW | grep -o "0x.*"`
$ xprop -id $WINDOWID _NET_WM_NAME | grep -o "\".*\""
A window can be focused by sending a _NET_ACTIVE_WINDOW client message to the root window. For example, using wmctrl(1) to send the message (assuming 0x4a0000b is the id of the window to be focused):
$ wmctrl -i -a 0x4a0000b
Windows can be closed by sending a _NET_CLOSE_WINDOW client message to the root window. For example, using wmctrl(1) to send the message (assuming 0x4a0000b is the id of the window to be closed):
$ wmctrl -i -c 0x4a0000b
Windows can be floated and un-floated by adding or removing the _NET_WM_STATE_ABOVE atom from the _NET_WM_STATE property of the window. This can be achieved by sending a _NET_WM_STATE client message to the root window. For example, the following toggles the floating state of a window using wmctrl(1) to send the message (assuming 0x4a0000b is the id of the window to be floated or un-floated):
$ wmctrl -i -r 0x4a0000b -b toggle,_NET_WM_STATE_ABOVE
Windows can also be iconified and un-iconified by substituting _NET_WM_STATE_HIDDEN for _NET_WM_STATE_ABOVE in the previous example:
$ wmctrl -i -r 0x4a0000b -b toggle,_NET_WM_STATE_HIDDEN
Floating windows can also be resized and moved by sending a _NET_MOVERESIZE_WINDOW client message to the root window. For example, using wmctrl(1) to send the message (assuming 0x4a0000b is the id of the window to be resize/moved):
$ wmctrl -i -r 0x4a0000b -e 0,100,50,640,480
This moves the window to (100,50) and resizes it to 640x480.
Any _NET_MOVERESIZE_WINDOW events received for stacked windows are ignored.
SIGNALS
Sending spectrwm a HUP signal will restart it.
FILES
~/.spectrwm.conf
spectrwm user specific settings.
/etc/spectrwm.conf
spectrwm global settings.
HISTORY
spectrwm was inspired by xmonad & dwm.
AUTHORS
spectrwm was written by:
Marco Peereboom ⟨marco@peereboom.us⟩
Ryan Thomas McBride ⟨mcbride@countersiege.com⟩
Darrin Chandler ⟨dwchandler@stilyagin.com⟩
Pierre-Yves Ritschard ⟨pyr@spootnik.org⟩
Tuukka Kataja ⟨stuge@xor.fi⟩
Jason L. Wright ⟨jason@thought.net⟩
Reginald Kennedy ⟨rk@rejii.com⟩
Lawrence Teo ⟨lteo@lteo.net⟩
Tiago Cunha ⟨tcunha@gmx.com⟩
David Hill ⟨dhill@mindcry.org⟩
February 15, 2012 Bitrig 1.0
Hors ligne
Hors ligne
Merci pour ce tuto
Le top serais d'inclure le logo livarp dans screenfetch
Utiliser des logiciels propriétaires, c'est comme les plats préparés, on est incapable de dire les conservateurs qu'ils contiennent, on dira toujours que c'est bon, mais ça ne remplacera jamais le repas fait maison par sa maman.
]:D #! Crunchbang & Archlinux GNU/Linux User ]:D
Hors ligne
Exact, d'autant plus que pour l'image du "10 / ", je me suis trompé d'adresse ! En effet, j'ai bien fourni une image spectrwm pour le "9 / Résultat final", mais pour l "10 / écran screenfetch" j'ai fourni une image openbox...
Pas trop grave, le plus important c'est le code. Ce tutoriel peut fonctionner avec toutes distributions gnu/linux ou bsd.
Toutefois, j'essaye de me rattraper ce soir dès le retour at home.
Bon usage à tout le monde !
Mr. S.
Hors ligne
Bonsoir à tout le monde,
Pour la correction de l'image située au point n° 10 de cet exposé, j'ai repris la commande
screenfetch
et voilà ce que cela donne :
1 / Sans option :
18:31 stevie > screenfetch < Host-001:pts/0:~
_,met$$$$$gg. stevie@Host-001
,g$$$$$$$$$$$$$$$P. OS: Debian 9.5 stretch
,g$$P"" """Y$$.". Kernel: i686 Linux 4.9.0-8-686-pae
,$$P' `$$$. Uptime: 3m
',$$P ,ggs. `$$b: Packages: 2125
`d$$' ,$P"' . $$$ Shell: zsh 5.3.1
$$P d$' , $$P Resolution: 1440x900
$$: $$. - ,d$$' WM: SpectrWM
$$\; Y$b._ _,d$P' GTK Theme: livarp_theme [GTK2/3]
Y$$. `.`"Y$$$$P"' Font: Helvetica 12
`$$b "-.__ CPU: Genuine Intel CPU T2050 @ 1.6GHz
`Y$$ GPU: Gallium 0.4 on NV46
`Y$$. RAM: 159MiB / 2018MiB
`$$b.
`Y$$b.
`"Y$b._
`""""
2 / Avec l'option -D :
18:31 stevie > screenfetch -D livarp < Host-001:pts/0:~
stevie@Host-001
OS: livarp
Kernel: i686 Linux 4.9.0-8-686-pae
##### Uptime: 3m
####### Packages: Unknown
##O#O## Shell: zsh 5.3.1
####### Resolution: 1440x900
########### WM: SpectrWM
############# GTK Theme: livarp_theme [GTK2/3]
############### Font: Helvetica 12
################ CPU: Genuine Intel CPU T2050 @ 1.6GHz
################# GPU: Gallium 0.4 on NV46
##################### RAM: 159MiB / 2018MiB
#####################
#################
18:31 stevie >
3 / Avec l'option -A :
18:35 stevie > screenfetch -A livarp < Host-001:pts/0:~
stevie@Host-001
OS: Debian 9.5 stretch
Kernel: i686 Linux 4.9.0-8-686-pae
##### Uptime: 8m
####### Packages: 2125
##O#O## Shell: zsh 5.3.1
####### Resolution: 1440x900
########### WM: SpectrWM
############# GTK Theme: livarp_theme [GTK2/3]
############### Font: Helvetica 12
################ CPU: Genuine Intel CPU T2050 @ 1.6GHz
################# GPU: Gallium 0.4 on NV46
##################### RAM: 155MiB / 2018MiB
#####################
#################
18:36 stevie >
Bref, quelque soit l'option, je n'ai pas réussi à sortir le logo de Livarp. A la place, c'est Tux qui nous salue.
Bonne soirée à toutes et à tous.
Mr. S.
Hors ligne
Bonsoir à tout le monde, ...
Bref, quelque soit l'option, je n'ai pas réussi à sortir le logo de Livarp. A la place, c'est Tux qui nous salue.
Bonne soirée à toutes et à tous.
Mr. S.
Il faut l'inclure dans le code source de screenfetch, et ensuite rajouter le nom de la distro etc, je l'avais fais pour Viperr à l'époque ou pour Kali Linux je ne sais plus, le plus dur est de créer l'image en ASCII avec un format raisonnable qui ne déborde pas trop.
Utiliser des logiciels propriétaires, c'est comme les plats préparés, on est incapable de dire les conservateurs qu'ils contiennent, on dira toujours que c'est bon, mais ça ne remplacera jamais le repas fait maison par sa maman.
]:D #! Crunchbang & Archlinux GNU/Linux User ]:D
Hors ligne