This commit is contained in:
Geoffrey Frogeye 2018-11-24 13:45:14 +01:00
parent f9849dfcfa
commit 84967eac60
27 changed files with 180 additions and 25 deletions

View file

@ -1,4 +1,4 @@
#include ".Xresources.d/xft" #include ".Xresources.d/xft"
#include ".Xresources.d/theme" ! #include ".Xresources.d/theme"
#include ".Xresources.d/xterm" #include ".Xresources.d/xterm"
#include ".Xresources.d/urxvt" #include ".Xresources.d/urxvt"

View file

@ -37,7 +37,7 @@ URxvt.keysym.C-S-V: eval:paste_clipboard
! Extensions ! Extensions
URxvt.perl-ext-common: resize-font,bell-command,readline,selection URxvt.perl-ext-common: resize-font,bell-command,readline,selection,matcher
! Changing font size on the fly (extension: resize-font, package: urxvt-resize-font-git) ! Changing font size on the fly (extension: resize-font, package: urxvt-resize-font-git)
URxvt.keysym.C-KP_Subtract: resize-font:smaller URxvt.keysym.C-KP_Subtract: resize-font:smaller
@ -53,3 +53,9 @@ urxvt*shading: 30
! Bell command (extension: bell-command) ! Bell command (extension: bell-command)
URxvt.bell-command: play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null URxvt.bell-command: play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null
! Open URL in browser (extension: matcher)
URxvt.url-launcher: o
URxvt.matcher.button: 1
URxvt.matcher.rend.0: Uline Bold fg5

4
bashrc
View file

@ -55,10 +55,8 @@ 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 s='sudo -s -E' alias s='sudo -s -E'
alias po='eval $(proxy off)'
alias nw="sudo systemctl restart NetworkManager"
alias mc="machines"
alias tracefiles="strace -f -t -e trace=file" alias tracefiles="strace -f -t -e trace=file"
alias n='urxvtc &' alias n='urxvtc &'

View file

@ -74,7 +74,7 @@ bindsym Print exec scrot -ue 'mv $f ~/Screenshots/'
bindsym $mod+Print exec scrot -e 'mv $f ~/Screenshots/' bindsym $mod+Print exec scrot -e 'mv $f ~/Screenshots/'
bindsym Ctrl+Print exec sleep 1 && scrot -se 'mv $f ~/Screenshots/' bindsym Ctrl+Print exec sleep 1 && scrot -se 'mv $f ~/Screenshots/'
focus_follows_mouse yes focus_follows_mouse no
mouse_warping output mouse_warping output
# change focus # change focus

View file

@ -44,8 +44,8 @@ def randomColor(seed=0):
class TimeProvider(StatefulSection, PeriodicUpdater): class TimeProvider(StatefulSection, PeriodicUpdater):
FORMATS = ["%H:%M", FORMATS = ["%H:%M",
"%d/%m %H:%M:%S", "%m-%d %H:%M:%S",
"%a %d/%m/%y %H:%M:%S"] "%a %y-%m-%d %H:%M:%S"]
NUMBER_STATES = len(FORMATS) NUMBER_STATES = len(FORMATS)
DEFAULT_STATE = 1 DEFAULT_STATE = 1
@ -666,11 +666,20 @@ class I3WorkspacesProviderSection(Section):
self.parent = parent self.parent = parent
self.setName(name) self.setName(name)
self.setDecorators(clickLeft=self.switchTo) self.setDecorators(clickLeft=self.switchTo)
self.tempText = None
def empty(self): def empty(self):
self.updateTheme(self.parent.themeNormal) self.updateTheme(self.parent.themeNormal)
self.updateText(None) self.updateText(None)
def tempShow(self):
self.updateText(self.tempText)
def tempEmpty(self):
self.tempText = self.dstText[1]
self.updateText(None)
class I3WorkspacesProvider(Section, I3Updater): class I3WorkspacesProvider(Section, I3Updater):
# TODO FEAT Multi-screen # TODO FEAT Multi-screen
@ -735,11 +744,11 @@ class I3WorkspacesProvider(Section, I3Updater):
if e.change == 'default': if e.change == 'default':
self.modeSection.updateText(None) self.modeSection.updateText(None)
for section in self.sections.values(): for section in self.sections.values():
section.show() section.tempShow()
else: else:
self.modeSection.updateText(e.change) self.modeSection.updateText(e.change)
for section in self.sections.values(): for section in self.sections.values():
section.empty() section.tempEmpty()
def __init__(self, theme=0, themeFocus=3, themeUrgent=1, themeMode=2, customNames=dict()): def __init__(self, theme=0, themeFocus=3, themeUrgent=1, themeMode=2, customNames=dict()):
I3Updater.__init__(self) I3Updater.__init__(self)

