Compare commits

...

2 commits

14 changed files with 2518 additions and 10 deletions

20
bashrc
View file

@ -24,6 +24,9 @@ export JAVA_FONTS=/usr/share/fonts/TTF
export ANDROID_HOME=/opt/android-sdk
export GOPATH=$HOME/.go
export XDG_CONFIG_HOME=$HOME/.config
export ARDUINO=/usr/share/arduino
export ARDUINO_DIR=$ARDUINO
export ARDMK_VENDOR=archlinux-arduino
# ALIASES
@ -39,6 +42,12 @@ alias rm='rm -Iv --one-file-system'
alias free='free -m'
alias df='df -h'
alias pacman='pacman --color auto'
alias dmesg='dmesg --ctime'
# Frequent mistakes
alias systemclt=systemctl
alias docker='sudo docker'
alias docker-compose='sudo docker-compose'
# Shortcuts for commonly used commands
alias ll="ls -l $LS_OPTIONS"
@ -49,6 +58,10 @@ alias s='sudo -s -E'
alias po='eval $(proxy off)'
alias nw="sudo systemctl restart NetworkManager"
alias mc="machines"
alias vpn="sudo systemctl start openvpn-client@$HOSTNAME"
alias vpno="sudo systemctl stop openvpn-client@$HOSTNAME"
alias vpns="sudo systemctl status openvpn-client@$HOSTNAME"
alias vpnr="sudo systemctl restart openvpn-client@$HOSTNAME"
# Superseding commands with better ones if they are present
if which vim &> /dev/null; then
alias vi='vim'
@ -73,7 +86,7 @@ shopt -s extglob
shopt -s histappend
shopt -s hostcomplete
export HISTSIZE=10000
export HISTSIZE=100000
export HISTFILESIZE=${HISTSIZE}
export HISTCONTROL=ignoreboth
@ -111,3 +124,8 @@ fi
[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly)
# Node Version Manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View file

@ -1,14 +1,14 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=47
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=0
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
show_program_path=0
highlight_base_name=0
highlight_megabytes=0
highlight_threads=1

View file

@ -51,7 +51,7 @@ set $up_bar killall -USR1 i3status
# Start Applications
bindsym $mod+Return exec xterm
bindsym $mod+p exec thunar
bindsym $mod+m exec qutebrowser
bindsym $mod+m exec qutebrowser --override-restore
# Volume control
#bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+ unmute; exec $up_bar

View file

