Table des matières

Installer et configurer un environnement de bureau sous Linux depuis 0

Cette page n'est pas encore organisé car mon système n'est toujours pas stable. J'espère d'ici la fin de l'année faire quelque chose de propre et de fonctionnel.

paquets utilisés :

apt-get install slim openbox xorg conky bash-completion xscreensaver palemoon

autologin :

nano /etc/slim.conf

ajouter ces deux lignes :

default_ser bruno
auto_login yes
echo "PS1='\[\033[01;36m\]\w\[\033[00m\]\e[1m\[\033[00;31m\]\$\[\033[00;00m\]\e[0m '" >> /root/.bashrc

config conkyrc

Pré-requis :

apt isntall lm-sensors hddtemp

fichier /etc/conky/conky.conf :

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

Mise en forme pour i3 :
<file conf conky.conf>
alignment top_right
background yes
double_buffer yes
text_buffer_size 1024
out_to_console no
out_to_stderr no
extra_newline no
update_interval 2
gap_x 10
gap_y 50
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
own_window yes
own_window_type override
own_window_transparent yes
xftalpha 1
override_utf8_locale yes
#font
xftfont Monospace:style=Bold:size=10

Mise en forme pour openbox :

alignment top_right
background no
border_width 0
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont Monospace:size=10
gap_x 10
gap_y 50
maximum_width 300
minimum_size 5 5
net_avg_samples 2
no_buffers no
double_buffer yes
out_to_console no
out_to_stderr no
extra_newline no
own_window no
own_window_transparent yes
own_window_class Conky
own_window_type desktop
stippled_borders 0
update_interval 3
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no

Template :