View file

@ -19,6 +19,6 @@ if [ "$TERM" = "linux" ]; then
\e]PFcfd0c2 \e]PFcfd0c2
" "
# get rid of artifacts # get rid of artifacts
clear # clear
fi fi

1
config/llpp.conf Normal file
View file

@ -0,0 +1 @@
savepath-command='echo %s'

View file

@ -93,7 +93,7 @@ sticker_file "~/.cache/mpd/sticker.sql"
# argument is recommended for troubleshooting, though can quickly stretch # argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage. # available resources on limited hardware storage.
# #
log_level "verbose" log_level "default"
# #
# If you have a problem with your MP3s ending abruptly it is recommended that # If you have a problem with your MP3s ending abruptly it is recommended that
# you set this argument to "no" to attempt to fix the problem. If this solves # you set this argument to "no" to attempt to fix the problem. If this solves

View file

@ -0,0 +1 @@
/usr/lib/systemd/user/psd.service

View file

@ -0,0 +1,10 @@
[Unit]
Description=IPFS daemon
After=network.target
[Service]
ExecStart=/usr/bin/ipfs daemon
Restart=on-failure
[Install]
WantedBy=default.target

View file

@ -0,0 +1 @@
/home/geoffrey/.config/systemd/user/urxvtd.socket

View file

@ -0,0 +1,10 @@
[Unit]
Description=Urxvt Terminal Daemon
Requires=urxvtd.socket
[Service]
ExecStart=/usr/bin/urxvtd -o -q
Environment=RXVT_SOCKET=%t/urxvtd-%H
[Install]
WantedBy=default.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=urxvt daemon (socket activation)
Documentation=man:urxvtd(1) man:urxvt(1)
[Socket]
ListenStream=%t/urxvtd-%H
[Install]
WantedBy=sockets.target

View file

@ -5,8 +5,5 @@
# SSH agent # SSH agent
[[ -z "$SSH_AUTH_SOCK" && -x "$(which ssh-agent)" ]] && eval `ssh-agent -s` &> /dev/null [[ -z "$SSH_AUTH_SOCK" && -x "$(which ssh-agent)" ]] && eval `ssh-agent -s` &> /dev/null
# TTY Colors
[ -f "$HOME/.config/linuxColors.sh" ] && . "$HOME/.config/linuxColors.sh"
# Bashrc # Bashrc
[ -f ~/.bashrc ] && source ~/.bashrc [ -f ~/.bashrc ] && source ~/.bashrc

View file

@ -33,9 +33,11 @@ curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/4a17eea8a39f72
curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.rasi" > ~/.config/rofi/theme.rasi curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.rasi" > ~/.config/rofi/theme.rasi
curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.config" > ~/.config/rofi/theme.config curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.config" > ~/.config/rofi/theme.config
# qutebrowser
curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/master/themes/base16-${scheme}.config.py" > ~/.config/qutebrowser/theme.py
# TODO dunst (template online, but not to my liking) # TODO dunst (template online, but not to my liking)
# TODO bar (might change bar in the future, so...) # TODO bar (might change bar in the future, so...)
# TODO qutebrowser (need to fiddle with the config thing)
# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config) # TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config)
# Reload a bunch of things to make changes immediate # Reload a bunch of things to make changes immediate

6
scripts/gitCheckoutModes Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# From https://stackoverflow.com/a/2083563
git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -d'\n' chmod +x
git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x

View file