@ -36,7 +36,7 @@ ethernet eth0 {
ethernet usb0 {
# if you use %speed, i3status requires the cap_net_admin capability
format_up = " %ip"
format_down = ""
format_down = "📱"
}
cpu_usage {
@ -56,11 +56,11 @@ battery 0 {
path_exists VPN {
# path exists when a VPN tunnel launched by nmcli/nm-applet is active
path = "/proc/sys/net/ipv4/conf/tun0"
format = ""
format = "🔐"
}
tztime local {
format = "%d/%m/%Y %H:%M:%S"
format = "🕘 %d/%m/%Y %H:%M:%S"
timezone = "Europe/Paris"
}
@ -76,8 +76,8 @@ disk "/home" {
format = " %avail / %total"
}
volume master {
format = " %volume"
format_muted = " %volume"
format = "🔈 %volume"
format_muted = "🔇 %volume"
device = "default"
mixer = "Master"
mixer_idx = 0

View file

View file

@ -0,0 +1,695 @@
# vim: ft=conf
#
# In this config file, qutebrowser's key bindings are configured.
# The format looks like this:
#
# [keymode]
#
# command
# keychain
# keychain2
# ...
#
# All blank lines and lines starting with '#' are ignored.
# Inline-comments are not permitted.
#
# keymode is a comma separated list of modes in which the key binding should be
# active. If keymode starts with !, the key binding is active in all modes
# except the listed modes.
#
# For special keys (can't be part of a keychain), enclose them in `<`...`>`.
# For modifiers, you can use either `-` or `+` as delimiters, and these names:
#
# * Control: `Control`, `Ctrl`
# * Meta: `Meta`, `Windows`, `Mod4`
# * Alt: `Alt`, `Mod1`
# * Shift: `Shift`
#
# For simple keys (no `<>`-signs), a capital letter means the key is pressed
# with Shift. For special keys (with `<>`-signs), you need to explicitly add
# `Shift-` to match a key pressed with shift.
#
# Note that default keybindings are always bound, and need to be explicitly
# unbound if you wish to remove them:
#
# <unbound>
# keychain
# keychain2
# ...
[!normal]
leave-mode
<escape>
<ctrl-[>
[normal]
# Keybindings for normal mode.
clear-keychain ;; search ;; fullscreen --leave
<escape>
set-cmd-text -s :open
o
set-cmd-text :open {url:pretty}
go
set-cmd-text -s :open -t
O
set-cmd-text :open -t -i {url:pretty}
gO
set-cmd-text -s :open -b
xo
set-cmd-text :open -b -i {url:pretty}
xO
set-cmd-text -s :open -w
wo
set-cmd-text :open -w {url:pretty}
wO
set-cmd-text /
/
set-cmd-text ?
?
set-cmd-text :
:
open -t
ga
<ctrl-t>
open -w
<ctrl-n>
tab-close
d
<ctrl-w>
tab-close -o
D
tab-only
co
tab-focus
T
tab-move
gm
tab-move -
gl
tab-move +
gr
tab-next
J
<ctrl-pgdown>
tab-prev
K
<ctrl-pgup>
tab-clone
gC
reload
r
<f5>
reload -f
R
<ctrl-f5>
back
H
<back>
back -t
th
back -w
wh
forward
L
<forward>
forward -t
tl
forward -w
wl
fullscreen
<f11>
hint
f
hint all tab
F
hint all window
wf
hint all tab-bg
;b
hint all tab-fg
;f
hint all hover
;h
hint images
;i
hint images tab
;I
hint links fill :open {hint-url}
;o
hint links fill :open -t -i {hint-url}
;O
hint links yank
;y
hint links yank-primary
;Y
hint --rapid links tab-bg
;r
hint --rapid links window
;R
hint links download
;d
hint inputs
;t
scroll left
h
scroll down
j
scroll up
k
scroll right
l
undo
u
<ctrl-shift-t>
scroll-perc 0
gg
scroll-perc
G
search-next
n
search-prev
N
enter-mode insert
i
enter-mode caret
v
enter-mode set_mark
`
enter-mode jump_mark
'
yank
yy
yank -s
yY
yank title
yt
yank title -s
yT
yank domain
yd
yank domain -s
yD
yank pretty-url
yp
yank pretty-url -s
yP
open -- {clipboard}
pp
open -- {primary}
pP
open -t -- {clipboard}
Pp
open -t -- {primary}
PP
open -w -- {clipboard}
wp
open -w -- {primary}
wP
quickmark-save
m
set-cmd-text -s :quickmark-load
b
set-cmd-text -s :quickmark-load -t
B
set-cmd-text -s :quickmark-load -w
wb
bookmark-add
M
set-cmd-text -s :bookmark-load
gb
set-cmd-text -s :bookmark-load -t
gB
set-cmd-text -s :bookmark-load -w
wB
save
sf
set-cmd-text -s :set
ss
set-cmd-text -s :set -t
sl
set-cmd-text -s :bind
sk
zoom-out
-
zoom-in
+
zoom
=
navigate prev
[[
navigate next
]]
navigate prev -t
{{
navigate next -t
}}
navigate up
gu
navigate up -t
gU
navigate increment
<ctrl-a>
navigate decrement
<ctrl-x>
inspector
wi
download
gd
download-cancel
ad
download-clear
cd
view-source
gf
set-cmd-text -s :buffer
gt
tab-focus last
<ctrl-tab>
enter-mode passthrough
<ctrl-v>
quit
<ctrl-q>
scroll-page 0 1
<ctrl-f>
scroll-page 0 -1
<ctrl-b>
scroll-page 0 0.5
<ctrl-d>
scroll-page 0 -0.5
<ctrl-u>
tab-focus 1
<alt-1>
tab-focus 2
<alt-2>
tab-focus 3
<alt-3>
tab-focus 4
<alt-4>
tab-focus 5
<alt-5>
tab-focus 6
<alt-6>
tab-focus 7
<alt-7>
tab-focus 8
<alt-8>
tab-focus 9
<alt-9>
home
<ctrl-h>
stop
<ctrl-s>
print
<ctrl-alt-p>
open qute:settings
Ss
follow-selected
<return>
<ctrl-m>
<ctrl-j>
<shift-return>
<enter>
<shift-enter>
follow-selected -t
<ctrl-return>
<ctrl-enter>
repeat-command
.
record-macro
q
run-macro
@
wq
ZZ
[insert]
# Keybindings for insert mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `open-editor`: Open a texteditor with the focused field.
# * `paste-primary`: Paste primary selection at cursor position.
open-editor
<ctrl-e>
insert-text {primary}
<shift-ins>
[hint]
# Keybindings for hint mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `follow-hint`: Follow the currently selected hint.
follow-hint
<return>
<ctrl-m>
<ctrl-j>
<shift-return>
<enter>
<shift-enter>
hint --rapid links tab-bg
<ctrl-r>
hint links
<ctrl-f>
hint all tab-bg
<ctrl-b>
[command]
# Keybindings for command mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `command-history-prev`: Switch to previous command in history.
# * `command-history-next`: Switch to next command in history.
# * `completion-item-focus`: Select another item in completion.
# * `command-accept`: Execute the command currently in the commandline.
command-history-prev
<ctrl-p>
command-history-next
<ctrl-n>
completion-item-focus prev
<shift-tab>
<up>
completion-item-focus next
<tab>
<down>
completion-item-focus next-category
<ctrl-tab>
completion-item-focus prev-category
<ctrl-shift-tab>
completion-item-del
<ctrl-d>
command-accept
<return>
<ctrl-m>
<ctrl-j>
<shift-return>
<enter>
<shift-enter>
[prompt]
# Keybindings for prompts in the status line.
# You can bind normal keys in this mode, but they will be only active
# when a yes/no-prompt is asked. For other prompt modes, you can only
# bind special keys.
# Useful hidden commands to map in this section:
# * `prompt-accept`: Confirm the entered value.
# * `prompt-accept yes`: Answer yes to a yes/no question.
# * `prompt-accept no`: Answer no to a yes/no question.
prompt-accept
<return>
<ctrl-m>
<ctrl-j>
<shift-return>
<enter>
<shift-enter>
prompt-accept yes
y
prompt-accept no
n
prompt-open-download
<ctrl-x>
prompt-item-focus prev
<shift-tab>
<up>
prompt-item-focus next
<tab>
<down>
[command,prompt]
rl-backward-char
<ctrl-b>
rl-forward-char
<ctrl-f>
rl-backward-word
<alt-b>
rl-forward-word
<alt-f>
rl-beginning-of-line
<ctrl-a>
rl-end-of-line
<ctrl-e>
rl-unix-line-discard
<ctrl-u>
rl-kill-line
<ctrl-k>
rl-kill-word
<alt-d>
rl-unix-word-rubout
<ctrl-w>
rl-backward-kill-word
<alt-backspace>
rl-yank
<ctrl-y>
rl-delete-char
<ctrl-?>
rl-backward-delete-char
<ctrl-h>
[caret]
toggle-selection
v
<space>
drop-selection
<ctrl-space>
enter-mode normal
c
move-to-next-line
j
move-to-prev-line
k
move-to-next-char
l
move-to-prev-char
h
move-to-end-of-word
e
move-to-next-word
w
move-to-prev-word
b
move-to-start-of-next-block
]
move-to-start-of-prev-block
[
move-to-end-of-next-block
}
move-to-end-of-prev-block
{
move-to-start-of-line
0
move-to-end-of-line
$
move-to-start-of-document
gg
move-to-end-of-document
G
yank selection -s
Y
yank selection
y
<return>
<ctrl-m>
<ctrl-j>
<shift-return>
<enter>
<shift-enter>
scroll left
H
scroll down
J
scroll up
K
scroll right
L

File diff suppressed because it is too large Load diff

1
scripts/.gitignore vendored
View file

@ -1 +1,2 @@
sct
node_modules

52
scripts/html2pdf Executable file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env node
// Imports
var fs = require('fs');
var pdf = require('html-pdf');
var yargs = require('yargs');
// Understanding
var argv = yargs
.usage("Usage: $0 -o out.pdf [options]")
.example('$0 -i doc.pdf -o doc.pdf', 'Convert doc.html to PDF using the default values')
.help('h')
.alias('h', 'help')
.describe('i', 'Input file')
.alias('i', 'input')
.default('i', '/dev/stdin')
.describe('o', 'Output file')
.alias('o', 'output')
.describe('t', 'Title of file')
.alias('t', 'title')
.default('t', 'Sans titre')
.demandOption(['o'])
.argv;
// Settings
options = {
"base": "file://" + process.cwd() + '/',
"format": "A4",
"orientation": "portrait",
"border": "2cm",
"footer": {
"height": "10mm",
"contents": {
default: '<div style="text-align: left; float: left;">' + argv.title + '</div> <div style="text-align:right; float: right;">{{page}}/{{pages}}</div>',
}
},
}
// Reading
htmlString = fs.readFileSync(argv.i, "utf8");
// Conversion
pdf.create(htmlString, options).toFile(argv.o, function(err, res) {
if (err) console.error(err);
});

113
scripts/md2html Executable file
View file

@ -0,0 +1,113 @@
#!/usr/bin/env node
// Imports
var fs = require('fs');
var marked = require('marked');
var highlight = require('highlight.js');
var katex = require('katex');
var yargs = require('yargs');
var extend = require('util')._extend;
// Constants
var template = '<!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="UTF-8"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/xcode.min.css" integrity="sha256-OED7Gmqde0cMVVeo1zVd+3fBD4EST32D4h9YT7KY0aY=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous"> <style type="text/css"> image { max-width: 100 % } </style> <title>%TITLE%</title> </head> <body> <main class="page-content" aria-label="Content"> %BODY% </main> </body> </html>'
// Understanding
var argv = yargs
.usage("Usage: $0 [options]")
.example('$0 -i doc.md -o doc.html', 'Convert doc.md to HTML using the default template')
.help('h')
.alias('h', 'help')
.describe('i', 'Input file')
.alias('i', 'input')
.default('i', '/dev/stdin')
.describe('o', 'Output file')
.alias('o', 'output')
.default('o', '/dev/stdout')
.describe('t', 'Template file (%BODY% is replaced by the text)')
.alias('t', 'template')
.argv;
if (argv.t) {
template = fs.readFileSync(argv.t, "utf8");
}
// Settings
var extraLangages = {
avrpseudo: function (hljs) {
lang = extend({}, highlight.getLanguage('avrasm'));
lang.keywords.keyword += ' Si Alors Sinon FinSi TantQue FinTantQue Pour FinPour allant de à ←';
lang.keywords.keyword += ' Lire Sortir sur Appeler Retourner';
lang.keywords.keyword += ' DecalerDroite DecalerGauche';
lang.keywords.keyword += ' Incrementer Decrementer';
lang.keywords.built_in += ' vrai faux';
lang.contains.push({
className: 'meta',
begin: /Configurer.+/,
end: /\n/,
});
return lang;
},
avrasmplus: function (hljs) {
lang = extend({}, highlight.getLanguage('avrasm'));
lang.keywords.keyword += ' si saut alors et ou if then goto && || <-';
lang.contains.push({
className: 'meta',
begin: /@\w+/,
});
return lang;
},
};
for (lang in extraLangages) {
// This must be done before any call to highlight.highlight :/
highlight.registerLanguage(lang, extraLangages[lang]);
}
var renderer = new marked.Renderer();
marked.setOptions({
highlight: function (code, lang) {
if (highlight.getLanguage(lang)) {
return highlight.highlight(lang, code).value;
} else {
// if (extraLangages[lang]) {
// highlight.registerLanguage(lang, extraLangages[lang]);
// return highlight.highlight(lang, code).value;
// } else {
// }
console.warn("Unknown language: " + lang);
return highlight.highlightAuto(code).value;
}
}
});
// Processing
markdownString = fs.readFileSync(argv.i, "utf8");
// TeX
markdownString = markdownString.replace(/\\\$/g, '&dollar;')
markdownString = markdownString.replace(/\$\$([\s\S]+)\$\$/gm, function(glob, formula) {
return katex.renderToString(formula, {displayMode: true});
});
markdownString = markdownString.replace(/\$([^$]+)\$/g, function(glob, formula) {
return katex.renderToString(formula, {displayMode: false});
});
// Conversion
htmlString = marked(markdownString, {renderer: renderer});
fullHtmlString = template.replace('%BODY%', htmlString);
// Saving
if (argv.o == '/dev/stdout') {
console.log(fullHtmlString);
} else {
fs.writeFileSync(argv.o, fullHtmlString);
}

22
scripts/package.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "geoffreyfrogeye-dotfiles-scripts",
"version": "1.0.0",
"description": "Stores dependencies used for GeoffreyFrogeye's dotfiles scripts.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://git.frogeye.fr/geoffrey/dotfiles"
},
"author": "GeoffreyFrogeye",
"license": "GPL-3.0",
"dependencies": {
"highlight.js": "^9.11.0",
"html-pdf": "^2.1.0",
"katex": "^0.7.1",
"marked": "^0.3.6",
"yargs": "^8.0.1"
}
}

5
scripts/remcrlf Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Removes CRLF (^M or \r) from a file
sed -e "s/^M//" $1 -i

20
scripts/transfer Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env sh
if [ $# -eq 0 ]
then
echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
fi
tmpfile=$( mktemp -t transferXXX )
if tty -s
then
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
else
curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile
fi
cat $tmpfile
rm -f $tmpfile

2
vimrc
View file

@ -44,7 +44,7 @@ nmap <F7> :UndotreeToggle<CR>:UndotreeFocus<CR>
""" CTRLP """
let g:ctrlp_custom_ignore = {
\ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor)$',
\ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor|output)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
\ }