From 6b40e8800eb2c6522d32b8d88d461a60649aa225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 20 Mar 2019 22:14:09 +0100 Subject: [PATCH] Overdue update --- Xresources.d/urxvt | 2 +- bashrc | 2 +- config/autorandr/bg | 4 +-- config/i3/config | 16 +++++++-- scripts/install-prefs | 4 +-- scripts/ter | 66 +++++++++++++++++++++++++++++++++++ scripts/updateCompressedMusic | 2 +- 7 files changed, 87 insertions(+), 9 deletions(-) create mode 100755 scripts/ter diff --git a/Xresources.d/urxvt b/Xresources.d/urxvt index 08f7754..93c9b65 100644 --- a/Xresources.d/urxvt +++ b/Xresources.d/urxvt @@ -22,7 +22,7 @@ URxvt*scrollBar: false ! Font declaration -URxvt.font: xft:DejaVu Sans Mono for Powerline:size=12:antialias=true,xft:Symbola:size=12:antialias=true +URxvt.font: xft:DejaVu Sans Mono for Powerline:size=12:antialias=true,xft:Twemoji:size=12:antialias=true ! Font spacing URxvt.letterSpace: 0 diff --git a/bashrc b/bashrc index 65c6a1e..af290e8 100644 --- a/bashrc +++ b/bashrc @@ -33,7 +33,7 @@ export LS_OPTIONS='--group-directories-first --time-style=+"%Y-%m-%d %H:%M:%S" - alias ls="ls $LS_OPTIONS" alias grep='grep --color=tty -d skip' alias mkdir='mkdir -v' -alias cp="cp -i" +alias cp="cp -i --reflink=auto" alias mv="mv -iv" alias dd='dd status=progress' alias rm='rm -Iv --one-file-system' diff --git a/config/autorandr/bg b/config/autorandr/bg index e1bcee1..91b38c0 100644 --- a/config/autorandr/bg +++ b/config/autorandr/bg @@ -1,4 +1,4 @@ -https://i.imgur.com/yVtVucs.jpg # Doctor Who Series 11 +# https://i.imgur.com/yVtVucs.jpg # Doctor Who Series 11 # Derivate of these ones https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-230622.png # https://geoffrey.frogeye.fr/files/backgrounds/VertBleu.png -# https://geoffrey.frogeye.fr/files/backgrounds/BleuVert.png +https://geoffrey.frogeye.fr/files/backgrounds/BleuVert.png diff --git a/config/i3/config b/config/i3/config index b42ea20..1fd3cf8 100644 --- a/config/i3/config +++ b/config/i3/config @@ -38,6 +38,7 @@ bindsym $mod+z kill bindsym button2 kill bindsym $mod+c exec --no-startup-id rofi-pass --last-used +bindsym $mod+i exec --no-startup-id rofimoji --last-used bindsym $mod+plus exec --no-startup-id rofi -modi ssh -show ssh bindsym $mod+ù exec --no-startup-id rofi -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t "sudo -s -E"' bindsym $mod+Tab exec --no-startup-id rofi -modi window -show window @@ -62,8 +63,8 @@ bindsym XF86AudioPrev exec mpc prev bindsym XF86AudioPlay exec mpc toggle bindsym XF86AudioNext exec mpc next bindsym $mod+F10 exec ~/.scripts/showKeyboardLayout -bindsym $mod+F11 exec urxvtc -e 'pacmixer' -bindsym $mod+F12 exec urxvtc -e 'pacmixer' +bindsym $mod+F11 exec xterm -e 'pacmixer' +bindsym $mod+F12 exec xterm -e 'pacmixer' #Brightness control bindsym XF86MonBrightnessDown exec xbacklight -dec 5 -time 0 @@ -303,6 +304,17 @@ mode "Resize" { bindsym $mod+r mode "Resize" +mode "Presentation" { + # These bindings trigger as soon as you enter the resize mode + bindsym e workspace back_and_forth + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+Shift+p mode "Presentation" + set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default bindsym $mod+t mode "$mode_screen" mode "$mode_screen" { diff --git a/scripts/install-prefs b/scripts/install-prefs index 38f2c27..8b50453 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -233,8 +233,8 @@ if [ $GUI == 1 ]; then # Desktop manager inst dunst feh i3-wm i3lock numlockx qutebrowser rofi rxvt-unicode scrot trayer unclutter xautolock xclip if [ $ARCH == 1 ]; then - inst xorg-xinit xorg-xbacklight ttf-dejavu - altInst lemonbar-xft-git autorandr-git keynav-enhanced pacmixer rofi-pass + inst xorg-xinit xorg-xbacklight ttf-dejavu autorandr + altInst lemonbar-xft-git keynav-enhanced pacmixer rofi-pass elif [ $DEBIAN == 1 ]; then # TODO autorandr pacmixer rofi-pass ttf-dejavu inst lemonbar keynav xbacklight diff --git a/scripts/ter b/scripts/ter new file mode 100755 index 0000000..13e8e50 --- /dev/null +++ b/scripts/ter @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 + +import sys +from math import inf + +gares = sys.argv[1:] + +N = len(gares) + +if N < 2: + print("Ben reste chez toi alors.") + sys.exit(1) + +def trajet_str(a, b): + return f"{gares[a]} → {gares[b]}" + +def chemin_str(stack): + return ", ".join([trajet_str(stack[i], stack[i+1]) for i in range(len(stack)-1)]) + +# Demande des prix des trajets + +prices = dict() + +for i in range(N): + for j in range(N-1, i, -1): + print(trajet_str(i, j)) + p = None + while not isinstance(p, float): + try: + p = float(input(f"Prix du trajet {trajet_str(i, j)} ? ").replace(',', '.')) + except ValueError: + print("C'est pas un prix ça !") + if i not in prices: + prices[i] = dict() + prices[i][j] = float(p) + +# Calcul des prix des chemins + +miniPrice = +inf +miniStack = None +maxiPrice = -inf +maxiStack = None + +def register_path(stack): + price = sum([prices[stack[i]][stack[i+1]]for i in range(len(stack)-1)]) + + global miniPrice, maxiPrice, miniStack, maxiStack + if price < miniPrice: + miniPrice = price + miniStack = stack.copy() + if price > maxiPrice: + maxiPrice = price + maxiStack = stack.copy() + print(f"{chemin_str(stack)} = {price:.2f} €") + +stack = [0] +while stack[0] == 0: + if stack[-1] >= N - 1: + register_path(stack) + stack.pop() + stack[-1] += 1 + else: + stack.append(stack[-1]+1) + +print(f"Prix minimum: {chemin_str(miniStack)} = {miniPrice:.2f} €") +print(f"Prix maximum: {chemin_str(maxiStack)} = {maxiPrice:.2f} €") diff --git a/scripts/updateCompressedMusic b/scripts/updateCompressedMusic index 6fb60cc..fa5517e 100755 --- a/scripts/updateCompressedMusic +++ b/scripts/updateCompressedMusic @@ -14,7 +14,7 @@ SOURCE_FOLDER = os.path.join(os.path.expanduser("~"), "Musiques") OUTPUT_FOLDER = os.path.join(os.path.expanduser("~"), ".musicCompressed") CONVERSIONS = {"flac": "opus"} FORBIDDEN_EXTENSIONS = ["jpg", "pdf", "ffs_db"] -FORGIVEN_FILENAMES = ["cover.jpg"] +FORGIVEN_FILENAMES = ["cover.jpg", "front.jpg"] IGNORED_EMPTY_FOLDER = [".stfolder"] # TODO FEAT Make the directory structure the same as the base one and