@ -191,7 +191,7 @@ if [ $TERMUX == 1 ]; then
inst tsu inst tsu
fi fi
fi fi
inst moreutils screen ncdu lsof htop proxytunnel pv curl wget netcat mosh bash-completion rsync pwgen fzf highlight inst moreutils screen ncdu lsof htop proxytunnel pv curl wget socat mosh bash-completion rsync pwgen fzf highlight
# TODO Test those who are on Debian machines and those who aren't # TODO Test those who are on Debian machines and those who aren't
if [ $ARCH == 1 ]; then if [ $ARCH == 1 ]; then
inst bash-completion inst bash-completion
@ -261,7 +261,7 @@ if [ $EXTRA == 1 ]; then
fi fi
# Extra CLI # Extra CLI
inst ffmpeg optipng syncthing mutt msmtp notmuch mbsync jq lynx inst ffmpeg optipng syncthing mutt msmtp notmuch mbsync jq lynx strace
inst unzip unrar jdupes bedup p7zip inst unzip unrar jdupes bedup p7zip
inst youtube-dl megatools speedtest-cli inst youtube-dl megatools speedtest-cli
systemdUserUnit syncthing systemdUserUnit syncthing
@ -291,11 +291,11 @@ if [ $EXTRA == 1 ]; then
# Extra GUI # Extra GUI
if [ $GUI == 1 ]; then if [ $GUI == 1 ]; then
inst vlc gimp inkscape mpd thunar musescore evince pdfpc texlive-{most,lang} inst vlc gimp inkscape mpd thunar musescore llpp pdfpc texlive-{most,lang}
if [ $ARCH == 1 ]; then if [ $ARCH == 1 ]; then
inst simplescreenrecorder mpc inst simplescreenrecorder mpc
altInst vimpc-git ashuffle-git ttf-emojione-color altInst vimpc-git ashuffle-git ttf-emojione-color puddletag
# FPGA goodness # FPGA goodness
inst gtkwave inst gtkwave

6
scripts/logstasync Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
serv="$1"
shift
ssh "$serv" 'sudo tail --follow=name --retry --quiet $(sudo find $(echo /var/log/$([ -d /var/log/httpd/ ] && echo httpd || echo apache2)) -type f -name *access.log)' | logstalgia --sync "$@"

72
scripts/o Executable file
View file

@ -0,0 +1,72 @@
#!/usr/bin/env python3
import os
import sys
import magic
import subprocess
import urllib.request
import tempfile
# Getting what's needed
path = sys.argv[1]
# Getting the MIME type
ishttp = path.startswith('http')
buf = None
if ishttp:
buf = urllib.request.urlopen(path)
chunk = buf.read(1024)
mime = magic.from_buffer(chunk, mime=True)
else:
assert os.path.isfile(path), f"Not a file: {path}"
path = os.path.realpath(path)
mime = magic.from_file(path, mime=True)
mime = tuple(mime.split('/'))
assert len(mime) == 2
graphical = not not os.environ.get('DISPLAY')
# Some energumens
if mime[0] == "application" and mime[1] in ("json", "javascript"):
mime = ("text", mime[1])
# Determine stuff
ex = None # Executable needed to open the file
forcelocal = False # If we need to copy the file locally before opening it
isterm = False # Executable should run in a terminal
if mime[0] == "text":
if not ishttp:
ex = os.environ.get('VISUAL' if graphical else 'EDITOR', None)
isterm = True
elif mime[0] == "image":
ex = "feh"
elif mime[0] in ("audio", "video"):
ex = "mpv"
isterm = True
elif mime == ("application", "pdf"):
ex = "llpp.inotify"
forcelocal = True
# Open stuff
tmp = None
if ex:
if forcelocal and ishttp:
tmp = tempfile.NamedTemporaryFile(prefix='o')
tmp.write(chunk)
tmp.write(buf.read())
path = tmp.name
else:
ex = 'xdg-open'
if ishttp:
ex = os.environ.get('BROWSER', ex)
if buf:
buf.close()
# TODO Launch a new terminal window for some
p = subprocess.run([ex, path])
if tmp:
tmp.close()
sys.exit(p.returncode)

View file