TEXT
${color #7f8c8d}${alignc}----- Hardware ----- $alignc $color
${color grey}RAM:$color  $mem - $memperc% ${color grey} Swap:$color $swap - $swapperc%
${color grey}CPU:$color  $cpu% ${color grey} Proc:$color $processes  ${color grey}Zombie:$color $running_processes
CPU1: ${exec echo "scale=1; $((`cpufreq-info -c 0 -f`)) / 1000 / 1000" | bc | awk '{printf "%1.1f\n", $0}'} GHz CPU2: ${exec echo "scale=1; $((`cpufreq-info -c 1 -f`)) / 1000 / 1000" | bc | awk '{printf "%1.1f\n", $0}'} GHz CPU3: ${exec echo "scale=1; $((`cpufreq-info -c 2 -f`)) / 1000 / 1000" | bc | awk '{printf "%1.1f\n", $0}'} GHz CPU4: ${exec echo "scale=1; $((`cpufreq-info -c 3 -f`)) / 1000 / 1000" | bc | awk '{printf "%1.1f\n", $0}'} GHz
${color grey}HDD I/O: $color ${diskiograph /dev/sda 13,150 07,1927 ff0000} ${diskio /dev/sda}
${color grey}/     $color ${fs_used /} ${fs_bar /}
${color grey}/home $color ${fs_used /home} ${fs_bar /home}
${color grey}CPU :$color ${texeci 1200 $(sensors|awk '{print $3 }'|grep "^+")} ${color grey}M/B :$color ${hwmon 1 temp 1}°
$hr
${color #7f8c8d}${alignc}----- Network(s) ----- $alignc $color
${color grey}Pub:$color ${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${color grey}Pass:$color ${texeci 1200 ip r|head -n1|awk '{print $3}'}
${color grey}Data:$color ${texeci 1200 ifconfig eth0 | grep -e "Bcast" | cut -c 20-33} ${downspeed eth0} (up) ${upspeed eth0} (down)
$hr
${color #7f8c8d}${alignc}----- Most processus used ----- $alignc $color
${top name 1} ${top pid 1} ${top cpu 1}% ${top mem 1}%
${top name 2} ${top pid 2} ${top cpu 2}% ${top mem 2}%
${top name 3} ${top pid 3} ${top cpu 3}% ${top mem 3}%
$hr
${color #7f8c8d}${alignc}----- Monitoring (Target) ----- $alignc $color
${color grey}bruno-tatu.com:$color HTTPS (${if_match ${texeci 1200 curl -s -I -k https://bruno-tatu.com | grep HTTP | cut -c 9-12} != 200} ${color red}Error$color ${else} OK $endif)
${color grey}www.start-it.fr:$color HTTP (${if_match ${texeci 1200 curl -s -I http://www.start-it.fr | grep HTTP | cut -c 9-12} != 200} ${color red}Error$color ${else} OK $endif)
$hr
${color #7f8c8d}${alignc}----- Monitoring (Self)----- $alignc $color
${color #7f8c8d}${alignc}--- Force access --- $alignc $color
${color red}${texeci 600 cat /var/log/auth.log |grep failure | awk '{ gsub(/\[.*\]:/,"",$5); gsub(/[a-z]*=/,"",$14); gsub(/[a-z]*=/,"",$15); print $2" "$1": "$5" "$14" "$15 }'} $color
${color #7f8c8d}${alignc}--- Current connexions --- $alignc $color
${color grey}Entrées : $color${tcp_portmon 1 32767 count}${color grey} Sorties :$color ${tcp_portmon 32768 61000 count}
${color grey}Connections Out${alignr} Service / Port$color
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${color grey}Connections In${alignr} Service / Port$color
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
$hr
${color #7f8c8d}${alignc}--- Output Connections --- $alignc $color
${color grey}${texeci 5 netstat -taupen|grep -v "chromium" |grep -v "x-www-browser"|grep -e "ESTABLISHED" -e "CLOSE_WAIT"|awk '{print $5" "$9}'} $colorrtmon 32768 61000 rhost 2} ${alignr} $$
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${color grey}Connections In${alignr} Service / Port$color
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
$hr
${color #7f8c8d}${alignc}--- Output Connections --- $alignc $color
${color grey}${texeci 5 netstat -taupen|grep -v "chromium" |grep -v "x-www-browser"|grep -e "ESTABLISHED" -e "CLOSE_WAIT"|awk '{print $5" "$9}'} $color
Il faut modifier les droits pour que l'utilisateur courrant puisse accèder à certains fichiers.
# usermod -aG adm mon_utilisateur

configurer menu d'openbox

Les fichiers de configurations se situe dans /etc/X11/openbox

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

menu.xml
<?xml version="1.0" encoding="UTF-8"?>
 
<openbox_menu xmlns="http://openbox.org/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://openbox.org/
                file:///usr/share/openbox/menu.xsd">
 
<menu id="root-menu" label="Openbox 3">
  <item label="Terminal">
    <action name="Execute"><execute>x-terminal-emulator</execute></action>
  </item>
  <item label="Web">
    <action name="Execute"><execute>x-www-browser</execute></action>
  </item>
  <item label="LibreOffice">
    <action name="Execute"><execute>libreoffice</execute></action>
  </item>
  <separator />
  <item label="Nautilus">
    <action name="Execute"><execute>nautilus</execute></action>
  </item>
  <item label="Icedove">
    <action name="Execute"><execute>icedove</execute></action>
  </item>
  <separator />
 
  <!-- This requires the presence of the 'menu' package to work -->
  <menu id="/Debian" />
  <separator />
  <menu id="client-list-menu" />
  <separator />
  <item label="Config openbox">
    <action name="Execute"><execute>obconf</execute></action>
  </item>
  <item label="Lock">
    <action name="Execute"><execute>xscreensaver-command -lock</execute></action>
  </item>
  <item label="Restart">
    <action name="Restart" />
  </item>
  <item label="Exit">
    <action name="Exit" />
  </item>
</menu>
 
</openbox_menu>

rc.xml

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

rc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
        Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
  <resistance>
    <strength>50</strength>
    <screen_edge_strength>50</screen_edge_strength>
  </resistance>
  <focus>
    <focusNew>yes</focusNew>
    <followMouse>yes</followMouse>
    <focusLast>yes</focusLast>
    <underMouse>no</underMouse>
    <focusDelay>100</focusDelay>
    <raiseOnFocus>no</raiseOnFocus>
  </focus>
  <placement>
    <policy>UnderMouse</policy>
    <center>yes</center>
    <monitor>Primary</monitor>
    <primaryMonitor>1</primaryMonitor>
  </placement>
  <theme>
    <name>Nightmare-02</name>
    <titleLayout>LIMDC</titleLayout>
    <keepBorder>yes</keepBorder>
    <animateIconify>no</animateIconify>
    <font place="ActiveWindow">
      <name>sans</name>
      <size>8</size>
      <weight>bold</weight>
      <slant>normal</slant>
    </font>
    <font place="InactiveWindow">
      <name>sans</name>
      <size>8</size>
      <weight>bold</weight>
      <slant>normal</slant>
    </font>
    <font place="MenuHeader">
      <name>sans</name>
      <size>9</size>
      <weight>normal</weight>
      <slant>normal</slant>
    </font>
    <font place="MenuItem">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="ActiveOnScreenDisplay">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveOnScreenDisplay">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
  </theme>
  <desktops>
    <!-- this stuff is only used at startup, pagers allow you to change them
       during a session
 
       these are default values to use when other ones are not already set
       by other applications, or saved in your session
 
       use obconf if you want to change these without having to log out
       and back in -->
    <number>3</number>
    <firstdesk>1</firstdesk>
    <names>
      <name>1</name>
      <name>2</name>
      <name>3</name>
    </names>
    <popupTime>0</popupTime>
    <!-- The number of milliseconds to show the popup for when switching
       desktops.  Set this to 0 to disable the popup. -->
  </desktops>
  <resize>
    <drawContents>yes</drawContents>
    <popupShow>Nonpixel</popupShow>
    <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
    <popupPosition>Center</popupPosition>
    <!-- 'Center', 'Top', or 'Fixed' -->
    <popupFixedPosition>
      <!-- these are used if popupPosition is set to 'Fixed' -->
      <x>10</x>
      <!-- positive number for distance from left edge, negative number for
         distance from right edge, or 'Center' -->
      <y>10</y>
      <!-- positive number for distance from top edge, negative number for
         distance from bottom edge, or 'Center' -->
    </popupFixedPosition>
  </resize>
  <!-- You can reserve a portion of your screen where windows will not cover when
     they are maximized, or when they are initially placed.
     Many programs reserve space automatically, but you can use this in other
     cases. -->
  <margins>
    <top>0</top>
    <bottom>0</bottom>
    <left>0</left>
    <right>0</right>
  </margins>
  <dock>
    <position>TopLeft</position>
    <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
    <floatingX>0</floatingX>
    <floatingY>0</floatingY>
    <noStrut>no</noStrut>
    <stacking>Above</stacking>
    <!-- 'Above', 'Normal', or 'Below' -->
    <direction>Vertical</direction>
    <!-- 'Vertical' or 'Horizontal' -->
    <autoHide>no</autoHide>
    <hideDelay>300</hideDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <showDelay>300</showDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <moveButton>Middle</moveButton>
    <!-- 'Left', 'Middle', 'Right' -->
  </dock>
  <keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <!-- Keybindings for desktop switching -->
    <keybind key="C-A-Left">
      <action name="GoToDesktop">
        <to>left</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Right">
      <action name="GoToDesktop">
        <to>right</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Up">
      <action name="GoToDesktop">
        <to>up</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Down">
      <action name="GoToDesktop">
        <to>down</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Left">
      <action name="SendToDesktop">
        <to>left</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Right">
      <action name="SendToDesktop">
        <to>right</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Up">
      <action name="SendToDesktop">
        <to>up</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Down">
      <action name="SendToDesktop">
        <to>down</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="W-F1">
      <action name="GoToDesktop">
        <to>1</to>
      </action>
    </keybind>
    <keybind key="W-F2">
      <action name="GoToDesktop">
        <to>2</to>
      </action>
    </keybind>
    <keybind key="W-F3">
      <action name="GoToDesktop">
        <to>3</to>
      </action>
    </keybind>
    <keybind key="W-F4">
      <action name="GoToDesktop">
        <to>4</to>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <!-- Keybindings for windows -->
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="A-Escape">
      <action name="Lower"/>
      <action name="FocusToBottom"/>
      <action name="Unfocus"/>
    </keybind>
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>
    <!-- Take a screenshot of the current window with scrot when Alt+Print are pressed -->
    <keybind key="A-Print">
      <action name="Execute">
        <command>scrot -s</command>
      </action>
    </keybind>
    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
      <action name="NextWindow">
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow">
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="C-A-Tab">
      <action name="NextWindow">
        <panels>yes</panels>
        <desktop>yes</desktop>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <!-- Keybindings for window switching with the arrow keys -->
    <keybind key="W-S-Right">
      <action name="DirectionalCycleWindows">
        <direction>right</direction>
      </action>
    </keybind>
    <keybind key="W-S-Left">
      <action name="DirectionalCycleWindows">
        <direction>left</direction>
      </action>
    </keybind>
    <keybind key="W-S-Up">
      <action name="DirectionalCycleWindows">
        <direction>up</direction>
      </action>
    </keybind>
    <keybind key="W-S-Down">
      <action name="DirectionalCycleWindows">
        <direction>down</direction>
      </action>
    </keybind>
    <!-- Keybindings for running applications -->
    <keybind key="W-e">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Konqueror</name>
        </startupnotify>
        <command>kfmclient openProfile filemanagement</command>
      </action>
    </keybind>
    <!-- Launch scrot when Print is pressed -->
    <keybind key="Print">
      <action name="Execute">
        <command>scrot</command>
      </action>
    </keybind>
  </keyboard>
  <mouse>
    <dragThreshold>10</dragThreshold>
    <!-- number of pixels the mouse must move before a drag begins -->
    <doubleClickTime>500</doubleClickTime>
    <!-- in milliseconds (1000 = 1 second) -->
    <screenEdgeWarpTime>100</screenEdgeWarpTime>
    <!-- Time before changing desktops when the pointer touches the edge of the
       screen while moving a window, in milliseconds (1000 = 1 second).
       Set this to 0 to disable warping -->
    <screenEdgeWarpMouse>false</screenEdgeWarpMouse>
    <!-- Set this to TRUE to move the mouse pointer across the desktop when
       switching due to hitting the edge of the screen -->
    <context name="Frame">
      <mousebind button="A-Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="A-Left" action="Click">
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="A-Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="A-Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="A-Right" action="Drag">
        <action name="Resize"/>
      </mousebind>
      <mousebind button="A-Middle" action="Press">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Up" action="Click">
        <action name="SendToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Down" action="Click">
        <action name="SendToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    <context name="Titlebar">
      <mousebind button="Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="Left" action="DoubleClick">
        <action name="ToggleShade"/>
      </mousebind>
      <mousebind button="Up" action="Click">
        <action name="if">
          <shaded>no</shaded>
          <then>
            <action name="Shade"/>
            <action name="FocusToBottom"/>
            <action name="Unfocus"/>
            <action name="Lower"/>
          </then>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="if">
          <shaded>yes</shaded>
          <then>
            <action name="Unshade"/>
            <action name="Raise"/>
          </then>
        </action>
      </mousebind>
    </context>
    <context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="Top">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>top</edge>
        </action>
      </mousebind>
    </context>
    <context name="Left">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>left</edge>
        </action>
      </mousebind>
    </context>
    <context name="Right">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>right</edge>
        </action>
      </mousebind>
    </context>
    <context name="Bottom">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>bottom</edge>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="TRCorner BRCorner TLCorner BLCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="Client">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Icon">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="AllDesktops">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleOmnipresent"/>
      </mousebind>
    </context>
    <context name="Shade">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleShade"/>
      </mousebind>
    </context>
    <context name="Iconify">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="Iconify"/>
      </mousebind>
    </context>
    <context name="Maximize">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleMaximize"/>
      </mousebind>
      <mousebind button="Middle" action="Click">
        <action name="ToggleMaximize">
          <direction>vertical</direction>
        </action>
      </mousebind>
      <mousebind button="Right" action="Click">
        <action name="ToggleMaximize">
          <direction>horizontal</direction>
        </action>
      </mousebind>
    </context>
    <context name="Close">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="Close"/>
      </mousebind>
    </context>
    <context name="Desktop">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Root">
      <!-- Menus -->
      <mousebind button="Middle" action="Press">
        <action name="ShowMenu">
          <menu>client-list-combined-menu</menu>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="ShowMenu">
          <menu>root-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="MoveResize">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
  </mouse>
  <menu>
    <file>/var/lib/openbox/debian-menu.xml
  <file>menu.xml</file>
  <hideDelay>200</hideDelay>
  <middle>no</middle>
  <submenuShowDelay>100</submenuShowDelay>
  <submenuHideDelay>400</submenuHideDelay>
  <showIcons>yes</showIcons>
  <manageDesktops>yes</manageDesktops>
</menu>
<applications>
<application name="the window's _OB_APP_NAME property (see obxprop)"
            class="the window's _OB_APP_CLASS property (see obxprop)"
        groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
       groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
             role="the window's _OB_APP_ROLE property (see obxprop)"
            title="the window's _OB_APP_TITLE property (see obxprop)"
             type="the window's _OB_APP_TYPE property (see obxprob)..
                    (if unspecified, then it is 'dialog' for child windows)">
# you may set only one of name/class/role/title/type, or you may use more
# than one together to restrict your matches.
# the name, class, role, and title use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.
# the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
#    or desktop
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
  # each rule element can be left out or set to 'default' to specify to not 
  # change that attribute of the window
  <decor>yes</decor>
  # enable or disable window decorations
  <shade>no</shade>
  # make the window shaded when it appears, or not
  <position force="no">
    # the position is only used if both an x and y coordinate are provided
    # (and not set to 'default')
    # when force is "yes", then the window will be placed here even if it
    # says you want it placed elsewhere.  this is to override buggy
    # applications who refuse to behave
    <x>center</x>
    # a number like 50, or 'center' to center on screen. use a negative number
    # to start from the right (or bottom for <y>), ie -50 is 50 pixels from
    # the right edge (or bottom). use 'default' to specify using value
    # provided by the application, or chosen by openbox, instead.
    <y>200</y>
    <monitor>1</monitor>
    # specifies the monitor in a xinerama setup.
    # 1 is the first head, or 'mouse' for wherever the mouse is
  </position>
  <size>
    # the size to make the window.
    <width>20</width>
    # a number like 20, or 'default' to use the size given by the application.
    # you can use fractions such as 1/2 or percentages such as 75% in which
    # case the value is relative to the size of the monitor that the window
    # appears on.
    <height>30%</height>
  </size>
  <focus>yes</focus>
  # if the window should try be given focus when it appears. if this is set
  # to yes it doesn't guarantee the window will be given focus. some
  # restrictions may apply, but Openbox will try to
  <desktop>1</desktop>
  # 1 is the first desktop, 'all' for all desktops
  <layer>normal</layer>
  # 'above', 'normal', or 'below'
  <iconic>no</iconic>
  # make the window iconified when it appears, or not
  <skip_pager>no</skip_pager>
  # asks to not be shown in pagers
  <skip_taskbar>no</skip_taskbar>
  # asks to not be shown in taskbars. window cycling actions will also
  # skip past such windows
  <fullscreen>yes</fullscreen>
  # make the window in fullscreen mode when it appears
  <maximized>true</maximized>
  # 'Horizontal', 'Vertical' or boolean (yes/no)
</application>
# end of the example
</applications>

</openbox_config>

</file>

autorstart

nano .openbox/autostart
tint2 &
feh --bg-center ~/.config/openbox/city.jpg &
conky -d &
exec ~/Documents/Telegram &
pidgin &
exec ~/.config/scripts/acces_reseau.sh &
sleep 1
xscreensaver -no-splash &
nano .i3/config
feh --bg-center  ~/.config/background.jpg &

Mes alias

.bashrc
alias pdf='evince $1'
alias doc='openoffice $1'
alias ls='ls $LS_OPTIONS -lah'
PATH="$PATH:/usr/local/pgsql/bin/" 
alias random="shuf -i 1-100 -n 1"
alias update='apt-get update && apt-get upgrade && apt-get dist-upgrade'
alias find='find / -name $1'
alias lsd='du -h -d 1 |grep -v "^0" |sort -h -r'
alias search='apt-cache search $1'

Outils audio

apt-get install pavucontrol

Nouveau thème

voici la procédure que j'ai suivi :

wget https://launchpadlibrarian.net/210716797/bunsen-evopop-theme_1.01entornosgnulinux-1ubuntu1_amd64.deb
dpkg -i bunsen-evopop-theme_1.01entornosgnulinux-1ubuntu1_amd64.deb

Dans mon cas il me manquait des dépendances du coup :

apt-get -f install
dpkg -i bunsen-evopop-theme_1.01entornosgnulinux-1ubuntu1_amd64.deb

Opaticité

apt install compton && compton -cCGfF -D 2 -b -i 0.90 --vsync opengl

Définir un serveur DNS par défaut pour toutes les connexions

nano /etc/dhcp/dhclient.conf

Ajouter :

prepend domain-name-servers 8.8.8.8;

Au prochain démarrage, ces modifications seront appliqués dans le fichier /etc/resolv.conf

Notifications

apt-get install dunst
nano /home/bruno/.config/dunst/dunstrc

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

dunstrc
[global]
    font = Monospace 8
 
    # Allow a small subset of html markup in notifications and formats:
    #   <b>bold</b>
    #   <i>italic</i>
    #   <s>strikethrough</s>
    #   <u>underline</u>
    #
    # For a complete reference see
    # <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
    # If markup is not allowed, those tags will be stripped out of the
    # message.
    allow_markup = yes
 
    # Treat incoming notifications as plain text
    plain_text = no
 
    # The format of the message.  Possible variables are:
    #   %a  appname
    #   %s  summary
    #   %b  body
    #   %i  iconname (including its path)
    #   %I  iconname (without its path)
    #   %p  progress value if set ([  0%] to [100%]) or nothing
    # Markup is allowed
    format = "<b>%s</b>\n%b"
 
    # Sort messages by urgency.
    sort = yes
 
    # Show how many messages are currently hidden (because of geometry).
    indicate_hidden = yes
 
    # Alignment of message text.
    # Possible values are "left", "center" and "right".
    alignment = left
 
    # The frequency with which text that is longer than the notification
    # window allows bounces back and forth.
    # This option conflicts with "word_wrap".
    # Set to 0 to disable.
    bounce_freq = 0
 
    # Show age of message if message is older than show_age_threshold
    # seconds.
    # Set to -1 to disable.
    show_age_threshold = 60
 
    # Split notifications into multiple lines if they don't fit into
    # geometry.
    word_wrap = yes
 
    # Ignore newlines '\n' in notifications.
    ignore_newline = no
 
 
    # The geometry of the window:
    #   [{width}]x{height}[+/-{x}+/-{y}]
    # The geometry of the message window.
    # The height is measured in number of notifications everything else
    # in pixels.  If the width is omitted but the height is given
    # ("-geometry x2"), the message window expands over the whole screen
    # (dmenu-like).  If width is 0, the window expands to the longest
    # message displayed.  A positive x is measured from the left, a
    # negative from the right side of the screen.  Y is measured from
    # the top and down respectively.
    # The width can be negative.  In this case the actual width is the
    # screen width minus the width defined in within the geometry option.
    geometry = "300x5-30+20"
 
    # Shrink window if it's smaller than the width.  Will be ignored if
    # width is 0.
    shrink = no
 
    # The transparency of the window.  Range: [0; 100].
    # This option will only work if a compositing window manager is
    # present (e.g. xcompmgr, compiz, etc.).
    transparency = 0
 
    # Don't remove messages, if the user is idle (no mouse or keyboard input)
    # for longer than idle_threshold seconds.
    # Set to 0 to disable.
    idle_threshold = 120
 
    # Which monitor should the notifications be displayed on.
    monitor = 0
 
    # Display notification on focused monitor.  Possible modes are:
    #   mouse: follow mouse pointer
    #   keyboard: follow window with keyboard focus
    #   none: don't follow anything
    #
    # "keyboard" needs a window manager that exports the
    # _NET_ACTIVE_WINDOW property.
    # This should be the case for almost all modern window managers.
    #
    # If this option is set to mouse or keyboard, the monitor option
    # will be ignored.
    follow = mouse
 
    # Should a notification popped up from history be sticky or timeout
    # as if it would normally do.
    sticky_history = yes
 
    # Maximum amount of notifications kept in history
    history_length = 20
 
    # Display indicators for URLs (U) and actions (A).
    show_indicators = yes
 
    # The spacing between lines.  If the height is smaller than the
    # font height, it will get raised to the font height.
    line_height = 0
 
    # The height of the entire notification.  If the height is smaller
    # than the font height and padding combined, it will be raised
    # to the font height and padding.
    notification_height = 0
 
    # Draw a line of "separator_height" pixel height between two
    # notifications.
    # Set to 0 to disable.
    separator_height = 2
 
    # Padding between text and separator.
    padding = 8
 
    # Horizontal padding.
    horizontal_padding = 8
 
    # Define a color for the separator.
    # possible values are:
    #  * auto: dunst tries to find a color fitting to the background;
    #  * foreground: use the same color as the foreground;
    #  * frame: use the same color as the frame;
    #  * anything else will be interpreted as a X color.
    separator_color = frame
 
    # Print a notification on startup.
    # This is mainly for error detection, since dbus (re-)starts dunst
    # automatically after a crash.
    startup_notification = false
 
    # dmenu path.
    dmenu = /usr/bin/dmenu -p dunst:
 
    # Browser for opening urls in context menu.
    browser = /usr/bin/firefox -new-tab
 
    # Align icons left/right/off
    icon_position = off
 
    # Paths to default icons.
    icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
 
[frame]
    width = 3
    color = "#aaaaaa"
 
[shortcuts]
 
    # Shortcuts are specified as [modifier+][modifier+]...key
    # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
    # "mod3" and "mod4" (windows-key).
    # Xev might be helpful to find names for keys.
 
    # Close notification.
    close = ctrl+space
 
    # Close all notifications.
    close_all = ctrl+shift+space
 
    # Redisplay last message(s).
    # On the US keyboard layout "grave" is normally above TAB and left
    # of "1".
    history = ctrl+grave
 
    # Context menu.
    context = ctrl+shift+period
 
[urgency_low]
    # IMPORTANT: colors have to be defined in quotation marks.
    # Otherwise the "#" and following would be interpreted as a comment.
    background = "#222222"
    foreground = "#888888"
    timeout = 10
 
[urgency_normal]
    background = "#285577"
    foreground = "#ffffff"
    timeout = 10
 
[urgency_critical]
    background = "#900000"
    foreground = "#ffffff"
    timeout = 0
 
 
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
#   script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
 
#[espeak]
#    summary = "*"
#    script = dunst_espeak.sh
 
#[script-test]
#    summary = "*script*"
#    script = dunst_test.sh
 
#[ignore]
#    # This notification will not be displayed
#    summary = "foobar"
#    format = ""
 
#[signed_on]
#    appname = Pidgin
#    summary = "*signed on*"
#    urgency = low
#
#[signed_off]
#    appname = Pidgin
#    summary = *signed off*
#    urgency = low
#
#[says]
#    appname = Pidgin
#    summary = *says*
#    urgency = critical
#
#[twitter]
#    appname = Pidgin
#    summary = *twitter.com*
#    urgency = normal
#
# vim: ft=cfg

Autres outils utiles

# apt-get install screenfetch
# screenfetch -N > /etc/motd
# apt install redshift && redshift -l 43:5

Résolutions d'écran

sudo nano /etc/default/grub
GRUB_GFXMODE=1920x1080
GFXPAYLOAD=keep
sudo update-grub2

Gestion automatique du changement eth0 et usb0

#!/bin/bash
 
while true
do
        if [ $(ip a|awk '{print $2 }' |grep usb) ]; then
                if [ $(ip r|head -n 1|tail -n 1|grep eth0) ]; then
                        #   echo "Connexion via usb..."
                        sleep 3
                        echo 'mdp' |sudo -S route delete default eth0
                fi
                else
                if [ ! $(netstat -rn|grep "^0.0.0.0" |awk '{print $8}') ]; then
                        #   echo "Connexion via eth0..."
                        sleep 3
                        echo 'mdp' | sudo -S dhclient eth0
                fi
        fi
 
sleep 15
 
done
 usermod -aG sudo mon_utilisateur

raccourcis clavier

https://doc.ubuntu-fr.org/gmrun