This commit is contained in:
Geoffrey Frogeye 2019-01-06 14:05:05 +01:00
parent 84967eac60
commit 7a7a3b68f4
8 changed files with 65 additions and 10 deletions

4
bashrc
View file

@ -29,7 +29,7 @@ export PYTHONSTARTUP=$HOME/.config/pythonstartup.py
# ALIASES # ALIASES
# Completion for existing commands # Completion for existing commands
export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M:%S" --color=auto --file-type --human-readable' export LS_OPTIONS='--group-directories-first --time-style=+"%Y-%m-%d %H:%M:%S" --color=auto --file-type --human-readable'
alias ls="ls $LS_OPTIONS" alias ls="ls $LS_OPTIONS"
alias grep='grep --color=tty -d skip' alias grep='grep --color=tty -d skip'
alias mkdir='mkdir -v' alias mkdir='mkdir -v'
@ -55,7 +55,7 @@ alias please=sudo
alias ll="ls -l $LS_OPTIONS" alias ll="ls -l $LS_OPTIONS"
alias la="ls -la $LS_OPTIONS" alias la="ls -la $LS_OPTIONS"
alias x='startx; logout' alias x='startx; logout'
alias nx='nvidia-startx; logout' alias nx='nvidia-xrun; logout'
alias s='sudo -s -E' alias s='sudo -s -E'
alias tracefiles="strace -f -t -e trace=file" alias tracefiles="strace -f -t -e trace=file"
alias n='urxvtc &' alias n='urxvtc &'

View file

@ -70,9 +70,9 @@ bindsym XF86MonBrightnessDown exec xbacklight -dec 5 -time 0
bindsym XF86MonBrightnessUp exec xbacklight -inc 5 -time 0 bindsym XF86MonBrightnessUp exec xbacklight -inc 5 -time 0
# Screenshots # Screenshots
bindsym Print exec scrot -ue 'mv $f ~/Screenshots/' bindsym Print exec scrot -ue 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f'
bindsym $mod+Print exec scrot -e 'mv $f ~/Screenshots/' bindsym $mod+Print exec scrot -e 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f'
bindsym Ctrl+Print exec sleep 1 && scrot -se 'mv $f ~/Screenshots/' bindsym Ctrl+Print exec sleep 1 && scrot -se 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f'
focus_follows_mouse no focus_follows_mouse no
mouse_warping output mouse_warping output

View file

@ -535,7 +535,7 @@ class TaskWarriorProvider(StatefulSection, InotifyUpdater):
def fetcher(self): def fetcher(self):
maxi = -math.inf maxi = -math.inf
total = 0 total = 0
for task in self.taskw.load_tasks()['pending']: for task in self.taskw.load_tasks('pending')['pending']:
urgency = task['urgency'] urgency = task['urgency']
if urgency > maxi: if urgency > maxi:
maxi = urgency maxi = urgency

View file

@ -0,0 +1,13 @@
[Unit]
Description=Remote desktop service (VNC)
[Service]
Type=simple
# wait for Xorg started by ${USER}
ExecStartPre=/bin/sh -c 'while ! pgrep -U "$USER" Xorg; do sleep 2; done'
ExecStart=/usr/bin/x0vncserver -rfbauth /home/${USER}/.vnc/passwd
# or login with your username & password
#ExecStart=/usr/bin/x0vncserver -PAMService=login -PlainUsers=${USER} -SecurityTypes=TLSPlain
[Install]
WantedBy=default.target

View file

@ -43,7 +43,7 @@ fileext = ".vcf"
[storage geoffrey_contacts_remote] [storage geoffrey_contacts_remote]
type = "carddav" type = "carddav"
url = "https://dav.frogeye.fr/caldav.php/" url = "https://cloud.frogeye.fr/remote.php/dav"
username = "geoffrey" username = "geoffrey"
password.fetch = ["command", "sh", "-c", "cat ~/.config/vdirsyncer/pass"] password.fetch = ["command", "sh", "-c", "cat ~/.config/vdirsyncer/pass"]
@ -65,6 +65,6 @@ fileext = ".ics"
[storage geoffrey_calendar_remote] [storage geoffrey_calendar_remote]
type = "caldav" type = "caldav"
url = "https://dav.frogeye.fr/caldav.php/" url = "https://cloud.frogeye.fr/remote.php/dav"
username = "geoffrey" username = "geoffrey"
password.fetch = ["command", "sh", "-c", "cat ~/.config/vdirsyncer/pass"] password.fetch = ["command", "sh", "-c", "cat ~/.config/vdirsyncer/pass"]

9
scripts/pw Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Generate strong enough password(s)
# This generates a password with ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy,
# which is a bit above the recommended standars (128 bits) while still having
# a 0 probability that the service will break because of incompatible character
pwgen 32 -s

21
scripts/totask Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import taskw
import sys
tw = taskw.TaskWarrior()
total = 0
number = 0
statuses = set()
for task in tw._get_task_objects(*sys.argv[1:], 'export'):
statuses.add(task['status'])
if task['status'] not in {'pending', 'waiting'}:
continue
urgency = task['urgency']
if urgency <= 0:
continue
total += urgency
number += 1
print(f"Σ{total:.3f} #{number}")

View file

@ -6,7 +6,19 @@ import subprocess
for root, dirs, files in os.walk("."): for root, dirs, files in os.walk("."):
for name in files: for name in files:
base, ext = os.path.splitext(name) base, ext = os.path.splitext(name)
if ext.lower() != ".zip": if name.endswith(".zip"):
cmd = ["unzip"]
elif name.endswith(".7z"):
cmd = ["7z", "e"]
elif name.endswith(".rar"):
cmd = ["unrar", "x"]
elif name.endswith('.tar'):
cmd = ["tar", "xf"]
elif name.endswith('.tar.gz'):
cmd = ["tar", "xzf"]
elif name.endswith('.tar.xz'):
cmd = ["tar", "xJf"]
else:
continue continue
filepath = os.path.join(root, name) filepath = os.path.join(root, name)
@ -15,7 +27,7 @@ for root, dirs, files in os.walk("."):
os.mkdir(dirpath) os.mkdir(dirpath)
cmd = ["unzip", os.path.realpath(filepath)] cmd.append(os.path.realpath(filepath))
r = subprocess.run(cmd, cwd=dirpath) r = subprocess.run(cmd, cwd=dirpath)
r.check_returncode() r.check_returncode()