@ -1,7 +1,7 @@
#!/usr/bin/bash #!/usr/bin/bash
# From https://stackoverflow.com/a/14736593 # From https://stackoverflow.com/a/14736593
for FILE in $* for FILE in "$@"
do do
printf "$FILE: " printf "$FILE: "
pdftk "$FILE" dump_data | grep NumberOfPages | awk '{print $2}' pdftk "$FILE" dump_data | grep NumberOfPages | awk '{print $2}'

0
scripts/pushToTalk Normal file → Executable file
View file

0
scripts/rankmirrors Normal file → Executable file
View file

View file

@ -18,7 +18,7 @@ log = logging.getLogger()
FORCE = '-f' in sys.argv FORCE = '-f' in sys.argv
if FORCE: if FORCE:
sys.argv.remove('-f') sys.argv.remove('-f')
SOURCE_FOLDER = os.path.realpath(sys.argv[1]) if len(sys.argv) >= 2 else os.path.join(os.path.expanduser("~"), "Musique") SOURCE_FOLDER = os.path.realpath(sys.argv[1]) if len(sys.argv) >= 2 else os.path.join(os.path.expanduser("~"), "Musiques")
def isMusic(f): def isMusic(f):
ext = os.path.splitext(f)[1][1:].lower() ext = os.path.splitext(f)[1][1:].lower()

23
scripts/rmf Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
# Rename sync-conflict files to normal files
# WARNING Does not check for conclicts
import os
import re
for root, dirs, files in os.walk('.'):
for f in files:
if '.sync-conflict' not in f:
continue
nf = re.sub('.sync-conflict-\d{8}-\d{6}-\w{7}', '', f)
F = os.path.join(root, f)
NF = os.path.join(root, nf)
if os.path.exists(NF):
print(f"'{F}' → '{NF}': file already exists")
else:
print(f"'{F}' → '{NF}': done")
os.rename(F, NF)

View file

@ -8,7 +8,7 @@ host="$1"
port="$2" port="$2"
if [ -z "$http_proxy" ]; then if [ -z "$http_proxy" ]; then
nc "$host" "$port" socat "TCP:$host:$port" -
else else
proxy=$(echo "$http_proxy" | sed 's/^https\?:\/\///' | sed 's/\/$//') proxy=$(echo "$http_proxy" | sed 's/^https\?:\/\///' | sed 's/\/$//')
port=443 # Most won't want this port=443 # Most won't want this

View file

@ -10,8 +10,8 @@ coloredlogs.install(level='DEBUG', fmt='%(levelname)s %(message)s')
log = logging.getLogger() log = logging.getLogger()
# Constants # Constants
SOURCE_FOLDER = os.path.join(os.path.expanduser("~"), "Musique") SOURCE_FOLDER = os.path.join(os.path.expanduser("~"), "Musiques")
OUTPUT_FOLDER = os.path.join(os.path.expanduser("~"), ".MusiqueCompressed") OUTPUT_FOLDER = os.path.join(os.path.expanduser("~"), ".musicCompressed")
CONVERSIONS = {"flac": "opus"} CONVERSIONS = {"flac": "opus"}
FORBIDDEN_EXTENSIONS = ["jpg", "pdf", "ffs_db"] FORBIDDEN_EXTENSIONS = ["jpg", "pdf", "ffs_db"]
FORGIVEN_FILENAMES = ["cover.jpg"] FORGIVEN_FILENAMES = ["cover.jpg"]

4
vimrc
View file

@ -96,6 +96,10 @@ nmap <F3> :Autoformat<CR>
let g:pymode_virtualenv = 1 let g:pymode_virtualenv = 1
let g:pymode_lint_ignore = ["W0401"] let g:pymode_lint_ignore = ["W0401"]
let g:pymode_lint_cwindow = 0 let g:pymode_lint_cwindow = 0
let g:pymode_lint_on_fly = 1
" let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe']
let g:pymode_lint_checkers = ['pyflakes', 'mccabe']
" Pymode temporarly disabled for battle dev
" TODO Even with magic pymod_motion complains about the option `magic&` being not set :/ " TODO Even with magic pymod_motion complains about the option `magic&` being not set :/
let g:pymode_motion = 0 let g:pymode_motion = 0