Browse Source

Stuff

crash2
Geoffrey Frogeye 4 years ago
parent
commit
84967eac60
  1. 2
      Xresources
  2. 8
      Xresources.d/urxvt
  3. 4
      bashrc
  4. 2
      config/i3/config
  5. 17
      config/lemonbar/providers.py
  6. 2
      config/linuxColors.sh
  7. 1
      config/llpp.conf
  8. 2
      config/mpd/mpd.conf
  9. 1
      config/systemd/user/default.target.wants/psd.service
  10. 10
      config/systemd/user/ipfs.service
  11. 1
      config/systemd/user/sockets.target.wants/urxvtd.socket
  12. 10
      config/systemd/user/urxvtd.service
  13. 9
      config/systemd/user/urxvtd.socket
  14. 3
      profile
  15. 4
      scripts/changeColors
  16. 6
      scripts/gitCheckoutModes
  17. 8
      scripts/install-prefs
  18. 6
      scripts/logstasync
  19. 72
      scripts/o
  20. 2
      scripts/pdfpages
  21. 0
      scripts/pushToTalk
  22. 0
      scripts/rankmirrors
  23. 2
      scripts/replayGain
  24. 23
      scripts/rmf
  25. 2
      scripts/tunnel
  26. 4
      scripts/updateCompressedMusic
  27. 4
      vimrc

2
Xresources

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

8
Xresources.d/urxvt

@ -37,7 +37,7 @@ URxvt.keysym.C-S-V: eval:paste_clipboard
! 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)
URxvt.keysym.C-KP_Subtract: resize-font:smaller
@ -53,3 +53,9 @@ urxvt*shading: 30
! 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
! Open URL in browser (extension: matcher)
URxvt.url-launcher: o
URxvt.matcher.button: 1
URxvt.matcher.rend.0: Uline Bold fg5

4
bashrc

@ -55,10 +55,8 @@ 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 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 n='urxvtc &'

2
config/i3/config

@ -74,7 +74,7 @@ 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/'
focus_follows_mouse yes
focus_follows_mouse no
mouse_warping output
# change focus

17
config/lemonbar/providers.py

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

2
config/linuxColors.sh

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

1
config/llpp.conf

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

2
config/mpd/mpd.conf

@ -93,7 +93,7 @@ sticker_file "~/.cache/mpd/sticker.sql"
# argument is recommended for troubleshooting, though can quickly stretch
# 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
# you set this argument to "no" to attempt to fix the problem. If this solves

1
config/systemd/user/default.target.wants/psd.service

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

10
config/systemd/user/ipfs.service

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

1
config/systemd/user/sockets.target.wants/urxvtd.socket

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

10
config/systemd/user/urxvtd.service

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

9
config/systemd/user/urxvtd.socket

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

3
profile

@ -5,8 +5,5 @@
# SSH agent
[[ -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
[ -f ~/.bashrc ] && source ~/.bashrc

4
scripts/changeColors

@ -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}.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 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)
# Reload a bunch of things to make changes immediate

6
scripts/gitCheckoutModes

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

8
scripts/install-prefs

@ -191,7 +191,7 @@ if [ $TERMUX == 1 ]; then
inst tsu
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
if [ $ARCH == 1 ]; then
inst bash-completion
@ -261,7 +261,7 @@ if [ $EXTRA == 1 ]; then
fi
# 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 youtube-dl megatools speedtest-cli
systemdUserUnit syncthing
@ -291,11 +291,11 @@ if [ $EXTRA == 1 ]; then
# Extra GUI
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
inst simplescreenrecorder mpc
altInst vimpc-git ashuffle-git ttf-emojione-color
altInst vimpc-git ashuffle-git ttf-emojione-color puddletag
# FPGA goodness
inst gtkwave

6
scripts/logstasync

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

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

2
scripts/pdfpages

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

0
scripts/pushToTalk

0
scripts/rankmirrors

2
scripts/replayGain

@ -18,7 +18,7 @@ log = logging.getLogger()
FORCE = '-f' in sys.argv
if FORCE:
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):
ext = os.path.splitext(f)[1][1:].lower()

23
scripts/rmf

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

2
scripts/tunnel

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

4
scripts/updateCompressedMusic

@ -10,8 +10,8 @@ coloredlogs.install(level='DEBUG', fmt='%(levelname)s %(message)s')
log = logging.getLogger()
# Constants
SOURCE_FOLDER = os.path.join(os.path.expanduser("~"), "Musique")
OUTPUT_FOLDER = os.path.join(os.path.expanduser("~"), ".MusiqueCompressed")
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"]

4
vimrc

@ -96,6 +96,10 @@ nmap <F3> :Autoformat<CR>
let g:pymode_virtualenv = 1
let g:pymode_lint_ignore = ["W0401"]
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 :/
let g:pymode_motion = 0

Loading…
Cancel
Save