diff --git a/bashrc b/bashrc index b85ce1f..65c6a1e 100644 --- a/bashrc +++ b/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 &' diff --git a/config/i3/config b/config/i3/config index e4cd3d7..b42ea20 100644 --- a/config/i3/config +++ b/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 diff --git a/config/lemonbar/providers.py b/config/lemonbar/providers.py index c229607..3211264 100755 --- a/config/lemonbar/providers.py +++ b/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 diff --git a/config/systemd/user/x0vncserver.service b/config/systemd/user/x0vncserver.service new file mode 100644 index 0000000..5c06eb8 --- /dev/null +++ b/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 diff --git a/config/vdirsyncer/config b/config/vdirsyncer/config index 7ef5e40..0f6f246 100644 --- a/config/vdirsyncer/config +++ b/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"] diff --git a/scripts/pw b/scripts/pw new file mode 100755 index 0000000..3bd63fe --- /dev/null +++ b/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 diff --git a/scripts/totask b/scripts/totask new file mode 100755 index 0000000..841595d --- /dev/null +++ b/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}") diff --git a/scripts/unziptree b/scripts/unziptree index d109c0b..5cf5ab9 100755 --- a/scripts/unziptree +++ b/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()