Nouveau fichiers et modifs

This commit is contained in:
Breizh 2018-12-26 00:40:38 +01:00
parent d0b18ff3e4
commit b9b369d825
37 changed files with 391 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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}

View file

@ -119,6 +119,11 @@ separator=false
[vpn]
label=vpn
interval=30
separator=false
#[bandwidth]
#interval=1
#markup=none
# Packages to update
[updates]

View file

@ -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`"

98
.i3blocks/bandwidth.new Executable file
View file

@ -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

3
.local/bin/codepostal Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
dig +short +nodnssec TXT ${1-22300}.cp.bortzmeyer.fr

3
.local/bin/factorio_launch Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
DRI_PRIME=1 factorio

4
.local/bin/isup Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
ip=$(host -W 5 $1 | grep 'has address' | cut -d' ' -f4)
echo $ip

3
.local/bin/keybind Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
xev | grep keycode

12
.local/bin/keyboard_toggle Executable file
View file

@ -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

4
.local/bin/keycode Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'

4
.local/bin/launch_minecraft.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
export DRI_PRIME=1
java -jar ~/bin/te_minecraft.jar

14
.local/bin/launch_polybar.sh Executable file
View file

@ -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..."

3
.local/bin/meteo Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
curl "fr.wttr.in/${1-Rennes}"

2
.local/bin/mping Executable file
View file

@ -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)}';

1
.local/bin/progress_info.sh Symbolic link
View file

@ -0,0 +1 @@
/home/breizh/git/git_updater/progress_info.sh

38
.local/bin/reveil Executable file
View file

@ -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

BIN
.local/bin/rotatefs Executable file

Binary file not shown.

6
.local/bin/rtorrent-magnet Executable file
View file

@ -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é"

1
.local/bin/seven-square Symbolic link
View file

@ -0,0 +1 @@
/home/breizh/git/sevensquare/build/seven-square

BIN
.local/bin/ski32.exe Executable file

Binary file not shown.

13
.local/bin/status Executable file
View file

@ -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

36
.local/bin/tabColor Executable file
View file

@ -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_

BIN
.local/bin/te_minecraft.jar Normal file

Binary file not shown.

BIN
.local/bin/tetris Executable file

Binary file not shown.

9
.local/bin/tmp_swap Executable file
View file

@ -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

12
.local/bin/touchpad_toggle Executable file
View file

@ -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

1
.local/bin/update.sh Symbolic link
View file

@ -0,0 +1 @@
/home/breizh/git/git_updater/update.sh

63
.local/bin/vconsole Executable file
View file

@ -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

3
.local/bin/vimura Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
zathura -x "vim --servername latex -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*

14
.local/bin/ytdl Executable file
View file

@ -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

29
.local/bin/ytdl_live Executable file
View file

@ -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

View file

@ -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