===== 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 * Personnaliser le prompt : echo "PS1='\[\033[01;36m\]\w\[\033[00m\]\e[1m\[\033[00;31m\]\$\[\033[00;00m\]\e[0m '" >> /root/.bashrc * typographie du terminal : Monospace Regular taille 11 ==== config conkyrc ==== Pré-requis : apt isntall lm-sensors hddtemp fichier /etc/conky/conky.conf : Mise en forme pour i3 : 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 x-terminal-emulator x-www-browser libreoffice nautilus icedove obconf xscreensaver-command -lock ==== rc.xml ==== 50 50 yes yes yes no 100 no UnderMouse
yes
Primary 1
Nightmare-02 LIMDC yes no sans 8 bold normal sans 8 bold normal sans 9 normal normal sans 9 normal normal sans 9 bold normal sans 9 bold normal 3 1 1 2 3 0 yes Nonpixel Center 10 10 0 0 0 0 TopLeft 0 0 no Above Vertical no 300 300 Middle C-g left no right no up no down no left no right no up no down no 1 2 3 4 client-menu scrot -s yes yes right left up down true Konqueror kfmclient openProfile filemanagement scrot 10 500 100 false previous next previous next previous next no yes client-menu top left right bottom client-menu client-menu client-menu vertical horizontal previous next previous next previous next client-list-combined-menu root-menu previous next previous next /var/lib/openbox/debian-menu.xml menu.xml 200 no 100 400 yes yes # 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 yes # enable or disable window decorations no # make the window shaded when it appears, or not # 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 center # a number like 50, or 'center' to center on screen. use a negative number # to start from the right (or bottom for ), 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. 200 1 # specifies the monitor in a xinerama setup. # 1 is the first head, or 'mouse' for wherever the mouse is # the size to make the window. 20 # 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. 30% yes # 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 1 # 1 is the first desktop, 'all' for all desktops normal # 'above', 'normal', or 'below' no # make the window iconified when it appears, or not no # asks to not be shown in pagers no # asks to not be shown in taskbars. window cycling actions will also # skip past such windows yes # make the window in fullscreen mode when it appears true # 'Horizontal', 'Vertical' or boolean (yes/no) # end of the example
==== 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 === 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 === * Thème du gestinnaire de fenre : Evopop de bunsen. 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 [global] font = Monospace 8 # Allow a small subset of html markup in notifications and formats: # bold # italic # strikethrough # underline # # For a complete reference see # . # 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 = "%s\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 ==== * Personnaliser son motd # apt-get install screenfetch # screenfetch -N > /etc/motd * Assombrir l'écran : # 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