diff --git a/.Xresources b/.Xresources index d0c5cdc..e511a1e 100644 --- a/.Xresources +++ b/.Xresources @@ -57,6 +57,7 @@ XTerm*reverseVideo: on XTerm*selectToClipboard: true URxvt.font: xft:xos4 Terminus,xft:DejaVu Sans Mono,xft:Noto Sans +!URxvt.font: xft:Fira Mono,xft:DejaVu Sans Mono,xft:Noto Sans !URxvt.font: xft:Latin Modern Mono:size=12, xft:xos4 Terminus, xft:DejaVu Sans Mono !URxvt.letterSpace: 1.5 URxvt.depth: 32 diff --git a/.bash_profile b/.bash_profile index f26d028..f7f7bf4 100644 --- a/.bash_profile +++ b/.bash_profile @@ -20,7 +20,6 @@ eval $(ssh-agent -s) #~/.local/bin/vconsole if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then -# play -q /usr/share/sounds/freedesktop/stereo/service-login.oga & export GTK2_RC_FILES="$HOME/.gtkrc-2.0" export QT_QPA_PLATFORMTHEME=qt5ct export BROWSER="firefox" @@ -29,6 +28,7 @@ if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then startx logout else + play -q "$HOME/Musique/WELCOME BACK.wav" & export BROWSER=elinks exec fish fi diff --git a/.config/gtk-3.0/settings.ini.bak b/.config/gtk-3.0/settings.ini.bak index 0b3e947..6cfe277 100644 --- a/.config/gtk-3.0/settings.ini.bak +++ b/.config/gtk-3.0/settings.ini.bak @@ -1,8 +1,8 @@ [Settings] gtk-application-prefer-dark-theme=false -gtk-theme-name=Vertex +gtk-theme-name=GlossyBlack gtk-icon-theme-name=Vertex-Icons -gtk-font-name=xos4 Terminus +gtk-font-name=Linux Biolinum 10 gtk-button-images=1 gtk-menu-images=1 gtk-enable-event-sounds=1 diff --git a/.config/i3/config b/.config/i3/config index c5fab23..50f3d05 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -372,6 +372,7 @@ exec --no-startup-id env DRI_PRIME=1 steam-native -silent #exec --no-startup-id qbittorrent #exec --no-startup-id gdfs $HOME/.google_drive $HOME/Google_Drive/ #exec --no-startup-id transmission-gtk -m +exec --no-startup-id play -q "$HOME/Musique/WELCOME BACK.wav" # Start i3bar to display a workspace bar (plus the system information i3status if available) bar { diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 20a38c5..090d551 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -10,6 +10,5 @@ hr-seek-framedrop=no #no-resume-playback alang=fr,fre,fra slang=fr,fre,fra -save-position-on-quit cache=123400 demuxer-readahead-secs=20 diff --git a/.conkyrc b/.conkyrc index adc2b83..ee88888 100644 --- a/.conkyrc +++ b/.conkyrc @@ -65,7 +65,7 @@ ${color2}${font xos4 Terminus:pixelsize=14}Swap${font}${alignr}$swap / $swapfree $swapperc% ${if_match $swapperc>80}${color CC99CC}$else${if_match $swapperc>40}${color 6699CC}$else${color 66CCCC}$endif$endif${swapbar}$color${if_up wlp1s0} ${color2}${font xos4 Terminus:pixelsize=14}Wi-Fi${font}${alignr}${addr wlp1s0}${color} -${wireless_essid} ${wireless_link_qual_perc wlp1s0}%$alignr${wireless_freq wlp1s0} +${wireless_essid wlp1s0} ${wireless_link_qual_perc wlp1s0}%$alignr${wireless_freq wlp1s0} Canal ${wireless_channel wlp1s0}$alignr${wireless_bitrate wlp1s0} Descendant ${totaldown wlp1s0}${alignr}${totalup wlp1s0} Montant ${downspeed wlp1s0}${alignr}${upspeed wlp1s0} diff --git a/.i3blocks.conf b/.i3blocks.conf index efe9773..20f18be 100644 --- a/.i3blocks.conf +++ b/.i3blocks.conf @@ -119,6 +119,11 @@ separator=false [vpn] label=vpn interval=30 +separator=false + +#[bandwidth] +#interval=1 +#markup=none # Packages to update [updates] diff --git a/.i3blocks/bandwidth b/.i3blocks/bandwidth index 0ed2f75..6cfad90 100755 --- a/.i3blocks/bandwidth +++ b/.i3blocks/bandwidth @@ -70,7 +70,7 @@ tx_rate=$(( $tx_diff / $time_diff )) # 1024^2 = 1048576, then display MiB/s instead # incoming -echo -n " " +echo -n "↓ " rx_kib=$(( $rx_rate >> 10 )) if [[ "$rx_rate" -gt 1048576 ]]; then printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`" @@ -81,7 +81,7 @@ fi echo -n " " # outgoing -echo -n " " +echo -n "↑ " tx_kib=$(( $tx_rate >> 10 )) if [[ "$tx_rate" -gt 1048576 ]]; then printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`" diff --git a/.i3blocks/bandwidth.new b/.i3blocks/bandwidth.new new file mode 100755 index 0000000..5403a95 --- /dev/null +++ b/.i3blocks/bandwidth.new @@ -0,0 +1,98 @@ +#!/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/.local/bin/codepostal b/.local/bin/codepostal new file mode 100755 index 0000000..a6df74d --- /dev/null +++ b/.local/bin/codepostal @@ -0,0 +1,3 @@ +#!/bin/bash + +dig +short +nodnssec TXT ${1-22300}.cp.bortzmeyer.fr diff --git a/.local/bin/factorio_launch b/.local/bin/factorio_launch new file mode 100755 index 0000000..c144b7c --- /dev/null +++ b/.local/bin/factorio_launch @@ -0,0 +1,3 @@ +#!/bin/bash + +DRI_PRIME=1 factorio diff --git a/.local/bin/isup b/.local/bin/isup new file mode 100755 index 0000000..cfe96d6 --- /dev/null +++ b/.local/bin/isup @@ -0,0 +1,4 @@ +#!/bin/bash + +ip=$(host -W 5 $1 | grep 'has address' | cut -d' ' -f4) +echo $ip diff --git a/.local/bin/keybind b/.local/bin/keybind new file mode 100755 index 0000000..177f9d4 --- /dev/null +++ b/.local/bin/keybind @@ -0,0 +1,3 @@ +#!/bin/bash + +xev | grep keycode diff --git a/.local/bin/keyboard_toggle b/.local/bin/keyboard_toggle new file mode 100755 index 0000000..21dcf9b --- /dev/null +++ b/.local/bin/keyboard_toggle @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ $(setxkbmap -query|grep oss) ]] +then + setxkbmap fr bepo + notify-send 'Clavier Bépo' +else + setxkbmap fr oss + notify-send 'Clavier OSS' +fi +exit 0 + diff --git a/.local/bin/keycode b/.local/bin/keycode new file mode 100755 index 0000000..68dee0f --- /dev/null +++ b/.local/bin/keycode @@ -0,0 +1,4 @@ +#!/bin/bash + +xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }' + diff --git a/.local/bin/launch_minecraft.sh b/.local/bin/launch_minecraft.sh new file mode 100755 index 0000000..fc8c4f0 --- /dev/null +++ b/.local/bin/launch_minecraft.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export DRI_PRIME=1 +java -jar ~/bin/te_minecraft.jar diff --git a/.local/bin/launch_polybar.sh b/.local/bin/launch_polybar.sh new file mode 100755 index 0000000..972c24f --- /dev/null +++ b/.local/bin/launch_polybar.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +# Launch bar1 and bar2 +polybar example & + + +echo "Bars launched..." + diff --git a/.local/bin/meteo b/.local/bin/meteo new file mode 100755 index 0000000..7be539c --- /dev/null +++ b/.local/bin/meteo @@ -0,0 +1,3 @@ +#!/bin/bash + +curl "fr.wttr.in/${1-Rennes}" diff --git a/.local/bin/mping b/.local/bin/mping new file mode 100755 index 0000000..424d5fa --- /dev/null +++ b/.local/bin/mping @@ -0,0 +1,2 @@ +#!/bin/bash +ping $1|awk -F[=\ ] '/me=/{t=$(NF-1);f=3000-14*log(t^20);c="play -q -n synth 1 pl " f;print $0;system(c)}'; diff --git a/.local/bin/progress_info.sh b/.local/bin/progress_info.sh new file mode 120000 index 0000000..c31bcdc --- /dev/null +++ b/.local/bin/progress_info.sh @@ -0,0 +1 @@ +/home/breizh/git/git_updater/progress_info.sh \ No newline at end of file diff --git a/.local/bin/reveil b/.local/bin/reveil new file mode 100755 index 0000000..029924a --- /dev/null +++ b/.local/bin/reveil @@ -0,0 +1,38 @@ +#!/bin/bash + +[[ -z "$3" ]] && volume=90 || volume="$3" + +sleeptime=$(date -Iseconds -d "$1") +wakeuptime=$(date -Iseconds -d "$2") + +#if [[ "$(whoami)" != "root" ]] +#then +# echo "Ce script doit être exécuté en root" >&2 +# exit 1 +#fi + +echo $sleeptime +echo $wakeuptime + +read + +echo 0 off > /proc/acpi/ibm/led +pkill xscreensaver + +termdown -f contessa -a "$sleeptime" +mocp -s +pkill vlc + +termdown -f contessa -a "$wakeuptime" + +#rtcwake -m mem -t $wakeuptime + +amixer -q -D default sset Master "$volume%" + +echo 0 on > /proc/acpi/ibm/led + +pkill mpv +mpv --loop-file ${HOME}/Musique_old/Sons/reveil.mp3 +xscreensaver & +#mpv --loop-file /home/breizh/Musique/Radio_caroline.m3u + diff --git a/.local/bin/rotatefs b/.local/bin/rotatefs new file mode 100755 index 0000000..ffce7e2 Binary files /dev/null and b/.local/bin/rotatefs differ diff --git a/.local/bin/rtorrent-magnet b/.local/bin/rtorrent-magnet new file mode 100755 index 0000000..b2b1476 --- /dev/null +++ b/.local/bin/rtorrent-magnet @@ -0,0 +1,6 @@ +#!/bin/bash +watch_folder=~/rtorrent/watch/start +cd $watch_folder +[[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit; +echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent" +notify-send "rTorrent" "Torrent ajouté" diff --git a/.local/bin/seven-square b/.local/bin/seven-square new file mode 120000 index 0000000..d80500e --- /dev/null +++ b/.local/bin/seven-square @@ -0,0 +1 @@ +/home/breizh/git/sevensquare/build/seven-square \ No newline at end of file diff --git a/.local/bin/ski32.exe b/.local/bin/ski32.exe new file mode 100755 index 0000000..92be1a5 Binary files /dev/null and b/.local/bin/ski32.exe differ diff --git a/.local/bin/status b/.local/bin/status new file mode 100755 index 0000000..93b0d53 --- /dev/null +++ b/.local/bin/status @@ -0,0 +1,13 @@ +#!/usr/bin/fish + +function etat_init -a message + echo -n "[ ] $message" +end + +function etat_status -a message color + echo -en "\r[" + test -z $color; or set_color $color + echo -n $message + set_color normal + echo "]" +end diff --git a/.local/bin/tabColor b/.local/bin/tabColor new file mode 100755 index 0000000..f82da76 --- /dev/null +++ b/.local/bin/tabColor @@ -0,0 +1,36 @@ +#!/bin/bash + +# Texte de l'exemple ( >= 3 caractères ) : +TEXT=" Bash " ; + +# Couleur du texte : +declare -a FG=('' '1' '4' '5' '7' '30' '31' '32' \ +'33' '34' '35' '36' '37') ; + +echo + +# Première ligne : +printf "FG \ BG\t%${#TEXT}s" ; +for bg in {40..47} ; do + printf "%${#TEXT}s" "${bg} " ; +done +echo ; + +# Création du tableau de présentation des combinaisons : +for fg in ${!FG[*]} ; do + echo -ne "${FG[fg]}\t\033[${FG[fg]}m$TEXT" ; + for bg in {40..47} ; do + echo -ne "\033[${FG[fg]};${bg}m$TEXT\033[0m" ; + done + echo ; +done + +# Comment déclarer une couleur : +cat <<_eof_ + + Format de déclaration : \\033[XXm où XX prend les valeurs + de FG ou BG" ; + Retour aux paramètres par défaut : \033[0m" ; + Pour plus de détails : http://www.admin-linux.fr/?p=9011 + +_eof_ diff --git a/.local/bin/te_minecraft.jar b/.local/bin/te_minecraft.jar new file mode 100644 index 0000000..f3f048f Binary files /dev/null and b/.local/bin/te_minecraft.jar differ diff --git a/.local/bin/tetris b/.local/bin/tetris new file mode 100755 index 0000000..1aa4156 Binary files /dev/null and b/.local/bin/tetris differ diff --git a/.local/bin/tmp_swap b/.local/bin/tmp_swap new file mode 100755 index 0000000..2d25edc --- /dev/null +++ b/.local/bin/tmp_swap @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ $1 = "on" ]] +then + sudo mount -o remount,size=12G,noatime /tmp +elif [[ $1 = "off" ]] +then + sudo mount -o remount,size=4G,noatime /tmp +fi diff --git a/.local/bin/touchpad_toggle b/.local/bin/touchpad_toggle new file mode 100755 index 0000000..a7e62e9 --- /dev/null +++ b/.local/bin/touchpad_toggle @@ -0,0 +1,12 @@ +#!/bin/bash +STATE=`xinput list-props "ETPS/2 Elantech Touchpad"|grep 'Device Enabled'|awk '{print $4}'` +echo $ID +if [ $STATE -eq 1 ] +then + xinput disable "ETPS/2 Elantech Touchpad" + notify-send 'Touchpad disabled' +else + xinput enable "ETPS/2 Elantech Touchpad" + notify-send 'Touchpad enabled' +fi +exit 0 diff --git a/.local/bin/update.sh b/.local/bin/update.sh new file mode 120000 index 0000000..7088a4e --- /dev/null +++ b/.local/bin/update.sh @@ -0,0 +1 @@ +/home/breizh/git/git_updater/update.sh \ No newline at end of file diff --git a/.local/bin/vconsole b/.local/bin/vconsole new file mode 100755 index 0000000..cb8aaab --- /dev/null +++ b/.local/bin/vconsole @@ -0,0 +1,63 @@ +#!/bin/sh +# Base16 Eighties - Virtual console color setup script +# Chris Kempson (http://chriskempson.com) + +color00="2d2d2d" # Base 00 - Black +color01="f2777a" # Base 08 - Red +color02="99cc99" # Base 0B - Green +color03="ffcc66" # Base 0A - Yellow +color04="6699cc" # Base 0D - Blue +color05="cc99cc" # Base 0E - Magenta +color06="66cccc" # Base 0C - Cyan +color07="d3d0c8" # Base 05 - White +color08="747369" # Base 03 - Bright Black +color09=$color01 # Base 08 - Bright Red +color10=$color02 # Base 0B - Bright Green +color11=$color03 # Base 0A - Bright Yellow +color12=$color04 # Base 0D - Bright Blue +color13=$color05 # Base 0E - Bright Magenta +color14=$color06 # Base 0C - Bright Cyan +color15="f2f0ec" # Base 07 - Bright White + +# 16 color space +echo -e "\e]P0$color00" +echo -e "\e]P1$color01" +echo -e "\e]P2$color02" +echo -e "\e]P3$color03" +echo -e "\e]P4$color04" +echo -e "\e]P5$color05" +echo -e "\e]P6$color06" +echo -e "\e]P7$color07" +echo -e "\e]P8$color08" +echo -e "\e]P9$color09" +echo -e "\e]PA$color10" +echo -e "\e]PB$color11" +echo -e "\e]PC$color12" +echo -e "\e]PD$color13" +echo -e "\e]PE$color14" +echo -e "\e]PF$color15" +if [ -x /sbin/clear ]; then + /sbin/clear +else + echo -e "\e[H" + echo -e "\e[2J" +fi + +# clean up +unset color00 +unset color01 +unset color02 +unset color03 +unset color04 +unset color05 +unset color06 +unset color07 +unset color08 +unset color09 +unset color10 +unset color11 +unset color12 +unset color13 +unset color14 +unset color15 + diff --git a/.local/bin/vimura b/.local/bin/vimura new file mode 100755 index 0000000..842c49c --- /dev/null +++ b/.local/bin/vimura @@ -0,0 +1,3 @@ +#!/bin/bash + +zathura -x "vim --servername latex -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $* diff --git a/.local/bin/ytdl b/.local/bin/ytdl new file mode 100755 index 0000000..ef9660f --- /dev/null +++ b/.local/bin/ytdl @@ -0,0 +1,14 @@ +#!/bin/bash + +youtube-dl -F "$1" +printf "Choose the audio format: " +read afmt +printf "Choose the video format: " +read vfmt + +audio=$(youtube-dl -f "${afmt}" -g "$1") +video=$(youtube-dl -f "${vfmt}" -g "$1") +title=$(youtube-dl -e "$1") + +ffmpeg -i "${audio}" -i "${video}" -f matroska -c:a copy -c:v copy "$title.mkv" +exit 0 diff --git a/.local/bin/ytdl_live b/.local/bin/ytdl_live new file mode 100755 index 0000000..29a905a --- /dev/null +++ b/.local/bin/ytdl_live @@ -0,0 +1,29 @@ +#!/bin/bash + +list="$@ " +_PID= + +#echo -e "\n\n-- $(date "+%Y-%m-%d %H:%M:%S") ------------------------\n" >> ytdl.log + +if [ -n "$list" ] +then + youtube-dl $list #2>>ytdl.err >>ytdl.log & + _PID=$(jobs -p) +fi + +while true +do + read -p "URL: " url + kill $_PID || (sleep 2; kill -9 $_PID) + if [ $url = "." ] + then + kill $_PID || (sleep 2; kill -9 $_PID) + exit 0 + fi + list="${list}${url} " + #echo -e "\n\n-- $(date "+%Y-%m-%d %H:%M:%S") ------------------------\n" >> ytdl.log + youtube-dl $list #2>>ytdl.err >>ytdl.log & + _PID=$(jobs -p) +done + + diff --git a/.xinitrc b/.xinitrc index 74ed1ee..73b7566 100644 --- a/.xinitrc +++ b/.xinitrc @@ -22,6 +22,8 @@ DEFAULT_SESSION='i3 --shmlog-size 0' [[ -f ~/.fehbg ]] && ~/.fehbg [[ -f ~/.screenlayout/home.sh ]] && ~/.screenlayout/home.sh +setxkbmap fr oss + [[ -f ~/.Xmodmap ]] && xmodmap ~/.Xmodmap case $1 in