Geoffrey Frogeye 4 years ago
parent
commit
7a7a3b68f4
  1. 4
      bashrc
  2. 6
      config/i3/config
  3. 2
      config/lemonbar/providers.py
  4. 13
      config/systemd/user/x0vncserver.service
  5. 4
      config/vdirsyncer/config
  6. 9
      scripts/pw
  7. 21
      scripts/totask
  8. 16
      scripts/unziptree

4
bashrc

@ -29,7 +29,7 @@ export PYTHONSTARTUP=$HOME/.config/pythonstartup.py
# ALIASES
# 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 grep='grep --color=tty -d skip'
alias mkdir='mkdir -v'
@ -55,7 +55,7 @@ alias please=sudo
alias ll="ls -l $LS_OPTIONS"
alias la="ls -la $LS_OPTIONS"
alias x='startx; logout'
alias nx='nvidia-startx; logout'
alias nx='nvidia-xrun; logout'
alias s='sudo -s -E'
alias tracefiles="strace -f -t -e trace=file"
alias n='urxvtc &'

6
config/i3/config

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

2
config/lemonbar/providers.py

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

13
config/systemd/user/x0vncserver.service

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

4
config/vdirsyncer/config

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

9
scripts/pw

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

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

16
scripts/unziptree

@ -6,7 +6,19 @@ import subprocess
for root, dirs, files in os.walk("."):
for name in files:
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
filepath = os.path.join(root, name)
@ -15,7 +27,7 @@ for root, dirs, files in os.walk("."):
os.mkdir(dirpath)
cmd = ["unzip", os.path.realpath(filepath)]
cmd.append(os.path.realpath(filepath))
r = subprocess.run(cmd, cwd=dirpath)
r.check_returncode()

Loading…
Cancel
Save