diff --git a/.Xresources b/.Xresources index daeffe7..ce7100d 100644 --- a/.Xresources +++ b/.Xresources @@ -46,7 +46,7 @@ Xft.rgba: rgb Xft.autohint: false Xft.hintstyle: hintmedium Xft.lcdfilter: lcdlegacy -Xft.dpi: 93.54 +Xft.dpi: 96 Xcursor.theme: Adwaita Xcursor.size: 0 @@ -58,7 +58,7 @@ XTerm*reverseVideo: on XTerm*selectToClipboard: true URxvt.font: xft:IBM Plex Mono:size=11,xft:DejaVu Sans Mono:size=11 -!URxvt.font: xft:xos4 Terminus:pixelsize=16,xft:DejaVu Sans Mono:pixelsize=16,xft:Noto Sans Mono:pixelsize=16 +!URxvt.font: xft:xos4 Terminus:pixsize=14,xft:DejaVu Sans Mono:pixsize=14 !URxvt.letterSpace: -1 URxvt.depth: 32 !URxvt.background: [100]#000000 @@ -176,7 +176,7 @@ URxvt*secondaryScreen: true URxvt*secondaryScroll: false ! URxvt*perl-lib: string ! URxvt*perl-eval: perl-eval -URxvt*perl-ext-common: bell-command,vtwheel,resize-font,searchable-scrollback,option-popup,selection +URxvt*perl-ext-common: vtwheel,resize-font,searchable-scrollback,option-popup,selection ! URxvt*perl-ext: string URxvt*iso14755: false URxvt*iso14755_52: false diff --git a/.bash_profile b/.bash_profile index 082daa7..e9018e5 100644 --- a/.bash_profile +++ b/.bash_profile @@ -15,6 +15,8 @@ export PATH=~/.gem/ruby/2.5.0/bin:~/.local/bin:$PATH #export LANGUAGE=fr_CA:fr_FR:fr:en export HASTE_SERVER="https://haste.breizh.me" export MPD_HOST="$HOME/.mpd/socket" +export KRESUS_PYTHON_EXEC=python +export MAGICK_TMPDIR="$HOME/.cache/ImageMagick/" eval $(ssh-agent -s) diff --git a/.bashrc b/.bashrc index 1739932..dea983e 100644 --- a/.bashrc +++ b/.bashrc @@ -288,3 +288,5 @@ alias moon='curl -H "Accept-Language: fr" wttr.in/Moon' # change title trap 'echo -ne "\e]0;$PWD > $BASH_COMMAND\007"' DEBUG + +source /home/breizh/.config/broot/launcher/bash/br diff --git a/.config/compton.conf b/.config/compton.conf deleted file mode 100644 index d6da2ab..0000000 --- a/.config/compton.conf +++ /dev/null @@ -1,106 +0,0 @@ -# Shadow -shadow = false; -# no-dnd-shadow = true; -# no-dock-shadow = true; -clear-shadow = true; -detect-rounded-corners = true; -shadow-radius = 5; -shadow-offset-x = 1; -shadow-offset-y = 1; -shadow-opacity = .3; -shadow-ignore-shaped = false; -shadow-exclude = [ - "name = 'Notification'", -# workaround for conky until it provides window properties: - "override_redirect = 1 && !WM_CLASS@:s", - "class_g ?= 'Dunst'", -# disable shadows for hidden windows: - "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", - "_GTK_FRAME_EXTENTS@:c", -# disables shadows on sticky windows: -# "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'", -# disables shadows on i3 frames - "class_g ?= 'i3-frame'" -]; - -# shadow-exclude-reg = "x10+0+0"; -# xinerama-shadow-crop = true; - -menu-opacity = 0.95; -inactive-opacity = 0.93; -active-opacity = 1; -alpha-step = 0.01; -inactive-dim = 0.0; -blur-background = false; -blur-kern = "3x3box"; - -#paint-on-overlay = false; - -fading = false; -fade-delta = 1; -fade-in-step = 0.03; -fade-out-step = 0.03; -fade-exclude = [ ]; - -backend = "xrender"; -mark-wmwin-focused = true; -mark-ovredir-focused = true; -detect-client-opacity = true; -unredir-if-possible = true; -refresh-rate = 0; -vsync = "none"; -dbe = false; -paint-on-overlay = true; -focus-exclude = [ "class_g = 'Cairo-clock'" ]; -detect-transient = true; -detect-client-leader = true; -invert-color-include = [ ]; -glx-copy-from-front = false; -glx-swap-method = "undefined"; - -opacity-rule = [ -"99:name *?= 'Call'", -"99:name *?= 'Conky'", -"99:class_g = 'Darktable'", -"50:class_g = 'Dmenu'", -"99:name *?= 'Event'", -"99:class_g = 'Firefox'", -"99:class_g = 'GIMP'", -"99:name *?= 'Image'", -"99:class_g = 'Lazpaint'", -"99:class_g = 'Midori'", -"99:name *?= 'Minitube'", -"99:class_g = 'Mousepad'", -"99:name *?= 'MuseScore'", -"90:name *?= 'Page Info'", -"99:name *?= 'Pale Moon'", -"90:name *?= 'Panel'", -"99:class_g = 'Pinta'", -"90:name *?= 'Restart'", -"99:name *?= 'sudo'", -"99:name *?= 'Screenshot'", -"99:class_g = 'Viewnior'", -"99:class_g = 'VirtualBox'", -"99:name *?= 'VLC'", -"99:name *?= 'Write'", -"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", -"96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" -]; - -wintypes : -{ - tooltip : - { - fade = true; - shadow = false; - opacity = 0.85; - focus = true; - }; - fullscreen : - { - fade = true; - shadow = false; - opacity = 1; - focus = true; - }; -}; diff --git a/.config/conky/conky_mount b/.config/conky/conky_mount index 519c5b5..931791f 100755 --- a/.config/conky/conky_mount +++ b/.config/conky/conky_mount @@ -5,6 +5,7 @@ then for disk in /dev/sd? do [[ "$disk" == "/dev/sda" ]] && continue + [[ "$disk" == "/dev/sdb" ]] && echo echo '${voffset 2}Lecture '$(basename $disk)' ${diskio_read '$(basename $disk)'}${goto 140}Écriture '$(basename $disk)' ${diskio_write '$(basename $disk)'}' done else diff --git a/.config/conky/conkyrc1 b/.config/conky/conkyrc1 index 996aa5f..a561690 100644 --- a/.config/conky/conkyrc1 +++ b/.config/conky/conkyrc1 @@ -66,11 +66,9 @@ ${template1 5} #${template1 9} #${template1 10} -${color2}${font2}Disque E/S $hr${font}${color} +${color2}${font2}Disque E/S $hr${font}${color}${execpi 5 /home/breizh/.config/conky/conky_mount es} ${voffset 2}Lecture sda ${diskio_read sda}${goto 140}Écriture sda ${diskio_write sda} ${diskiograph_read sda 26,125}$alignr${diskiograph_write sda 26,125} -${execpi 5 /home/breizh/.config/conky/conky_mount es} - ${template2 1} ${template2 2} ${template2 3} @@ -88,5 +86,7 @@ ${template3 /home /home} ${template3 /tmp /tmp} +${template3 /dev/shm /dev/shm} + ${execpi 5 /home/breizh/.config/conky/conky_mount}#${color2}${font2}$hr${font}${color} ]] diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 175f8e2..838f9e0 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -412,5 +412,9 @@ #[stack-volumes] # appname = "some_volume_notifiers" # set_stack_tag = "volume" + +[redshift] + summary = "Redshift" + history_ignore = yes # # vim: ft=cfg diff --git a/.config/fish/functions/cp.fish b/.config/fish/functions/cp.fish index 89c28a6..2fd3cc7 100644 --- a/.config/fish/functions/cp.fish +++ b/.config/fish/functions/cp.fish @@ -1,4 +1,4 @@ -function cp - command cp --reflink=auto $argv +# Defined in - @ line 1 +function cp --description 'alias cp advcp -g' + advcp -g $argv; end - diff --git a/.config/gtk-3.0/bookmarks b/.config/gtk-3.0/bookmarks index c4bd4f3..03c2ed6 100644 --- a/.config/gtk-3.0/bookmarks +++ b/.config/gtk-3.0/bookmarks @@ -4,3 +4,4 @@ file:///home/breizh/Musique Musique file:///home/breizh/Vid%C3%A9os Vidéos file:///home/breizh/T%C3%A9l%C3%A9chargements Téléchargements file:///tmp tmp +file:///home/breizh/Screenshots Screenshots diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index c0f2410..2c8c356 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -2,7 +2,7 @@ gtk-application-prefer-dark-theme=false gtk-theme-name=Vertex-Dark gtk-icon-theme-name=Vertex-Icons -gtk-font-name=IBM Plex Sans 10 +gtk-font-name=IBM Plex Sans gtk-button-images=1 gtk-menu-images=1 gtk-enable-event-sounds=1 diff --git a/.config/gtk-3.0/settings.ini.bak b/.config/gtk-3.0/settings.ini.bak index b6d5326..fdbac85 100644 --- a/.config/gtk-3.0/settings.ini.bak +++ b/.config/gtk-3.0/settings.ini.bak @@ -2,7 +2,7 @@ gtk-application-prefer-dark-theme=false gtk-theme-name=Vertex-Dark gtk-icon-theme-name=Vertex-Icons -gtk-font-name=IBM Plex Sans 11 +gtk-font-name=IBM Plex Mono gtk-button-images=1 gtk-menu-images=1 gtk-enable-event-sounds=1 diff --git a/.config/htop/htoprc b/.config/htop/htoprc index 8dceee8..dc6b46b 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. -fields=0 17 18 48 49 38 39 113 111 46 47 2 1 -sort_key=46 +fields=0 17 18 48 49 39 113 109 110 46 47 2 1 +sort_key=2 sort_direction=1 hide_threads=0 hide_kernel_threads=1 @@ -20,7 +20,7 @@ update_process_names=0 account_guest_in_cpu_meter=0 color_scheme=0 delay=15 -left_meters=LeftCPUs2 Blank CPU Memory Swap Blank Battery Tasks -left_meter_modes=1 2 1 1 1 2 1 2 +left_meters=LeftCPUs2 Blank CPU Memory Swap Blank Tasks +left_meter_modes=1 2 1 1 1 2 2 right_meters=RightCPUs2 Blank CPU Memory LoadAverage Blank Clock Uptime right_meter_modes=1 2 2 2 2 2 2 2 diff --git a/.config/i3/config b/.config/i3/config index 9aafee8..9c2c915 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -42,7 +42,7 @@ new_window normal 1 new_float normal 1 # Hide borders -hide_edge_borders smart +# hide_edge_borders smart # change borders bindsym $mod+u border none @@ -53,7 +53,7 @@ bindsym $mod+n border normal 1 # is used in the bar {} block below. font xft:IBM Plex Sans, DejaVu Sans 11 #font xft:xos4 Terminus, DejaVu Sans Mono 14 -#font xft:Terminus, DejaVu Sans Mono 14 +#font xft:Terminus, DejaVu Sans Mono 12 # Use Mouse+$mod to drag floating windows floating_modifier $mod @@ -88,7 +88,7 @@ bindsym $mod+Ctrl+d exec --no-startup-id dmenu_run -f -p "Execute:" -nb '#2d2d2d #exec --no-startup-id volumeicon #bindsym $mod+Ctrl+m exec i3-sensible-terminal -e 'alsamixer' -exec --no-startup-id sleep 10 && pulseaudio && sleep 20 && pacmd load-module module-ladspa-sink sink_name=binaural master=alsa_output.pci-0000_0b_00.3.analog-stereo plugin=bs2b label=bs2b control=700,4.5 +#exec --no-startup-id sleep 10 && pulseaudio && sleep 20 && pacmd load-module module-ladspa-sink sink_name=binaural master=alsa_output.pci-0000_0b_00.3.analog-stereo plugin=bs2b label=bs2b control=700,4.5 #exec --no-startup-id sleep 10 && pulseaudio #exec --no-startup-id pa-applet bindsym $mod+Ctrl+m exec pavucontrol @@ -116,6 +116,8 @@ bindsym XF86AudioStop exec --no-startup-id mpc stop bindsym XF86AudioRaiseVolume exec --no-startup-id mpc volume +2 bindsym XF86AudioLowerVolume exec --no-startup-id mpc volume -2 +# Beep tog +bindsym $mod+Delete exec --no-startup-id $HOME/.local/bin/toggle-beep && pkill -SIGRTMIN+14 i3blocks # LEDs controls bindsym --release Caps_Lock exec --no-startup-id pkill -SIGRTMIN+11 i3blocks @@ -144,6 +146,8 @@ bindsym $mod+l exec passmenu --type -l 10 bindsym Shift+XF86MyComputer exec i3-input -f "xft:xos4 Terminus" -F 'mark %s' -P 'Mark: ' bindsym XF86MyComputer exec i3-input -f "xft:xos4 Terminus" -F '[con_mark="%s"] focus' -P 'Go to: ' bindsym Ctrl+XF86MyComputer exec i3-input -f "xft:xos4 Terminus" -F 'unmark %s' -P 'Unmark: ' +bindsym $mod+Pause exec --no-startup-id killall -SIGUSR1 dunst +bindsym $mod+Shift+Pause exec --no-startup-id killall -SIGUSR2 dunst #set $mode_ide (a)tom (t)exmaker #mode "$mode_ide" { @@ -297,6 +301,8 @@ for_window [class="Pavucontrol"] floating enable for_window [class="qt5ct"] floating enable sticky enable border normal for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal for_window [class="Simple-scan"] floating enable border normal +for_window [class="(?i)TransportFever2"] border none fullscreen disable +for_window [class="(?i)factorio"] border none for_window [class="(?i)System-config-printer.py"] floating enable border normal for_window [class="Skype"] floating enable border normal for_window [class="Thus"] floating enable border normal @@ -305,7 +311,7 @@ for_window [class="Timeset-gui"] floating enable border normal for_window [class="Xfburn"] floating enable for_window [class="(?i)variety"] floating enable for_window [class="Yad"] floating enable -for_window [class="firefox"] border pixel 1 +#for_window [class="firefox"] border pixel 1 for_window [title="(?i)pinentry"] floating enable for_window [title="(?i)Minecraft"] border none # switch to workspace with urgent window automatically @@ -363,7 +369,7 @@ mode "resize" { } # Lock screen -bindsym $mod+9 exec --no-startup-id xscreensaver-command -lock +bindsym $mod+9 exec --no-startup-id xscreensaver-command -activate # Autostart applications ## adjustment of i3bar battery reading (only run at the very first login): @@ -383,8 +389,8 @@ exec claws-mail --online exec --no-startup-id jami-gnome -r exec --no-startup-id sleep 2 && urxvtc -e newsboat exec --no-startup-id sleep 7 && i3-msg '[title="newsboat"] move scratchpad' -exec --no-startup-id variety -#exec --no-startup-id while true; do feh --bg-center $HOME/Images/wallpapers/396396-blackangel.jpg; sleep 5m; feh --bg-max $HOME/Images/wallpapers/other-clock-tower-time-brick-gears-steampunk-high-quality-picture.jpg; sleep 5m; done +#exec --no-startup-id variety +#exec --no-startup-id feh --no-fehbg --bg-center ~/Images/wallpapers-steampunk/396396-blackangel.jpg --bg-fill ~/Images/wallpapers-steampunk/other-clock-tower-time-brick-gears-steampunk-high-quality-picture_edited-flop.png exec --no-startup-id xinput --disable "AlpsPS/2 ALPS DualPoint TouchPad" exec --no-startup-id redshift-gtk exec --no-startup-id sudo radeontop -d /dev/shm/radeontop @@ -397,7 +403,7 @@ exec --no-startup-id steam-native -silent -language french #exec --no-startup-id sleep 5 && qbittorrent #exec --no-startup-id gdfs $HOME/.google_drive $HOME/Google_Drive/ #exec --no-startup-id transmission-gtk -m -exec --no-startup-id syncthing-gtk +exec --no-startup-id syncthing exec --no-startup-id SVPManager # Start i3bar to display a workspace bar (plus the system information i3status if available) @@ -413,8 +419,8 @@ bar { bindsym button4 nop bindsym button5 nop # font -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1 - font xft:IBM Plex Mono, DejaVu Sans Mono 11 - # font xft:xos4 Terminus, DejaVu Sans Mono 14 + # font xft:IBM Plex Mono, DejaVu Sans Mono 11 + font xft:Terminus, DejaVu Sans Mono 12 strip_workspace_numbers yes colors { diff --git a/.config/i3blocks/config b/.config/i3blocks/config index b019683..f509fe0 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -48,9 +48,9 @@ interval=5 # Support multiple chips, though lm-sensors. # The script may be called with -w and -c switches to specify thresholds, # see the script for details. -#[temperature] +[temperature] #instance=coretemp-isa-0000 -#interval=3 +interval=3 #separator=false # #[temperature] @@ -88,6 +88,9 @@ interval=2 interval=30 separator=false +[bandwidth] +interval=2 + # Network interface monitoring # # If the instance is not specified, use the interface used for default route. @@ -183,6 +186,11 @@ signal=10 # # bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks # bindsym --release Num_Lock exec pkill -SIGRTMIN+12 i3blocks +[beep] +interval=once +signal=14 +separator=false + [keyindicator] instance=Caps interval=once diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index 3c5c443..dfe7a91 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -34,7 +34,7 @@ db_file "~/.mpd/database" # The special value "syslog" makes MPD use the local syslog daemon. This # setting defaults to logging to syslog. # -log_file "~/.mpd/log" +log_file "syslog" # # This setting sets the location of the file which stores the process ID # for use of mpd --kill and some init scripts. This setting is disabled by diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 34c20e0..410f683 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -31,6 +31,7 @@ alang=fr,fre,fra slang=fr,fre,fra # Network -cache=262144 +cache=yes +demuxer-max-bytes=256MiB demuxer-readahead-secs=20 ytdl-format="((bestvideo[container=webm][height=1080]/bestvideo[ext=webm][height=1080]/bestvideo[height=1080]/bestvideo[height>=?720]/bestvideo)+(bestaudio[container=webm]/bestaudio[ext=webm]/bestaudio))/best" diff --git a/.config/youtube-dl/config b/.config/youtube-dl/config index 74d8899..5001c93 100644 --- a/.config/youtube-dl/config +++ b/.config/youtube-dl/config @@ -1,4 +1,4 @@ --o %(title)s.mkv +-o "%(playlist_index)s.%(title)s.mkv" --merge-output-format mkv --sub-lang fr,en --embed-subs diff --git a/.i3blocks/bandwidth b/.i3blocks/bandwidth index 6cfad90..8d5c1fc 100755 --- a/.i3blocks/bandwidth +++ b/.i3blocks/bandwidth @@ -1,90 +1,80 @@ #!/bin/bash -# Copyright (C) 2012 Stefan Breunig -# Copyright (C) 2014 kaueraal -# Copyright (C) 2015 Thiago Perrotta -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +runtime="${XDG_RUNTIME_DIR}/i3blocks" +[[ ! -d "$runtime" ]] && mkdir -p "$runtime" -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Use the provided interface, otherwise the device used for the default route. -if [[ -n $BLOCK_INSTANCE ]]; then - INTERFACE=$BLOCK_INSTANCE -else - INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }') -fi - -# Issue #36 compliant. -if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || ! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ] +# Interface à utiliser (sinon, celle ayant la route par défaut) +if [[ -n "$instance" ]] then - #echo "$INTERFACE down" - #echo "$INTERFACE down" - #echo "#FF0000" - exit 0 -fi - -# path to store the old results in -path="/dev/shm/$(basename $0)-${INTERFACE}" - -# grabbing data for each adapter. -read rx < "/sys/class/net/${INTERFACE}/statistics/rx_bytes" -read tx < "/sys/class/net/${INTERFACE}/statistics/tx_bytes" - -# get time -time=$(date +%s) - -# write current data if file does not exist. Do not exit, this will cause -# problems if this file is sourced instead of executed as another process. -if ! [[ -f "${path}" ]]; then - echo "${time} ${rx} ${tx}" > "${path}" - chmod 0666 "${path}" -fi - -# read previous state and update data storage -read old < "${path}" -echo "${time} ${rx} ${tx}" > "${path}" - -# parse old data and calc time passed -old=(${old//;/ }) -time_diff=$(( $time - ${old[0]} )) - -# sanity check: has a positive amount of time passed -[[ "${time_diff}" -gt 0 ]] || exit - -# calc bytes transferred, and their rate in byte/s -rx_diff=$(( $rx - ${old[1]} )) -tx_diff=$(( $tx - ${old[2]} )) -rx_rate=$(( $rx_diff / $time_diff )) -tx_rate=$(( $tx_diff / $time_diff )) - -# shift by 10 bytes to get KiB/s. If the value is larger than -# 1024^2 = 1048576, then display MiB/s instead - -# incoming -echo -n "↓ " -rx_kib=$(( $rx_rate >> 10 )) -if [[ "$rx_rate" -gt 1048576 ]]; then - printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`" + iface="$instance" else - echo -n "${rx_kib}K" + iface="$(ip route | awk '/^default/ { print $5 ; exit }')" fi -echo -n " " +# Si l'interface est inactive on quitte sans rien afficher +if [[ ! -e "/sys/class/net/${iface}/operstate" \ + || "$(> 10 )) -if [[ "$tx_rate" -gt 1048576 ]]; then - printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`" +rx="$( ${runtime}/bw + +# Calcul du débit en octets/seconde +time_diff="$(( $time - ${old[0]} ))" +[[ "$time_diff" -eq 0 ]] && exit +rx_rate="$(( ($rx - ${old[1]}) / $time_diff ))" +tx_rate="$(( ($tx - ${old[2]}) / $time_diff ))" + +# Affichage +if [[ "$rx_rate" -lt 1048576 ]] +then + # Moins de 1 Mio/s : affichage en Kio/s précis à 1 kio + rx_value=$(bc -l <<<$rx_rate/1024) + rx_unit=K + tx_prec=0 +elif [[ "$rx_rate" -lt 10485760 ]] +then + # Moins de 10 Mio/s : affichage en Mio/s précis à 10 kio + rx_value=$(bc -l <<<$rx_rate/1024/1024) + rx_unit=M + rx_prec=2 else - echo -n "${tx_kib}K" + # Plus de 10 Mio/s : affichage en Mio/s précis à 100 kio + rx_value=$(bc -l <<<$rx_rate/1024/1024) + rx_unit=M + rx_prec=1 fi + +if [[ "$tx_rate" -lt 1048576 ]] +then + # Moins de 1 Mio/s : affichage en Kio/s précis à 1 kio + tx_value=$(bc -l <<<$tx_rate/1024) + tx_unit=K + tx_prec=0 +elif [[ "$tx_rate" -lt 10485760 ]] +then + # Moins de 10 Mio/s : affichage en Mio/s précis à 10 kio + tx_value=$(bc -l <<<$tx_rate/1024/1024) + tx_unit=M + tx_prec=2 +else + # Plus de 10 Mio/s : affichage en Mio/s précis à 100 kio + tx_value=$(bc -l <<<$tx_rate/1024/1024) + tx_unit=M + tx_prec=1 +fi + +# Affichage du tout dans i3blocks +printf "↓ %4.*f%s ↑ %4.*f%s\n" "${rx_prec}" "${rx_value/./,}" "${rx_unit}" "${tx_prec}" "${tx_value/./,}" "${tx_unit}" + diff --git a/.i3blocks/bandwidth.new b/.i3blocks/bandwidth.new deleted file mode 100755 index 5403a95..0000000 --- a/.i3blocks/bandwidth.new +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# Source: http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html - -INSTANCE="${BLOCK_INSTANCE}" -# If you don't like you can use any other IP -INTERFACE="$(ip route get 8.8.8.8 | grep -Po '(?<=(dev )).*(?= src)')" - -if [[ "${INSTANCE}" = "" ]]; then - INSTANCE="${INTERFACE};both" -fi - -DISPLAY=$(echo "${INSTANCE}" | awk -F ';' '{print $2}') -INSTANCE=$(echo "${INSTANCE}" | awk -F ';' '{print $1}') - -if [[ "${DISPLAY}" = "" ]]; then - DISPLAY="both" -fi - -ONE_KB=1024 -ONE_MB=$(echo "${ONE_KB}*1024" | bc -l) -TEN_MB=$(echo "${ONE_MB}*10" | bc -l) -OHD_MB=$(echo "${TEN_MB}*10" | bc -l) - -URGENT_VALUE="${ONE_MB}" - -PREV_IN=0 -PREV_OUT=0 - -PREV_FILE="/tmp/.bandwidth" - -if [[ -f "${PREV_FILE}" ]]; then - PREV_CONT=$(cat "${PREV_FILE}") - PREV_IN=$(echo "${PREV_CONT}" | head -n 1) - PREV_OUT=$(echo "${PREV_CONT}" | tail -n 1) -fi - -BANDWIDTH=$(grep "${INSTANCE}" /proc/net/dev | awk -F: '{print $2}' | awk '{print $1" "$9}') - -if [[ "${BANDWIDTH}" = "" ]]; then - exit -fi - -BYTES_IN=$(echo "${BANDWIDTH}" | awk -F ' ' '{print $1}') -BYTES_OUT=$(echo "${BANDWIDTH}" | awk -F ' ' '{print $2}') - -function FormatNumber() { - if [[ "${1}" -ge "${OHD_MB}" ]]; then - echo $(echo "scale=0;${1}/${ONE_MB}" | bc -l)"mb" - elif [[ "${1}" -ge "${TEN_MB}" ]]; then - echo $(echo "scale=1;${1}/${ONE_MB}" | bc -l)"mb" - elif [[ "${1}" -ge "${ONE_MB}" ]]; then - echo $(echo "scale=2;${1}/${ONE_MB}" | bc -l)"mb" - elif [[ "${1}" -ge "${ONE_KB}" ]]; then - echo $(echo "scale=0;${1}/${ONE_KB}" | bc -l)"kb" - else - echo "${1}""b" - fi -} - -if [[ "${PREV_IN}" != "" ]] && [[ "${PREV_OUT}" != "" ]]; then - # Calculate the CPU usage since we last checked. - DIFF_IN=$(echo "scale=0;${BYTES_IN} - ${PREV_IN}" | bc -l) - DIFF_OUT=$(echo "scale=0;${BYTES_OUT} - ${PREV_OUT}" | bc -l) - DIFF_TOTAL=0 - - USAGE_IN=$(FormatNumber "${DIFF_IN}") - USAGE_OUT=$(FormatNumber "${DIFF_OUT}") - - if [[ "${DISPLAY}" = "both" ]]; then - echo "${USAGE_IN} : ${USAGE_OUT}" - echo "${USAGE_IN} : ${USAGE_OUT}" - echo "" - DIFF_TOTAL=$((DIFF_TOTAL+DIFF_IN)) - DIFF_TOTAL=$((DIFF_TOTAL+DIFF_OUT)) - elif [[ "${DISPLAY}" = "in" ]]; then - echo "${USAGE_IN}" - echo "${USAGE_IN}" - echo "" - DIFF_TOTAL=$((DIFF_TOTAL+DIFF_IN)) - elif [[ "${DISPLAY}" = "out" ]]; then - echo "${USAGE_OUT}" - echo "${USAGE_OUT}" - echo "" - DIFF_TOTAL=$((DIFF_TOTAL+DIFF_OUT)) - fi -else - echo "?" - echo "?" - echo "" -fi - -# Remember the total and idle CPU times for the next check. -echo "${BYTES_IN}" > "${PREV_FILE}" -echo "${BYTES_OUT}" >> "${PREV_FILE}" - -if [[ "${DIFF_TOTAL}" -ge "${URGENT_VALUE}" ]]; then - exit 33 -fi diff --git a/.i3blocks/internet b/.i3blocks/internet index 808ccbb..e4dd195 100755 --- a/.i3blocks/internet +++ b/.i3blocks/internet @@ -10,7 +10,7 @@ then claws-mail --offline touch /dev/shm/claws_offline fi -elif ping -c 1 93.184.216.34 -W 1 &>/dev/null +elif ping -c 1 2001:41d0:e:3cd::1 -W 1 &>/dev/null then color="#99CC99" if [ -f /dev/shm/claws_offline ] diff --git a/.i3blocks/mpd b/.i3blocks/mpd index a777398..e267bc7 100755 --- a/.i3blocks/mpd +++ b/.i3blocks/mpd @@ -1,5 +1,8 @@ #!/bin/bash +runtime="${XDG_RUNTIME_DIR}/i3blocks" +[[ ! -d "$runtime" ]] && mkdir -p "$runtime" + if ! systemctl --user is-active mpd &>/dev/null then origstatus='off' @@ -8,8 +11,8 @@ else [[ -z "$origstatus" ]] && origstatus='stop' fi -LONG=25 -SHORT=10 +LONG=30 +SHORT=15 case $BLOCK_BUTTON in 1) mpc -q prev ;; @@ -49,12 +52,12 @@ esac if [[ "$origstatus" != "stop" ]] && [[ "$origstatus" != "off" ]] then - if [[ ! -f /dev/shm/mpd ]] + if [[ ! -f $runtime/mpd ]] then - mpc -f '[[%artist%§]%title%|[%file%]' current > /dev/shm/mpd + mpc -f '[[%artist%§]%title%|[%file%]' current > ${runtime}/mpd fi - song=$( /dev/shm/mpd-scroll - song="$( ${runtime}/mpd-scroll + song="$(<${runtime}/mpd-scroll)" else - song="$( /dev/shm/mpd-scroll + song="$(<${runtime}/mpd-scroll)" + printf "%-${LONG}s" "${song:1}" > ${runtime}/mpd-scroll fi fi @@ -96,11 +99,11 @@ then shortsong="${song} " ;; short) - longsong="$(" echo "${shortsong} $status$shorttime" else - [[ -f /dev/shm/mpd ]] && rm /dev/shm/mpd - [[ -f /dev/shm/mpd-scroll ]] && rm /dev/shm/mpd-scroll + [[ -f ${runtime}/mpd ]] && rm ${runtime}/mpd + [[ -f ${runtime}/mpd-scroll ]] && rm ${runtime}/mpd-scroll printf "%${LONG}s $status[--:-- --:-- --:--]\n" " " printf "%${SHORT}s $status--:-- --:--\n" " " fi diff --git a/.i3blocks/temperature b/.i3blocks/temperature index fe7acbf..9d62791 100755 --- a/.i3blocks/temperature +++ b/.i3blocks/temperature @@ -1,82 +1,18 @@ -#!/usr/bin/perl -# Copyright 2014 Pierre Mavro -# Copyright 2014 Vivien Didelot -# Copyright 2014 Andreas Guldstrand -# Copyright 2014 Benjamin Chretien +#!/bin/bash -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +used=$(sensors -j | jq '."amdgpu-pci-0900"."edge"."temp1_input"') -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Choix de la couleur +if [[ $used -ge 90 ]] +then color="#f2777a" +elif [[ $used -ge 70 ]] +then color="#f99157" +elif [[ $used -ge 50 ]] +then color="#ffcc66" +elif [[ $used -ge 10 ]] +then color="#99cc99" +else color="#66cccc" +fi -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -use strict; -use warnings; -use utf8; -use Getopt::Long; - -binmode(STDOUT, ":utf8"); - -# default values -my $t_warn = 60; -my $t_crit = 70; -my $chip = "$ENV{BLOCK_INSTANCE}"; -my $temperature = -9999; -my $color = "#d3d0c8"; -#my $status = ""; - -sub help { - print "Usage: temperature [-w ] [-c ] [--chip ]\n"; - print "-w : warning threshold to become yellow\n"; - print "-c : critical threshold to become red\n"; - print "--chip : sensor chip\n"; - exit 0; -} - -GetOptions("help|h" => \&help, - "w=i" => \$t_warn, - "c=i" => \$t_crit, - "chip=s" => \$chip); - -# Get chip temperature -open (SENSORS, "sensors -u $chip |") or die; -while () { - if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { - $temperature = $1; - last; - } -} -close(SENSORS); - -$temperature eq -9999 and die 'Cannot find temperature'; - -# Print color, if needed -if ($temperature >= $t_crit) { - $color = "#f2777a"; -# $status = ""; - #exit 33; -} elsif ($temperature >= $t_warn) { - $color = "#f99157"; -# $status = ""; -} elsif ($temperature >= 50) { - $color = "#ffcc66"; -# $status = ""; -} elsif ($temperature >=40) { - $color = "#99cc99"; -# $status = ""; -} else { - $color = "#66cccc"; -# $status = ""; -} - -#printf "$status %d°C\n%d°C\n$color\n", $temperature, $temperature; -printf "%d°C", $temperature, $temperature; - -exit 0; +# Affichage +printf "gpu%3d°C\n" "$color" "$used" diff --git a/.i3blocks/updates b/.i3blocks/updates index b1840bb..16981f3 100755 --- a/.i3blocks/updates +++ b/.i3blocks/updates @@ -1,16 +1,19 @@ #!/bin/bash +runtime="${XDG_RUNTIME_DIR}/i3blocks" +[[ ! -d "$runtime" ]] && mkdir -p "$runtime" + echo -n "updt " -if [[ -f /dev/shm/claws_offline ]] +if [[ -f ${runtime}/claws_offline ]] then echo "" exit fi -if [[ ! -f /dev/shm/updates ]] +if [[ ! -f ${runtime}/updates ]] then - echo 0 > /dev/shm/updates + echo 0 > ${runtime}/updates fi avail=($(checkupdates | cut -d' ' -f1)) @@ -22,11 +25,11 @@ then echo "" else echo "" - if [[ $(cat /dev/shm/updates) -ne $total ]] || [[ -n "$BLOCK_BUTTON" ]] + if [[ $(cat ${runtime}/updates) -ne $total ]] || [[ -n "$BLOCK_BUTTON" ]] then [[ $total -eq 1 ]] && notify-send "1 mise à jour disponible" "$(for item in ${avail[@]} ${aur[@]}; do echo -n $item; done)" [[ $total -gt 1 ]] && notify-send "$total mises à jour disponibles" "$(for item in ${avail[@]} ${aur[@]}; do echo -n "$item, "; done | sed 's/, $//g')" fi fi -echo $total > /dev/shm/updates +echo $total > ${runtime}/updates diff --git a/.local/bin/mpd-notif b/.local/bin/mpd-notif index 8dc248e..81b8e93 100755 --- a/.local/bin/mpd-notif +++ b/.local/bin/mpd-notif @@ -1,17 +1,37 @@ #!/bin/bash export MPD_HOST="$HOME/.mpd/socket" +DUNST_ID=$(sum <<<"mpd" | cut -d' ' -f1) + +runtime="${XDG_RUNTIME_DIR}/i3blocks" +[[ ! -d "$runtime" ]] && mkdir -p "$runtime" while true do systemctl --user is-active mpd.service || exit 1 - infos=$(mpc -w -f '[[%artist%\n]%title%[\n%album%]]|[%file%]' current) - mpc -f '[[%artist%§]%title%|[%file%]' current > /dev/shm/mpd - echo "$( /dev/shm/mpd-scroll - if [[ -z "$infos" ]] + timeout 5 mpc -w current + onelineinfos="$(mpc -f '[%artist%§]%title%|[%file%]' current)" + if [[ "$onelineinfos" != "$(<${runtime}/mpd)" ]] then - infos="Arrêt" + echo "$onelineinfos" > ${runtime}/mpd + echo "$(<${runtime}/mpd) " > ${runtime}/mpd-scroll + infos=$(mpc -f '[[%artist%\n]%title%[\n%album%]]|[%file%]' current) + if [[ -z "$infos" ]] + then + infos="Arrêt" + fi + artist=$(sed -n 1p <<<$infos) + title=$(sed -n 2p <<<$infos) + album=$(sed -n 3p <<<$infos) + [[ -z "$title" ]] && title="$artist" && artist="" + title=$(basename "$title") + curl -s -X POST -u breizh:$(pass show Web/pleroma.breizh.pm) \ + --data-urlencode "title=${title}" \ + --data-urlencode "artist=${artist}" \ + --data-urlencode "album=${album}" \ + https://pleroma.breizh.pm/api/v1/pleroma/scrobble &>/dev/null & + dunstify -r $DUNST_ID "MPD" "$infos" + ( pidof cava && sleep 1 && pkill -USR1 cava ) & fi - notify-send "MPD" "$infos" - pidof cava && pkill -USR1 cava done + diff --git a/.vim/.netrwhist b/.vim/.netrwhist index d9d2d24..44452b0 100644 --- a/.vim/.netrwhist +++ b/.vim/.netrwhist @@ -1,3 +1,5 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =1 +let g:netrw_dirhistcnt =3 +let g:netrw_dirhist_3='/home/breizh/.cache/dmenu-recent' +let g:netrw_dirhist_2='/home/breizh/.mozilla/firefox/5i4s6px2.tmp' let g:netrw_dirhist_1='/home/breizh/.config/unity3d/Ludeon Studios/RimWorld by Ludeon Studios/Config' diff --git a/.xinitrc b/.xinitrc index 2a0a98c..7b956e3 100644 --- a/.xinitrc +++ b/.xinitrc @@ -48,7 +48,7 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then unset f fi -[ -f $HOME/.fehbg ] && $HOME/.fehbg +#[ -f $HOME/.fehbg ] && $HOME/.fehbg [ -f $HOME/.screenlayout/home.sh ] && $HOME/.screenlayout/home.sh setxkbmap fr oss diff --git a/.xscreensaver b/.xscreensaver index 6a5e760..3bf9696 100644 --- a/.xscreensaver +++ b/.xscreensaver @@ -1,5 +1,5 @@ # XScreenSaver Preferences File -# Written by xscreensaver-demo 5.43 for breizh on Sat Aug 31 16:59:23 2019. +# Written by xscreensaver-demo 5.43 for breizh on Thu Nov 28 21:22:13 2019. # https://www.jwz.org/xscreensaver/ timeout: 0:15:00 @@ -37,11 +37,11 @@ imageDirectory: /home/breizh/.config/variety mode: random selected: -1 -textMode: url +textMode: program textLiteral: mepuʁkwaikskrinseivøʁdekonotãavεkl'yteεfɥit textFile: -textProgram: -textURL: https://danstonchat.com/rss.xml +textProgram: /home/breizh/.local/bin/screensaver +textURL: https://breizh.pm programs: \ maze -root \n\ @@ -143,7 +143,7 @@ programs: \ - GL: dnalogo -root \n\ GL: engine -root -titles \n\ GL: flipscreen3d -root \n\ - GL: gltext -root \n\ + GL: gltext -root -text '%A%n%d %b %Y%n%r' \n\ GL: menger -root \n\ GL: molecule -root -no-labels -no-shells \n\ rotzoomer -root \n\