diff options
89 files changed, 5423 insertions, 804 deletions
diff --git a/.Xresources b/.Xresources index b1c3e3d..3745cc9 100644 --- a/.Xresources +++ b/.Xresources @@ -1,3 +1,6 @@ +! Better to use multiples of 96 +Xft.dpi: 96 + ! uncomment following to display corretly using font 10x20 ! URxvt.boldFont: URxvt.transparent: false @@ -7,9 +10,11 @@ URxvt.colorBD: blue3 URxvt.colorUL: magenta3 URxvt.cursorColor: red ! URxvt.color12: rgb:5c/5c/ff -!URxvt.font: xft:Mono:size=12 -!URxvt.letterSpace: -1 Urxvt.font: 6x13 +!URxvt.font: xft:Mono:size=12 +!URxvt.font: xft:Mono:size=10 +!URxvt.letterSpace: 0 +URxvt.letterSpace: 0 URxvt.perl-ext-common: font-size URxvt.keysym.C-Prior: font-size:increase URxvt.keysym.C-Next: font-size:decrease @@ -17,11 +22,20 @@ URxvt.keysym.C-Next: font-size:decrease !URxvt.background: black xterm*termName: xterm-256color +xterm*internalBorder: 4 xterm*VT100.Translations: #override \ + <Key> F11: fullscreen(toggle) \n\ Ctrl <Key> Next: smaller-vt-font() \n\ - Ctrl <Key> Prior: larger-vt-font() \n -xterm*faceName: DejaVu Sans Mono -xterm*faceSize: 10 + Ctrl <Key> Prior: larger-vt-font() \n\ + Shift Ctrl <Key> C: copy-selection(CLIPBOARD) \n\ + Shift Ctrl <Key> V: insert-selection(CLIPBOARD) \n +! Meta <Key> minus: smaller-vt-font() \n\ +! Meta <Key> equal: larger-vt-font() \n +xterm*cursorColor: red +!xterm*visualBell: true +!xterm*geometry: 100x32 +!xterm*faceName: DejaVu Sans Mono +!xterm*faceSize: 10 ! xterm*font: 7x14 ! Allow sixel graphics. (Try: "convert -colors 16 foo.jpg sixel:-"). xterm*decTerminalID: vt340 @@ -29,6 +43,8 @@ xterm*decTerminalID: vt340 xterm*allowWindowOps : False xterm*disallowedWindowOps : 1,2,3,4,5,6,7,8,9,11,13,18,19,20,21,GetSelection,SetSelection,SetWinLines,SetXprop +! Colors optimized for a light background +! ! Black + DarkGrey *color0: #000000 *color8: #555753 diff --git a/.backupignore b/.backupignore new file mode 100644 index 0000000..d44fbac --- /dev/null +++ b/.backupignore @@ -0,0 +1,12 @@ +.*[Cc]ache/ +*[Cc]ache/ +CacheStorage/ +kernel-build/ +kernel-build.old/ +src/kernel.org/ +go/pkg/ +gopath/pkg/ +sigfox/vm/ +nvlib/ +dvlib/ +*.o diff --git a/.bash-powerline.sh b/.bash-powerline.sh index 626157a..6d2ee2d 100644 --- a/.bash-powerline.sh +++ b/.bash-powerline.sh @@ -23,7 +23,7 @@ __powerline() { elif test -f '/etc/hostname'; then host=$(</etc/hostname) else - host=$(hostname) + host=$(hostname -s) fi [ "$PS_SYMBOL" ] || PS_SYMBOL=';' @@ -5,7 +5,7 @@ export PAGER=less export EDITOR=vim -export HISTIGNORE=2fa:ls:ps:history:tc:cursor +export HISTIGNORE='sudo id:uname:date:exit:df:ll:ls:ps:pwd:tc:top:history' export HISTCONTROL=ignoreboth:erasedups # no start space and duplicate entries export HISTSIZE=100000 # big big history export HISTFILESIZE=100000 # big big history @@ -37,6 +37,9 @@ fixab() { printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 "$1"; } #export LESS_TERMCAP_ue=$'\E[0m' # end underline export LESS=iXFRx4 +export BACKUP=bip:/home/backup/marc@$(hostname -s) +export LESS=XFRx4 + # gnuplot display in terminal export GNUTERM='sixelgd enhanced truecolor font "arial,9"' @@ -49,47 +52,40 @@ alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date #alias cp='cp --reflink' alias ls='ls --color=auto -v' alias ll='ls -AlFhv' +alias more='less' alias vi='vim' alias view='vim -R' +#alias ldd='otool -L' # Darwin only +alias ibrew='arch -x86_64 /usr/local/bin/brew' #alias op='xdg-open' #alias git='hub' #alias go='go1.14.1' -alias go11='go1.11.13' -alias go12='go1.12.10' -alias go13='go1.13.8' -alias go14='go1.14.2' +#alias go11='go1.11.13' +#alias go12='go1.12.10' +#alias go13='go1.13.8' +#alias go14='go1.14.2' alias gob='go build' alias goh='p go help' alias god='p go doc' +alias gol='GO111MODULE=off go' alias gtr='go test -v -run' alias gtb='go test -v -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' -#alias vi='vim' -#alias rvi='sudo vim' -#alias rxt='sudo xt' -#alias rxvi='sudo xvi' -alias ww='vi ~/Wiki/HomePage' +alias ww='vi ~/Wiki/home_page.md' +alias s='vi ~/Wiki/scratch.md' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' -alias uc='systemctl --user' -alias wpa='sudo wpa_gui -i wlan0' - -alias ifre='echo "ip link set wlo1 down; ip link set wlo1 up"|sudo sh' - -# Some admin command -alias dmesg='sudo dmesg' -alias mount='sudo mount' -alias umount='sudo umount' -alias cryptsetup='sudo cryptsetup' - alias by='go build ./cmd/yaegi' alias cy='cd ~/go/src/github.com/traefik/yaegi' #alias ty='go test -v -short ./interp' -alias ya='rlwrap -pblue yaegi' -alias dya='YAEGI_AST_DOT=1 YAEGI_CFG_DOT=1 ./yaegi' +alias y='rlwrap -pblue yaegi' +alias dy='YAEGI_AST_DOT=1 YAEGI_CFG_DOT=1 ./yaegi' alias wai='~/go/src/github.co/traefik/whoami/whoami' # yaegi debug export YAEGI_DOT_CMD='dotty -' +export YAEGI_UNSAFE=1 +export YAEGI_UNRESTRICTED=1 +export YAEGI_SYSCALL=1 #mosht() { mosh "$@" -- tmux new -A; } #export -f mosht @@ -97,6 +93,8 @@ export YAEGI_DOT_CMD='dotty -' #ssht() { ssh -t "$@" -- tmux new -A; } #export -f ssht +sshs() { ssh -t "$@" -- screen -d -R; } + #mpvx() { mpv --vo=sixel --profile=sw-fast --really-quiet "$@"; } #export -f mpvx @@ -112,10 +110,16 @@ export YAEGI_DOT_CMD='dotty -' #wsd() (cd ~/Wiki && git add . && git diff --cached) #export -f wsd +man() { + local width='' + [ $(tput cols) -gt 88 ] && width='MANWIDTH=88' + env $width man "$@" +} + meteo() { local request="wttr.in/${1-Toulouse}?F&T" [ "$(tput cols)" -lt 125 ] && request+='&n' - curl -H "Accept-Language: ${LANG%_*}" --compressed "$request" + curl -H "Accept-Language: fr" --compressed "$request" } #PS1='[\u@\h \W]\$ ' @@ -126,13 +130,21 @@ meteo() { #[ -f "$base/usr/share/fzf/completion.bash" ] && . "$base/usr/share/fzf/completion.bash" #[ -f "$base/usr/share/fzf/key-bindings.bash" ] && . "$base/usr/share/fzf/key-bindings.bash" #unset base +#[ -f "/usr/share/fzf/completion.bash" ] && . "/usr/share/fzf/completion.bash" +#[ -f "/usr/share/fzf/key-bindings.bash" ] && . "/usr/share/fzf/key-bindings.bash" # Arch: display package to install for missing commands #[ -f '/usr/share/doc/pkgfile/command-not-found.bash' ] && . /usr/share/doc/pkgfile/command-not-found.bash # Display git status in prompt . ~/.bash-powerline.sh -# export PS1='; ' # load Nix config files (aka auto-completion etc.) #export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" +# eval "$(direnv hook bash)" +#export GITHUB_TOKEN=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 + +#set -o vi +#bind -m vi-command ".":insert-last-argument +#bind -m vi-command 'Control-l: clear-screen' +#bind -m vi-insert 'Control-l: clear-screen' diff --git a/.config/aerc/aerc.conf b/.config/aerc/aerc.conf new file mode 100644 index 0000000..fb471fc --- /dev/null +++ b/.config/aerc/aerc.conf @@ -0,0 +1,751 @@ +# +# aerc main configuration + +[general] +# +# Used as a default path for save operations if no other path is specified. +# ~ is expanded to the current user home dir. +# +#default-save-path= + +# If set to "gpg", aerc will use system gpg binary and keystore for all crypto +# operations. If set to "internal", the internal openpgp keyring will be used. +# If set to "auto", the system gpg will be preferred unless the internal +# keyring already exists, in which case the latter will be used. +# +# Default: auto +#pgp-provider=auto + +# By default, the file permissions of accounts.conf must be restrictive and +# only allow reading by the file owner (0600). Set this option to true to +# ignore this permission check. Use this with care as it may expose your +# credentials. +# +# Default: false +#unsafe-accounts-conf=false + +# Output log messages to specified file. A path starting with ~/ is expanded to +# the user home dir. When redirecting aerc's output to a file using > shell +# redirection, this setting is ignored and log messages are printed to stdout. +# +#log-file= + +# Only log messages above the specified level to log-file. Supported levels +# are: trace, debug, info, warn and error. When redirecting aerc's output to +# a file using > shell redirection, this setting is ignored and the log level +# is forced to trace. +# +# Default: info +#log-level=info + +# Set the $TERM environment variable used for the embedded terminal. +# +# Default: xterm-256color +#term=xterm-256color + +# Display OSC8 strings in the embedded terminal +# +# Default: false +#enable-osc8=false + +# Default shell command to use for :menu. This will be executed with sh -c and +# will run in an popover dialog. +# +# Any occurrence of %f will be replaced by a temporary file path where the +# command is expected to write output lines to be consumed by :menu. Otherwise, +# the lines will be read from the command's standard output. +# +# Examples: +# default-menu-cmd=fzf +# default-menu-cmd=fzf --multi +# default-menu-cmd=dmenu -l 20 +# default-menu-cmd=ranger --choosefiles=%f +# +#default-menu-cmd= + +[ui] +# +# Describes the format for each row in a mailbox view. This is a comma +# separated list of column names with an optional align and width suffix. After +# the column name, one of the '<' (left), ':' (center) or '>' (right) alignment +# characters can be added (by default, left) followed by an optional width +# specifier. The width is either an integer representing a fixed number of +# characters, or a percentage between 1% and 99% representing a fraction of the +# terminal width. It can also be one of the '*' (auto) or '=' (fit) special +# width specifiers. Auto width columns will be equally attributed the remaining +# terminal width. Fit width columns take the width of their contents. If no +# width specifier is set, '*' is used by default. +# +# Default: date<20,name<17,flags>4,subject<* +#index-columns=date<20,name<17,flags>4,subject<* + +# +# Each name in index-columns must have a corresponding column-$name setting. +# All column-$name settings accept golang text/template syntax. See +# aerc-templates(7) for available template attributes and functions. +# +# Here are some examples to show the To field instead of the From field for +# an email (modifying column-name): +# +# 1. a generic one +# column-name={{ .Peer | names | join ", " }} +# 2. based upon the selected folder +# column-name={{if match .Folder "^(Gesendet|Sent)$"}}{{index (.To | names) 0}}{{else}}{{index (.From | names) 0}}{{end}} +# +# Default settings +#column-date={{.DateAutoFormat .Date.Local}} +#column-name={{index (.From | names) 0}} +#column-flags={{.Flags | join ""}} +#column-subject={{.ThreadPrefix}}{{if .ThreadFolded}}{{printf "{%d}" .ThreadCount}}{{end}}{{.Subject}} + +# +# String separator inserted between columns. When the column width specifier is +# an exact number of characters, the separator is added to it (i.e. the exact +# width will be fully available for the column contents). +# +# Default: " " +#column-separator=" " + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +#timestamp-format=2006-01-02 03:04 PM +timestamp-format=2006-01-02 15:04 + +# +# Index-only time format for messages that were received/sent today. +# If this is not specified, timestamp-format is used instead. +# +#this-day-time-format= + +# +# Index-only time format for messages that were received/sent within the last +# 7 days. If this is not specified, timestamp-format is used instead. +# +#this-week-time-format= + +# +# Index-only time format for messages that were received/sent this year. +# If this is not specified, timestamp-format is used instead. +# +#this-year-time-format= + +# +# Width of the sidebar, including the border. +# +# Default: 20 +#sidebar-width=20 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +#empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +#empty-dirlist=(no folders) +# +# Value to set {{.Subject}} template to when subject is empty. +# +# Default: (no subject) +#empty-subject=(no subject) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +mouse-enabled=true + +# +# Ring the bell when new messages are received +# +# Default: true +#new-message-bell=true + +# +# Template to use for Account tab titles +# +# Default: {{.Account}} +#tab-title-account={{.Account}} + +# Marker to show before a pinned tab's name. +# +# Default: ` +#pinned-tab-marker='`' + +# Template for the left side of the directory list. +# See aerc-templates(7) for all available fields and functions. +# +# Default: {{.Folder}} +#dirlist-left={{.Folder}} + +# Template for the right side of the directory list. +# See aerc-templates(7) for all available fields and functions. +# +# Default: {{if .Unread}}{{humanReadable .Unread}}/{{end}}{{if .Exists}}{{humanReadable .Exists}}{{end}} +#dirlist-right={{if .Unread}}{{humanReadable .Unread}}/{{end}}{{if .Exists}}{{humanReadable .Exists}}{{end}} + +# Delay after which the messages are actually listed when entering a directory. +# This avoids loading messages when skipping over folders and makes the UI more +# responsive. If you do not want that, set it to 0s. +# +# Default: 200ms +#dirlist-delay=200ms + +# Display the directory list as a foldable tree that allows to collapse and +# expand the folders. +# +# Default: false +#dirlist-tree=false + +# If dirlist-tree is enabled, set level at which folders are collapsed by +# default. Set to 0 to disable. +# +# Default: 0 +#dirlist-collapse=0 + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +#sort= + +# Moves to next message when the current message is deleted +# +# Default: true +#next-message-on-delete=true + +# Automatically set the "seen" flag when a message is opened in the message +# viewer. +# +# Default: true +#auto-mark-read=true + +# The directories where the stylesets are stored. It takes a colon-separated +# list of directories. If this is unset or if a styleset cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets +# ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets +# /usr/local/share/aerc/stylesets +# /usr/share/aerc/stylesets +# +#stylesets-dirs= + +# Uncomment to use box-drawing characters for vertical and horizontal borders. +# +# Default: " " +#border-char-vertical=" " +#border-char-horizontal=" " + +# Sets the styleset to use for the aerc ui elements. +# +# Default: default +#styleset-name=default +styleset-name=mv + +# Activates fuzzy search in commands and their arguments: the typed string is +# searched in the command or option in any position, and need not be +# consecutive characters in the command or option. +# +# Default: false +#fuzzy-complete=false + +# How long to wait after the last input before auto-completion is triggered. +# +# Default: 250ms +#completion-delay=250ms + +# The minimum required characters to allow auto-completion to be triggered after +# completion-delay. +# +# Setting this to "manual" disables automatic completion, leaving only the +# manually triggered completion with the $complete key (see aerc-binds(5) for +# more details). +# +# Default: 1 +#completion-min-chars=1 + +# +# Global switch for completion popovers +# +# Default: true +#completion-popovers=true + +# Uncomment to use UTF-8 symbols to indicate PGP status of messages +# +# Default: ASCII +#icon-unencrypted= +#icon-encrypted=✔ +#icon-signed=✔ +#icon-signed-encrypted=✔ +#icon-unknown=✘ +#icon-invalid=⚠ + +# Reverses the order of the message list. By default, the message list is +# ordered with the newest (highest UID) message on top. Reversing the order +# will put the oldest (lowest UID) message on top. This can be useful in cases +# where the backend does not support sorting. +# +# Default: false +#reverse-msglist-order = false + +# Reverse display of the mesage threads. Default order is the the intial +# message is on the top with all the replies being displayed below. The +# reverse option will put the initial message at the bottom with the +# replies on top. +# +# Default: false +#reverse-thread-order=false + +# Sort the thread siblings according to the sort criteria for the messages. If +# sort-thread-siblings is false, the thread siblings will be sorted based on +# the message UID in ascending order. This option is only applicable for +# client-side threading with a backend that enables sorting. Note that there's +# a performance impact when sorting is activated. +# +# Default: false +#sort-thread-siblings=false + +#[ui:account=foo] +# +# Enable a threaded view of messages. If this is not supported by the backend +# (IMAP server or notmuch), threads will be built by the client. +# +# Default: false +#threading-enabled=false + +# Force client-side thread building +# +# Default: false +#force-client-threads=false + +# Show thread context enables messages which do not match the current query (or +# belong to the current mailbox) to be shown for context. These messages can be +# styled separately using "msglist_thread_context" in a styleset. This feature +# is not supported by all backends +# +# Default: false +#show-thread-context=false + +# Debounce client-side thread building +# +# Default: 50ms +#client-threads-delay=50ms + +# +# Thread prefix customization: + +# +# Customize the thread prefix appearance by selecting the arrow head. +# +# Default: ">" +#thread-prefix-tip = ">" + +# +# Customize the thread prefix appearance by selecting the arrow indentation. +# +# Default: " " +#thread-prefix-indent = " " + +# +# Customize the thread prefix appearance by selecting the vertical extension of +# the arrow. +# +# Default: "│" +#thread-prefix-stem = "│" + +# +# Customize the thread prefix appearance by selecting the horizontal extension +# of the arrow. +# +# Default: "" +#thread-prefix-limb = "" + +# +# Customize the thread prefix appearance by selecting the folded thread +# indicator. +# +# Default: "" +#thread-prefix-folded = "" + +# +# Customize the thread prefix appearance by selecting the unfolded thread +# indicator. +# +# Default: "" +#thread-prefix-unfolded = "" + +# +# Customize the thread prefix appearance by selecting the first child connector. +# +# Default: "" +#thread-prefix-first-child = "" + +# +# Customize the thread prefix appearance by selecting the connector used if +# the message has siblings. +# +# Default: "├─" +#thread-prefix-has-siblings = "├─" + +# +# Customize the thread prefix appearance by selecting the connector used if the +# message has no parents and no children. +# +# Default: "" +#thread-prefix-lone = "" + +# +# Customize the thread prefix appearance by selecting the connector used if the +# message has no parents and has children. +# +# Default: "" +#thread-prefix-orphan = "" + +# +# Customize the thread prefix appearance by selecting the connector for the last +# sibling. +# +# Default: "└─" +#thread-prefix-last-sibling = "└─" + +# +# Customize the reversed thread prefix appearance by selecting the connector for +# the last sibling. +# +# Default: "┌─" +#thread-prefix-last-sibling-reverse = "┌─" + +# +# Customize the reversed thread prefix appearance by selecting the first child +# connector. +# +# Default: "" +#thread-prefix-first-child-reverse = "" + +# +# Customize the reversed thread prefix appearance by selecting the connector +# used if the message has no parents and has children. +# +# Default: "" +#thread-prefix-orphan-reverse = "" + +[statusline] +# +# Describes the format for the status line. This is a comma separated list of +# column names with an optional align and width suffix. See [ui].index-columns +# for more details. To completely mute the status line except for push +# notifications, explicitly set status-columns to an empty string. +# +# Default: left<*,center:=,right>* +#status-columns=left<*,center:=,right>* + +# +# Each name in status-columns must have a corresponding column-$name setting. +# All column-$name settings accept golang text/template syntax. See +# aerc-templates(7) for available template attributes and functions. +# +# Default settings +#column-left=[{{.Account}}] {{.StatusInfo}} +#column-center={{.PendingKeys}} +#column-right={{.TrayInfo}} + +# +# String separator inserted between columns. +# See [ui].column-separator for more details. +# +#column-separator=" " + +# Specifies the separator between grouped statusline elements. +# +# Default: " | " +#separator=" | " + +# Defines the mode for displaying the status elements. +# Options: text, icon +# +# Default: text +#display-mode=text + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -Rc +#pager=less -Rc + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +#alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +#show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +#header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +#always-show-mime=false + +# Define the maximum height of the mimetype switcher before a scrollbar is used. +# The height of the mimetype switcher is restricted to half of the display +# height. If the provided value for the height is zero, the number of parts will +# be used as the height of the type switcher. +# +# Default: 0 +#max-mime-height = 0 + +# Parses and extracts http links when viewing a message. Links can then be +# accessed with the open-link command. +# +# Default: true +#parse-http-links=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +#editor= + +# +# When set, aerc will create and read .eml files for composing that have +# non-standard \n linebreaks. This is only relevant if the used editor does not +# support CRLF linebreaks. +# +#lf-editor=false + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +#header-layout=To|From,Subject + +# +# Edit headers into the text editor instead than separate fields. +# +# When this is true, address-book-cmd is not supported and address completion +# is left to the editor itself. Also, displaying multiple headers on the same +# line is not possible. +# +# Default: false +#edit-headers=false + +# +# Specifies the command to be used to tab-complete email addresses. Any +# occurrence of "%s" in the address-book-cmd will be replaced with what the +# user has typed so far. +# +# The command must output the completions to standard output, one completion +# per line. Each line must be tab-delimited, with an email address occurring as +# the first field. Only the email address field is required. The second field, +# if present, will be treated as the contact name. Additional fields are +# ignored. +# +# This parameter can also be set per account in accounts.conf. +address-book-cmd=abook --mutt-query "%s" + +# Specifies the command to be used to select attachments. Any occurrence of +# '%s' in the file-picker-cmd will be replaced with the argument <arg> +# to :attach -m <arg>. Any occurence of '%f' will be replaced by the +# location of a temporary file, from which aerc will read the selected files. +# +# If '%f' is not present, the command must output the selected files to +# standard output, one file per line. If it is present, then aerc does not +# capture the standard output and instead reads the files from the temporary +# file which should have the same format. +#file-picker-cmd= + +# +# Allow to address yourself when replying +# +# Default: true +#reply-to-self=true + +# Warn before sending an email with an empty subject. +# +# Default: false +#empty-subject-warning=false + +# +# Warn before sending an email that matches the specified regexp but does not +# have any attachments. Leave empty to disable this feature. +# +# Uses Go's regexp syntax, documented at https://golang.org/s/re2syntax. The +# "(?im)" flags are set by default (case-insensitive and multi-line). +# +# Example: +# no-attachment-warning=^[^>]*attach(ed|ment) +# +#no-attachment-warning= + +# +# When set, aerc will generate "format=flowed" bodies with a content type of +# "text/plain; format=flowed" as described in RFC3676. This format is easier to +# handle for some mailing software, and generally just looks like ordinary +# text. To actually make use of this format's features, you'll need support in +# your editor. +# +#format-flowed=false + +[multipart-converters] +# +# Converters allow to generate multipart/alternative messages by converting the +# main text/plain part into any other MIME type. Only exact MIME types are +# accepted. The commands are invoked with sh -c and are expected to output +# valid UTF-8 text. +# +# Example (obviously, this requires that you write your main text/plain body +# using the markdown syntax): +#text/html=pandoc -f markdown -t html --standalone + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The commands are invoked with sh -c. The following folders are prepended to +# the system $PATH to allow referencing filters from their name only: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/filters +# ~/.local/libexec/aerc/filters +# ${XDG_DATA_HOME:-~/.local/share}/aerc/filters +# $PREFIX/libexec/aerc/filters +# $PREFIX/share/aerc/filters +# /usr/libexec/aerc/filters +# /usr/share/aerc/filters +# +# If you want to run a program in your default $PATH which has the same name +# as a builtin filter (e.g. /usr/bin/colorize), use its absolute path. +# +# The following variables are defined in the filter command environment: +# +# AERC_MIME_TYPE the part MIME type/subtype +# AERC_FORMAT the part content type format= parameter +# AERC_FILENAME the attachment filename (if any) +# AERC_SUBJECT the message Subject header value +# AERC_FROM the message From header value +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +# +text/plain=colorize +text/calendar=calendar +message/delivery-status=colorize +message/rfc822=colorize +#text/html=pandoc -f html -t plain | colorize +text/html=html | colorize +#text/*=bat -fP --file-name="$AERC_FILENAME" +#application/x-sh=bat -fP -l sh +#image/*=catimg -w $(tput cols) - +#subject,~Git(hub|lab)=lolcat -f +#from,thatguywhodoesnothardwraphismessages=wrap -w 100 | colorize + +# This special filter is only used to post-process email headers when +# [viewer].show-headers=true +# By default, headers are piped directly into the pager. +# +.headers=colorize + +[openers] +# +# Openers allow you to specify the command to use for the :open and :open-link +# actions on a per-MIME-type basis. The :open-link URL scheme is used to +# determine the MIME type as follows: x-scheme-handler/<scheme>. +# +# {} is expanded as the temporary filename or URL to be opened with proper +# shell quoting. If it is not encountered in the command, the filename/URL will +# be appended to the end of the command. The command will then be executed with +# `sh -c`. +# +# Like [filters], openers support basic shell globbing. The first opener which +# matches the part's MIME type (or URL scheme handler MIME type) will be used, +# so order them from most to least specific. +# +# Examples: +# x-scheme-handler/irc=hexchat +# x-scheme-handler/http*=printf '%s' {} | wl-copy +# text/html=surf -dfgms +# text/plain=gvim {} +125 +# message/rfc822=thunderbird + +[hooks] +# +# Hooks are triggered whenever the associated event occurs. + +# +# Executed when a new email arrives in the selected folder +#mail-received=notify-send "[$AERC_ACCOUNT/$AERC_FOLDER] New mail from $AERC_FROM_NAME" "$AERC_SUBJECT" + +# +# Executed when mail is deleted from a folder +#mail-deleted=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" & + +# +# Executed when aerc adds mail to a folder +#mail-added=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" & + +# +# Executed when aerc starts +#aerc-startup=aerc :terminal calcurse && aerc :next-tab + +# +# Executed when aerc shuts down. +#aerc-shutdown= + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. If this is unset or if a template cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/templates +# ${XDG_DATA_HOME:-~/.local/share}/aerc/templates +# /usr/local/share/aerc/templates +# /usr/share/aerc/templates +# +#template-dirs= + +# The default template to be used for new messages. +# +# default: new_message +#new-message=new_message + +# The default template to be used for quoted replies. +# +# default: quoted_reply +#quoted-reply=quoted_reply + +# The default template to be used for forward as body. +# +# default: forward_as_body +#forwards=forward_as_body diff --git a/.config/aerc/binds.conf b/.config/aerc/binds.conf new file mode 100644 index 0000000..4c2efa4 --- /dev/null +++ b/.config/aerc/binds.conf @@ -0,0 +1,177 @@ +# Binds are of the form <key sequence> = <command to run> +# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit +<C-p> = :prev-tab<Enter> +<C-PgUp> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> +<C-PgDn> = :next-tab<Enter> +\[t = :prev-tab<Enter> +\]t = :next-tab<Enter> +<C-t> = :term<Enter> +? = :help keys<Enter> +<C-c> = :prompt 'Quit?' quit<Enter> +<C-q> = :prompt 'Quit?' quit<Enter> +<C-z> = :suspend<Enter> + +[messages] +q = :prompt 'Quit?' quit<Enter> + +j = :next<Enter> +<Down> = :next<Enter> +<C-d> = :next 50%<Enter> +<C-f> = :next 100%<Enter> +<PgDn> = :next 100%<Enter> + +k = :prev<Enter> +<Up> = :prev<Enter> +<C-u> = :prev 50%<Enter> +<C-b> = :prev 100%<Enter> +<PgUp> = :prev 100%<Enter> +g = :select 0<Enter> +G = :select -1<Enter> + +J = :next-folder<Enter> +<C-Down> = :next-folder<Enter> +K = :prev-folder<Enter> +<C-Up> = :prev-folder<Enter> +H = :collapse-folder<Enter> +<C-Left> = :collapse-folder<Enter> +L = :expand-folder<Enter> +<C-Right> = :expand-folder<Enter> + +v = :mark -t<Enter> +<Space> = :mark -t<Enter>:next<Enter> +V = :mark -v<Enter> + +T = :toggle-threads<Enter> +zc = :fold<Enter> +zo = :unfold<Enter> +za = :fold -t<Enter> +zM = :fold -a<Enter> +zR = :unfold -a<Enter> +<tab> = :fold -t<Enter> + +<Enter> = :view<Enter> +d = :prompt 'Really delete this message?' 'delete-message'<Enter> +D = :delete<Enter> +a = :archive flat<Enter> +A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter> + +C = :compose<Enter> +m = :compose<Enter> + +rr = :reply -a<Enter> +rq = :reply -aq<Enter> +Rr = :reply<Enter> +Rq = :reply -q<Enter> + +c = :cf<space> +$ = :term<space> +! = :term<space> +| = :pipe<space> + +/ = :search<space> +\ = :filter<space> +n = :next-result<Enter> +N = :prev-result<Enter> +<Esc> = :clear<Enter> + +s = :split<Enter> +S = :vsplit<Enter> + +pl = :patch list<Enter> +pa = :patch apply <Tab> +pd = :patch drop <Tab> +pb = :patch rebase<Enter> +pt = :patch term<Enter> +ps = :patch switch <Tab> + +[messages:folder=Drafts] +<Enter> = :recall<Enter> + +[view] +/ = :toggle-key-passthrough<Enter>/ +q = :close<Enter> +O = :open<Enter> +o = :open<Enter> +S = :save<space> +| = :pipe<space> +D = :delete<Enter> +A = :archive flat<Enter> + +<C-l> = :open-link <space> + +f = :forward<Enter> +rr = :reply -a<Enter> +rq = :reply -aq<Enter> +Rr = :reply<Enter> +Rq = :reply -q<Enter> + +H = :toggle-headers<Enter> +<C-k> = :prev-part<Enter> +<C-Up> = :prev-part<Enter> +<C-j> = :next-part<Enter> +<C-Down> = :next-part<Enter> +J = :next<Enter> +<C-Right> = :next<Enter> +K = :prev<Enter> +<C-Left> = :prev<Enter> + +[view::passthrough] +$noinherit = true +$ex = <C-x> +<Esc> = :toggle-key-passthrough<Enter> + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$noinherit = true +$ex = <C-x> +$complete = <C-o> +<C-k> = :prev-field<Enter> +<C-Up> = :prev-field<Enter> +<C-j> = :next-field<Enter> +<C-Down> = :next-field<Enter> +<A-p> = :switch-account -p<Enter> +<C-Left> = :switch-account -p<Enter> +<A-n> = :switch-account -n<Enter> +<C-Right> = :switch-account -n<Enter> +<tab> = :next-field<Enter> +<backtab> = :prev-field<Enter> +<C-p> = :prev-tab<Enter> +<C-PgUp> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> +<C-PgDn> = :next-tab<Enter> + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = <C-x> +<C-k> = :prev-field<Enter> +<C-Up> = :prev-field<Enter> +<C-j> = :next-field<Enter> +<C-Down> = :next-field<Enter> +<C-p> = :prev-tab<Enter> +<C-PgUp> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> +<C-PgDn> = :next-tab<Enter> + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send<Enter> +n = :abort<Enter> +v = :preview<Enter> +p = :postpone<Enter> +q = :choose -o d discard abort -o p postpone postpone<Enter> +e = :edit<Enter> +a = :attach<space> +d = :detach<space> + +[terminal] +$noinherit = true +$ex = <C-x> + +<C-p> = :prev-tab<Enter> +<C-n> = :next-tab<Enter> +<C-PgUp> = :prev-tab<Enter> +<C-PgDn> = :next-tab<Enter> diff --git a/.config/aerc/stylesets/mv b/.config/aerc/stylesets/mv new file mode 100644 index 0000000..189e28d --- /dev/null +++ b/.config/aerc/stylesets/mv @@ -0,0 +1,5 @@ +warning.fg=orange +statusline_warning.fg=orange + +[viewer] +url.fg=purple diff --git a/.config/bat/config b/.config/bat/config new file mode 100644 index 0000000..4143a20 --- /dev/null +++ b/.config/bat/config @@ -0,0 +1,27 @@ +# This is `bat`s configuration file. Each line either contains a comment or +# a command-line option that you want to pass to `bat` by default. You can +# run `bat --help` to get a list of all possible configuration options. + +# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` +# for a list of all available themes +#--theme="TwoDark" +#--theme="GitHub" +--theme="ansi" + +# Enable this to use italic text on the terminal. This is not supported on all +# terminal emulators (like tmux, by default): +#--italic-text=always + +# Uncomment the following line to disable automatic paging: +#--paging=never + +# Uncomment the following line if you are using less version >= 551 and want to +# enable mouse scrolling support in `bat` when running inside tmux. This might +# disable text selection, unless you press shift. +#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" + +# Syntax mappings: map a certain filename pattern to a language. +# Example 1: use the C++ syntax for Arduino .ino files +# Example 2: Use ".gitignore"-style highlighting for ".ignore" files +#--map-syntax "*.ino:C++" +#--map-syntax ".ignore:Git Ignore" diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..f9451a1 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,12 @@ +[main] +#font=Mono:size=9 +#font=MiscFixed:pixelsize=14 +font=Misc MiscFixed:pixelsize=13 +pad=2x0 center + +[cursor] +color=ffffff ff0000 + +[colors] +background=ffffff +foreground=000000 diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index a3da8ab..30af16a 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -1,2 +1,4 @@ [Settings] +gtk-icon-theme-name = Adwaita +gtk-theme-name = Adwaita gtk-font-name = Liberation Sans 9 diff --git a/.config/gtk-4.0/settings.ini b/.config/gtk-4.0/settings.ini new file mode 100644 index 0000000..30af16a --- /dev/null +++ b/.config/gtk-4.0/settings.ini @@ -0,0 +1,4 @@ +[Settings] +gtk-icon-theme-name = Adwaita +gtk-theme-name = Adwaita +gtk-font-name = Liberation Sans 9 diff --git a/.config/i3/config b/.config/i3/config index 48c461c..d898633 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -44,7 +44,7 @@ bindsym $mod+twosuperior exec --no-startup-id dunstctl history-pop # pulse audio systray icon -exec --no-startup-id pasystray +# exec --no-startup-id pasystray # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status @@ -56,36 +56,64 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ to bindsym $mod+KP_Enter exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status -# enable floating mode +# enable floating mode and border +for_window [class="aft-linux-qt"] floating enable for_window [class="Arandr"] floating enable +for_window [class="Asunder"] floating enable for_window [class="Brave-browser"] floating enable +for_window [class="Blueberry.py"] floating enable +for_window [class="Blueman-manager"] floating enable for_window [class="Chromium"] floating enable for_window [title="Task Manager - Chromium"] floating enable for_window [title="Gestionnaire de tâches – Chromium"] floating enable +for_window [class="DeltaChat"] floating enable for_window [instance="DOTTY"] floating enable +for_window [instance="LEFTY text view"] floating enable for_window [class="discord"] floating enable +for_window [class="easyeffects"] floating enable border normal for_window [class="Display"] floating enable for_window [class="Feedreader"] floating enable for_window [class="feh"] floating enable for_window [class="firefox"] floating enable +for_window [class="fluent-reader"] floating enable border normal for_window [class="Geeqie"] floating enable +for_window [class="Google-chrome"] floating enable +for_window [title="Google Chrome"] floating enable for_window [class="Gpicview"] floating enable for_window [class="Ghb"] floating enable for_window [class="Gitk"] floating enable for_window [class="gnuplot_qt"] floating enable for_window [instance="gxditview"] floating enable +for_window [class="index"] floating enable for_window [class="Keybase"] floating enable for_window [class="libreoffice"] floating enable +for_window [class="Liferea"] floating enable +for_window [class="lagrange"] floating enable for_window [class="llpp"] floating enable for_window [class="MuPDF"] floating enable +for_window [class="io.elementary.music"] floating enable +for_window [class="org.gnome.Music"] floating enable +for_window [class="Org.gnome.Software"] floating enable for_window [class="Pavucontrol"] floating enable -for_window [class="Slack"] floating enable +for_window [class="pcmanfm-qt"] floating enable +for_window [class="Picard"] floating enable +for_window [title="QEMU"] floating enable +for_window [class="Quodlibet"] floating enable +for_window [class="RSS Guard"] floating enable +#for_window [class="Navigator"] floating enable +for_window [class="SeaMonkey"] floating enable +#for_window [window_role="browser"] floating enable for_window [class="Signal"] floating enable +for_window [class="Slack"] floating enable for_window [class="Spotify"] floating enable -for_window [class="Thunderbird"] floating enable +for_window [class="Tauon Music Box"] floating enable +for_window [class="thunderbird"] floating enable +for_window [class="UXTerm"] floating enable for_window [class="vlc"] floating enable for_window [instance="wish"] floating enable for_window [class="wpa_gui"] floating enable +for_window [class="Xdialog"] floating enable +for_window [class="Xournalpp"] floating enable for_window [class="XVroot"] floating enable for_window [class="zoom"] floating enable @@ -96,11 +124,13 @@ floating_modifier $mod # start a terminal bindsym $mod+Return exec --no-startup-id xt +bindsym $mod+t exec --no-startup-id uxterm +bindsym $mod+Shift+t exec --no-startup-id xtb # kill focused window -bindsym $mod+Shift+a kill -bindsym $mod+w kill -bindsym --release button2 kill +bindsym $mod+q kill +#bindsym $mod+w kill +bindsym --release $mod+button2 kill # start dmenu (a program launcher) #bindsym $mod+d exec dmenu_run @@ -109,9 +139,10 @@ bindsym --release button2 kill # installed. #bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Mono-9'" #bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Mono-9'" -bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop #bindsym F1 exec --no-startup-id i3-dmenu-desktop -entry-type=command -bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Fixed-12'" +#bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Fixed-12'" +bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Fixed-12'" # Use playerctl to control media player from keyboard bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause @@ -174,7 +205,7 @@ bindsym $mod+Shift+space floating toggle bindsym $mod+space focus mode_toggle # focus the parent container -bindsym $mod+q focus parent +#bindsym $mod+q focus parent # focus the child container #bindsym $mod+d focus child diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..c79faf1 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,1518 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +# font_family monospace +# bold_font auto +# italic_font auto +# bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. To get a full list of supported fonts use the `kitty +#: list-fonts` command. By default they are derived automatically, by +#: the OSes font system. Setting them manually is useful for font +#: families that have many weight variants like Book, Medium, Thick, +#: etc. For example:: + +#: font_family Operator Mono Book +#: bold_font Operator Mono Medium +#: italic_font Operator Mono Book Italic +#: bold_italic_font Operator Mono Medium Italic + +# font_size 11.0 +# font_family Fira Code +font_size 14.0 + +#: Font size (in pts) + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the the string been LTR. For example, assuming the Hebrew word +#: ירושלים, selecting the character that on the screen appears to be ם +#: actually writes into the selection buffer the character י. kitty's +#: default behavior is useful in conjunction with a filter to reverse +#: the word order, however, if you wish to manipulate RTL glyphs, it +#: can be very challenging to work with, so this option is provided to +#: turn it off. Furthermore, this option can be used with the command +#: line program GNU FriBidi +#: <https://github.com/fribidi/fribidi#executable> to get BIDI +#: support, because it will force kitty to always treat the text as +#: LTR, which FriBidi expects for terminals. + +# adjust_line_height 0 +# adjust_column_width 0 + +#: Change the size of each character cell kitty renders. You can use +#: either numbers, which are interpreted as pixels or percentages +#: (number followed by %), which are interpreted as percentages of the +#: unmodified values. You can use negative pixels or percentages less +#: than 100% to reduce sizes (but this might cause rendering +#: artifacts). + +# adjust_baseline 0 + +#: Adjust the vertical alignment of text (the height in the cell at +#: which text is positioned). You can use either numbers, which are +#: interpreted as pixels or a percentages (number followed by %), +#: which are interpreted as the percentage of the line height. A +#: positive value moves the baseline up, and a negative value moves +#: them down. The underline and strikethrough positions are adjusted +#: accordingly. + +# symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each unicode code +#: point is specified in the form U+<code point in hexadecimal>. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. symbol_map itself can be specified multiple +#: times. Syntax is:: + +#: symbol_map codepoints Font Family Name + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features setting. + +# font_features none + +#: Choose exactly which OpenType features to enable or disable. This +#: is useful as some fonts might have features worthwhile in a +#: terminal. For example, Fira Code Retina includes a discretionary +#: feature, zero, which in that font changes the appearance of the +#: zero (0), to make it more easily distinguishable from Ø. Fira Code +#: Retina also includes other discretionary features known as +#: Stylistic Sets which have the tags ss01 through ss20. + +#: For the exact syntax to use for individual features, see the +#: Harfbuzz documentation <https://harfbuzz.github.io/harfbuzz-hb- +#: common.html#hb-feature-from-string>. + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, these are read from the FontConfig database first and +#: then this, setting is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use kitty + list-fonts +#: --psnames: + +#: .. code-block:: sh + +#: $ kitty + list-fonts --psnames | grep Fira +#: Fira Code +#: Fira Code Bold (FiraCode-Bold) +#: Fira Code Light (FiraCode-Light) +#: Fira Code Medium (FiraCode-Medium) +#: Fira Code Regular (FiraCode-Regular) +#: Fira Code Retina (FiraCode-Retina) + +#: The part in brackets is the PostScript name. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero:: + +#: font_features FiraCode-Retina +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: Change the sizes of the lines used for the box drawing unicode +#: characters These values are in pts. They will be scaled by the +#: monitor DPI to arrive at a pixel value. There must be four values +#: corresponding to thin, normal, thick, and very thick lines. + +#: }}} + +#: Cursor customization {{{ + +# cursor #cccccc +cursor #ff0000 + +#: Default cursor color + +# cursor_text_color #111111 + +#: Choose the color of text under the cursor. If you want it rendered +#: with the background color of the cell underneath instead, use the +#: special keyword: background + +# cursor_shape block + +#: The cursor shape can be one of (block, beam, underline). Note that +#: when reloading the config this will be changed only if the cursor +#: shape has not been set by the program running in the terminal. + +# cursor_beam_thickness 1.5 + +#: Defines the thickness of the beam cursor (in pts) + +# cursor_underline_thickness 2.0 + +#: Defines the thickness of the underline cursor (in pts) + +# cursor_blink_interval -1 +cursor_blink_interval 0 + +#: The interval (in seconds) at which to blink the cursor. Set to zero +#: to disable blinking. Negative values mean use system default. Note +#: that numbers smaller than repaint_delay will be limited to +#: repaint_delay. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position. + +# scrollback_pager_history_size 0 + +#: Separate scrollback history size, used only for browsing the +#: scrollback buffer (in MB). This separate buffer is not available +#: for interactive scrolling but will be piped to the pager program +#: when viewing scrollback buffer in a separate window. The current +#: implementation stores the data in UTF-8, so approximatively 10000 +#: lines per megabyte at 100 chars per line, for pure ASCII text, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_fill_enlarged_window no + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Modify the amount scrolled by the mouse wheel. Note this is only +#: used for low precision scrolling devices, not for high precision +#: scrolling on platforms such as macOS and Wayland. Use negative +#: numbers to change scroll direction. + +# touch_scroll_multiplier 1.0 + +#: Modify the amount scrolled by a touchpad. Note this is only used +#: for high precision scrolling devices on platforms such as macOS and +#: Wayland. Use negative numbers to change scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +# url_color #0087bd +# url_style curly + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, single, double, curly + +# open_url_with default + +#: The program with which to open URLs that are clicked on. The +#: special value default means to use the operating system's default +#: URL handler. + +# url_prefixes http https file ftp gemini irc gopher mailto news git + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +# detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. + +# url_excluded_characters + +#: Additional characters to be disallowed from URLs, when detecting +#: URLs under the mouse cursor. By default, all characters legal in +#: URLs are allowed. + +# copy_on_select no +copy_on_select yes + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, simply selecting text with the mouse will cause the text +#: to be copied to clipboard. Useful on platforms such as macOS that +#: do not have the concept of primary selections. You can instead +#: specify a name such as a1 to copy to a private kitty buffer +#: instead. Map a shortcut with the paste_from_buffer action to paste +#: from this private buffer. For example:: + +#: map cmd+shift+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. always will always do it. + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the unicode database will be matched. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +# focus_follows_mouse no +focus_follows_mouse yes + +#: Set the active window to the window under the mouse when moving the +#: mouse around + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. Valid values are: arrow, beam and hand + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. Valid values are: arrow, +#: beam and hand + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. +#: Valid values are: arrow, beam and hand + +#: Mouse actions {{{ + +#: Mouse buttons can be remapped to perform arbitrary actions. The +#: syntax for doing so is: + +#: .. code-block:: none + +#: mouse_map button-name event-type modes action + +#: Where ``button-name`` is one of ``left``, ``middle``, ``right`` or +#: ``b1 ... b8`` with added keyboard modifiers, for example: +#: ``ctrl+shift+left`` refers to holding the ctrl+shift keys while +#: clicking with the left mouse button. The number ``b1 ... b8`` can +#: be used to refer to upto eight buttons on a mouse. + +#: ``event-type`` is one ``press``, ``release``, ``doublepress``, +#: ``triplepress``, ``click`` and ``doubleclick``. ``modes`` +#: indicates whether the action is performed when the mouse is grabbed +#: by the program running in the terminal, or not. It can have one or +#: more or the values, ``grabbed,ungrabbed``. ``grabbed`` refers to +#: when the program running in the terminal has requested mouse +#: events. Note that the click and double click events have a delay of +#: click_interval to disambiguate from double and triple presses. + +#: You can run kitty with the kitty --debug-input command line option +#: to see mouse events. See the builtin actions below to get a sense +#: of what is possible. + +#: If you want to unmap an action map it to ``no-op``. For example, to +#: disable opening of URLs with a plain click:: + +#: mouse_map left click ungrabbed no-op + +#: .. note:: +#: Once a selection is started, releasing the button that started it will +#: automatically end it and no release event will be dispatched. + +# clear_all_mouse_actions no + +#: You can have kitty remove all mouse actions seen up to this point. +#: Useful, for instance, to remove the default mouse actions. + +# mouse_map left click ungrabbed mouse_click_url_or_select +# mouse_map shift+left click grabbed,ungrabbed mouse_click_url_or_select +# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_click_url + +#: Variant with ctrl+shift is present because the simple click based +#: version has an unavoidable delay of click_interval, to disambiguate +#: clicks from double clicks. + +# mouse_map ctrl+shift+left press grabbed discard_event + +#: Prevent this press event from being sent to the program that has +#: grabbed the mouse, as the corresponding release event is used to +#: open a URL. + +# mouse_map middle release ungrabbed paste_from_selection +# mouse_map left press ungrabbed mouse_selection normal +# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle +# mouse_map left doublepress ungrabbed mouse_selection word +# mouse_map left triplepress ungrabbed mouse_selection line + +#: Select the entire line + +# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#: Select from the clicked point to the end of the line + +# mouse_map right press ungrabbed mouse_selection extend + +#: If you want only the end of the selection to be moved instead of +#: the nearest boundary, use move-end instead of extend. + +# mouse_map shift+middle release ungrabbed,grabbed paste_selection +# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal +# mouse_map shift+ctrl+alt+left press ungrabbed,grabbed mouse_selection rectangle +# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word +# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +#: Select the entire line + +# mouse_map shift+ctrl+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +#: Select from the clicked point to the end of the line + +# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend +#: }}} + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay (in milliseconds) between screen updates. Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS you have to either +#: set sync_to_monitor to no or use a monitor with a high refresh +#: rate. Also, to minimize latency when there is pending input to be +#: processed, repaint_delay is ignored. + +# input_delay 3 + +#: Delay (in milliseconds) before input from the program running in +#: the terminal is processed. Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents tearing (https://en.wikipedia.org/wiki/Screen_tearing) +#: when scrolling. However, it limits the rendering speed to the +#: refresh rate of your monitor. With a very high speed mouse/high +#: keyboard repeat rate, you may notice some slight input latency. If +#: so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +# enable_audio_bell yes +enable_audio_bell no + +#: Enable/disable the audio bell. Useful in environments that require +#: silence. + +# visual_bell_duration 0.0 + +#: Visual bell duration. Flash the screen when a bell occurs for the +#: specified number of seconds. Set to zero to disable. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on linux. + +# bell_on_tab yes + +#: Show a bell symbol on the tab if a bell occurs in one of the +#: windows in the tab and the window is not the currently focused +#: window + +# command_on_bell none + +#: Program to run when a bell occurs. The environment variable +#: KITTY_CHILD_CMDLINE can be used to get the program running in the +#: window in which the bell occurred. + +#: }}} + +#: Window layout {{{ + +remember_window_size no +initial_window_width 640 +initial_window_height 480 + +#: If enabled, the window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * +enabled_layouts tall,fat,grid + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the https://sw.kovidgoyal.net/kitty/overview/#layouts. + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing windows. The cells value is used for horizontal resizing +#: and the lines value for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified the unit is assumed to +#: be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: minimum needed borders for inactive windows are drawn. That is only +#: the borders that separate the inactive window from a neighbor. Note +#: that setting a non-zero window margin overrides this and causes all +#: borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin (in pts) to use when only a single window is +#: visible. Negative values will cause the value of +#: window_margin_width to be used instead. A single value sets all +#: four sides. Two values set the vertical and horizontal sides. Three +#: values set top, horizontal and bottom. Four values set top, right, +#: bottom and left. + +# window_padding_width 0 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be on +#: only the bottom and right edges. + +# active_border_color #00ff00 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #cccccc + +#: The color for the border of inactive windows + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +# hide_window_decorations no + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only can be used to only hide the titlebar. +#: Whether this works and exactly what effect it has depends on the +#: window manager/operating system. Note that the effects of changing +#: this setting when reloading config are undefined. + +# resize_debounce_time 0.1 + +#: The time (in seconds) to wait before redrawing the screen when a +#: resize event is received. On platforms such as macOS, where the +#: operating system sends events corresponding to the start and end of +#: a resize, this number is ignored. + +# resize_draw_strategy static + +#: Choose how kitty draws a window while a resize is in progress. A +#: value of static means draw the current window contents, mostly +#: unchanged. A value of scale means draw the current window contents +#: scaled. A value of blank means draw a blank window. A value of size +#: means show the window size in cells. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with an +#: initial_window_width and initial_window_height in number of cells, +#: this option can be used to keep the margins as small as possible +#: when resizing the OS window. Note that this does not currently work +#: on Wayland. + +# confirm_os_window_close 0 + +#: Ask for confirmation when closing an OS window or a tab that has at +#: least this number of kitty windows in it. A value of zero disables +#: confirmation. This confirmation also applies to requests to quit +#: the entire application (all OS windows, via the quit action). + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: Which edge to show the tab bar on, top or bottom + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts) + +# tab_bar_margin_height 0.0 0.0 + +#: The margin above and below the tab bar (in pts). The first number +#: is the margin between the edge of the OS Window and the tab bar and +#: the second number is the margin between the tab bar and the +#: contents of the current tab. + +# tab_bar_style fade + +#: The tab bar style, can be one of: + +#: fade +#: Each tab's edges fade into the background color (see tab_fade) +#: slant +#: Tabs look like the tabs in a physical file +#: separator +#: Tabs are separated by a configurable separator (see tab_separator) +#: powerline +#: Tabs are shown as a continuous line with "fancy" separators (see tab_powerline_style) +#: hidden +#: The tab bar is hidden. If you use this, you might want to create a mapping +#: for the https://sw.kovidgoyal.net/kitty/actions/#select-tab action which presents you with a list +#: of tabs and allows for easy switching to a tab. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, or round. + +# tab_activity_symbol none + +#: Some text or a unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. If you want to use +#: leading or trailing spaces surround the text with quotes. + +# tab_title_template "{title}" + +#: A template to render the tab title. The default just renders the +#: title. If you wish to include the tab-index as well, use something +#: like: {index}: {title}. Useful if you have shortcuts mapped for +#: goto_tab N. If you prefer to see the index as a superscript, use +#: {sup.index}. In addition you can use {layout_name} for the current +#: layout name, {num_windows} for the number of windows in the tab and +#: {num_window_groups} for the number of window groups (not counting +#: overlay windows) in the tab. Note that formatting is done by +#: Python's string formatting machinery, so you can use, for instance, +#: {layout_name[:2].upper()} to show only the first two letters of the +#: layout name, upper-cased. If you want to style the text, you can +#: use styling directives, for example: +#: {fmt.fg.red}red{fmt.fg.default}normal{fmt.bg._00FF00}green +#: bg{fmt.bg.normal}. Similarly, for bold and italic: +#: {fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}. + +# active_tab_title_template none + +#: Template to use for active tabs, if not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +#: }}} + +#: Color scheme {{{ + +# foreground #dddddd +# background #000000 + +#: The foreground and background colors + +# background_opacity 1.0 + +#: The opacity of the background. A number between 0 and 1, where 1 is +#: opaque and 0 is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background. This is so that things like the status bar in vim, +#: powerline prompts, etc. still look good. But it means that if you +#: use a color theme with a background color in your editor, it will +#: not be rendered as transparent. Instead you should change the +#: default background color in your kitty config and not use a +#: background color in the editor color scheme. Or use the escape +#: codes to set the terminals default colors in a shell script to +#: launch your editor. Be aware that using a value less than 1.0 is a +#: (possibly significant) performance hit. If you want to dynamically +#: change transparency of windows set dynamic_background_opacity to +#: yes (this is off by default as it has a performance cost). Changing +#: this setting when reloading the config will only work if +#: dynamic_background_opacity was enabled in the original config. + +# background_image none + +#: Path to a background image. Must be in PNG format. + +# background_image_layout tiled + +#: Whether to tile or scale the background image. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. +#: Changing this setting by reloading the config is not supported. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. The +#: tint is applied only under the text area, not margin/borders. Makes +#: it easier to read the text. Tinting is done using the current +#: background color for each window. This setting applies only if +#: background_opacity is set and transparent windows are supported or +#: background_image is set. + +# dim_opacity 0.75 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 + +#: The foreground for text selected with the mouse. A value of none +#: means to leave the color unchanged. + +# selection_background #fffacd + +#: The background for text selected with the mouse. + +#: The color table {{{ + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 + +#: black + +# color1 #cc0403 +# color9 #f2201f + +#: red + +# color2 #19cb00 +# color10 #23fd00 + +#: green + +# color3 #cecb00 +# color11 #fffd00 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 3 (violet) + +#: }}} + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login and --interactive to ensure that the shell starts in +#: interactive mode and reads its startup rc files. + +# editor . + +#: The terminal editor (such as ``vim`` or ``nano``) to use when +#: editing the kitty config file or similar tasks. + +#: The default value of . means to use the environment variables +#: VISUAL and EDITOR in that order. If these variables aren't set, +#: kitty will run your shell (``$SHELL -l -i -c env``) to see if your +#: shell config files set VISUAL or EDITOR. If that doesn't work, +#: kitty will cycle through various known editors (``vim``, ``emacs``, +#: etc) and take the first one that exists on your system. + +# close_on_child_death no + +#: Close the window when the child process (shell) exits. If no (the +#: default), the terminal will remain open when the child exits as +#: long as there are still processes outputting to the terminal (for +#: example disowned or backgrounded processes). If yes, the window +#: will close as soon as the child process exits. Note that setting it +#: to yes means that any background processes still using the terminal +#: can fail silently because their stdout/stderr/stdin no longer work. + +# allow_remote_control no +allow_remote_control yes + +#: Allow other programs to control kitty. If you turn this on other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over ssh +#: connections. You can chose to either allow any program running +#: within kitty to control it, with yes or only programs that connect +#: to the socket specified with the kitty --listen-on command line +#: option, if you use the value socket-only. The latter is useful if +#: you want to prevent programs running on a remote computer over ssh +#: from controlling kitty. Reloading the config will not affect this +#: setting. + +# listen_on none + +#: Tell kitty to listen to the specified unix/tcp socket for remote +#: control connections. Note that this will apply to all kitty +#: instances. It can be overridden by the kitty --listen-on command +#: line flag. This option accepts only UNIX sockets, such as +#: unix:${TEMP}/mykitty or (on Linux) unix:@mykitty. Environment +#: variables are expanded. If {kitty_pid} is present then it is +#: replaced by the PID of the kitty process, otherwise the PID of the +#: kitty process is appended to the value, with a hyphen. This option +#: is ignored unless you also set allow_remote_control to enable +#: remote control. See the help for kitty --listen-on for more +#: details. Changing this option by reloading the config is not +#: supported. + +# env + +#: Specify environment variables to set in all child processes. Note +#: that environment variables are expanded recursively, so if you +#: use:: + +#: env MYVAR1=a +#: env MYVAR2=${MYVAR1}/${HOME}/b + +#: The value of MYVAR2 will be a/<path to home directory>/b. + +# update_check_interval 24 + +#: Periodically check if an update to kitty is available. If an update +#: is found a system notification is displayed informing you of the +#: available update. The default is to check every 24 hrs, set to zero +#: to disable. Changing this option by reloading the config is not +#: supported. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session command line option for +#: individual instances. See +#: https://sw.kovidgoyal.net/kitty/overview/#startup-sessions in the +#: kitty documentation for details. Note that relative paths are +#: interpreted with respect to the kitty config directory. Environment +#: variables in the path are expanded. Changing this option by +#: reloading the config is not supported. + +# clipboard_control write-clipboard write-primary + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: set of possible actions is: write-clipboard read-clipboard write- +#: primary read-primary. The default is to allow writing to the +#: clipboard and primary selection. Note that enabling the read +#: functionality is a security risk as it means that any program, even +#: one running on a remote server via SSH can read your clipboard. See +#: also clipboard_max_size. + +# clipboard_max_size 64 + +#: The maximum size (in MB) of data from programs running in kitty +#: that will be stored for writing to the system clipboard. See also +#: clipboard_control. A value of zero means no size limit is applied. + +# allow_hyperlinks yes + +#: Process hyperlink (OSC 8) escape sequences. If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click by holding down ctrl+shift and clicking +#: with the mouse. The special value of ``ask`` means that kitty will +#: ask before opening the link. + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on Stack Overflow +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. Changing this option by reloading the config will only affect +#: newly created windows. + +#: }}} + +#: OS specific tweaks {{{ + +# wayland_titlebar_color system + +#: Change the color of the kitty window's titlebar on Wayland systems +#: with client side window decorations such as GNOME. A value of +#: system means to use the default system color, a value of background +#: means to use the background color of the currently active window +#: and finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: Change the color of the kitty window's titlebar on macOS. A value +#: of system means to use the default system color, a value of +#: background means to use the background color of the currently +#: active window and finally you can use an arbitrary color, such as +#: #12af59 or red. WARNING: This option works by using a hack, as +#: there is no proper Cocoa API for it. It sets the background color +#: of the entire window and makes the titlebar transparent. As such it +#: is incompatible with background_opacity. If you want to use both, +#: you are probably better off just hiding the titlebar with +#: hide_window_decorations. + +# macos_option_as_alt no + +#: Use the option key as an alt key. With this set to no, kitty will +#: use the macOS native Option+Key = unicode character behavior. This +#: will break any Alt+key keyboard shortcuts in your terminal +#: programs, but you can use the macOS unicode input technique. You +#: can use the values: left, right, or both to use only the left, +#: right or both Option keys as Alt, instead. Changing this setting by +#: reloading the config is not supported. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks (⌘+Tab) on macOS. Changing +#: this setting by reloading the config is not supported. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed. By +#: default, kitty will stay running, even with no open windows, as is +#: the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level (OS) windows to not be +#: resizable on macOS. Changing this setting by reloading the config +#: will only affect newly created windows. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes. For example, a value of +#: 0.75 will result in rendering that looks similar to sub-pixel +#: antialiasing at common font sizes. + +# macos_traditional_fullscreen no + +#: Use the traditional full-screen transition, that is faster, but +#: less pretty. + +# macos_show_window_title_in all + +#: Show or hide the window title in the macOS window or menu-bar. A +#: value of window will show the title of the currently active window +#: at the top of the macOS window. A value of menubar will show the +#: title of the currently active window in the macOS menu-bar, making +#: use of otherwise wasted space. all will show the title everywhere +#: and none hides the title in the window and the menu-bar. + +# macos_custom_beam_cursor no + +#: Enable/disable custom mouse cursor for macOS that is easier to see +#: on both light and dark backgrounds. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. Changing this setting +#: by reloading the config is not supported. + +# linux_display_server auto + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. Changing this setting by +#: reloading the config is not supported. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase unicode characters. +#: For example: ``a`` for the A key, ``[`` for the left square bracket +#: key, etc. For functional keys, such as ``Enter or Escape`` the +#: names are present at https://sw.kovidgoyal.net/kitty/keyboard- +#: protocol/#functional-key-definitions. For a list of modifier names, +#: see: GLFW mods <https://www.glfw.org/docs/latest/group__mods.html> + +#: On Linux you can also use XKB key names to bind keys that are not +#: supported by GLFW. See XKB keys +#: <https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon- +#: keysyms.h> for a list of key names. The name to use is the part +#: after the XKB_KEY_ prefix. Note that you can only use an XKB key +#: name for keys that are not known as GLFW keys. + +#: Finally, you can use raw system key codes to map keys, again only +#: for keys that are not known as GLFW keys. To see the system key +#: code for a key, start kitty with the kitty --debug-input option. +#: Then kitty will output some debug text for every key event. In that +#: text look for ``native_code`` the value of that becomes the key +#: name in the shortcut. For example: + +#: .. code-block:: none + +#: on_key_input: glfw key: 65 native_code: 0x61 action: PRESS mods: 0x0 text: 'a' + +#: Here, the key name for the A key is 0x61 and you can use it with:: + +#: map ctrl+0x61 something + +#: to map ctrl+a to something. + +#: You can use the special action no_op to unmap a keyboard shortcut +#: that is assigned in the default configuration:: + +#: map kitty_mod+space no_op + +#: You can combine multiple actions to be triggered by a single +#: shortcut, using the syntax below:: + +#: map key combine <separator> action1 <separator> action2 <separator> action3 ... + +#: For example:: + +#: map kitty_mod+e combine : new_window : next_layout + +#: this will create a new window and switch to the next available +#: layout + +#: You can use multi-key shortcuts using the syntax shown below:: + +#: map key1>key2>key3 action + +#: For example:: + +#: map ctrl+f>2 set_font_size 20 + +#: The full list of actions that can be mapped to key presses is +#: available here </actions>. + +# kitty_mod ctrl+shift + +#: The value of kitty_mod is used as the modifier for all default +#: shortcuts, you can change it in your kitty.conf to change the +#: modifiers for all the default shortcuts. + +# clear_all_shortcuts no + +#: You can have kitty remove all shortcut definition seen up to this +#: point. Useful, for instance, to remove the default shortcuts. + +# kitten_alias hints hints --hints-offset=0 + +#: You can create aliases for kitten names, this allows overriding the +#: defaults for kitten options and can also be used to shorten +#: repeated mappings of the same kitten with a specific group of +#: options. For example, the above alias changes the default value of +#: kitty +kitten hints --hints-offset to zero for all mappings, +#: including the builtin ones. + +#: Clipboard {{{ + +# map kitty_mod+c copy_to_clipboard + +#: There is also a copy_or_interrupt action that can be optionally +#: mapped to Ctrl+c. It will copy only if there is a selection and +#: send an interrupt otherwise. Similarly, copy_and_clear_or_interrupt +#: will copy and clear the selection or send an interrupt if there is +#: no selection. + +# map kitty_mod+v paste_from_clipboard +# map kitty_mod+s paste_from_selection +# map kitty_mod+o pass_selection_to_program + +#: You can also pass the contents of the current selection to any +#: program using pass_selection_to_program. By default, the system's +#: open program is used, but you can specify your own, the selection +#: will be passed as a command line argument to the program, for +#: example:: + +#: map kitty_mod+o pass_selection_to_program firefox + +#: You can pass the current selection to a terminal program running in +#: a new kitty window, by using the @selection placeholder:: + +#: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +# map kitty_mod+up scroll_line_up +# map kitty_mod+down scroll_line_down +# map kitty_mod+page_up scroll_page_up +# map kitty_mod+page_down scroll_page_down +# map kitty_mod+home scroll_home +# map kitty_mod+end scroll_end +# map kitty_mod+h show_scrollback + +#: You can pipe the contents of the current screen + history buffer as +#: STDIN to an arbitrary program using the ``launch`` function. For +#: example, the following opens the scrollback buffer in less in an +#: overlay window:: + +#: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#: For more details on piping screen and buffer contents to external +#: programs, see launch. + +#: }}} + +#: Window management {{{ + +# map kitty_mod+enter new_window + +#: You can open a new window running an arbitrary program, for +#: example:: + +#: map kitty_mod+y launch mutt + +#: You can open a new window with the current working directory set to +#: the working directory of the current window using:: + +#: map ctrl+alt+enter launch --cwd=current + +#: You can open a new window that is allowed to control kitty via the +#: kitty remote control facility by prefixing the command line with @. +#: Any programs running in that window will be allowed to control +#: kitty. For example:: + +#: map ctrl+enter launch --allow-remote-control some_program + +#: You can open a new window next to the currently active window or as +#: the first window, with:: + +#: map ctrl+n launch --location=neighbor some_program +#: map ctrl+f launch --location=first some_program + +#: For more details, see launch. + +# map kitty_mod+n new_os_window + +#: Works like new_window above, except that it opens a top level OS +#: kitty window. In particular you can use new_os_window_with_cwd to +#: open a window with the current working directory. + +# map kitty_mod+w close_window +# map kitty_mod+] next_window +# map kitty_mod+[ previous_window +# map kitty_mod+f move_window_forward +# map kitty_mod+b move_window_backward +# map kitty_mod+` move_window_to_top +# map kitty_mod+r start_resizing_window +# map kitty_mod+1 first_window +# map kitty_mod+2 second_window +# map kitty_mod+3 third_window +# map kitty_mod+4 fourth_window +# map kitty_mod+5 fifth_window +# map kitty_mod+6 sixth_window +# map kitty_mod+7 seventh_window +# map kitty_mod+8 eighth_window +# map kitty_mod+9 ninth_window +# map kitty_mod+0 tenth_window +#: }}} + +#: Tab management {{{ + +# map kitty_mod+right next_tab +# map kitty_mod+left previous_tab +# map kitty_mod+t new_tab +# map kitty_mod+q close_tab +# map shift+cmd+w close_os_window +# map kitty_mod+. move_tab_forward +# map kitty_mod+, move_tab_backward +# map kitty_mod+alt+t set_tab_title + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, and any number larger than the last tab being the last tab:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and use +#: new_tab_with_cwd. Finally, if you want the new tab to open next to +#: the current tab rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +# map kitty_mod+l next_layout + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout + +#: There is also a toggle layout function that switches to the named +#: layout or back to the previous layout if in the named layout. +#: Useful to temporarily "zoom" the active window by switching to the +#: stack layout:: + +#: map ctrl+alt+z toggle_layout stack +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+backspace change_font_size all 0 + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +# map kitty_mod+e open_url_with_hints + +#: Open a currently visible URL using the keyboard. The program used +#: to open the URL is specified in open_url_with. + +# map kitty_mod+p>f kitten hints --type path --program - + +#: Select a path/filename and insert it into the terminal. Useful, for +#: instance to run git commands on a filename output from a previous +#: git command. + +# map kitty_mod+p>shift+f kitten hints --type path + +#: Select a path/filename and open it with the default open program. + +# map kitty_mod+p>l kitten hints --type line --program - + +#: Select a line of text and insert it into the terminal. Use for the +#: output of things like: ls -1 + +# map kitty_mod+p>w kitten hints --type word --program - + +#: Select words and insert into terminal. + +# map kitty_mod+p>h kitten hints --type hash --program - + +#: Select something that looks like a hash and insert it into the +#: terminal. Useful with git, which uses sha1 hashes to identify +#: commits + +# map kitty_mod+p>n kitten hints --type linenum + +#: Select something that looks like filename:linenum and open it in +#: vim at the specified line number. + +# map kitty_mod+p>y kitten hints --type hyperlink + +#: Select a hyperlink (i.e. a URL that has been marked as such by the +#: terminal program, for example, by ls --hyperlink=auto). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see kittens/hints. +#: }}} + +#: Miscellaneous {{{ + +# map kitty_mod+f11 toggle_fullscreen +# map kitty_mod+f10 toggle_maximized +# map kitty_mod+u kitten unicode_input +# map kitty_mod+f2 edit_config_file +# map kitty_mod+escape kitty_shell window + +#: Open the kitty shell in a new window/tab/overlay/os_window to +#: control kitty using commands. + +# map kitty_mod+a>m set_background_opacity +0.1 +# map kitty_mod+a>l set_background_opacity -0.1 +# map kitty_mod+a>1 set_background_opacity 1 +# map kitty_mod+a>d set_background_opacity default +# map kitty_mod+delete clear_terminal reset active + +#: You can create shortcuts to clear/reset the terminal. For example:: + +#: # Reset the terminal +#: map kitty_mod+f9 clear_terminal reset active +#: # Clear the terminal screen by erasing all contents +#: map kitty_mod+f10 clear_terminal clear active +#: # Clear the terminal scrollback by erasing it +#: map kitty_mod+f11 clear_terminal scrollback active +#: # Scroll the contents of the screen into the scrollback +#: map kitty_mod+f12 clear_terminal scroll active + +#: If you want to operate on all windows instead of just the current +#: one, use all instead of active. + +#: It is also possible to remap Ctrl+L to both scroll the current +#: screen contents into the scrollback buffer and clear the screen, +#: instead of just clearing the screen, for example, for ZSH add the +#: following to ~/.zshrc: + +#: .. code-block:: sh + +#: scroll-and-clear-screen() { +#: printf '\n%.0s' {1..$LINES} +#: zle clear-screen +#: } +#: zle -N scroll-and-clear-screen +#: bindkey '^l' scroll-and-clear-screen + +# map kitty_mod+f5 load_config_file + +#: Reload kitty.conf, applying any changes since the last time it was +#: loaded. Note that a handful of settings cannot be dynamically +#: changed and require a full restart of kitty. You can also map a +#: keybinding to load a different config file, for example:: + +#: map f5 load_config /path/to/alternative/kitty.conf + +#: Note that all setting from the original kitty.conf are discarded, +#: in other words the new conf settings *replace* the old ones. + +# map kitty_mod+f6 debug_config + +#: Show details about exactly what configuration kitty is running with +#: and its host environment. Useful for debugging issues. + + +#: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#: client program when pressing specified shortcut keys. For example:: + +#: map ctrl+alt+a send_text all Special text + +#: This will send "Special text" when you press the ctrl+alt+a key +#: combination. The text to be sent is a python string literal so you +#: can use escapes like \x1b to send control codes or \u21fb to send +#: unicode characters (or you can just input the unicode characters +#: directly as UTF-8 text). The first argument to send_text is the +#: keyboard modes in which to activate the shortcut. The possible +#: values are normal or application or kitty or a comma separated +#: combination of them. The special keyword all means all modes. The +#: modes normal and application refer to the DECCKM cursor key mode +#: for terminals, and kitty refers to the special kitty extended +#: keyboard protocol. + +#: Another example, that outputs a word and then moves the cursor to +#: the start of the line (same as pressing the Home key):: + +#: map ctrl+alt+a send_text normal Word\x1b[H +#: map ctrl+alt+a send_text application Word\x1bOH + +#: }}} + +#: }}} diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..3419359 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,168 @@ +# xwayland disable + +input * { + xkb_layout "fr" +} + +input <identifier> xkb_model "pc101" + +bar { + status_command i3status +} + +output * bg #103040 solid_color + +# output eDP-1 scale 1.25 + +input "1739:52544:SYNA7DAB:00_06CB:CD40_Touchpad" { + tap enabled + natural_scroll enabled +} + +font Monospace 9 + +set $mod Mod4 + +bindsym $mod+q kill +bindsym $mod+Return exec --no-startup-id foot +#bindsym $mod+Return exec --no-startup-id xt +#bindsym $mod+d exec --no-startup-id bemenu-run +#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -dmenu="bemenu -i -fn 'Mono-12' --hf '#00ff00' --tf '#00ff00'" +#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -dmenu="wmenu-run" +#bindsym $mod+d exec --no-startup-id wemenu-run +bindsym $mod+d exec --no-startup-id fuzzel -T foot + +for_window [app_id="google-chrome"] floating enable +for_window [class="firefox"] floating enable +for_window [class="thunderbird"] floating enable + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+m focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+m move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+z layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +#bindsym $mod+q focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+ampersand workspace number $ws1 +bindsym $mod+eacute workspace number $ws2 +bindsym $mod+quotedbl workspace number $ws3 +bindsym $mod+apostrophe workspace number $ws4 +bindsym $mod+parenleft workspace number $ws5 +bindsym $mod+minus workspace number $ws6 +bindsym $mod+egrave workspace number $ws7 +bindsym $mod+underscore workspace number $ws8 +bindsym $mod+ccedilla workspace number $ws9 +bindsym $mod+agrave workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+ampersand move container to workspace number $ws1 +bindsym $mod+Shift+eacute move container to workspace number $ws2 +bindsym $mod+Shift+quotedbl move container to workspace number $ws3 +bindsym $mod+Shift+apostrophe move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+minus move container to workspace number $ws6 +bindsym $mod+Shift+egrave move container to workspace number $ws7 +bindsym $mod+Shift+underscore move container to workspace number $ws8 +bindsym $mod+Shift+ccedilla move container to workspace number $ws9 +bindsym $mod+Shift+agrave move container to workspace number $ws10 + +# Cycle through active workspaces +bindsym $mod+Tab workspace next +bindsym $mod+Shift+Tab workspace prev + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +# bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" +bindsym $mod+Ctrl+backspace exec killall sway + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym m resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Move a workspace to a different monitor +bindsym $mod+greater move workspace to output right +bindsym $mod+less move workspace to output left + diff --git a/.config/yay/config.json b/.config/yay/config.json new file mode 100644 index 0000000..f330f41 --- /dev/null +++ b/.config/yay/config.json @@ -0,0 +1,50 @@ +{ + "aururl": "https://aur.archlinux.org", + "aurrpcurl": "https://aur.archlinux.org/rpc?", + "buildDir": "/home/marc/.cache/yay", + "editor": "", + "editorflags": "", + "makepkgbin": "makepkg", + "makepkgconf": "", + "pacmanbin": "pacman", + "pacmanconf": "/etc/pacman.conf", + "redownload": "no", + "answerclean": "yes", + "answerdiff": "yes", + "answeredit": "", + "answerupgrade": "", + "gitbin": "git", + "gpgbin": "gpg", + "gpgflags": "", + "mflags": "", + "sortby": "votes", + "searchby": "name-desc", + "gitflags": "", + "removemake": "ask", + "sudobin": "sudo", + "sudoflags": "", + "version": "12.3.5", + "requestsplitn": 150, + "completionrefreshtime": 7, + "maxconcurrentdownloads": 1, + "bottomup": true, + "sudoloop": false, + "timeupdate": false, + "devel": false, + "cleanAfter": true, + "keepSrc": false, + "provides": true, + "pgpfetch": true, + "cleanmenu": true, + "diffmenu": true, + "editmenu": false, + "combinedupgrade": true, + "useask": false, + "batchinstall": false, + "singlelineresults": false, + "separatesources": true, + "debug": false, + "rpc": true, + "doubleconfirm": true, + "rebuild": "no" +} diff --git a/.forward b/.forward new file mode 100644 index 0000000..b561804 --- /dev/null +++ b/.forward @@ -0,0 +1 @@ +marc mvertes@free.fr diff --git a/.fvwm2rc b/.fvwm2rc new file mode 100644 index 0000000..e3aea63 --- /dev/null +++ b/.fvwm2rc @@ -0,0 +1,347 @@ +HilightColor black IndianRed +WindowFont fixed +IconFont fixed +MenuStyle black grey76 grey30 fixed fvwm +IgnoreModifiers 2 + +#Style "*" SloppyFocus +Style "*" MouseFocusClickRaises +Style "*" ForeColor black +Style "*" BackColor SteelBlue +Style "*" IconBox 800x64+0-0 +Style "*" MWMFunctions, MWMButtons, MWMBorder, MWMDecor, DecorateTransient, StickyIcon +Style "*" RandomPlacement + +OpaqueMoveSize 0 +#EdgeScroll 100 100 +#EdgeScroll 100000 100000 +EdgeScroll 0 0 +EdgeResistance 100000 100000 +#style "*" EdgeMoveResistance 100000 100 + +DeskTopSize 2x2 + +#ImagePath /usr/X11R6/include/X11/pixmaps/ +#ImagePath /usr/share/pixmaps/ + +Style "*" BorderWidth 4, HandleWidth 4 +Style "Fvwm*" NoTitle, Sticky, WindowListSkip +Style "*Pager" NoHandles, BorderWidth 0, WindowListSkip, CirculateSkip +Style "FvwmBanner" StaysOnTop +Style "FvwmButtons" NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 4 +Style "*lock" NoTitle, NoHandles, WindowListSkip +Style "gkrellm" NoTitle, Sticky, WindowListSkip, CirculateSkip +#Style "*unknown*" NoTitle, BorderWidth 0, NoHandles, WindowListSkip + +#Style "rxvt" Icon Monitor.xpm +#Style "xterm" Icon Monitor.xpm +#Style "uxterm" Icon Monitor.xpm + +#========================================================================# +# Stuff to do at start-up +# + +AddToFunc "StartFunction" ++ I Module FvwmPager 0 0 ++ I Exec status2 ++ I Exec dunst +#+ "I" Exec xsetroot -solid rgb:3/4/5 +#+ "I" Exec setxkbmap fr +#+ "I" Exec synclient VertScrollDelta=-114 + +#========================================================================# +# Now define some handy complex functions +# +AddToFunc "Move-or-Raise" "M" Move ++ "M" Raise ++ "C" Raise ++ "D" Maximize 100 100 + +AddToFunc "Move-or-Lower" "M" Move ++ "M" Lower ++ "C" Lower ++ "D" RaiseLower + +AddToFunc "Move-or-Iconify" "M" Move ++ "D" Iconify + +AddToFunc "Resize-or-Raise" "M" Resize ++ "M" Raise ++ "C" Raise ++ "D" RaiseLower + +AddToFunc "Focus-and-Raise" I Focus ++ I Iconify false ++ I Raise ++ I WarpToWindow 50 8p + +#========================================================================# +DestroyMenu "Quit-Verify" +AddToMenu "Quit-Verify" +#+ "&Lock screen" Exec exec vlock -an ++ "&Fvwm restart" Restart +#+ "&Lock screen" Exec exec slock sudo sh -c "echo mem > /sys/power/state" ++ "&Quit X11" Quit ++ "&Suspend" Exec exec slock sudo sh -c "echo mem > /sys/power/state" +#+ "&Suspend" Exec exec suspend ++ "&Reboot" Exec exec sudo /sbin/reboot ++ "&Power off" Exec exec sudo /sbin/poweroff + +DestroyMenu "Module-Popup" +AddToMenu "Module-Popup" ++ "Debug" Module FvwmDebug ++ "Identify" Module FvwmIdent ++ "Window List" Module FvwmWinList + +DestroyMenu "Desktop-Apps" +AddToMenu "Desktop-Apps" +#+ "&Brave" Exec exec brave ++ "&Chromium" Exec exec chromium ++ "&Discord" Exec exec discord ++ "&Firefox" Exec exec firefox ++ "&Google Chrome" Exec exec google-chrome-stable ++ "&Keybase" Exec exec keybase-gui ++ "&LibreOffice" Exec exec libreoffice ++ "&RSS Guard" Exec exec rssguard ++ "S&ignal" Exec exec signal-desktop ++ "&Slack" Exec exec slack ++ "Sea&Monkey" Exec exec seamonkey ++ "&Zoom" Exec exec zoom + +DestroyMenu "Settings" +AddToMenu "Settings" ++ "&Display" Exec exec arandr +#+ "&Keyboard" Exec exec setxkbmap fr ++ "&Power" Exec exec xt -e sudo powertop ++ "&Sound" Exec exec pavucontrol ++ "&Wifi" Exec exec wpa_gui -i wlan0 + +DestroyMenu "Multimedia" +AddToMenu "Multimedia" ++ "&Asunder" Exec exec asunder ++ "&Geeqie" Exec exec geeqie +#+ "&Molotov" Exec exec molotov + "&Quodlibet" Exec exec quodlibet ++ "&Spotify" Exec exec spotify ++ "&Vlc" Exec exec vlc + +DestroyMenu "Utilities" +AddToMenu "Utilities" +#+ "&Xterm" Exec exec uxterm -sl 500 -j -ls -cr red +#+ "&Top" Exec exec uxterm -T Top -n Top -e top +#+ "&Xterm" Exec exec urxvtc +sb -sl 500 -j -ls -cr red ++ "&Xterm" Exec exec xt ++ "&Black Xterm" Exec exec xtb ++ "File manager" Exec exec pcmanfm-qt ++ "&Top" Exec exec xt -T Top -n Top -e /bin/top +#+ "&Web" Exec exec chromium --disk-cache-dir=/tmp/chromium-cache +#+ "&Web" Exec exec brave ++ "&Firefox" Exec exec firefox ++ "&Chromium" Exec exec chromium --disk-cache-dir=/tmp/chromium-cache ++ "T&hunderbird" Exec exec thunderbird +#+ "xclipboard" Exec exec xclipboard +#+ "" Nop ++ "" Nop ++ "&System" Popup Settings ++ "&Desktop" Popup Desktop-Apps ++ "M&ultimedia" Popup Multimedia +#+ "ssh bip" Exec exec uxterm -j -sl 500 -cr red -e mosh bip +#+ "ssh dev.ugrid.net" Exec exec uxterm -j -sl 500 -cr red -e ssh dev.ugrid.net ++ "" Nop ++ "&Quit" Popup Quit-Verify + +# Define the most common window operations +DestroyMenu "Window Ops" +AddToMenu "Window Ops" ++ "&Move Alt+F5" Function Move-or-Raise ++ "&Resize Alt+F6" Function Resize-or-Raise ++ "R&aise" Raise ++ "&Lower" Lower ++ "(De)Iconify" Iconify ++ "(Un)Stick" Stick ++ "(Un)Maximize Alt+F12" Function maximize_func ++ "" Nop ++ "&Kill" Destroy ++ "&Close" Delete ++ "" Nop ++ "Switch to..." WindowList ++ "Refresh Screen" Refresh + +# +# A trimmed down version of "Window Ops", good for binding to decorations +# +AddToMenu "Window-Ops2" "&Move Alt+F5" Move-or-Raise ++ "&Size Alt+F6" Resize-or-Raise ++ "Mi&nimize Alt+F4" Iconify 1 ++ "&Horizontal Max Alt+F10" Maximize 100 0 ++ "&Vertical Max Alt+F11" Maximize 0 100 ++ "Ma&ximize Alt+F12" Maximize 100 100 ++ "" Nop ++ "&Kill" Destroy ++ "&Close" Delete + +#========================================================================# +# +# One more complex function - couldn't be defined earlier because it used +# pop-up menus +# +# This creates the "system" menu for the title-bar window-ops +# pop-up +# +AddToFunc "window_ops_func" "C" PopUp Window-Ops2 ++ "M" PopUp Window-Ops2 ++ "D" Delete + +#========================================================================# +# +# Mouse bindings +# + +# First, for the mouse in the root window +# Button 1 gives the Utilities menu +# Button 2 gives the Window Ops menu +# Button 3 gives the WindowList (like TwmWindows) +# I use the AnyModifier (A) option for the modifier field, so you can hold down +# any shift-control-whatever combination you want! + +# Button Context Modifi Function +Mouse 1 R A Menu "Utilities" Nop +Mouse 2 R A Menu "Window Ops" Nop +Mouse 3 R A WindowList + +# Now the title bar buttons +# Any button in the left title-bar button gives the window ops menu +# Any button in the first right title-bar button Iconifies the window +# Any button in the second title-bar button full-maximizes +# Note the use of "Mouse 0" for AnyButton. + +# Button Context Modif Function +Mouse 0 1 A Function "window_ops_func" +Mouse 0 2 A Maximize 100 100 +Mouse 0 4 A Iconify + +# Now the rest of the frame +# Here I invoke my complex functions for Move-or-lower, Move-or-raise, +# and Resize-or-Raise. +# +# Button 1 in the corner/sides pieces, with any modifiers, gives resize or raise +Mouse 1 FS A Function "Resize-or-Raise" +# Button 1 in the title, or icon, w/ any modifiers, gives move or raise +Mouse 1 T A Function "Move-or-Raise" + +# Button 1 in an icons gives move for a drag, de-iconify for a double-click, +# nothing for a single click +# Button 2 in an icon, w/ any modifiers, gives de-iconify +Mouse 1 I A Function "Move-or-Iconify" +Mouse 2 I A Iconify + +# Button 2 in the corners, sides, or title-bar gives the window ops menu +Mouse 2 FST A Function "window_ops_func" + +# Button 3 anywhere in the decoration (except the title-bar buttons) +# does a raise-lower +Mouse 3 TSIF A RaiseLower + +# Button 3 in the window, with the Modifier-1 key (usually alt or diamond) +# gives Raise-Lower. Used to use control here, but that interferes with xterm +Mouse 3 W M RaiseLower + +#========================================================================# +# Now some keyboard shortcuts. +# Arrow Keys, wrap mode enabled +# press arrow + control anywhere, and scroll by 1 page +Key Left A C Scroll -100000 0 +Key Right A C Scroll +100000 +0 +Key Up A C Scroll +0 -100000 +Key Down A C Scroll +0 +100000 + +#Key Left A C Scroll -100 0 +#Key Right A C Scroll +100 +0 +#Key Up A C Scroll +0 -100 +#Key Down A C Scroll +0 +100 +# +# press arrow + meta key, and scroll by 1/10 of a page +#Key Left A M Scroll -10 +0 +#Key Right A M Scroll +10 +0 +#Key Up A M Scroll +0 -10 +#Key Down A M Scroll +0 +10 + +# press shift arrow + control anywhere, and move the pointer by 1% of a page +Key Left A SC CursorMove -1 0 +Key Right A SC CursorMove +1 +0 +Key Up A SC CursorMove +0 -1 +Key Down A SC CursorMove +0 +1 + +# press shift arrow + meta key, and move the pointer by 1/10 of a page +Key Left A SM CursorMove -10 +0 +Key Right A SM CursorMove +10 +0 +Key Up A SM CursorMove +0 -10 +Key Down A SM CursorMove +0 +10 + +# Keyboard accelerators +Key Super_L A A Popup "Utilities" +Key F1 A M Popup "Utilities" +Key F2 A M Popup "Window Ops" +Key F3 A M Module "WindowList" FvwmWinList +Key F4 A M Iconify +Key F5 A M Move +Key F6 A M Resize +Key F7 A M RaiseLower +#Key F8 A M Exec exec xbacklight +10 +Key F9 A M Close +Key F10 A M Maximize 100 0 +Key F11 A M Maximize 0 100 +Key F12 A M Maximize + +#Key XF86MonBrightnessDown A A Exec exec xbacklight -10 +#Key XF86MonBrightnessUp A A Exec exec xbacklight +10 +Key XF86AudioRaiseVolume A A Exec exec amixer set Master 5%+ +Key XF86AudioLowerVolume A A Exec exec amixer set Master 5%- +Key XF86AudioMute A A Exec exec amixer set Master toggle + +#Page Up/Dapge Down keys are used to scroll by one desktop page +# in any context, press page up/down + control +# in root context, just pressing page up/down is OK +# +# I prefer the non-wrapping scroll. These are for example purposes only +#Key Next A C Scroll 100000 0 +#Key Next R N Scroll 100000 0 +#Key Prior A C Scroll -100000 0 +#Key Prior R N Scroll -100000 0 + +#Key Tab A M Prev Focus +#Key Tab A MS Next Focus +Key Tab A M Prev Focus-and-Raise +Key Tab A MS Next Focus-and-Raise + +Key Escape A C WindowList + + +#========================================================================# + +# Definitions used by the modules + +#------------------ Pager +*FvwmPagerBack grey60 +*FvwmPagerFore black +#*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* +*FvwmPagerFont fixed +*FvwmPagerHilight #c3c3c3 +*FvwmPagerGeometry 80x60-1-1 +*FvwmPagerLabel 0 "arch" +*FvwmPagerSmallFont 5x8 + +#------------------ Identify +*FvwmIdentBack #000080 +*FvwmIdentFore Yellow +*FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* + +#------------------ FvwmWinList +*FvwmWinListBack #c3c3c3 +*FvwmWinListFore Black +*FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* +*FvwmWinListAction Click1 Iconify -1,Focus +*FvwmWinListAction Click2 Iconify +*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent +*FvwmWinListUseSkipList +*FvwmWinListGeometry +0-1 @@ -11,5 +11,12 @@ [user] email = mvertes@free.fr name = Marc Vertes + signinkey = DF3DEEB6285CE0B5CD4E95C3C3C0303496E733B9 [pull] rebase = false +[push] + autoSetupRemote = true +[hub] + protocol = ssh +[init] + defaultBranch = main diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 new file mode 100644 index 0000000..4c7c7e8 --- /dev/null +++ b/.gtkrc-2.0 @@ -0,0 +1,3 @@ +gtk-icon-theme-name = "Adwaita" +gtk-theme-name = "Adwaita" +gtk-font-name = "Liberation Sans 9" diff --git a/.i3status.conf b/.i3status.conf index 87656f8..31c0a8d 100644 --- a/.i3status.conf +++ b/.i3status.conf @@ -22,6 +22,7 @@ order += "disk /" order += "cpu_usage" #order += "load" order += "memory" +order += "volume master" order += "cpu_temperature 0" order += "tztime local" @@ -33,7 +34,7 @@ read_file hostname { wireless _first_ { #format_up = "🌐 %essid %quality" #format_up = "📶 %essid %quality" - format_up = "📡 %essid %quality" + format_up = "📡 %essid %signal %bitrate" format_down = "📡 down" } @@ -46,7 +47,8 @@ ethernet _first_ { battery all { last_full_capacity = true integer_battery_capacity = true - format = "%status %percentage %remaining" +# format = "%status %percentage %remaining" + format = "%status %percentage %remaining %consumption" status_chr = "⚡🔋" status_bat = "🔋" status_unk = "? UNK" @@ -93,8 +95,9 @@ memory { cpu_temperature 0 { format = "🌡%degrees °C" #path = "/sys/class/hwmon/hwmon0/temp1_input" + #path = "/sys/class/hwmon/hwmon6/temp1_input" #path = "/sys/class/hwmon/hwmon7/temp1_input" - path = "/sys/class/hwmon/hwmon6/temp1_input" + #path = "/sys/class/hwmon/hwmon8/temp1_input" } tztime local { @@ -102,3 +105,9 @@ tztime local { format = "%a %d %b %H:%M:%S" #format = "📅 %a %d %b ⌚ %H:%M:%S" } + +volume master { + format = "🎜 %volume" + format_muted = "🎜 mute (%volume)" + device = "pulse:alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink" +} diff --git a/.local/share/applications/lock.desktop b/.local/share/applications/lock.desktop new file mode 100644 index 0000000..f34faa6 --- /dev/null +++ b/.local/share/applications/lock.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=Lock Screen +Exec=loginctl lock-session +Terminal=true diff --git a/.local/share/applications/thunderbird.desktop b/.local/share/applications/thunderbird.desktop new file mode 100644 index 0000000..e1e8dc0 --- /dev/null +++ b/.local/share/applications/thunderbird.desktop @@ -0,0 +1,173 @@ +[Desktop Entry] +Name=Thunderbird +Comment=Send and receive mail with Thunderbird +Comment[ast]=Lleer y escribir corréu electrónicu +Comment[ca]=Llegiu i escriviu correu +Comment[cs]=Čtení a psaní pošty +Comment[da]=Skriv/læs e-post/nyhedsgruppe med Mozilla Thunderbird +Comment[de]=E-Mails und Nachrichten mit Thunderbird lesen und schreiben +Comment[el]=Διαβάστε και γράψτε γράμματα με το Mozilla Thunderbird +Comment[es]=Lea y escriba correos y noticias con Thunderbird +Comment[fi]=Lue ja kirjoita sähköposteja +Comment[fr]=Lire et écrire des courriels +Comment[gl]=Lea e escriba correo electrónico +Comment[he]=קריאה/כתיבה של דוא״ל/חדשות באמצעות Mozilla Thunderbird +Comment[hr]=Čitajte/šaljite e-poštu s Thunderbird +Comment[hu]=Levelek írása és olvasása a Thunderbirddel +Comment[it]=Per leggere e scrivere email +Comment[ja]=メールの読み書き +Comment[ko]=Mozilla Thunderbird 메일/뉴스 읽기 및 쓰기 클라이언트 +Comment[nl]=E-mail/nieuws lezen en schrijven met Mozilla Thunderbird +Comment[pl]=Czytanie i wysyłanie e-maili +Comment[pt_BR]=Leia e escreva suas mensagens +Comment[ru]=Читайте и пишите письма +Comment[sk]=Čítajte a píšte poštu pomocou programu Thunderbird +Comment[sv]=Läs och skriv e-post +Comment[ug]=ئېلخەت ۋە خەۋەرلەرنى Mozilla Thunderbird دا كۆرۈش ۋە يېزىش +Comment[uk]=Читання та написання листів +Comment[vi]=Đọc và soạn thư điện tử +Comment[zh_CN]=阅读邮件或新闻 +Comment[zh_TW]=以 Mozilla Thunderbird 讀寫郵件或新聞 +GenericName=Mail Client +GenericName[ast]=Client de correu +GenericName[ca]=Client de correu +GenericName[cs]=Poštovní klient +GenericName[da]=E-postklient +GenericName[de]=E-Mail-Anwendung +GenericName[el]=Λογισμικό αλληλογραφίας +GenericName[es]=Cliente de correo +GenericName[fi]=Sähköpostiohjelma +GenericName[fr]=Client de messagerie +GenericName[gl]=Cliente de correo electrónico +GenericName[he]=לקוח דוא״ל +GenericName[hr]=Klijent e-pošte +GenericName[hu]=Levelezőkliens +GenericName[it]=Client email +GenericName[ja]=電子メールクライアント +GenericName[ko]=메일 클라이언트 +GenericName[nl]=E-mailprogramma +GenericName[pl]=Klient poczty +GenericName[pt_BR]=Cliente de E-mail +GenericName[ru]=Почтовый клиент +GenericName[sk]=Poštový klient +GenericName[ug]=ئېلخەت دېتالى +GenericName[uk]=Поштова програма +GenericName[vi]=Phần mềm khách quản lý thư điện tử +GenericName[zh_CN]=邮件新闻客户端 +GenericName[zh_TW]=郵件用戶端 +Exec=env MOZ_USE_XINPUT2=1 /usr/lib/thunderbird/thunderbird %u +Terminal=false +Type=Application +Icon=thunderbird +Categories=Network;Email; +MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall; +StartupNotify=true +Actions=ComposeMessage;OpenAddressBook; + +[Desktop Action ComposeMessage] +Name=Write new message +Name[ar]=اكتب رسالة جديدة +Name[ast]=Redactar mensaxe nuevu +Name[be]=Напісаць новы ліст +Name[bg]=Съставяне на ново съобщение +Name[br]=Skrivañ ur gemennadenn nevez +Name[ca]=Escriu un missatge nou +Name[cs]=Napsat novou zprávu +Name[da]=Skriv en ny meddelelse +Name[de]=Neue Nachricht verfassen +Name[el]=Σύνταξη νέου μηνύματος +Name[es_AR]=Escribir un nuevo mensaje +Name[es_ES]=Redactar nuevo mensaje +Name[et]=Kirjuta uus kiri +Name[eu]=Idatzi mezu berria +Name[fi]=Kirjoita uusi viesti +Name[fr]=Rédiger un nouveau message +Name[fy_NL]=Skriuw in nij berjocht +Name[ga_IE]=Scríobh teachtaireacht nua +Name[gd]=Sgrìobh teachdaireachd ùr +Name[gl]=Escribir unha nova mensaxe +Name[he]=כתיבת הודעה חדשה +Name[hr]=Piši novu poruku +Name[hu]=Új üzenet írása +Name[hy_AM]=Գրել նոր նամակ +Name[is]=SKrifa nýjan póst +Name[it]=Scrivi nuovo messaggio +Name[ja]=新しいメッセージを作成する +Name[ko]=새 메시지 작성 +Name[lt]=Rašyti naują laišką +Name[nb_NO]=Skriv ny melding +Name[nl]=Nieuw bericht aanmaken +Name[nn_NO]=Skriv ny melding +Name[pl]=Nowa wiadomość +Name[pt_BR]=Nova mensagem +Name[pt_PT]=Escrever nova mensagem +Name[rm]=Scriver in nov messadi +Name[ro]=Scrie un mesaj nou +Name[ru]=Создать новое сообщение +Name[si]=නව ලිපියක් ලියන්න +Name[sk]=Nová e-mailová správa +Name[sl]=Sestavi novo sporočilo +Name[sq]=Shkruani mesazh të ri +Name[sr]=Писање нове поруке +Name[sv_SE]=Skriv ett nytt meddelande +Name[ta_LK]=புதிய செய்தியை எழுதுக +Name[tr]=Yeni ileti yaz +Name[uk]=Написати нового листа +Name[vi]=Viết thư mới +Name[zh_CN]=编写新消息 +Name[zh_TW]=寫一封新訊息 +Exec=env MOZ_USE_XINPUT2=1 /usr/lib/thunderbird/thunderbird -compose + +[Desktop Action OpenAddressBook] +Name=Open address book +Name[ar]=افتح دفتر العناوين +Name[ast]=Abrir llibreta de direiciones +Name[be]=Адкрыць адрасную кнігу +Name[bg]=Отваряне на адресник +Name[br]=Digeriñ ur c'harned chomlec'hioù +Name[ca]=Obre la llibreta d'adreces +Name[cs]=Otevřít Adresář +Name[da]=Åbn adressebog +Name[de]=Adressbuch öffnen +Name[el]=Άνοιγμα ευρετηρίου διευθύνσεων +Name[es_AR]=Abrir libreta de direcciones +Name[es_ES]=Abrir libreta de direcciones +Name[et]=Ava aadressiraamat +Name[eu]=Ireki helbide-liburua +Name[fi]=Avaa osoitekirja +Name[fr]=Ouvrir un carnet d'adresses +Name[fy_NL]=Iepenje adresboek +Name[ga_IE]=Oscail leabhar seoltaí +Name[gd]=Fosgail leabhar-sheòlaidhean +Name[gl]=Abrir a axenda de enderezos +Name[he]=פתיחת ספר כתובות +Name[hr]=Otvori adresar +Name[hu]=Címjegyzék megnyitása +Name[hy_AM]=Բացել Հասցեագիրքը +Name[is]=Opna nafnaskrá +Name[it]=Apri rubrica +Name[ja]=アドレス帳を開く +Name[ko]=주소록 열기 +Name[lt]=Atverti adresų knygą +Name[nb_NO]=Åpne adressebok +Name[nl]=Adresboek openen +Name[nn_NO]=Opne adressebok +Name[pl]=Książka adresowa +Name[pt_BR]=Catálogo de endereços +Name[pt_PT]=Abrir livro de endereços +Name[rm]=Avrir il cudeschet d'adressas +Name[ro]=Deschide agenda de contacte +Name[ru]=Открыть адресную книгу +Name[si]=ලිපින පොත විවෘත කරන්න +Name[sk]=Otvoriť adresár +Name[sl]=Odpri adressar +Name[sq]=Hapni libër adresash +Name[sr]=Отвори адресар +Name[sv_SE]=Öppna adressboken +Name[ta_LK]=முகவரி பத்தகத்தை திறக்க +Name[tr]=Adres defterini aç +Name[uk]=Відкрити адресну книгу +Name[vi]=Mở sổ địa chỉ +Name[zh_CN]=打开通讯录 +Name[zh_TW]=開啟通訊錄 +Exec=env MOZ_USE_XINPUT2=1 /usr/lib/thunderbird/thunderbird -addressbook diff --git a/.local/share/applications/wpa_gui.desktop b/.local/share/applications/wpa_gui.desktop index 29542af..1955a23 100644 --- a/.local/share/applications/wpa_gui.desktop +++ b/.local/share/applications/wpa_gui.desktop @@ -2,7 +2,7 @@ Version=1.0 Name=wpa_gui Comment=Graphical user interface for wpa_supplicant -Exec=sudo wpa_gui -i wlan0 +Exec=wpa_gui -i wlan0 Icon=wpa_gui GenericName=wpa_supplicant user interface Terminal=false diff --git a/.mbsyncrc b/.mbsyncrc new file mode 100644 index 0000000..dcfe913 --- /dev/null +++ b/.mbsyncrc @@ -0,0 +1,38 @@ +IMAPStore free-remote +Host imap.free.fr +SSLType IMAPS +User mvertes@free.fr +PassCmd "pass email/mvertes@free.fr" + +MaildirStore free-local +Path ~/Mail/free/ +Inbox ~/Mail/free/INBOX +Subfolders Verbatim + +Channel free +Far :free-remote: +Near :free-local: +Create Both +Expunge Both +Patterns * +SyncState * + +IMAPStore gmail-remote +Host imap.gmail.com +SSLType IMAPS +AuthMechs LOGIN +User marc.vertes@traefik.io +PassCmd "pass email/marc.vertes@traefik.io" + +MaildirStore gmail-local +Path ~/Mail/gmail/ +Inbox ~/Mail/gmail/INBOX +Subfolders Verbatim + +Channel gmail +Far :gmail-remote: +Near :gmail-local: +Create Both +Expunge Both +Patterns * !"[Gmail]/All Mail" !"[Gmail]/Important" !"[Gmail]/Starred" !"[Gmail]/Bin" +SyncState * diff --git a/.mutt/free b/.mutt/free new file mode 100644 index 0000000..4694401 --- /dev/null +++ b/.mutt/free @@ -0,0 +1,8 @@ +set folder = "~/Mail/free/" +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set trash = "+Trash" +set record = "" + +set from = "mvertes@free.fr" +set realname = "Marc Vertes" diff --git a/.mutt/muttrc b/.mutt/muttrc new file mode 100644 index 0000000..817065b --- /dev/null +++ b/.mutt/muttrc @@ -0,0 +1,68 @@ +set folder=~/Mail/free +set spoolfile=+/INBOX +set header_cache=~/.cache/mutt +auto_view text/html +alternative_order text/plain text/enriched text/html + +color normal black default + +color hdrdefault red default +color signature blue default +color indicator black brightyellow +color error brightred default +color status white blue +color tree red default # the thread tree in the index menu +color tilde magenta default +color message blue default +color markers cyan default +color attachment brightmagenta default +color search black green # how to hilite searches in the pager +color quoted blue default # quoted text +color quoted1 magenta default +color quoted2 red default +color quoted3 green default +color quoted4 cyan default +color quoted5 blue default +color quoted6 magenta default +color quoted7 red default +color quoted8 green default +color quoted9 cyan default +color underline brightgreen default +color index green default ~F + +color header red default ^(From|Subject): +# point out url's +color body black default "((ftp|http|https)://|(file|news):|www\\.)[-a-z0-9_.:]*[a-z0-9](/[^][{} \t\n\r\"<>()]*[^][{} \t\n\r\"<>().,:!])?/?" +color body cyan default [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses + +# smilies and the like +color body brightgreen default "<[Gg]>" +color body brightgreen default "<[Bb][Gg]>" +# see also the variables smileys +color body black yellow ">?[;:][-^]?[][)(><}{|/DP][)}]*" + +# +# Mono +# + +mono normal none # normal text +mono indicator reverse # actual message +mono tree none # thread arrows +mono status reverse # status line +#mono error bold +mono error standout +mono message none # info messages +mono quoted bold +mono signature none +mono attachment underline # MIME attachments +mono search reverse # search matches +mono tilde none # ~ at bottom of msg +mono markers bold # + at beginning of wrapped lines +mono hdrdefault none # default header lines +mono bold bold # hilite bold patterns in body +mono underline underline # hilite underlined patterns in body +mono header bold "^(from|subject):" +mono body underline "((ftp|http|https)://|(file|news):|www\\.)[-a-z0-9_.:]*[a-z0-9](/[^][{} \t\n\r\"<>()]*[^][{} \t\n\r\"<>().,:!])?/?" +mono body underline "[-a-z_0-9.]+@[-a-z_0-9.]+" +mono body bold "(^| )\\*[-a-z0-9äöüß*]+\\*[,.?]?[ \n]" +mono body underline "(^| )_[-a-z0-9äöüß_]+_[,.?]?[ \n]" diff --git a/.otp_accounts.json.gpg b/.otp_accounts.json.gpg index bbf1956..e99f48a 100644 --- a/.otp_accounts.json.gpg +++ b/.otp_accounts.json.gpg @@ -1,27 +1,49 @@ -----BEGIN PGP MESSAGE----- -hQIMA+yVXrx81qjVAQ/8DgattaALSr1kOyqcTFdn43dNBwLSBD369Cs3zu7ez5xz -DpBBecMNSuCVFPq0QfocNlDmz3BZxrkrttmAz3W7iK5rDKZeYTAG10ZT7NzI5K/C -43WgEbf3W7FLxJGy6ASv2wRI/NRDZyjWe8yEEE5OF5ZTLawV57R/xW2UHemegI3l -aAC4nU1hWHnmErdaubdxzgCva/hrd3SzroSVfmuQp+Cq1/AszDAe9LQltSAIo2oZ -wwct6GIBNXoiA61YB3+m7oZfMfMa+1fNEobYReN/9E8iVMz01fWWOGsYRIue07yd -0aAMj+ywQ1VU5G2SJ++B3pchbD+ViXvLEy1bnNF37PplKYnjN06db0MuflkfDM+A -ICMTvhGlR58DwBueuLrWBh6dAbSOuz8tHQXzs5nlBI/Vvd2YUkw5Stcn+VBi7Bwg -xvq2WiMhRT0nIvb1yuNGCpwWt2W1ckba79opBe4j1mvXYOq9vTT2VjJnAKe3k55B -KWQBEkRe+T5FgcSfpRiMTogIvA8aOXTxkOltzjWjH5GXza65en4R9LNg7HB/lUd7 -zb3KVEg++XuPFVU08hFF8B4vb3zsLDy0Uf26Ilv63lNgvKR9TAC9VDEfY91qMXWl -e1yeiGQCoAmU2BLm4MopwqBBEADjYSJETS1Kvz3hiR2AvcR5gMcpxp6C121723/S -wWgBuVgsKQmnYVNMzkNhaKj5qWOak5jXq1py751jkGKkVUwSkVQwjMr99A06fNE+ -p0k1XjA36flRSzQgh3vcOTTutXaLe1TfEHC3TWOaXu30/S5ptkpcHFfBLSoVhZ3o -2PN5/3WcRvHL30vvLW7noB5wH32l0AzSHVnZ5cFqlNH5M00HrlPOH+Uy5WfYy684 -V7zyOpg+J7DdJQNS7HBGjSNdK738HUdxWHkNuxaK2HEuzc9YyWy6fpPrefY1z9nH -+H3pgmr4UxiUf0+LbYvL9xcaN265S1RIvx7QJJq7iTwZYtg/qc+SRfgVpvXUr40X -W3bTEO1baPeVpydhLMWyqReN1i3tClTG3uaVNYX5adqaaqBCaKyXexiHrSFJzaIb -mikACoQEFsh2acP+2cp8oCVGS5vdwEfkWfZSld4KfM/v37aDb4Mwq9Ap9/OAHwSt -RWONXZFWftgfhHXnem/iUswob+O+SvF2CSCs7cCqcB5gS0RZTsV3eiRfPbZTSSQD -xz95R4lZ2NIt99vDKi1NWrbIfTletCnYaOahKkC5bHqlzjZ10VKCOkYUBXyewSPy -4d+RCxlF9T6Pya0NKLjKEJwUG67Nr79w9OR6mVWR0e8f+ppw41ApUih3a3sLTuWl -DJFkJiYEL/EwBoAaAtfnMxqlPi6BXAJQXWngS8XMTmksr1PCVovFrr57e0tIyaLt -X4pDpxmElysDbZqLtpDtFU7OU4pMimSmSmQ= -=NBYN +hQIMA+yVXrx81qjVAQ/+LlxKCUSXoeouLcdeA1hA6N52r66XXUmak1hdMuII2d1u +uOfnYaC6uhjohbGF+OoSS/bMSmTz2rSDaSKJFzFyjcB8HMV65ZBb/4dg7ujdugXI +47dkqvwJC/ipJ8FC86sXYVSVCPNHyvOfU8vA0F289v+40UJPWv8ocIM+ZCeCblxD +CK+FCpdVVWF5j20qn1CxlUWxUs4d2ztogYUKoWNUy2grKENhEmkqRkCYk85Macmn +zsO0tpRUuFlt3Lj07l2BGLb6ZIh2sRis/rv4NGLUgdwS+j3hLVQCcWiKZmhWdDcQ +KcNg2LdR95O6izwX9K2GAP9go5RSDc+kSnz5o0w0DepxDu75lf5cL77ndaTY9Bi/ +JdK1qE1VHrNRuJ1iOn2dDxFlQfFj2MnVABtG6h7BBlTQwz7lumYeuL4gM2m/Y5U9 +0p5/bSkt2ANIVCI+C8cukbMAdVaFxrUZ0J+Ir+RXnyF28ECBVfFfP6r4wLXYdbOp ++4sNo2x9wuBED1Qhkxp1lesRE1MUN9seJXMYM48HLDuRluSo+RQeK2FS1uc5c9kY +Ozjq3xehK7RqI0kBD5eW+BQzOrkq+YmMy7kYlH4uFx43tsE1Ie4BeEex3SReQcO1 +9BsNZPqEvd9eoa6hg/6rtiM7LCL3qs6xKUG3St1scw39O0oz4b2vpMZqw5dd8XuF +AYwD4gO8x2JTLcUBC/4lwe4w+sFiOiweYXUSDna+hDctogknBjx2e6vKxEmub87d +EMHjG2RIjbIOEu2Heyb24SphqSxe/dqi9vkj5hldUyN6ZLAcqOmYflGlLMkQN321 +Vn7fGnQM8da3n5tc3WBL4AdgmXhgj9bTbnVGiXL10MUGxkBtnc4hkGQwVMhyauot +02Sahrh0f9miunzbvH3Y00lZFc60ZOxInoIQdoBViEQ4pJztUHHrn5JKf2ajkGZS +e+PAwp0zi2JVl+2Rf039FRdghKeDdvZYobNV0GsBsRpbO5L5el+FHAZQwc/Yo7ya +AMhGb6Ewz/Lk5pWq4PbPJOUY3MvYrJOjDyCOz6DDEnuo5eoHwq2KmGGnkiiZ29Kf +dkcEsbxCM8twJa7N7LoBsGFesLw6uTz2BoIFVyTAHgxVxm85X5suiMgoPdxESXTj +gKY27mzessrxBoYMGjTThLJEOI4V4jlznA/1JJks24setxf03qd1FK5/dXNe87+I +3uFkNPUsyK7D5FtEMgbSw+gBAJW493F1qUTGrU5KmgNo94ApQcC9fKUwMzGbcLa6 +P43SxaM4qdq9gx9uIrjzAH4EZX7BE1H96pJfYrgoswdvPvGSjM4OYVxOANieN5xo +dkwQ1vHifSZ/xmEU6XdJPLEWr8oSFUhjjpd4C5jL2Xq9QLS/rLkyuV8ONck/FZkR +fQoNmLCWsllW1BpTlxArGUvwJsrR+l2/PXyU6VVXj8ntb1Wjl6MiL+JTv7vkPNyH +C56eoKORca0EtScVDMhIPWfn8wdeoroPr9eoSvyL/Dcol7spkHVbQ5jITwSwS9F8 +wUw9dxOn6chwbZqwSe7Sg/npNwaq+b0TEjGhwChu3vNIC4IgjOZYkkzGkC7z75Cq +9boUEvfo9Z4SO91PjKdrs8D+t/X5znqy+TmH0Ovr5y7FRqlZs7uf/CqeuSGNkomI +89x6aXM+081w/6zme1rnoPrMbTTLwuEX2wJ9Z4s9Zq8BrkC19h9cmKhZyd8yb9NU +KENQUdfSiNjmjLhT3vafPRvIt5nMyDmq/fir+e5fCHZS69+SoLm5x1U2VHD1NoBB +KvH8l8o5l4zBKsD1C1LiNzcIZ39N+xl83aFk1Y0WaKX/PFubztHj2iHKtaGBjJLk +OL/3kmQhNW8XWjS9swbrxIYRVfTLXoQ4npMCxY1dvViWpt0r7PbxJMcbjG1adEvk +HsmPQUhSHgjxaezd1it7kYu1GpgNEHW2grKMDt23p2QUEuU6beqrQ84A2HgCYei0 +TqUXk3W1NXAZAe9rSwJgwBBWidLfXGgNAoP0dDG1d9ANYFktC9gIt1ZLDPZWxs/x +v/dfMaO3/+C80ON5B1eK/ZpFc4WKboZMa9Aqzwav3XnXok/w+nazLa+FsgoROxSh +ZDO16Khr3hQ2bPf53Cj7FGJRUfmi3Jt/2na4rSrvjjhG6nNgZurIJE7ZW/ggIJ6f +GjdG0Ni8tzpTk5thI05gHDdY8JLZ/zwVZ1yUrhS5n9azDam2Oo+M4L20nxjrMnfE +nGNiYLZKpCn63y5W19eznm/8gPjp1Jh9UIhXrtii+a2rIXK9z6Y2a9oPqnxsO7s0 +dGgFLa/Wb7WHAfEmuJ5H0T+pRP22cVK7bxKvgRxhq8INTUCpm+I6dCXx3KU+v2XX +cp0/WK4KPDiEIlGjyVZBcF08wvmNG4yEtNqaJQ21FPrBE3reLq08gDdEvMdg5FDh +CPbexx0yoMiPU16SC7fPGo27j22OYQaWlMQBSA+951NWAMhdRY7c+5ehIO62aChn +/w7ww8Rxx6BBc4meBROtPnyCb4b/PMkWrmFp3h8qeUvvLKsxwrd32rglw332KrTz +F2Amnc7eiS9N7Y5uxjx6AOpIDyNovGpShY+ReFUp2kUnClMrQERz/gBF8SdFiBZj +Ud1V1FR7HoSp3rVpHUzv6c12DoyQiUkOOzJ6oCHV9NnOhB349wKtTpo671v5h6sK +dx6v9bCwKEFmRGZd6Vb+v7u0VY/t4I9iOQiGJm57Y0jUAS7HNxVMXEUgCrWXfzJh +T3enPB81c2Ohsp0FBVuxU+FucBY2B4h6qtcG3Uyne/Gq4TcWRYlt5/Em6IXojprm +0I6oD0UBjnXA +=OCjq -----END PGP MESSAGE----- @@ -23,3 +23,5 @@ case $SHELL in (*/ash) export ENV=~/.shrc ;; (*/bash) . ~/.bashrc ;; esac + +#[ "$(tty)" != /dev/tty1 ] || exec dbus-run-session sway @@ -1 +1,3 @@ startup_message off +defmousetrack on +mousetrack on diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100644 index 8d624a0..0000000 --- a/.tmux.conf +++ /dev/null @@ -1,3 +0,0 @@ -set-option -g prefix ² -unbind-key C-b -bind-key ² send-prefix diff --git a/.vim/pack/mvertes/install.sh b/.vim/pack/mvertes/install.sh index 36cf414..90cd4b3 100755 --- a/.vim/pack/mvertes/install.sh +++ b/.vim/pack/mvertes/install.sh @@ -1,7 +1,14 @@ #!/bin/sh -e -plugins='https://github.com/mvertes/vimki https://github.com/fatih/vim-go' -ht='vim -c "helptags doc" -c "q"' +plugins=' +git@github.com:mvertes/vimki +git@github.com:fatih/vim-go +git@github.com:othree/xml.vim +git@github.com:junegunn/fzf.vim +git@github.com:mattn/libcallex-vim +git@github.com:bytesnake/vim-graphical-preview +' +ht='test -d doc && vim -c "helptags doc" -c "q"' mkdir -p start cd start @@ -4,6 +4,7 @@ set ls=1 ruler set ai ts=4 sw=4 noet " Not a good idea to activate mouse, as it disables cut & paste in MacOS +>>>>>>> 6d506e0b30569c547f41f6d6334a1b5133774da4 "set mouse=a syntax off filetype on @@ -31,7 +32,7 @@ set belloff=all set guifont=6x13:h13 " fzf plugin -set rtp+=/opt/homebrew/opt/fzf +"set rtp+=/opt/homebrew/opt/fzf let g:fzf_preview = 'cat {}' " set grepprg=rg\ --vimgrep\ --smart-case\ --hidden\ --follow @@ -50,12 +51,12 @@ autocmd filetype vimki nmap <leader>z :FZF ~/Wiki<CR> autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 -let g:netrw_browsex_viewer = "open" +let g:netrw_browsex_viewer = "xdg-open" let g:netrw_gx = "<cWORD>" let g:netrw_banner = 0 " python and yaml formatting: -" autocmd filetype python,yaml set ts=2 sts=2 sw=2 et +autocmd filetype python,yaml set ts=2 sts=2 sw=2 et :set wrap :set linebreak @@ -86,7 +87,7 @@ hi SpellBad gui=undercurl noremap <leader>n :bn<cr> noremap <leader><leader> :bd<cr> -noremap <leader>o :!open <cWORD>&<cr><cr> +noremap <leader>o :!xdg-open <cWORD>&<cr><cr> noremap <C-g> :tag <c-r><c-w><cr> noremap <C-p> :Files<cr> diff --git a/.w3m/config b/.w3m/config new file mode 100644 index 0000000..74a71ed --- /dev/null +++ b/.w3m/config @@ -0,0 +1,163 @@ +tabstop 8 +indent_incr 4 +pixel_per_char 9 +pixel_per_line 13 +frame 1 +target_self 0 +open_tab_blank 0 +open_tab_dl_list 0 +display_link 0 +display_link_number 0 +decode_url 0 +display_lineinfo 0 +ext_dirlist 1 +dirlist_cmd file:///$LIB/dirlist.cgi +use_dictcommand 1 +dictcommand file:///$LIB/w3mdict.cgi +multicol 0 +alt_entity 0 +graphic_char 0 +display_borders 0 +disable_center 0 +fold_textarea 0 +display_ins_del 1 +ignore_null_img_alt 1 +view_unseenobject 0 +display_image 1 +pseudo_inlines 1 +auto_image 1 +max_load_image 4 +ext_image_viewer 1 +image_scale 100 +inline_img_protocol 0 +imgdisplay w3mimgdisplay +image_map_list 1 +fold_line 0 +show_lnum 0 +show_srch_str 1 +label_topline 0 +nextpage_topline 0 +color 1 +basic_color terminal +anchor_color blue +image_color green +form_color red +mark_color cyan +bg_color terminal +active_style 0 +active_color cyan +visited_anchor 0 +visited_color magenta +pagerline 10000 +use_history 1 +history 100 +save_hist 1 +confirm_qq 0 +close_tab_back 0 +mark 0 +emacs_like_lineedit 0 +space_autocomplete 0 +vi_prec_num 0 +mark_all_pages 0 +wrap_search 0 +ignorecase_search 1 +use_mouse 1 +reverse_mouse 0 +relative_wheel_scroll 0 +relative_wheel_scroll_ratio 30 +fixed_wheel_scroll_count 5 +clear_buffer 1 +decode_cte 0 +auto_uncompress 0 +preserve_timestamp 1 +keymap_file keymap +document_root +personal_document_root +cgi_bin +index_file +mime_types ~/.mime.types, /usr/etc/mime.types +mailcap ~/.w3m/mailcap, /usr/etc/w3m/mailcap +urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap +editor /usr/bin/vi +mailto_options 1 +mailer /usr/bin/mail +extbrowser /usr/bin/firefox +extbrowser2 +extbrowser3 +extbrowser4 +extbrowser5 +extbrowser6 +extbrowser7 +extbrowser8 +extbrowser9 +bgextviewer 1 +use_lessopen 0 +passwd_file ~/.w3m/passwd +disable_secret_security_check 0 +ftppasswd +ftppass_hostnamegen 1 +pre_form_file ~/.w3m/pre_form +siteconf_file ~/.w3m/siteconf +user_agent +no_referer 0 +cross_origin_referer 1 +accept_language en;q=1.0 +accept_encoding gzip, compress, bzip, bzip2, deflate, br +accept_media text/html, text/*;q=0.5, image/* +argv_is_url 1 +retry_http 1 +default_url 1 +follow_redirection 10 +meta_refresh 0 +localhost_only 0 +dns_order 0 +nntpserver +nntpmode +max_news 50 +use_proxy 1 +http_proxy +https_proxy +gopher_proxy +ftp_proxy +no_proxy +noproxy_netaddr 1 +no_cache 0 +ssl_forbid_method 2, 3, t, 5 +ssl_min_version +ssl_cipher +ssl_verify_server 1 +ssl_cert_file +ssl_key_file +ssl_ca_path +ssl_ca_file +ssl_ca_default 1 +use_cookie 1 +show_cookie 0 +accept_cookie 1 +accept_bad_cookie 0 +cookie_reject_domains +cookie_accept_domains +cookie_avoid_wrong_number_of_dots +display_charset UTF-8 +document_charset UTF-8 +auto_detect 2 +system_charset UTF-8 +follow_locale 1 +ext_halfdump 0 +use_wide 1 +use_combining 1 +east_asian_width 0 +use_language_tag 1 +ucs_conv 1 +pre_conv 0 +search_conv 1 +fix_width_conv 1 +use_gb12345_map 0 +use_jisx0201 0 +use_jisc6226 0 +use_jisx0201k 0 +use_jisx0212 0 +use_jisx0213 0 +strict_iso2022 1 +gb18030_as_ucs 0 +simple_preserve_space 0 diff --git a/.w3m/keymap b/.w3m/keymap new file mode 100644 index 0000000..d53ab11 --- /dev/null +++ b/.w3m/keymap @@ -0,0 +1 @@ +keymap M-/ COMMAND "GOTO https://duckduckgo.com/lite/; NEXT_LINK; GOTO_LINK" @@ -1,4 +1,10 @@ #!/bin/sh + +. /etc/X11/xinit/xinitrc.d/50-systemd-user.sh +#eval $(ssh-agent) +eval $(gnome-keyring-daemon --start) +export SSH_AUTH_SOCK + # start pulseaudio on crux only. Should be handled by systemd on arch #pulseaudio --start --exit-idle-time=-1 --log-target=syslog & @@ -21,4 +27,5 @@ xsetroot -solid rgb:1/3/4 # Start window manager #exec fvwm +#lxpolkit exec i3 @@ -2,12 +2,15 @@ # start pulseaudio on crux only. Should be handled by systemd on arch #pulseaudio --start --exit-idle-time=-1 --log-target=syslog & +eval $(ssh-agent) + +# See also /etc/X11/xorg.conf.d/10-input.conf # enable tapping and natural scrolling on touchpad # see xinput --list[-props] for ids xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Tapping Enabled' 1 xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Natural Scrolling Enabled' 1 -# Better use /etc/X11/xorg.conf.d/10-keyboard.conf to handle hot plugged keyboards +# Better use /etc/X11/xorg.conf.d/10-keyboard.conf for hot plugged keyboards #setxkbmap fr #xk hdmi @@ -15,6 +18,7 @@ hdmi xrdb ~/.Xresources #xsetroot -solid rgb:3/4/5 xsetroot -solid rgb:1/3/4 +#feh --bg-fill ~/Pictures/night1.jpg #feh --bg-fill ~/Downloads/Alaska_Range.jpg #conky #slock @@ -22,3 +26,4 @@ xsetroot -solid rgb:1/3/4 # Start window manager #exec fvwm exec i3 +#exec cwm diff --git a/README.md b/README.md new file mode 100644 index 0000000..0c83b01 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Dotfiles + +Configuration files, stored in a bare git repository. Avoid symlinks and extra tooling + +Use: + + git init --bare ~/dotfiles + alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' + +Au lieu de + + dotfiles config status.showUntrackedFiles no + +`cat ~/.gitignore` : + + * + +On other machine, to reconstruct: + + git clone --bare git@bip.im:dotfiles dotfiles + alias dotfiles as above + dotfiles checkout + +remove files in the way if necessary + +Manage one branch per computer if necessary. + +If a change is for all, do it on master, then: + + dotfiles merge master @@ -1,36 +1,54 @@ #!/bin/sh -# Incremental backup using rsync(1). -[ "$USER" = root ] || exec sudo "$0" "$@" +# A backup a day keeps the doctor away. -backup() { - date=$(date +%Y%m%d_%H%M%S) - last=$(rsync --list-only "$dest/" 2>/dev/null | cut -b 47- | tail -1) +usage() { + echo "Usage: $0 [-nv] [[[user@]host]:dir] - case $last in - ([12]*) opt_link=--link-dest=../$last;; - (*) opt_link=;; - esac +Incremental backup using rsync(1). If run as root, a full system +backup is performed. Otherwise, the user's home directory is backed. - rsync -HSxa$optv --exclude-from=$ignore $opt_link / /boot "$dest/$date" -} +Options: +-n dry-run +-v verbose -dest=/.history -ignore=/etc/backup/ignore +Files: +- $HOME/.backupignore exclude files from user backup (non root) +- /etc/backupignore exclude files from system backup (root) -while getopts :d:i:nv opt; do +Environment: +- BACKUP backup directory" +} + +while getopts :nv opt; do case $opt in - (d) dest="$OPTARG" ;; - (i) ignore="$OPTARG" ;; (n|v) optv="$opt$optv" ;; - (*) echo "Usage: $0 [-nv] [-d [host:]dir] [clean|diff]"; exit 1 ;; + (*) usage; exit 1 ;; esac done shift $((OPTIND - 1)) -[ "$1" ] && cmd=$1 && shift || cmd="" -case $cmd in -(""|save) backup ;; -(clean) exec backup-clean ${optv+-$optv} "$dest";; -(diff) exec diffdir "$@";; -esac +BACKUP=${1:-$BACKUP} +[ "$BACKUP" ] || { usage; exit 1; } + +[ "$USER" = root ] && + ignore=/etc/backupignore volumes='/ /boot' || + ignore="$HOME/.backupignore" volumes="$HOME" +[ -f "$ignore" ] && ignore="--exclude-from=$ignore" || ignore= + +now=$(date +%F) +opt_link='' +past=$(rsync --list-only "$BACKUP/" 2>/dev/null | awk '{print $NF}' | sort -r) +for f in $past +do + case $f in + ([0-9][0-9][0-9][0-9]-*) ;; + (*) continue ;; + esac + [ "$f" = "$now" ] && continue + opt_link="--link-dest=../$f" + break +done + +echo "# Backup $volumes to $BACKUP/$now" +exec rsync -HSXxa$optv $ignore $opt_link $volumes "$BACKUP/$now" diff --git a/bin/backup-clean b/bin/backup-clean index 30d25db..34e6d97 100755 --- a/bin/backup-clean +++ b/bin/backup-clean @@ -1,89 +1,67 @@ #!/bin/sh -# backup garbage collector -[ "$USER" = root ] || exec sudo "$0" "$@" -# Durations, in number of seconds. -hd=3600 # hour duration: 60s * 60 -h12=43200 # 12h: hd * 12 -dd=86400 # day duration: hd * 24 -wd=604800 # week duration: dd * 7 -md=2592000 # month duration: dd * 30 -yd=31557600 # year duration: dd * 365.25 +usage() { + echo "Usage: $0 [-nv] [[[user@]host:]dir] -now=$(date +'%Y%m%d_%H%M%S') +$0 removes old backups and keeps: +- backups for the current day +- 1 backup per past day for the current month +- 1 backup per past month for the current year +- 1 backup per past year -# The following works only for busybox date, not coreutils -# Kept for reference only. -#date2ts() { d=${1%_*} t=${1#*_}; date -d "$d${t%??}" +%s; } +Options: +-n dry run +-v verbose -# Convert date to timestamp, using date from GNU coreutils, -# works also with busybox date. -date2ts() { - t=$1; r=${t#????}; Y=${t%$r} # Year (with century) - t=$r; r=${t#??}; m=${t%$r} # Month - t=$r; r=${t#??}; d=${t%$r} # Day - t=${r#_}; r=${t#??}; H=${t%$r} # Hour - t=$r; r=${t#??}; M=${t%$r} # Minute - S=${t#??} # Second - date -d "$Y-$m-$d $H:$M:$S" +%s - #date -jf "%Y-%m-%d %H:%M:%S" "$Y-$m-$d $H:$M:$S" +%s # BSD, MacOS (not tested) +Environment variables: +- BACKUP - backup directory" } -ts2date() { date -d "@$1" +'%Y%m%d_%H%M%S'; } - -tsn=$(date2ts "$now") - -# Minimal retention delay in seconds, according to backup age, -# implemented using POSIX shell arithmetic. -retention_delay() { - d=$((tsn - $1)) - if [ $((d < h12)) = 1 ]; then - r=0 # keep all backups in the last 12 hours - elif [ $((d < dd)) = 1 ]; then - r=$hd # keep 1 backup per hour in the last day - elif [ $((d < wd)) = 1 ]; then - r=$dd # keep 1 backup per day in the last week - elif [ $((d < md)) = 1 ]; then - r=$wd # keep 1 backup per week in the last month - elif [ $((d < yd)) = 1 ]; then - r=$md # keep 1 backup per month in the last year - else - r=$yd # keep 1 backup per year in the previous years - fi - echo $r -} - -dest=/.history -while getopts :d:nv opt; do +while getopts :nv opt; do case $opt in - (d) tsn=$(date2ts "$OPTARG") ;; - (n) optn=1 ;; - (v) optv=1 ;; - (*) echo "Usage: $0 [-nv] [dir]"; exit 1 ;; + (n) optn=echo ;; + (v) optv=-t ;; + (*) usage; exit 1 ;; esac done -shift $((OPTIND - 1)) -[ "$1" ] && dest=$1 +shift $((OPTIND -1)) + +BACKUP=${1:-$BACKUP} +[ "$BACKUP" ] || { usage; exit 1; } -# Sorted list of backups, most recent first. -lbu=$(ls -rv "$dest") -lasy=${lbu##* +host=${BACKUP%:*} dir=${BACKUP#*:} +ls='ls -r' rm="xargs -r $optv $optn rm -rf" +[ "$host" = "$dir" ] || ls="ssh $host $ls" rm="ssh $host $rm" + +echo "# Cleaning backups on $BACKUP" + +$ls "$dir" | +awk -v now=$(date +%Y-%m-%d) -v dir="$dir" ' +BEGIN { + yn = substr(now, 1, 4) # Year now + mn = substr(now, 6, 2) # Month now + dn = substr(now, 9, 2) # Day now } -for d in $lbu; do - tsc=$(date2ts "$d") - if ! [ "$tsp" ]; then - [ "$optv" ] && echo "keep $dest/$d" - tsp=$tsc - continue - fi - mrd=$(retention_delay "$tsp") - dp=$((tsp - tsc)) - #if [ $((dp < mrd)) = 1 ]; then - if [ "$d" != "last" -a $((dp < mrd)) = 1 ]; then - [ "$optv" ] && echo "delete $dest/$d" - [ "$optn" ] || rm -rf "${dest:?}/$d" - else - [ "$optv" ] && echo "keep $dest/$d" - tsp=$tsc - fi -done +{ + yb = substr($0, 1, 4) # Year backup + mb = substr($0, 6, 2) # Month backup + db = substr($0, 9, 2) # Day backup + $0 = dir "/" $0 + + dy = yn - yb + dm = dy * 12 + mn - mb + # if (yb != yn) { + if (dm > 12) { + if (yb in yearly) print; else yearly[yb] = 1 + next + } + # if (mb != mn) { + dd = dm * 30 + dn - db + if (dd > 30) { + if (mb in monthly) print; else monthly[mb] = 1 + next + } + if (db != dn) { + if (db in dayly) print; else dayly[db] = 1 + } +}' | $rm @@ -2,23 +2,26 @@ # Backup to yoda [ "$USER" = root ] || exec sudo "$0" "$@" -usage='Usage: byo [-cdk] [/dev/sda2] +usage='Usage: byo [-cdkx] [/dev/sda2] Backup local disk to yoda external disk. Options: -c close and umount yoda -d dedupe yoda -k do not umount and close yoda + -x enable debug traces ' -while getopts :Ccdk opt; do +while getopts :Ccdkx opt; do case $opt in - (C|c|d|k) eval "opt$opt=$opt" ;; + (C|c|d|k|x) eval "opt$opt=$opt" ;; (*) printf %s "$usage"; exit 1 ;; esac done shift $((OPTIND - 1)) +[ "$optx" ] && set -x + dev=$1 yoda_uuid='8c463221-6bb7-414e-9060-c9570bb3a6bb' [ "$dev" ] || dev=$(blkid --uuid "$yoda_uuid") @@ -26,8 +29,8 @@ yoda_uuid='8c463221-6bb7-414e-9060-c9570bb3a6bb' dest=/mnt/backup/$(hostname) [ -b /dev/mapper/yoda ] && noclose=1 || cryptsetup open "$dev" yoda findmnt /dev/mapper/yoda /mnt >/dev/null && noumount=1 || mount /dev/mapper/yoda /mnt -time backup -v -d "$dest" -[ ! "$optC" ] || backup -v -d "$dest" clean +time backup -v "$dest" +# [ ! "$optC" ] || backup -v -d "$dest" clean [ ! "$optd" ] || time duperemove -drh --hashfile="$dest/.hashfile" "$dest" df -h / "$dest" ls -v "$dest" @@ -1,556 +1,213 @@ #!/bin/sh -# Local dv (aka sim) +# - Usage: dv command [options] [args] +# - dv is a dumb version management tool. +# - Options: +# - -a num set ancestor level (default 1) +# - -n dry-run mode, no changes are made +# - -v verbose mode +# - Commands: -dv_version='dv-0.23 Copyright 2013-2014 Marc Vertes, Philippe Bergheaud' unset CDPATH export LC_ALL=C IFS=' ' - -anc() { - usage 'anc [Version]' 'print ancestor' && return - getdv .dv || die no item - case $1 in - (""|.|$PWD) - [ "$Opt_N" ] && Opt_N=$(($Opt_N - 1)) - [ "$Opt_N" ] && info anc $R2 $Opt_N || echo $R2 +version=dv-0.2 +dvlib=${DVLIB:-$HOME/dvlib} +script="$(cd "$(dirname "$0")" && pwd)/${0##*/}" +aopt=1 + +case $(uname -o) in + (Android|Linux) + diffopt='--color=always' + lsopt='-v --color' ;; - (*) info anc $1 ${Opt_N:-1};; - esac -} + (Darwin) + diffopt='--color=always' + lsopt='-G' + ;; + (*BSD) + ;; +esac -cache() { - isremote "$1" || return - o=$1 _d=$cacheprefix/$1; pd=${_d%/*}; ppd=${pd%/*} t=$pd/.${_d##*/} - [ -d "$ppd" ] || mkdir -p "$ppd" - [ -L "$ppd/.dv." ] || ln -s . "$ppd/.dv." - [ -f "$_d/.dv" ] && return - [ -d "$pd" ] || mkdir -p "$pd" - set -- $pd/*; shift $(($# - 1)) - [ -d "$1" ] && ropt="--link-dest=../${1##*/}" || ropt= - rsync -aDS $ropt "$o/" "$t" && mv "$t" "$_d" +# anc [-a num] [dir] - prints the current ancestor of dir or current. +anc() { + set -- "$(dvdir "$1")" + for _ in $(seq "$aopt"); do + set -- "$1/.dv/anc" + done + [ -L "$1" ] && readlink -f "$1" } -client() { - usage 'client [Version]' 'print clients' && return - getdv .dv || die no item +# clone [-nv] v1 [dir] - clones an iterm version into dir (default: item). +clone() { case $1 in - (""|.|$PWD) - while getpdir .dv .. - do - cd "$R1" - getdv ".dv" - [ "$OptM" ] && echo "$R2 -> $PWD" || echo "$R2" - ((Opt_N = Opt_N-1)) || break - done ;; - (*) info cli $1 ${Opt_N:-9999} | sort -u ;; + ('') die 'missing argument' ;; + (*[/.-]*) set -- "$(path "$1")" "$2" ;; + (*) set -- "$(head "$1")" "$2" ;; esac + [ "$2" ] || { set -- "$1" "${1##*/}"; set -- "$1" "${2%%-*}"; } + [ -d "$1" ] || die "not found: $1" + rsync ${vopt:+"$vopt"} ${nopt:+"$nopt"} -a "$1/" "$2/" + rm -f "$2/.dv/anc" && ln -s "$1" "$2/.dv/anc" } -clone() { - usage 'clone [-A Author] [-m Msg] Version [Dir]' \ - 'Copy version to dir' && return - [ "$1" ] || die missing argument - [ "$3" ] && die too many arguments - getpdir .dv . && root=$R1 && getdv $root/.dv && lib=$R1 item=${R2%/*} - new_version=${1##*/} - if [ "$new_version" = "$1" ] - then - getdv .dv && lib=$R1 new_item=${R2%/*} || die no item - else - v=${1%/$new_version} - new_item=${v##*/} - [ "$new_item" = "$v" ] || new_lib=${v%/$new_item} - fi - [ "$PWD" = "$root" ] && [ "$item" != "$new_item" ] && - die "already a clone of $item" - lib=${lib:-$new_lib} - [ "$lib" ] || die no lib - [ "$new_lib" -a "$new_lib" != "$lib" ] && die "already in lib: $lib" - if [ "$new_version" = 0 ] # Init item in lib - then - initlib "$lib" - getdvinfo "$lib" || die "could not lock $lib" - mkdir -p /tmp/dv.$$/$new_item/0 - dv_write $new_item/0 $new_item/0 >/tmp/dv.$$/$new_item/0/.dv - { cat /tmp/dv.$$/$new_item/0/.dv; echo; } >>/tmp/dv.$$/.dvinfo.0 - ln -f /tmp/dv.$$/.dvinfo.0 /tmp/dv.$$/.dvinfo.1 - rsync -a /tmp/dv.$$/ "$lib" - fi - if [ ! "$2" ] # Use the item name as default directory (a la git) - then - set -- "$1" "${1%/*}" - set -- "$1" "${2##*/}" - echo cloning into "$2" - fi - [ ! -d "$2" ] && mkdir "$2" - cd "$2" || die cannot chdir to "$2" - # Rename existing supplier directories to allow supplier symlinks - find . -name .dv | while read l - do - l=${l%/.dv} && [ "$l" = "." ] && continue - mv "$l" "$l.dvold" - done - # Sync from lib, starting from most client item, up to last supplier - d=. s=$new_item/$new_version - while [ "$d" ] - do - [ -L "$d" ] && { - rm -f "$d" - [ -d "$d.dvold" ] && mv "$d.dvold" "$d" - } - cache "$lib/$s" && pref=$cacheprefix/ || pref= - rsync -aDS "$pref$lib/$s/" "$d" - dv_header "$d" Anc "$s" - dv_header "$d" Lib "$lib" - # Find next symlink pointing to a supplier - d= l= - eval "$(find . -type l | while read -r l - do - f=$(readlink "$l") - case $f in - (*/.dv./*) echo "d=\"$l\" s=\"${f#*/.dv./}\"" - break;; - esac - done)" +# desc - prints the descendants of a version +desc() { + set -- "$(path "$1")" + set -- "$1" "${1%/*}" + set -- "$1" "${2##*/}" + for a in "$dvlib/$2"/*/.dv/anc*; do + [ "$a" -ef "$1" ] && echo "${a%/*/*}" done } -desc() { - usage 'desc [Version]' 'print descendants' && return - getdv .dv || die no item - case $1 in - (""|.|$PWD) ;; - (*) info desc $1 ;; - esac +die() { + echo "$@" >&2 + exit 1 } -die() { echo "$0: fatal: $@" >&2; exit 1; } - +# diff [-a num] [[v1] v2] - prints differences (default: current and ancestor). diff() { - usage 'diff [-x pat] [-F File] [V1 [V2]]' 'Print differences' && return - getpdir .dv && getdv "$R1/.dv" || die not in a clone - lib=$R1 item=${R2%/*} old=${R2#*/} - [ "$lib" = "" ] && [ -L "../../.dv." ] && lib=${PWD%/*/*} - if [ "$2" ] - then - case $2 in - (.) new=. new_is_clone=1 ;; - (*) new=$lib/$item/$2 ;; - esac - cache "$new" && np=$cacheprefix/ || np= - old=$lib/$item/$1 - elif [ "$1" ] - then - case $1 in - (.) new=. new_is_clone=1 ;; - (*) new=$lib/$item/$1 ;; - esac - cache "$new" && np=$cacheprefix/ || np= - getdv "$np$new/.dv" && old=${R1:-$lib}/$R2 + if [ "$2" ]; then + set -- "$(path "$2")" "$(path "$1")" + elif [ "$1" ]; then + set -- "$(path "$1")" "$(anc "$(path "$1")")" else - new=$PWD new_is_clone=1 - cache "$new" && np=$cacheprefix/ || np= - getdv "$np$new/.dv" && old=${R1:-$lib}/$R2 + set -- "$(dvdir)" "$(anc)" fi - cache "$old" && op=$cacheprefix/ || op= - [ "$Opts" ] || printf "old %s\nnew %s\n" "$old" "$new" - # Itemized diff for all suppliers, deepest first - cd "$np$new" && for f in $(find . -type f -name .dv | sort -r) - do - d=${f%/.dv} - [ "$d" = . ] && prefix= || prefix=${d#./}/ - getdv "$f" && cache "$lib/$R2" - [ "$new_is_clone" ] && dest=$np$d || dest=$prefix$d - diffdir "$op$lib/$R2" "$dest" - Optx="$Optx --exclude=${d##*/}" - done -} - -# Usage: diffdir oldpath newpath -# Print differences between 2 directories -diffdir() { - [ -f "$2/.dvignore" ] && xf=--exclude-from=$2/.dvignore || xf= - rsync -aDSniv $xf --delete --exclude=".dv.*/" $Optx "$2/" "$1" | - awk -v OptF="${OptF#./}" -v prefix=$prefix ' - NF == 0 {exit} - NR < 2 || /\/*\.dv$/ || /\/$/ {next} - # Match an itemized status for all versions of rsync -i - $1 !~ /^[<>ch.*][fdLDS+][.+?cstpoguaxz]+$/ {next} - {key = $1; file = substr($0, length(key) + 2)} - OptF && OptF != file {next} - key == "*deleting" {print "deleted " prefix file; next} - substr(key, 3, 7) == "+++++++" {print "created " prefix file; next} - { # Avoid false positive if only mtime is changed. - of = "'$1'/" file; gsub("'\''", "'\'\\\\\'\''", of) - nf = "'$2'/" file; gsub("'\''", "'\'\\\\\'\''", nf) - if (substr(key, 2, 1) == "L") { # Symlink - src = target = file - sub(/.* -> /, "", target); - sub(/ -> .*/, "", src); - "readlink '$2'/" src | getline otarget - if (target != otarget) - print "changed " src - } else if (system("cmp -s '\''" of "'\'\ \''" nf "'\''")) - print "changed " file - }' - # Or: scan key for file/link size, checksum or permission change - # rsync -c is required - #key ~ /[cps]/ { print "changed " prefix file }' + [ "$2" ] && command diff $diffopt -U 3 -x .dv "$2" "$1" | less -F } -dv_write() { - cat <<- EOT - From $(username) - Date: $(date +"%F %T %z") - Version: $1 - Anc: $2 - EOT - - [ "$OptA" ] && echo "Author: $OptA" - printf "\n%s\n" "$Optm" +# dvdir prints the dir containing .dv. +dvdir() { + set -- "$(realpath "${1:-.}")" + while [ "$1" ]; do + [ -d "$1/.dv" ] && echo "$1" && return + set -- "${1%/*}" + done } -dv_header() { - awk -v val="$3" '/^'$2':/ {print "'$2': " val; done = 1; next} - NF == 0 && done == 0 {print "'$2': " val; done = 1} - {print}' $1/.dv >$1/.dv.$$ && mv $1/.dv.$$ $1/.dv +# head - prints the branch head versions. +head() { + for v in "$dvlib/${1:-$(name)}/"*; do + [ "$(desc "$v")" ] || echo "$v" + done } -# Usage: getdv path -# Return lib in R1, anc in R2, version in R3 -getdv() { - R1= R2= - while read -r line - do +# help - prints this help text. +help() { + while read -r line; do case $line in - ("Lib: "*) R1=${line#Lib: };; - ("Anc: "*) R2=${line#Anc: };; - ("Version: "*) R3=${line#Version: };; + (\#*\ -\ *) ;; + (*) continue ;; esac - done <$1 - [ "$R1" -o "$R2" ] + set -- "${line% - *}" "${line#* - }" + [ "$1" = '#' ] || printf " %-26s" "${1#\# }" + echo "$2" + done < "$script" } -# Usage: getdvinfo lib -# Get exclusive write access to a dvlib, for new version commit -getdvinfo() { - [ -d /tmp/dv.$$ ] || mkdir /tmp/dv.$$ - [ "$Optn" ] && { rsync "$1/.dvinfo.1" /tmp/dv.$$/.dvinfo.0; return; } - t=0 - for i in 1 2 3 4 5 - do - rsync --remove-source-files "$1/.dvinfo.0" /tmp/dv.$$/ && break - t=$(($t + $i)) && sleep $t - done - test -f /tmp/dv.$$/.dvinfo.0 +# incv increments version. +incv() { + set -- "$1" "${1##*[-.a-z_A-Z]}" + set -- "${1%"$2"}" "$2" + echo "$1$(($2 + 1))" } -putdvinfo() { - [ "$Optn" ] && return - ln -f /tmp/dv.$$/.dvinfo.0 /tmp/dv.$$/.dvinfo.1 - rsync -a /tmp/dv.$$/.dvinfo.[01] "$1/" - isremote "$1" && cp /tmp/dv.$$/.dvinfo.0 "$cacheprefix/$1/" +# init - creates an initial clone in the current directory. +init() { + [ "$(dvdir)" ] && die "already initialized: $(dvdir)" + mkdir .dv } -# Usage: getpdir file [path] -# Return absolute parent dir of path or PWD containing file -getpdir() { - R1="$([ -d "${2:-.}" ] && cd "${2:-.}" && pwd)" - while [ "$R1" ] - do - [ -f "$R1/$1" ] && return || R1=${R1%/*} - done - return 1 -} +# ls [item] - lists dvlib. +ls() ( + cd "$dvlib" && command ls $lsopt "$@" +) -# Usage: getprd file [path] -# Return relative path to parent directory containing file -getprd() { - R2="$(cd "${2:-.}" && pwd)"; R2=${R2%/*} R1=.. - while [ "$R2" ] - do - [ -f "$R2/$1" ] && return || R2=${R2%/*} R1=$R1/.. - done - return 1 +# name prints the item name. +name() { + set -- "$(dvdir)" + [ "$1" ] && echo "${1##*/}" || die "not a dv item, no .dv found" } -info() { - usage info && return - case $2 in - (*:*) lib=${2%/*/*} ;; - (*) getpdir .dv && getdv $R1/.dv && lib=$R1 || die no dvlib found - esac - case $2 in # $2 specifies: - (*/*/*) v=${2%/*/*}; v=${2#$v/} ;; # lib/item/version - (*/*) v=$2 ;; # item/version - (*) v=${R2%/*}/$2 ;; # version +# path prints the version path, if exist. +path() { + case $1 in + (*/*|.) dvdir "$1"; return ;; + ([0-9]*) set -- "$(name)-$1" ;; esac - isremote "$lib" && { - p=$cacheprefix - [ -d "$p/$lib" ] || mkdir -p "$p/$lib" - [ "$Optl" ] || rsync -a "$lib/.dvinfo.1" "$p/$lib/" - } || p= - info_query $1 $v $3 <$p/$lib/.dvinfo.1 -} - -info_query() -{ - awk -v arg0=$1 -v arg1=$2 -v arg2=$3 ' - /^From / { - if (v) msg[v] = var["Body"] - delete var - var["From"] = substr($0, 6) - header = 1 - next - } - header == 1 && NF == 0 { - v = var["Version"]; a = var["Anc"]; s = var["Sup"] - if (a != v) { - anc[v] = a; desc[a] = desc[a] ? desc[a] " " v : v - } - n = split(s, as) - for (i = 1; i <= n; i++) { - cli[as[i]] = cli[as[i]] ? cli[as[i]] " " v : v - } - sup[v] = s; msg[v] = var["Msg"]; date[v] = var["Date"] - if (var["Root"]) root[v] = var["Root"] - header = 0 - next - } - header == 1 { - i = index($0, ":") - var[substr($0, 1, i-1)] = substr($0, i+2) - next - } - header == 0 { - if ($0 ~ />+From /) sub(/>/, "") - var["Body"] = var["Body"] ? var["Body"] "\n" $0 : $0 - } - END { - if (v) msg[v] = var["Body"] - if (arg0 == "graph") anc_graph() - else if (arg0 == "anc") query_anc(arg1, arg2) - else if (arg0 == "sup") query_sup(arg1, arg2) - else if (arg0 == "cli") query_cli(arg1, arg2) - else if (arg0 == "log") print msg[arg1] - else if (arg0 == "from") print from[arg1] - else if (arg0 == "date") print date[arg1] - else if (arg0 == "desc") printl(desc[arg1]) - } - function anc_graph() { - print "digraph G {" - for (v in anc) print "\"" anc[v] "\" -> \"" v "\"" - print "}" - } - function query_anc(v, n) { while (n-- > 0) v = anc[v]; print v } - function query_cli(v, n) { - while (n-- > 0 && v != "") { - num = split(v, av); v = "" - for (i = 1; i <= num; i++) { - printl(cli[av[i]]) - v = v ? v " " cli[av[i]] : cli[av[i]] - } - } - } - function query_sup(v, n) { - while (n-- > 0 && v != "") { - num = split(v, av); v = "" - for (i = 1; i <= num; i++) { - printl(sup[av[i]]) - v = v ? v " " sup[av[i]] : sup[av[i]] - } - } - } - function printl(l, i, n) { - n = split(l, al) - for (i = 1; i <= n; i++) - if (root[al[i]]) - print al[i] " -> '"$PWD/"'" root[al[i]] - else - print al[i] - }' + set -- "${1%%-*}" "${1#*-}" + [ -d "$dvlib/$1/$1-$2" ] && echo "$dvlib/$1/$1-$2" } -initlib() { - rsync --list-only "$1/.dv." >/dev/null 2>&1 && return - mkdir -p /tmp/dv.$$ - ln -s . /tmp/dv.$$/.dv. - >/tmp/dv.$$/.dvinfo.0 - >/tmp/dv.$$/.dvinfo.1 - chmod g+w /tmp/dv.$$/.dvinfo.[01] - rsync -a /tmp/dv.$$/ "$1" -} +# save [-nv] [v1] - creates a new version from clone. +save() { + [ "$1" ] && case $1 in (*[0-9]) ;; (*) die "invalid version: $1" ;; esac + set -- "$(dvdir)" "$(aopt=1 anc)" "$(name)" "${1#[a-zA-Z_]*-}" + set -- "$1" "$2" "$3" "${4:-$(incv "${2##*/[a-zA-Z_]*-}")}" + echo "$dvlib/$3/$3-$4" + command diff -q -x .dv "$2" "$1" >/dev/null 2>&1 && die 'no changes, abort' + [ "$nopt" ] && return -isremote() { case $1 in (*:*) return;; esac; return 1; } + # Update ancestor in clone then copy in dvlib. + rm -f "$1/.dv/anc" && [ "$2" ] && ln -s "../../${2##*/}" "$1/.dv/anc" + rsync ${vopt:+"$vopt"} -a ${2:+--link-dest="$2"} --mkpath "$1/" "$dvlib/$3/$3-$4/" -help_all() { - printf "$dv_version\nUsage: dv command [options] [args]\n" - Opth=1; for c in $Cmdlist; do $c; done + # After save, clone ancestor points to new saved version. + rm -f "$1/.dv/anc" && ln -s "$dvlib/$3/$3-$4" "$1/.dv/anc" } -newversion() { - [ "$OptV" ] && R1=$OptV && return - case $OptB in - ('') R1=$1 ;; - (*[-/]*) die 'illegal character [-/] in branch name' ;; - (*[0-9.]) die 'illegal end character [0-9.] in branch name' ;; - (*) case $1 in (*-${OptB}[1-9]*) R1=$1;; (*) R1=$1-${OptB}0;; esac ;; - esac - R2=${R1##*[!0-9]} - optb=$Optb - [ "$optb" ] && R3=.1 optb=${optb%b} || R3= R1=${R1%$R2}$(($R2 + 1)) - while [ "${optb}" ]; do optb=${optb%b} R3=.0$R3; done - R1=$R1$R3 - while grep -q "^Version: $item/$R1\$" /tmp/dv.$$/.dvinfo.0 - do - R2=${R1##*[!0-9]} - [ "$R2" ] && R1=${R1%$R2}$(($R2 - 1)).1 || R1=${R1}1 - done +# status - prints dv informations. +status() { + echo "lib: $dvlib" + set -- "$(dvdir)" "$(anc)" + [ "$1" ] || die "not a dv item, no .dv found" + echo "root: $1" + [ "$2" ] || die "no ancestor found, please save it first" + echo "anc: $2" + command diff -q -x .dv "$2" "$1" } -patch() { - usage 'patch [-x pat] [-F File] [Dir|Version]' \ - 'Print patch diff from ancestor' && return - diff "$@" | awk -v wdflag="-v${OptD:+3}${OptN:+1}${OptO:+2}" ' - { key = $1; file = substr($0, length(key) + 2) } - key == "old" { old = (file ~ /:/ ? "'$cacheprefix'/" : "") file; next } - key == "new" { new = (file ~ /:/ ? "'$cacheprefix'/" : "") file; next } - { - of = old "/" file; gsub("'\''", "'\'\\\\\'\''", of) - nf = new "/" file; gsub("'\''", "'\'\\\\\'\''", nf) - system("diff -Naup '\''" of "'\'\ \''" nf "'\''; echo") - }' +# sync [url] - synchronize a remote dvlib. +sync() { + set -- "${1:-$(cat "$dvlib/.url" 2>/dev/null)}" + [ "$1" ] || die "missing url" + [ "$(cat "$dvlib/.url" 2>/dev/null)" = "$1" ] || echo "$1" > "$dvlib/.url" + rsync ${vopt:+"$vopt"} ${nopt:+"$nopt"} -aH --mkpath "$1/" "$dvlib/" + rsync ${vopt:+"$vopt"} ${nopt:+"$nopt"} -aH --mkpath "$dvlib/" "$1/" } -save() { - usage 'save [-bln] [-A Author] [-m msg] [-x pat] [-B Branch|-V Version] [Dir]'\ - 'Save dir into a new version' && return - [ "$2" ] && die 'too many arguments' - getpdir .dv "$1" || die "not in a clone: ${1:-$PWD}" && root=$R1 - cd "$root" - getdv .dv && lib=$R1 && getdvinfo "$lib" - # Process supplier subdirs from the deepest up to "." (most client) - for d in $(find . -type f -name .dv | sort -r) - do - d=${d%/.dv} - cd "$root/$d" - OptF= save1 "$d" && nanc=$R1 && echo $nanc - [ "$d" = . ] && continue # not a supplier, done - - # Replace supplier subdir by symlink in lib - getprd .dv && s=$R1/../.dv./$nanc - t=${d##*/}; t=.dv.$t - mv "$root/$d" "$root/${d%/*}/$t" - ln -s "$s" "$root/$d" - done - putdvinfo "$lib" - # Restore supplier subdirs and remove links to lib, deepest first - find . -type d -name ".dv.*" | sort -r | while read d - do - t=${d##*/.dv.}; t=${d%/*}/$t - rm -f "$t" && mv "$d" "$t" - done +# version - prints the current version of dv. +version() { + echo "$version" } -save1() { - getdv .dv && lib=$R1 anc=$R2 && item=${anc%/*} old=${anc#*/} - [ "$(diffdir "$lib/$anc" .)" ] || { R1=$anc; return; } - newversion $old && new=$item/$R1 - [ "$Optn" ] || dv_write "$new" "$anc" >.dv - # Compute list of direct suppliers, for caching in .dvinfo.0 - lsup=$(find . -type l | while read -r l - do - case $l in (*/.dv.*) continue ;; esac - f=$(readlink "$l") - case $f in (*/.dv./*) printf "%s " ${f#*/.dv./} ;; esac - done) - [ ! "$Optn" ] && [ "$lsup" ] && dv_header . Sup "$lsup" - { cat .dv; echo; } >>/tmp/dv.$$/.dvinfo.0 - [ -f ".dvignore" ] && xf=--exclude-from=.dvignore || xf= - rsync -aDS$Optn$Optv --link-dest=../$old $xf --exclude=".dv.*/" \ - ./ "$lib/$new" - R1=$new - [ "$Optn" ] && return - isremote "$lib" && rsync -aDS --link-dest=../$old --exclude=".dv.*/" \ - ./ "$cacheprefix/$lib/$new" - dv_header . Anc "$new" - dv_header . Lib "$lib" -} - -supplier() { - usage 'supplier [Version]' 'print suppliers' && return - getdv .dv || die no item +# Main program starts here. +[ "$DVDEBUG" ] && set -x || case $1 in - (""|.|$PWD) # create a temporary dvinfo file, query it - V=$R2; find . -name .dv | - while read dv - do - [ "$dv" = "./.dv" ] && continue - # get the supplier - getdv "$dv"; v=$R2; dv=${dv%/.dv} - # get the client - getpdir .dv "${dv%/*}"; getdv "$R1/.dv" - # declare the client as supplier - printf "From \nVersion: %s\nSup: %s\n" "$v" "$R2" - [ "$OptM" ] && echo "Root: ${dv#./}"; echo - done | info_query cli $V ${Opt_N:-9999} ;; - (*) info sup $1 ${Opt_N:-9999} ;; - esac | sort -u -} - -usage() { [ "$Opth" ] && printf " %-34s %s\n" "$1" "$2"; } - -username() { - case $(uname -s) in - (Darwin) id -P | awk -v FS=: '{print $8}' ;; - (*) awk -v FS=[:,] '/^'$USER':/ {print $5; exit}' /etc/passwd ;; + (anc|clone|desc|diff|head|help|init|ls|path|save|status|sync|version) ;; + (*) help; exit 1;; esac -} - -wdiff() { - usage 'wdiff [-DNO] [-x pat] [-F File] [Dir|Version]' \ - 'Print word diffs from ancestor' && return - diff "$@" | - awk -v wdflag="-v${OptD:+3}${OptN:+1}${OptO:+2}" ' - { key = $1; file = substr($0, length(key) + 2) } - key == "old" { old = (file ~ /:/ ? "'$cacheprefix'/" : "") file; next } - key == "new" { new = (file ~ /:/ ? "'$cacheprefix'/" : "") file; next } - { - of = old "/" file; gsub("'\''", "'\'\\\\\'\''", of) - nf = new "/" file; gsub("'\''", "'\'\\\\\'\''", nf) - system("wd " wdflag " '\''" of "'\'\ \''" nf "'\''; echo") - }' | less -FCimnqGrX -j5 -h0 +/'\[0' -} - -cacheprefix=$HOME/.cache/dv -Cmdlist='anc client clone desc diff info patch save supplier wdiff' -while getopts :nvV opt # Parse global options -do +cmd="$1" +shift +while getopts :a:nv opt; do case $opt in - (V) echo "$dv_version"; exit ;; - (*) help_all; exit ;; + (a) aopt="$OPTARG" ;; + (n) nopt=-n ;; + (v) vopt=-v ;; + (*) help; exit ;; esac done shift $((OPTIND - 1)) -[ $1 ] && C=$1 && shift 1 || { help_all; exit 1; } -for c in $Cmdlist -do - case $c in - ($C|_$C) cmd=$c; break;; - ($C*) [ $cmd ] && die ambiguous command $C || cmd=$c;; - esac -done -while getopts :0123456789A:bB:F:hl:m:MnNOsvV:x: opt # Parse command options -do - case $opt in - ([0-9]) Opt_N=$Opt_N$opt;; - ([bhlnMNOsv]) eval Opt$opt=\${Opt$opt}$opt ;; - ([ABFmV]) eval Opt$opt=\$OPTARG ;; - (x) Optx="$Optx --exclude=$OPTARG" ;; - (*) Opth=1; $cmd; exit 1;; - esac -done -shift $(($OPTIND - 1)) -trap "rm -rf /tmp/dv.$$" EXIT -[ "$cmd" ] || die "no command \"$C\"" && $cmd "$@" +$cmd "$@" + +# Todo: +# * a function to squash a branch in the trunk +# * merge another ancestor (use anc0, anc1, ...) +# * vendor management +# * show graphs (dot) +# * sync: dvlib sync / mirror: resolve conflict by branching +# * rename version. +# * .dvignore +# * make dvlib versions immutable. @@ -0,0 +1,6 @@ +#!/bin/sh +# quick file viewer +#exec fzf --multi --preview-window=right:66% --preview 'cat {1}' +exec fzf --ansi --multi --preview-window=right:75% \ + --bind=left:preview-page-up --bind=right:preview-page-down \ + --preview 'bat --color always {1}' @@ -1,8 +1,9 @@ #!/bin/sh # Use backup from andOTP -gpg -qd ~/.otp_accounts.json.gpg | +#cat ~/.otp_accounts.json | +gpg -qd ~/.otp_accounts.json.gpg 2>/dev/null | jq -r '.[] | "\(.label) \(.secret)"' | while read -r l s; do echo "$l $(oathtool --totp -b "$s")" -done +done | column -t diff --git a/bin/gemini b/bin/gemini new file mode 100755 index 0000000..1bc3d57 --- /dev/null +++ b/bin/gemini @@ -0,0 +1,132 @@ +#!/usr/bin/env yaegi +package main + +import ( + "bufio" + "crypto/tls" + "fmt" + "io/ioutil" + "net/url" + "os" + "strconv" + "strings" +) + +func main() { + stdinReader := bufio.NewReader(os.Stdin) + var u string // URL + links := make([]string, 0, 100) + history := make([]string, 0, 100) + for { + fmt.Print("> ") + cmd, _ := stdinReader.ReadString('\n') + cmd = strings.TrimSpace(cmd) + // Command dispatch + switch strings.ToLower(cmd) { + case "": // Nothing + continue + case "q": // Quit + fmt.Println("Bye!") + os.Exit(0) + case "b": // Back + if len(history) < 2 { + fmt.Println("No history yet!") + continue + } + u = history[len(history)-2] + history = history[0 : len(history)-2] + default: + index, err := strconv.Atoi(cmd) + if err != nil { + // Treat this as a URL + u = cmd + if !strings.HasPrefix(u, "gemini://") { + u = "gemini://" + u + } + } else { + // Treat this as a menu lookup + u = links[index-1] + } + } + // Parse URL + parsed, err := url.Parse(u) + if err != nil { + fmt.Println("Error parsing URL!") + continue + } + // Connect to server + conn, err := tls.Dial("tcp", parsed.Host+":1965", &tls.Config{InsecureSkipVerify: true}) + if err != nil { + fmt.Println("Failed to connect: " + err.Error()) + continue + } + defer conn.Close() + // Send request + conn.Write([]byte(u + "\r\n")) + // Receive and parse response header + reader := bufio.NewReader(conn) + responseHeader, err := reader.ReadString('\n') + parts := strings.Fields(responseHeader) + status, err := strconv.Atoi(parts[0][0:1]) + meta := parts[1] + // Switch on status code + switch status { + case 1, 3, 6: + // No input, redirects or client certs + fmt.Println("Unsupported feature!") + case 2: + // Successful transaction + // text/* content only + if !strings.HasPrefix(meta, "text/") { + fmt.Println("Unsupported type " + meta) + continue + } + // Read everything + bodyBytes, err := ioutil.ReadAll(reader) + if err != nil { + fmt.Println("Error reading body") + continue + } + body := string(bodyBytes) + if meta == "text/gemini" { + // Handle Gemini map + links = make([]string, 0, 100) + preformatted := false + for _, line := range strings.Split(body, "\n") { + if strings.HasPrefix(line, "```") { + preformatted = !preformatted + } else if preformatted { + fmt.Println(line) + } else if strings.HasPrefix(line, "=>") { + line = line[2:] + bits := strings.Fields(line) + parsedLink, err := url.Parse(bits[0]) + if err != nil { + continue + } + link := parsed.ResolveReference(parsedLink).String() + var label string + if len(bits) == 1 { + label = link + } else { + label = strings.Join(bits[1:], " ") + } + links = append(links, link) + fmt.Printf("[%d] %s\n", len(links), label) + } else { + // This should really be wrapped, but there's + // no easy support for this in Go's standard + // library + fmt.Println(line) + } + } + } else { + // Just print any other kind of text + fmt.Print(body) + } + history = append(history, u) + case 4, 5: + fmt.Println("ERROR: " + meta) + } + } +} @@ -1,7 +1,7 @@ #!/bin/sh # Toggle auxiliary HDMI screen on/off when connected/disconnected. -opt="--auto --left-of eDP1" +opt="--auto --left-of eDP-1" #opt="--auto --right-of eDP-1" #opt="--auto --above eDP-1" @@ -11,5 +11,5 @@ opt="--auto --left-of eDP1" # wait for the screen to settle sleep 3 -xrandr | grep -q 'HDMI1 connected' || opt="--off" -xrandr --output HDMI1 $opt +xrandr | grep -q '^DP-1 connected' || opt="--off" +xrandr --output DP-1 $opt @@ -2,6 +2,8 @@ # Display images directly in terminal. # Tested with xterm v361. Depends on imagemagick convert(1). +[ "$LC_TERMINAL" = iTerm2 ] && [ -x "$HOME/.iterm2/imgcat" ] && exec "$HOME/.iterm2/imgcat" "$@" + # maxsize prints the geomtry size of terminal window, with # a maximum value of 1000 pixels for width and height, or # 640x480 if terminal size can not be probed. diff --git a/bin/idot b/bin/idot deleted file mode 100755 index 44387e8..0000000 --- a/bin/idot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# dot -Gsize=9 -Nshape=box -Nstyle=rounded -Tsvg | convert -- - sixel:/dev/tty -# dot -Gsize=9 -Nfontname=Helvetica -Tsvg | convert -- - sixel:/-dev/tty -dot -Gsize=9 -Nfontname=Arial -Tpng | icat - /dev/tty @@ -36,6 +36,7 @@ ca() { pp() { pp_s=$1 pp_b=$2 R1='' while true; do + ! [ "$pp_s" ] && R1='' && return [ "$pp_b" = "$pp_s" ] && break pp_s=${pp_s%/*} [ "$R1" ] && R1=$R1/.. || R1=.. @@ -0,0 +1,136 @@ +#!/bin/sh + +# See https://spec.commonmark.org for reference +md2html() { + awk ' + function newblock(nb) { + if (text) print "<" block ">" text "</" block ">" + text = "" + block = nb ? nb : "p" + } + + function subinline(tgl, inl) { + while (match($0, tgl)) { + if (inline[ni] == inl) + ni -= sub(tgl, "</" inl ">") + else if (sub(tgl, "<" inl ">")) + inline[++ni] = inl + } + } + + function dolink(href, lnk) { + # Undo escaped html in uris + gsub(/&/, "\\&", href) + gsub(/</, "<", href) + gsub(/>/, ">", href) + # & can be tricky, and not standard: + gsub(/&/, "\\\\\\&", href) + gsub(/&/, "\\\\\\&", lnk) + return "<a href=\"" href "\">" lnk "</a>" + } + + BEGIN { ni = 0; nl = 0; text = ""; block = "p" } + + # Escape html + esc != "false" { gsub("&", "\\&"); gsub("<", "\\<"); gsub(">", "\\>") } + + # Horizontal rules (_ is not in markdown) + /^[ ]*([-*_] ?)+[ ]*$/ && text == "" { print "<hr>"; next } + + # Tables (not in markdown) + # Syntax: + # Right Align| Center Align |Left Align + /([ ]\|)|(\|[ ])/ { + if (block != "table") newblock("table") + nc = split($0, cells, "|") + $0 = "<tr>\n" + for (i = 1; i <= nc; i++) { + align = "left" + if (sub(/^[ ]+/, "", cells[i])) { + if (sub(/[ ]+$/, "", cells[i])) + align = "center" + else + align = "right" + } + sub(/[ ]+$/, "", cells[i]) + $0 = $0 "<td align=\"" align "\">" cells[i] "</td>\n" + } + $0 = $0 "</tr>" + } + + # Ordered and unordered (possibly nested) lists + /^[ ]*([*+-]|(([0-9]+[\.-]?)+))[ ]/ { + newblock("li") + nnl = 1 + while (match($0, /^[ ]/)) { sub(/^[ ]/,""); nnl++ } + while (nl > nnl) print "</" list[nl--] ">" + while (nl < nnl) { + list[++nl] = "ol" + if (match($0, /^[*+-]/)) list[nl] = "ul" + print "<" list[nl] ">" + } + sub(/^([*+-]|(([0-9]+[\.-]?)+))[ ]/,"") + } + + # Multi line list items + block == "li" { sub(/^( *)|( *)/,"") } + + # Code blocks + /^( | )/ { + if (block != "code") newblock("code") + sub(/^( | )/, "") + text = text $0 "\n" + next + } + + # Paragraph + /^$/ { newblock(); while(nl > 0) print "</" list[nl--] ">" } + + # Setex-style Headers (plus h3 with underscores) + /^=+$/ { block = "h" 1; next } + /^-+$/ { block = "h" 2; next } + /^_+$/ { block = "h" 3; next } + + # Atx-style headers + /^#/ { + newblock() + match($0, /#+/) + n = RLENGTH + if (n > 6) n = 6 + sub(/# */, "#") + text = substr($0, RLENGTH + 1) + block = "h" n + next + } + + { + # Images + while (match($0, /!\[[^\]]+\]\([^\)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /(!\[)|\)|(\]\()/) + sub(/!\[[^\]]+\]\([^\)]+\)/, "<img src=\"" a[3] "\" alt=\"" a[2] "\">") + } + # Links + while (match($0, /\[[^\]]+\]\([^\)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /[\[\)]|(\]\()/) + sub(/\[[^\]]+\]\([^\)]+\)/, dolink(a[3], a[2])) + } + # Auto links (uri matching is poor) + na = split($0, a, /(^\()|[ ]|([,\.\)]([ ]|$))/) + for (i = 1; i <= na; i++) + if (match(a[i], /^(((https?|ftp|file|news|irc):\/\/)|(mailto:)).+$/)) + sub(a[i], dolink(a[i], a[i])) + # Inline + subinline("(\\*\\*)|(__)", "strong") + subinline("\\*", "em") + subinline("`", "code") + text = text (text ? " " : "") $0 + } + + END { + while(ni > 0) text = text "</" inline[ni--] ">" + newblock() + while(nl > 0) print "</" list[nl--] ">" + }' "$1" +} + +md2html "$1" diff --git a/bin/md2html b/bin/md2html index 35e1d72..7be4aaa 100755 --- a/bin/md2html +++ b/bin/md2html @@ -1,43 +1,42 @@ #!/usr/bin/awk -f # md2html.awk -# by: Jesus Galan (yiyus) <yiyu.jgl@gmail>, May 2009 # Usage: # md2html file.md > file.html # Options: -v esc=false to not escape html -function newblock(nblock){ - if(text) - print "<" block ">" text "</" block ">"; - text = ""; - block = nblock ? nblock : "p"; +function newblock(nblock) { + if (text) + print "<" block ">" text "</" block ">" + text = "" + block = nblock ? nblock : "p" } -function subinline(tgl, inl){ - while(match($0, tgl)){ +function subinline(tgl, inl) { + while (match($0, tgl)){ if (inline[ni] == inl) - ni -= sub(tgl, "</" inl ">"); + ni -= sub(tgl, "</" inl ">") else if (sub(tgl, "<" inl ">")) - inline[++ni] = inl; + inline[++ni] = inl } } -function dolink(href, lnk){ +function dolink(href, lnk) { # Undo escaped html in uris - gsub(/&/, "\\&", href); - gsub(/</, "<", href); - gsub(/>/, ">", href); + gsub(/&/, "\\&", href) + gsub(/</, "<", href) + gsub(/>/, ">", href) # & can be tricky, and not standard: - gsub(/&/, "\\\\\\&", href); - gsub(/&/, "\\\\\\&", lnk); - return "<a href=\"" href "\">" lnk "</a>"; + gsub(/&/, "\\\\\\&", href) + gsub(/&/, "\\\\\\&", lnk) + return "<a href=\"" href "\">" lnk "</a>" } BEGIN { ni = 0; # inlines nl = 0; # nested lists - text = ""; - block = "p"; + text = "" + block = "p" } # Escape html @@ -49,128 +48,122 @@ esc != "false" { # Horizontal rules (_ is not in markdown) /^[ ]*([-*_] ?)+[ ]*$/ && text == "" { - print "<hr>"; - next; + print "<hr>" + next } # Tables (not in markdown) # Syntax: # Right Align| Center Align |Left Align /([ ]\|)|(\|[ ])/ { - if(block != "table") - newblock("table"); - nc = split($0, cells, "|"); - $0 = "<tr>\n"; - for(i = 1; i <= nc; i++){ - align = "left"; - if(sub(/^[ ]+/, "", cells[i])){ - if(sub(/[ ]+$/, "", cells[i])) - align = "center"; + if (block != "table") + newblock("table") + nc = split($0, cells, "|") + $0 = "<tr>\n" + for (i = 1; i <= nc; i++){ + align = "left" + if (sub(/^[ ]+/, "", cells[i])){ + if (sub(/[ ]+$/, "", cells[i])) + align = "center" else - align = "right"; + align = "right" } - sub(/[ ]+$/,"", cells[i]); - $0 = $0 "<td align=\"" align "\">" cells[i] "</td>\n"; + sub(/[ ]+$/,"", cells[i]) + $0 = $0 "<td align=\"" align "\">" cells[i] "</td>\n" } - $0 = $0 "</tr>"; + $0 = $0 "</tr>" } # Ordered and unordered (possibly nested) lists /^[ ]*([*+-]|(([0-9]+[\.-]?)+))[ ]/ { - newblock("li"); - nnl = 1; - while(match($0, /^[ ]/)){ - sub(/^[ ]/,""); - nnl++; + newblock("li") + nnl = 1 + while (match($0, /^[ ]/)){ + sub(/^[ ]/,"") + nnl++ } - while(nl > nnl) - print "</" list[nl--] ">"; - while(nl < nnl){ - list[++nl] = "ol"; - if(match($0, /^[*+-]/)) - list[nl] = "ul"; - print "<" list[nl] ">"; + while (nl > nnl) + print "</" list[nl--] ">" + while (nl < nnl){ + list[++nl] = "ol" + if (match($0, /^[*+-]/)) + list[nl] = "ul" + print "<" list[nl] ">" } - sub(/^([*+-]|(([0-9]+[\.-]?)+))[ ]/,""); + sub(/^([*+-]|(([0-9]+[\.-]?)+))[ ]/,"") } # Multi line list items block == "li" { - sub(/^( *)|( *)/,""); + sub(/^( *)|( *)/,"") } # Code blocks /^( | )/ { - if(block != "code") - newblock("code"); - sub(/^( | )/, ""); - text = text $0 "\n"; - next; + if (block != "code") + newblock("code") + sub(/^( | )/, "") + text = text $0 "\n" + next } -# Paragraph +# Paragraphs /^$/ { - newblock(); - while(nl > 0) - print "</" list[nl--] ">"; + newblock() + while (nl > 0) + print "</" list[nl--] ">" } -# Setex-style Headers -# (Plus h3 with underscores.) -/^=+$/ { - block = "h" 1; - next; -} - -/^-+$/ { - block = "h" 2; - next; +# Headers +/^#/ { + newblock() + match($0, /#+/) + n = RLENGTH + if (n > 6) + n = 6 + text = substr($0, RLENGTH + 1) + block = "h" n + next } -/^_+$/ { - block = "h" 3; - next; +# Alternate headers (underlined) +/^=+$/ { + block = "h" 1 + next } -# Atx-style headers -/^#/ { - newblock(); - match($0, /#+/); - n = RLENGTH; - if(n > 6) - n = 6; - text = substr($0, RLENGTH + 1); - block = "h" n; - next; +/^-+$/ { + block = "h" 2 + next } -// { +{ # Images - while(match($0, /!\[[^\]]+\]\([^\)]+\)/)){ - split(substr($0, RSTART, RLENGTH), a, /(!\[)|\)|(\]\()/); - sub(/!\[[^\]]+\]\([^\)]+\)/, "<img src=\"" a[3] "\" alt=\"" a[2] "\">"); + while (match($0, /!\[[^\]]+\]\([^\)]+\)/)){ + split(substr($0, RSTART, RLENGTH), a, /(!\[)|\)|(\]\()/) + sub(/!\[[^\]]+\]\([^\)]+\)/, "<img src=\"" a[3] "\" alt=\"" a[2] "\">") } # Links - while(match($0, /\[[^\]]+\]\([^\)]+\)/)){ - split(substr($0, RSTART, RLENGTH), a, /[\[\)]|(\]\()/); - sub(/\[[^\]]+\]\([^\)]+\)/, dolink(a[3], a[2])); + while (match($0, /\[[^\]]+\]\([^\)]+\)/)){ + split(substr($0, RSTART, RLENGTH), a, /[\[\)]|(\]\()/) + sub(/\[[^\]]+\]\([^\)]+\)/, dolink(a[3], a[2])) } # Auto links (uri matching is poor) - na = split($0, a, /(^\()|[ ]|([,\.\)]([ ]|$))/); - for(i = 1; i <= na; i++) - if(match(a[i], /^(((https?|ftp|file|news|irc):\/\/)|(mailto:)).+$/)) - sub(a[i], dolink(a[i], a[i])); + na = split($0, a, /(^\()|[ ]|([,\.\)]([ ]|$))/) + for (i = 1; i <= na; i++) + if (match(a[i], /^(((https?|ftp|file|news|irc):\/\/)|(mailto:)).+$/)) + sub(a[i], dolink(a[i], a[i])) # Inline - subinline("(\\*\\*)|(__)", "strong"); - subinline("\\*", "em"); - subinline("`", "code"); - text = text (text ? " " : "") $0; + subinline("(\\*\\*)|(__)", "strong") + subinline("\\*", "em") + subinline("`", "code") + text = text (text ? " " : "") $0 } END { - while(ni > 0) - text = text "</" inline[ni--] ">"; - newblock(); - while(nl > 0) - print "</" list[nl--] ">"; + while (ni > 0) + text = text "</" inline[ni--] ">" + newblock() + while (nl > 0) + print "</" list[nl--] ">" } diff --git a/bin/migrate_vimki b/bin/migrate_vimki new file mode 100755 index 0000000..15242e6 --- /dev/null +++ b/bin/migrate_vimki @@ -0,0 +1,58 @@ +#!/bin/sh + +# Migrate Wiki content from vimki to vimki2 format. + +fixfile() { + awk ' + { + for (i = 1; i <= NR; i++) { + if (match($i, /^[A-Z][A-Z_0-9]*[a-z][a-z0-9]*[_A-Z]/) == 0) continue + s = $i + l = "" + while (match(s, /^[A-Z][A-Z_0-9]*[a-z]+/) != 0) { + l = l substr(s, 1, RLENGTH) " " + s = substr(s, RLENGTH+1) + } + p = match(s, /[^A-Za-z0-9_]/) + if (p != 0) { + s2 = substr(s, 1, p-1) "]" substr(s, p) + s = s2 + } else s = s "]" + l = "[" l s + gsub(/[ \t_]+/, " ", l) + sub(/ *]/, "]", l) + $i = tolower(l) + } + print + } + ' "${1:-HomePage}" +} + +fixname() { + echo "$1" | awk '{ + s = $0 + l = "" + while (match(s, /^[A-Z][A-Z_0-9]*[a-z]+/) != 0) { + l = l substr(s, 1, RLENGTH) " " + s = substr(s, RLENGTH+1) + } + p = match(s, /[^A-Za-z0-9_]/) + if (p != 0) { + s2 = substr(s, 1, p-1) "]" substr(s, p) + s = s2 + } + l = l s + gsub(/[ \t_]+/, " ", l) + sub(/ *$/, "", l) + print tolower(l) + + }' +} + +mkdir -p $HOME/Wiki2 +cd $HOME/Wiki +for file in *; do + new=$(fixname "$file") + echo "$new" + fixfile "$file" > "$HOME/Wiki2/$new" +done diff --git a/bin/open b/bin/open deleted file mode 100755 index 0fa97a7..0000000 --- a/bin/open +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -exec >/tmp/open.out 2>&1 -set -x - -cmd=xdg-open -case $1 in -(*.mkv|*.mp4) cmd=vlc;; -esac - -exec $cmd "$@" @@ -0,0 +1,3 @@ +#!/bin/sh +adb forward tcp:8222 tcp:8022 +ssh ssh://u0_a250@localhost:8222 diff --git a/bin/rdate b/bin/rdate new file mode 100755 index 0000000..a69d137 --- /dev/null +++ b/bin/rdate @@ -0,0 +1,11 @@ +#!/bin/sh + +# Set date on remote machine from local one. This version works +# from MacOS to AlpineLinux. It is intended to re-sync clock of a +# virtual machine after host wakeup. + +# TODO: option to display the time difference between host and remote. +# hint: use 'date +%s' to get timestamp in seconds since epoch. + +ssh "$1" "sudo date $(date +%m%d%H%M%Y.%S)" + diff --git a/bin/start_godoc b/bin/start_godoc new file mode 100755 index 0000000..c6a716b --- /dev/null +++ b/bin/start_godoc @@ -0,0 +1,5 @@ +#!/bin/sh + +# Start a godoc server on port 6060 + +exec /home/marc/go/bin/godoc >/tmp/godoc.out 2>&1 & diff --git a/bin/status2 b/bin/status2 new file mode 100755 index 0000000..1b7ea55 --- /dev/null +++ b/bin/status2 @@ -0,0 +1,27 @@ +#!/bin/sh + +ip() { + while read -r w1 w2 w3; do + [ $w1 = /32 ] && [ $w2 = host ] && [ $ip != 127.0.0.1 ] && break + ip=$w2 + done < /proc/net/fib_trie +} + +power() { + while read -r line; do + case $line in POWER_SUPPLY_CAPACITY*) power=${line#*=}% && break;; esac + done < /sys/class/power_supply/BAT0/uevent +} + +status() { + power + ip + sound="$(pamixer --get-volume-human)" + clock="$(date +'%a %d %b %H:%M')" +} + +while true; do + status && echo "$ip , power $power , sound $sound , $clock" + sleep 17 +done | +root-tail -g '500x20-80-0' -fn '-*-fixed-medium-*-*-*-15-*-*-*-*-*-*-*' --color grey70 - diff --git a/bin/update_hosts b/bin/update_hosts new file mode 100755 index 0000000..74bf25b --- /dev/null +++ b/bin/update_hosts @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# Update /etc/hosts with a well curated blacklist of malware, ads, porn, etc. +# Custom hosts are preserved. + +[ "$USER" = root ] || exec sudo "$0" "$@" + +echo 'Checking from https://github.com/StevenBlack/hosts:' +lsd=$(curl -s 'https://api.github.com/repos/StevenBlack/hosts/commits?path=hosts&page=1&per_page=1' | jq -r '.[0].commit.committer.date') +#echo "last source update: $(date -j -f "%FT%TZ" "$lsd")" +echo "last source update: $(date --date="$lsd")" +echo "last local update: $(date -r /etc/hosts)" +# [ $(date -j -f "%FT%TZ" "$lsd" +%s) -lt $(date -r /etc/hosts +%s) ] && echo 'Nothing to do' && exit +[ $(date --date="$lsd" +%s) -lt $(date -r /etc/hosts +%s) ] && echo 'Nothing to do' && exit + +cd /etc +cp -p hosts hosts.old +hosts=$(awk '/^# Custom host/, /^# End of custom host/' hosts.old) +curl -s 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts' | awk ' + BEGIN { hosts = ARGV[1]; ARGV[1] = "" } + /^# Custom host/ { print hosts; next } + /^# End of custom host/ { next } + { print } +' "$hosts" > hosts.new + +mv hosts.new hosts +[ "$(uname -s)" != Darwin ] || { dscacheutil -flushcache; killall -HUP mDNSResponder; } +diff -u /etc/hosts.old /etc/hosts | diffstat diff --git a/bin/update_kernel_host b/bin/update_kernel_host new file mode 100755 index 0000000..4f2cbbf --- /dev/null +++ b/bin/update_kernel_host @@ -0,0 +1,13 @@ +#!/bin/sh -ex + +# After 'apk upgrade', update kernel and initrd on VM host + +if [ -f /etc/arch-release ]; then + scp /boot/Image /boot/initramfs-linux.img marc@m1:.vm/a1 + exit +fi + +sudo cp /boot/initramfs-virt /tmp +sudo chmod a+r /tmp/initramfs-virt +gunzip < /boot/vmlinuz-virt > /tmp/vmlinux +scp /tmp/initramfs-virt /tmp/vmlinux marc@m1:.vm/vm1/ diff --git a/bin/vcat b/bin/vcat new file mode 100755 index 0000000..7c162d4 --- /dev/null +++ b/bin/vcat @@ -0,0 +1,8 @@ +#!/bin/sh + +# Use vim to cat a file. +# Useful if file is vim-encrypted (password silently expected). + +trap "stty '$(stty -g)'" EXIT +stty -echo +vim -es '+%p' '+:q!' "$1" diff --git a/bin/vimki b/bin/vimki new file mode 100755 index 0000000..e3e0f4d --- /dev/null +++ b/bin/vimki @@ -0,0 +1,56 @@ +#!/bin/sh + +# Batch operations on vimki + +# rename changes the link name and propagates the change in the wiki +rename1() { + [ "$(head -c 8 "$3")" = VimCrypt ] && return + gawk -v old="$1" -v new="$2" -v IGNORECASE=1 ' + { + gsub("[[]" old "[]]", "[" new "]") + print + } + ' "$3" > "$3.$$" && mv "$3.$$" "$3" +} + +link2rx() { + gawk -v rx="$1" -v IGNORECASE=1 ' + BEGIN { + gsub(/_/, "\\W+", rx) + gsub(/a/, "[aåäáàâã]", rx) + gsub(/c/, "[cç]", rx) + gsub(/e/, "[eéèêë]", rx) + gsub(/i/, "[iîíìï]", rx) + gsub(/o/, "[oôöóõò]", rx) + gsub(/u/, "[uùûüú]", rx) + gsub(/y/, "[yÿ]", rx) + gsub(/n/, "[nñ]", rx) + print rx + }' +} + +#shellcheck disable=SC2020 + +linkfile() { + echo "$1" | + tr '[:upper:]' '[:lower:]' | + tr 'åäáàâãçéèêëîíìïôöóõòùûüúÿñ' 'aaaaaaceeeeiiiiooooouuuuyn' | + awk '{gsub(/\W+/, "_"); print}' +} + +rename() { + rx=$(link2rx "$1") + # Parallelize renaming + echo *.md | xargs -n 1 -P 8 "$0" rename1 "$rx" "$2" + oldf="$(linkfile "$1").md" + [ -f "$oldf" ] && mv "$oldf" "$(linkfile "$2").md" +} + +fixfiles() { + for f in *; do + mv "$f" "$(linkfile "$f")" + done +} + +cd ~/Wiki || exit +"$@" @@ -0,0 +1,286 @@ +#!/bin/sh + +# Manage virtual machines +# +# Prereq: +# - curl +# - cdrtools (isoinfo) +# - expect +# - qemu +# - screen +# +# TODO: +# - extract bzImage and initrd.gz with isoinfo +# - ssh scripts to finish install (once ssh is ready) +# +# DONE: +# - setup vde and networking +# - setup ssh keys so it is possible to ssh in vm from host +# +unset CDPATH +export LC_ALL=C IFS=' +' + +version='vm-0.1' + +arch=$(uname -m) +sys=$(uname -s) +alpine_version='3.15.0' +pubkey=$HOME/.ssh/id_rsa.pub +dir="${VM_DIR:-$HOME/.vm}" + +console() { + usage 'console name' 'Attach a console to a virtual machine' && return + [ "$1" ] || die "missing argument" + is_running "$1" && screen -r "vm!$1!" +} + +create_arch() { + usage 'create_arch [-s size] name' 'Create an archlinux disk image' && return + size=8g + while getopts :s: opt; do + case $opt in + s) size=$OPTARG ;; + *) Opth=2 create_arch; return ;; + esac + done + shift $((OPTIND - 1)) + [ -d "$dir/$1" ] && die "create failed: $dir/$1 already exists" + mkdir "$dir/$1" + cd "$dir/$1" || die "create failed: invalid directory $dir/$1" + qemu-img create "$1.raw" "$size" || die "create failed" + mac=$(new_macaddr) + ip=$(new_ip) + hdd="$1.raw" + echo "hdd=$hdd +mac=$mac +ip=$ip" >> config + + mkfs.ext4 "$1.raw" + mkdir -p mnt + sudo mount "$1.raw" mnt + sudo pacstrap mnt base base-devel + sudo umount mnt +} + +create() { + usage 'create [-s size] name' 'Create an alpinelinux disk image' && return + size=8g + while getopts :s: opt; do + case $opt in + s) size=$OPTARG ;; + *) Opth=2 create_arch; return ;; + esac + done + shift $((OPTIND - 1)) + [ -d "$dir/$1" ] && die "create failed: $dir/$1 already exists" + mkdir "$dir/$1" + cd "$dir/$1" || die "create failed: invalid directory $dir/$1" + qemu-img create "$1.raw" "$size" || die "create failed" + mac=$(new_macaddr) + ip=$(new_ip) + hdd="$1.raw" + echo "hdd=$hdd +mac=$mac +ip=$ip" >> config + + # Before install do not use virtio, as devices may not recognized as bootable + # TODO: alternate way: extract kernel and initrd files and pass them directly to qemu + screen -S "vm!$1!" -d -m qemu-system-$arch -nographic \ + -cdrom ../alpine-iso/alpine-virt-$alpine_version-$arch.iso \ + -hdd "$hdd" -net nic,macaddr=$mac -net vde + setup_alpine "$1" + post_setup_alpine "$1" +} + +die() { [ "$1" ] && echo "$0: $*" >&2; exit 1; } + +help() { + usage 'help' 'Print this help text' && return + printf "$version\n Manage virtual machines\n\nUsage: vm command [options] [args]\n" + Opth=1; for c in $Cmdlist; do $c; done +} + +init() { + mkdir -p "$dir" +} + +init_alpine_iso() { + usage init_alpine_iso '' && return + mkdir -p "$dir/alpine-iso" + iso_url="https://dl-cdn.alpinelinux.org/alpine/v${alpine_version%.*}/releases/$arch" + iso="alpine-virt-$alpine_version-$arch.iso" + cd "$dir/alpine-iso" + [ -f "$iso" ] || curl -LO "$iso_url/$iso" || rm -f "$iso" + echo "iso=$iso +" > config + echo 10 > ../index +} + +is_running() { screen -ls "vm!$1!" >/dev/null 2>&1; } + +ls() { + usage 'ls' 'list virtual machines' && return + init && cd "$dir" || die "could not change dir to $dir" + for i in */; do + i=${i%/} + [ "$i" = '*' ] && continue + is_running "$i" && state=active || state=stopped + printf "%-20s %s\n" "$i" "$state" + done +} + +new_ip() { + read index < $dir/index + index=$((index + 1)) + echo "$index" > $dir/index + echo "10.0.2.$index/24" +} + +new_macaddr() { printf 'de:ad:be:ef:%02x:%02x\n' $((RANDOM % 256)) $((RANDOM % 256)); } + +pidof() { + usage 'pidof name' 'print the PID of a virtual machine' && return + p=$(screen -ls "vm!$1!" | awk 'NR==2 {print substr($1, 1, index($1, ".")-1)}') + [ "$p" ] && pgrep -P $p +} + +post_setup_alpine() { + start "$1" + read proto key id < "$pubkey" + # echo ' + expect -c ' + set timeout -1 + spawn screen -x "vm!'$1'!" + expect { + " login: " { send "root\r"; exp_continue } + "Password: " { send "root\r"; exp_continue } + ":~# " + } + send "mkdir -pm 0700 .ssh\r" + expect ":~# " + send "echo '$proto' '$key' '$id' >.ssh/authorized_keys\r" + expect ":~# " + send "exit\r" + ' +} + +# setup_alpine automates alpine installation from iso to image. +# When done, base image system is ready, with storage and network up. +# No user nor ssh access configured yet. +# TODO: custom network (in case of no dhcp). +setup_alpine() { + usage 'setup_alpine' && return + expect -c ' + set timeout -1 + spawn screen -x "vm!'$1'!" + expect { + "localhost login: " { send "root\r"; exp_continue } + "localhost:~# " { send "SWAP_SIZE=0 setup-alpine\r"; exp_continue } + "Select keyboard layout: " { send "\r"; exp_continue } + "Enter system hostname" { send "'$1'\r"; exp_continue } + "Which one do you want to initialize?" { send "\r"; exp_continue } + "Ip address for eth0?" { send "'$ip'\r"; exp_continue } + "Gateway?" { send "10.0.2.2\r"; exp_continue } + "manual network configuration?" { send "\r"; exp_continue } + "DNS domain name?" { send "lan\r"; exp_continue } + "DNS nameserver(s)?" { send "10.0.2.2 1.1.1.1\r"; exp_continue } + "New password:" { send "root\r"; exp_continue } + "Retype password:" { send "root\r"; exp_continue } + "Which timezone are you in?" { send "\r"; exp_continue } + "HTTP/FTP proxy URL?" { send "\r"; exp_continue } + "Enter mirror number " { send "\r"; exp_continue } + "Which SSH server?" { send "\r"; exp_continue } + "Which disk(s) would you like to use?" { send "sda\r"; exp_continue } + "How would you like to use it?" { send "sys\r"; exp_continue } + "Erase the above disk(s) and continue?" { send "y\r"; exp_continue } + "Installation is complete" { send "poweroff\r" } + } + interact + ' +} + +start_vde() { + usage start_vde && return + sudo sh <<- EOT + vde_switch -tap tap0 -sock /tmp/vde.ctl -daemon -mod 666 + sleep 1 + ip address add 10.0.2.2/24 dev tap0 + ip link set tap0 up + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -A POSTROUTING -s 10.0.2.0/24 -o eth0 -j MASQUERADE + iptables -t nat -A POSTROUTING -s 10.0.2.0/24 -o wlan0 -j MASQUERADE + EOT + #slirpvde --dhcp --daemon +} + +stop_vde() { + # killall slirpvde + sudo sh <<- EOT + iptables -t nat -D POSTROUTING -s 10.0.2.0/24 -o eth0 -j MASQUERADE + iptables -t nat -D POSTROUTING -s 10.0.2.0/24 -o wlan0 -j MASQUERADE + ip link set tap0 down + killall vde_switch + EOT +} + +start() { + usage 'start [-acd] name' 'start a virtual machine' && return + while getopts :acd opt; do + case $opt in + a) opta=1 ;; + c) boot=c ;; + d) boot=d ;; + esac + done + shift $((OPTIND -1)) + [ "$1" ] || die 'start failed: name missing' + cd "$dir/$1" || die "start failed: invalid directory $dir/$1" + is_running "$1" || start_qemu "$1" + [ "$opta" ] && console "$1" +} + +start_qemu() ( + opt='-nographic -cpu max' + [ "$sys" = Linux ] && opt="$opt -enable-kvm" + . ./config || die "could not source $PWD/config" + exec 1>>qemu.log 2>&1 + date +%F_%T + set -x + screen -S "vm!$1!" -d -m qemu-system-$arch $opt \ + ${smp+-smp $smp} \ + ${ram+-m $ram} \ + ${mac+-net nic,macaddr=$mac,model=virtio-net-pci} -net vde \ + ${hdd+-drive file="$hdd",if=virtio,media=disk,format=raw} \ + ${iso+-drive file="$iso",if=virtio,media=cdrom,format=raw} \ + ${boot+-boot $boot} +) + +stop() { + usage 'stop name' 'stop a virtual machine' && return + is_running "$1" && kill "$(pidof "$1")" +} + +usage() { + case $Opth in + 1) printf " %-34s %s\n" "$1" "$2" ;; + 2) printf "$0 $1\n\t$2\n" ;; + *) return 1 ;; + esac +} + +version() { + usage 'version' 'Print version' && return + echo "$version" +} + +Cmdlist='console create help init_alpine_iso ls pidof setup_alpine start start_vde stop version' +[ "$1" ] && C=$1 && shift 1 || { help; exit 1; } +#for c in $Cmdlist; do +# case $c in +# ("$C") cmd=$c; break ;; +# ("$C"*) [ "$cmd" ] && die "ambiguous command $C" || cmd=$c ;; +# esac +#done +cmd=$C +[ "$cmd" ] || { help; exit 1; } && $cmd "$@" @@ -0,0 +1,6 @@ +#!/bin/sh + +cols=$(stty -a|awk -F "[ ;]" '{print $9; exit}') +[ $cols -gt 72 ] && stty cols 72 +w3m "${@:-https://ddg.gg/lite/}" +stty cols "$cols" @@ -0,0 +1,335 @@ +#!/bin/sh + +## wag is a tool to generate static web sites +## +## Commands: + +unset CDPATH +export LC_ALL=C IFS='
+' + +cmd=$(command -v "$0") + +dest=./public + +footer() { + : +} + +# front parses front matter +front() { + { + read a b && [ "$a" = "---" ] && [ "$b" = "" ] || return + while read a b; do + [ "$a" = "---" ] && [ "$b" = "" ] && break + eval "front_${a%:}=\"$b\"" + done + } < "$1" +} + +## gen generates site content from source files +gen() { + [ -d "$dest" ] || mkdir -p "$dest" + for f in *.md; do + [ "$f" = "*.md" ] && continue + g="$dest/${f%.md}.html" + [ "$f" -ot "$g" ] && continue + echo "f: $f $g" + front "$f" + { + header + md2html "$f" + footer + } > "$g" + done +} + +header() { + cat <<- EOT + <title>$front_title</title> + <meta charset="utf-8"> + <style>body {max-width: 52em; margin: 1em auto; padding: 1em}</style> + EOT +} + +## help prints this program documentation +help() { awk '/^## / {print substr($0, 4)}' "$cmd"; } + +lipsum='Lorem ipsum dolor sit amet, consectetur adipiscing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris +nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in +reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum.' + +# An overly simplified http request parser for static web sites. +http_request() { + read -r cmd uri proto + case $uri in */) uri="${uri}index.html" ;; esac + while true; do + read -r line || break + [ ${#line} = 0 ] && break + done + printf 'HTTP/1.1 200 OK\n\n' && cat "${uri#/}" +} + +md2h() { want="$2" got=$(echo "$1" | md2html -); } + +md2html() { + tmp=$(mktemp -u) + trap "rm -f '$tmp'" EXIT + { + cat "${1:--}" | tee "$tmp" | awk '/^[ ]*\[[^]]+\]:/' + cat "$tmp" + } | + awk ' + function newblock(nblock) { + if (text) + print "<" block ">" text "</" block ">" + text = "" + out = 1 + block = nblock ? nblock : "p" + } + + function subinline(tgl, inl) { + while (match($0, tgl)) { + if (inline[ni] == inl) + ni -= sub(tgl, "</" inl ">") + else if (sub(tgl, "<" inl ">")) + inline[++ni] = inl + } + } + + function dolink(href, lnk) { + # Undo escaped html in uris + gsub(/&/, "\\&", href) + gsub(/</, "<", href) + gsub(/>/, ">", href) + # & can be tricky, and not standard: + gsub(/&/, "\\\\\\&", href) + gsub(/&/, "\\\\\\&", lnk) + return "<a href=\"" href "\">" lnk "</a>" + } + + BEGIN { + ni = 0 # inlines + nl = 0 # nested lists + out = 0 # 0 if no output so far + text = "" + block = "p" + } + + # Skip front matter. + out == 0 && $0 == "---" { + do + getline + while ($0 != "---") + next + } + + # Escape HTML. + esc != "false" { + gsub("&", "\\&") + gsub("<", "\\<") + gsub(">", "\\>") + } + + # Internal references. + match($0, /^[ ]*\[[^]]+\]:/) > 0 { + k = substr($0, RSTART+1, RLENGTH-3) + v = substr($0, RLENGTH+1) + sub(/^[ ]/, "", v) + sub(/[ ]$/, "", v) + ref[substr($0, RSTART+1, RLENGTH-3)] = v + next + } + + # Horizontal rules. + /^[ ]*([-*_] ?)+[ ]*$/ && text == "" { + print "<hr>" + next + } + + # Tables. Syntax: + # Right Align| Center Align |Left Align + /([ ]\|)|(\|[ ])/ { + if (block != "table") + newblock("table") + nc = split($0, cells, "|") + $0 = "<tr>\n" + for (i = 1; i <= nc; i++) { + align = "left" + if (sub(/^[ ]+/, "", cells[i])) { + if (sub(/[ ]+$/, "", cells[i])) + align = "center" + else + align = "right" + } + sub(/[ ]+$/, "", cells[i]) + $0 = $0 "<td align=\"" align "\">" cells[i] "</td>\n" + } + $0 = $0 "</tr>" + } + + # Ordered and unordered (possibly nested) lists. + /^[ ]*([*+-]|(([0-9]+[.-]?)+))[ ]/ { + newblock("li") + nnl = 1 + while (match($0, /^[ ]/)) { + sub(/^[ ]/, "") + nnl++ + } + while (nl > nnl) + print "</" list[nl--] ">" + while (nl < nnl) { + list[++nl] = "ol" + if (match($0, /^[*+-]/)) + list[nl] = "ul" + print "<" list[nl] ">" + } + sub(/^([*+-]|(([0-9]+[.-]?)+))[ ]/, "") + } + + # Multi line list items. + block == "li" { + sub(/^( *)|( *)/, "") + } + + # Code blocks. + /^( | )/ { + if (block != "code") + newblock("code") + sub(/^( | )/, "") + text = text $0 "\n" + next + } + + # Paragraphs. + /^$/ { + newblock() + while (nl > 0) + print "</" list[nl--] ">" + } + + # Headers. + /^#+ / { + newblock() + match($0, /#+/) + n = RLENGTH + if (n > 6) + n = 6 + text = substr($0, RLENGTH + 1) + sub(/^ */, "", text) + block = "h" n + next + } + + # Alternate headers (underlined). + /^=+$/ { + block = "h" 1 + next + } + + /^-+$/ { + block = "h" 2 + next + } + + { + # Images. + while (match($0, /!\[[^]]+\]\([^)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /(!\[)|\)|(\]\()/) + sub(/!\[[^]]+\]\([^)]+\)/, "<img src=\"" a[3] "\" alt=\"" a[2] "\">") + } + # Links. + while (match($0, /\[[^]]+\]\([^)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /[[)]|(\]\()/) + sub(/\[[^]]+\]\([^)]+\)/, dolink(a[3], a[2])) + } + # Internal references. + while (match($0, /\[[^]]+\]/)) { + k = substr($0, RSTART+1, RLENGTH-2) + sub(/\[[^]]+\]/, dolink(ref[k], k)) + } + # Auto links (uri matching is poor). + na = split($0, a, /(^\()|[ ]|([,.)]([ ]|$))/) + for (i = 1; i <= na; i++) + if (match(a[i], /^(((https?|ftp|file|news|irc):\/\/)|(mailto:)).+$/)) + sub(a[i], dolink(a[i], a[i])) + # Inline. + subinline("(\\*\\*)|(__)", "strong") + subinline("\\*", "em") + subinline("`", "code") + text = text (text ? " " : "") $0 + } + + END { + while (ni > 0) + text = text "</" inline[ni--] ">" + newblock() + while (nl > 0) + print "</" list[nl--] ">" + }' +} + +#serve() { while true; do busybox nc -kl -p 1500 -e "$cmd http_request"; done; } +serve() { WAG_FUN=http_request busybox nc -kl -p 1500 -e "$cmd"; } + +test() { + fail=0 pass=0 skip=0 tfilter="$*" + + test_run md2h 'abc __def__ ghi' '<p>abc <strong>def</strong> ghi</p>' + test_run md2h 'abc **def** ghi' '<p>abc <strong>def</strong> ghi</p>' + test_run md2h 'abc *def* ghi' '<p>abc <em>def</em> ghi</p>' + test_run md2h 'abc ***def*** ghi' '<p>abc <strong><em>def</strong></em> ghi</p>' + test_run md2h 'abc `def` ghi' '<p>abc <code>def</code> ghi</p>' + test_run md2h '# h1' '<h1>h1</h1>' + test_run md2h '## h2' '<h2>h2</h2>' + test_run md2h 'h1 +==' '<h1>h1</h1>' + test_run md2h 'h2 +--' '<h2>h2</h2>' + test_run md2h 'abc [github] def' '<p>abc <a href="">github</a> def</p>' + test_run md2h 'abc [github](https://github.com) def' '<p>abc <a href="https://github.com">github</a> def</p>' + test_run md2h 'abc [github] def + +[github]: https://github.com' '<p>abc <a href="https://github.com">github</a> def</p>' + test_run md2h '--- +Title: front matter test +--- + +Hello [world]. + +--- +Bye. + +[world]: http://example.com' '<p>Hello <a href="http://example.com">world</a>.</p> +<hr> +<p>Bye.</p>' + + echo "Total: $((pass + fail + skip)), Passed: $pass, Failed: $fail, Skip: $skip" + return "$fail" +} + +test_run() { + eval "test_$1=\$((test_$1 + 1)); ti=\"\$test_$1\"" + [ "$tfilter" ] && + case "$1#$ti" in + $tfilter) ;; + *) skip=$((skip + 1)); return 0 ;; + esac + "$@" + [ "$got" = "$want" ] && { + pass=$((pass + 1)) + return 0 + } + fail=$((fail + 1)) + printf "%s FAIL\n Got: %s\n Want: %s\n" "$1#$ti" "$got" "$want" >&2 + return 1 +} + +[ "$WAG_FUN" ] && { $WAG_FUN; exit; } + +# Execute command line +[ "$1" ] || help && "$@" @@ -0,0 +1,6 @@ +#!/bin/sh +ip_plex=192.168.1.90 mac_plex=b0:83:fe:61:a7:aa +eval "mac=\$mac_$1 ip=\$ip_$1" +wakeonlan "$mac" +while ! nc -zw 2 "$ip" 22; do printf .; sleep 2; done +ssh "root@$ip" @@ -1,4 +1,6 @@ #!/bin/sh -exec xterm -sl 500 -j -cr red "$@" & +#exec xterm -sl 500 -j -cr red "$@" & +exec xterm "$@" & #cmd="urxvtc ${@:--T $HOSTNAME}" +#cmd="urxvtc $@" #eval "$cmd" || { [ $? = 2 ] && urxvtd -q -o -f && eval "$cmd"; } @@ -138,12 +138,13 @@ EOT cat > /mnt/etc/locale.gen << \EOT en_US.UTF-8 UTF-8 +en_GB.UTF-8 UTF-8 fr_FR.UTF-8 UTF-8 EOT echo yoda > /mnt/etc/hostname echo 'KEYMAP=fr-latin1' > /mnt/etc/vconsole.conf - echo 'LANG=en_US.UTF-8' > /mnt/etc/locale.conf + echo 'LANG=en_GB.UTF-8' > /mnt/etc/locale.conf ln -sf /usr/share/zoneinfo/Europe/Paris /mnt/etc/localtime cat > /mnt/etc/systemd/network/20-wired.network << \EOT @@ -171,6 +172,7 @@ EOT cat > /mnt/etc/systemd/resolved.conf << \EOT [Resolve] DNSSEC=no +DNSOverTLS=no EOT packages="linux linux-firmware intel-ucode amd-ucode sof-firmware \ diff --git a/casque/sennheiser_px100ii/ParametricEQ.txt b/casque/sennheiser_px100ii/ParametricEQ.txt new file mode 100644 index 0000000..eed7ac5 --- /dev/null +++ b/casque/sennheiser_px100ii/ParametricEQ.txt @@ -0,0 +1,11 @@ +Preamp: -6.5 dB +Filter 1: ON PK Fc 23 Hz Gain 6.3 dB Q 0.95 +Filter 2: ON PK Fc 162 Hz Gain -3.6 dB Q 0.66 +Filter 3: ON PK Fc 6208 Hz Gain 4.1 dB Q 3.63 +Filter 4: ON PK Fc 7884 Hz Gain 4.8 dB Q 2.31 +Filter 5: ON PK Fc 20428 Hz Gain 2.2 dB Q 0.14 +Filter 6: ON PK Fc 685 Hz Gain 0.9 dB Q 1.75 +Filter 7: ON PK Fc 1940 Hz Gain -2.8 dB Q 1.56 +Filter 8: ON PK Fc 2635 Hz Gain 3.4 dB Q 3.46 +Filter 9: ON PK Fc 3997 Hz Gain 3.0 dB Q 2.57 +Filter 10: ON PK Fc 4436 Hz Gain -5.7 dB Q 6.16 diff --git a/swift/boot/loader/entries/arch.conf b/swift/boot/loader/entries/arch.conf new file mode 100755 index 0000000..5392c64 --- /dev/null +++ b/swift/boot/loader/entries/arch.conf @@ -0,0 +1,5 @@ +title Yoda Arch Linux +linux /vmlinuz-linux +initrd /intel-ucode.img +initrd /initramfs-linux.img +options root=/dev/disk/by-uuid/8c89d665-a17b-47da-aa19-4c855f134d54 net.ifnames=0 rw acpi_osi=Linux acpi_backlight=video diff --git a/swift/boot/loader/entries/arch2.conf b/swift/boot/loader/entries/arch2.conf new file mode 100755 index 0000000..69d70b6 --- /dev/null +++ b/swift/boot/loader/entries/arch2.conf @@ -0,0 +1,7 @@ +title Yoda2 Arch Linux +linux /vmlinuz-linux +initrd /intel-ucode.img +initrd /initramfs-linux.img +#options root=/dev/disk/by-uuid/8c89d665-a17b-47da-aa19-4c855f134d54 net.ifnames=0 rw acpi_osi=Linux acpi_backlight=video +options root=/dev/disk/by-uuid/fd0bd5d9-abfd-46e2-bbec-cc5042c19507 net.ifnames=0 rw acpi_osi=Linux acpi_backlight=video +#options root=/dev/disk/by-uuid/fd0bd5d9-abfd-46e2-bbec-cc5042c19507 net.ifnames=0 rw acpi_osi=Linux acpi_backlight=video snd_sof_intel_hda_common.hda_model=alc255-acer diff --git a/swift/boot/loader/loader.conf b/swift/boot/loader/loader.conf new file mode 100755 index 0000000..340ea34 --- /dev/null +++ b/swift/boot/loader/loader.conf @@ -0,0 +1,3 @@ +default arch2 +timeout 4 +console-mode max diff --git a/swift/etc/X11/xorg.conf.d/10-input.conf b/swift/etc/X11/xorg.conf.d/10-input.conf new file mode 100644 index 0000000..ae48884 --- /dev/null +++ b/swift/etc/X11/xorg.conf.d/10-input.conf @@ -0,0 +1,7 @@ +Section "InputClass" + Identifier "HP 3 button mouse" + Driver "libinput" + Option "ScrollMethod" "button" + Option "ScrollButton" "2" + Option "NaturalScrolling" "on" +EndSection diff --git a/swift/etc/X11/xorg.conf.d/10-keyboard.conf b/swift/etc/X11/xorg.conf.d/10-keyboard.conf new file mode 100644 index 0000000..131f8f3 --- /dev/null +++ b/swift/etc/X11/xorg.conf.d/10-keyboard.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "Keyboard Defaults" + MatchIsKeyboard "yes" + Option "XkbLayout" "fr" + Option "XkbOptions" "caps:super,altwin:menu_win" +EndSection diff --git a/swift/etc/X11/xorg.conf.d/20-intel.conf b/swift/etc/X11/xorg.conf.d/20-intel.conf new file mode 100644 index 0000000..28e460c --- /dev/null +++ b/swift/etc/X11/xorg.conf.d/20-intel.conf @@ -0,0 +1,4 @@ +Section "ServerLayout" + Identifier "Main" + Option "Xinerama" "0" +EndSection diff --git a/swift/etc/backupignore b/swift/etc/backupignore new file mode 100644 index 0000000..693cfa4 --- /dev/null +++ b/swift/etc/backupignore @@ -0,0 +1,32 @@ +# file patterns to be excluded from backup +/backup +.history/ +.cache/ +.cargo/ +.rustup/ +.npm/ +Cache/ +cache/ +GPUCache +CacheStorage +go/pkg/ +keybase/ +sdk/ +tmp/ +kernel-build/ +kernel-build.old/ +.xsession-errors +/var/lib/docker +/var/lib/flatpak +/var/lib/systemd/coredump/ +.config/chromium/ +.config/discord/ +.config/Slack/ +.config/Signal/ +.config/spotify/ +.mozilla/firefox/ +.thunderbird/xgfazjt1.default/ImapMail/ +.thunderbird/xgfazjt1.default/global-messages-db.sqlite +*.journal +*.log +*.o diff --git a/swift/etc/fstab b/swift/etc/fstab new file mode 100644 index 0000000..00d3167 --- /dev/null +++ b/swift/etc/fstab @@ -0,0 +1,14 @@ +# /dev/nvme1n1p5 +UUID=fd0bd5d9-abfd-46e2-bbec-cc5042c19507 / xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 1 + +# /dev/nvme1n1p1 +UUID=120F-B472 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2 + +# /dev/nvme1n1p3 +UUID=E23C1C4C3C1C1DDB /mnt/windows ntfs-3g gid=1000,uid=1000,dmask=022,fmask=133,noauto 0 0 + +# /dev/nvme0n1p1 +UUID=8c89d665-a17b-47da-aa19-4c855f134d54 /data xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 2 + +# Sony walkman NW-A55L external flash +/dev/sdb1 /mnt/sdb1 exfat noauto,gid=20,uid=501,dmask=002,fmask=113 0 0 diff --git a/swift/etc/modprobe.d/swift5.conf b/swift/etc/modprobe.d/swift5.conf new file mode 100644 index 0000000..bda0f22 --- /dev/null +++ b/swift/etc/modprobe.d/swift5.conf @@ -0,0 +1,10 @@ +#options snd_hda_intel model=dell-headset-multi +#options snd_hda_intel power_save=1 +#options snd-intel-dspcfg dsp_driver=1 +options snd_sof_intel_hda_common hda_model=alc255-acer + +options i915 enable_fbc=1 +options i915 enable_psr=1 disable_power_well=0 +options i915 modeset=1 + +#blacklist snd_soc_skl diff --git a/swift/etc/nsswitch.conf b/swift/etc/nsswitch.conf new file mode 100644 index 0000000..392c640 --- /dev/null +++ b/swift/etc/nsswitch.conf @@ -0,0 +1,19 @@ +# Name Service Switch configuration file. +# See nsswitch.conf(5) for details. + +passwd: files systemd +group: files [SUCCESS=merge] systemd +shadow: files + +publickey: files + +# hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns +hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +netgroup: files diff --git a/swift/etc/qemu/bridge.conf b/swift/etc/qemu/bridge.conf new file mode 100644 index 0000000..a573665 --- /dev/null +++ b/swift/etc/qemu/bridge.conf @@ -0,0 +1 @@ +allow virbr0 diff --git a/swift/etc/resolv.conf b/swift/etc/resolv.conf new file mode 100644 index 0000000..a336b7f --- /dev/null +++ b/swift/etc/resolv.conf @@ -0,0 +1 @@ +nameserver 9.9.9.9 diff --git a/swift/etc/smtpd/smtpd.conf b/swift/etc/smtpd/smtpd.conf new file mode 100644 index 0000000..ac4dabf --- /dev/null +++ b/swift/etc/smtpd/smtpd.conf @@ -0,0 +1,20 @@ +# $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $ + +# This is the smtpd server system-wide configuration file. +# See smtpd.conf(5) for more information. + +table aliases file:/etc/smtpd/aliases +table secrets file:/etc/smtpd/secrets + +# To accept external mail, replace with: listen on all +# +listen on localhost + +action "local" maildir alias <aliases> +action "relay" relay host smtps://mvertes@smtp.free.fr auth <secrets> + +# Uncomment the following to accept external mail for domain "example.org" +# +# match from any for domain "example.org" action "local" +match for local action "local" +match for any action "relay" diff --git a/swift/etc/sudoers.d/01_marc b/swift/etc/sudoers.d/01_marc new file mode 100644 index 0000000..9ae91f4 --- /dev/null +++ b/swift/etc/sudoers.d/01_marc @@ -0,0 +1 @@ +marc ALL=(ALL) NOPASSWD: ALL diff --git a/swift/etc/systemd/network/20-wired.network b/swift/etc/systemd/network/20-wired.network new file mode 100644 index 0000000..9ac4295 --- /dev/null +++ b/swift/etc/systemd/network/20-wired.network @@ -0,0 +1,8 @@ +[Match] +Name=e* + +[Network] +DHCP=ipv4 + +[DHCP] +RouteMetric=10 diff --git a/swift/etc/systemd/network/25-wireless.network b/swift/etc/systemd/network/25-wireless.network new file mode 100644 index 0000000..3bb9c39 --- /dev/null +++ b/swift/etc/systemd/network/25-wireless.network @@ -0,0 +1,8 @@ +[Match] +Name=wl* + +[Network] +DHCP=ipv4 + +[DHCP] +RouteMetric=20 diff --git a/swift/etc/systemd/network/bind.network b/swift/etc/systemd/network/bind.network new file mode 100644 index 0000000..c0313fe --- /dev/null +++ b/swift/etc/systemd/network/bind.network @@ -0,0 +1,5 @@ +[Match] +Name=wl* + +[Network] +Bridge=br0 diff --git a/swift/etc/systemd/network/bridge.netdev b/swift/etc/systemd/network/bridge.netdev new file mode 100644 index 0000000..fe9c2ad --- /dev/null +++ b/swift/etc/systemd/network/bridge.netdev @@ -0,0 +1,4 @@ +[NetDev] +Name=br0 +Kind=bridge +MACAddress=3c:f0:11:73:77:51 diff --git a/swift/etc/systemd/network/bridge.network b/swift/etc/systemd/network/bridge.network new file mode 100644 index 0000000..684ce83 --- /dev/null +++ b/swift/etc/systemd/network/bridge.network @@ -0,0 +1,5 @@ +[Match] +Name=br0 + +[Network] +Address=10.0.2.1/24 diff --git a/swift/etc/systemd/resolved.conf b/swift/etc/systemd/resolved.conf new file mode 100644 index 0000000..186c2ec --- /dev/null +++ b/swift/etc/systemd/resolved.conf @@ -0,0 +1,3 @@ +[Resolve] +DNSSEC=no +DNSOverTLS=no diff --git a/swift/etc/udev/rules.d/95-hdmi-plug.rules b/swift/etc/udev/rules.d/95-hdmi-plug.rules new file mode 100644 index 0000000..465eada --- /dev/null +++ b/swift/etc/udev/rules.d/95-hdmi-plug.rules @@ -0,0 +1,5 @@ +ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/marc/.Xauthority", RUN+="/home/marc/bin/hdmi" + +ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="25a4", ATTRS{idProduct}=="9311", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/marc/.Xauthority", RUN+="/home/marc/bin/hdmi" + +ACTION=="remove", SUBSYSTEMS=="usb", ATTRS{idVendor}=="25a4", ATTRS{idProduct}=="9311", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/marc/.Xauthority", RUN+="/home/marc/bin/hdmi" diff --git a/swift/etc/udev/rules.d/hdmi.rules b/swift/etc/udev/rules.d/hdmi.rules new file mode 100644 index 0000000..ec06147 --- /dev/null +++ b/swift/etc/udev/rules.d/hdmi.rules @@ -0,0 +1 @@ +KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/marc/.Xauthority", RUN+="/home/marc/bin/hdmi" |
