Overdue update

This commit is contained in:
Geoffrey Frogeye 2019-03-20 22:14:09 +01:00
parent 7a7a3b68f4
commit 6b40e8800e
7 changed files with 87 additions and 9 deletions

View file

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

2
bashrc
View file

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

View file

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

View file

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

View file

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

66
scripts/ter Executable file
View file

@ -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} €")

View file

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