Commit 8f076e71 authored by Guilherme Semente's avatar Guilherme Semente 🌱

Initial commit

parents
*~
.\#*
\#*
*.elc
# just in case...
id_rsa
id_*_rsa
pubring.gpg
secring.gpg
.PHONE: all dotfiles xdg
all: dotfiles xdg
dotfiles:
summon *
xdg:
xdg-user-dirs-update
xdg-user-dirs-gtk-update
# Disguise as IE 9 on Windows 7
#user-agent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
# When following a redirect, automatically set the previous URL as referer
referer = ";auto"
# Wait 60 seconds before timing out
connect-timeout = 60
\ No newline at end of file
This diff is collapsed.
include /etc/firejail/firefox.profile
# downloads directory
whitelist ${HOME}/downloads/firefox
# vanilla firefox installation
whitelist /opt/firefox
whitelist ${HOME}/.local/opt/firefox
#env GTK_THEME=Adwaita:light
*~
.\#*
\#*
*.a
*.o
*.pyc
*.pyo
*.so
.stfolder
.stversions/
# -*- mode: conf -*-
[user]
useConfigOnly = true
[alias]
ci = commit
co = checkout
st = status -sb
[push]
default = current
[merge]
tool = meld
[github]
user = semente
[gitlab]
user = semente
[include]
path = ~/.config/git/local
[Desktop Entry]
Name=cbd
Exec=cbd
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
[Desktop Entry]
Name=syncmaild
Exec=syncmaild
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
file:///home/semente/org
file:///home/semente/src
file:///home/semente/etc
file:///home/semente/desktop
file:///home/semente/media
file:///tmp
[Settings]
gtk-application-prefer-dark-theme=1
gtk-key-theme-name=Emacs
gtk-key-theme-name = "Emacs"
gtk-icon-theme-name = "Adwaita"
gtk-theme-name = "Adwaita"
gtk-font-name = "Cantarell Regular 11"
#!/bin/sh
# cbd -- clear the clipboard every 4 minutes of X inactivity
#
# This tool is designed to prevent accidental pastes or leaks of data collected
# by your desktop environment clipboard.
#
# If you use a freedesktop.org compatible desktop environment you can setup cbd
# as a XDG autostart application:
#
# $ sudo apt install xclip xprintidle
# $ cat <<EOF >~/.config/autostart/cbd.desktop
# [Desktop Entry]
# Name=cbd
# Exec=cbd
# Terminal=false
# Type=Application
# X-GNOME-Autostart-enabled=true
# EOF
#
# Then restart your desktop environment or run it in the background:
#
# $ ( cbd & ) &
#
while true; do
# 240000 milliseconds / 4 minutes
[ "$(xprintidle)" -gt 240000 ] && for s in primary secondary clipboard; do
xclip -selection $s /dexv/null
done
sleep 60 && echo Plop!
done
#!/bin/sh
while true; do
# sync mail boxes
mbsync --quiet --all
# index mail boxes (i.e. update MU database)
mu index --quiet --maildir=~/mail
sleep 600 && echo Plop!
done
keyserver hkp://jirk5u4osbsr34t5.onion
keyserver hkps://hkps.pool.sks-keyservers.net
#keyserver hkp://keys.gnupg.net
# by using ~ for $HOME used to not work here for parcimonie and other tools
hkp-cacert /home/semente/.gnupg/sks-keyservers.netCA.pem
###+++--- GPGConf ---+++###
use-tor
###+++--- GPGConf ---+++### ter 28 nov 2017 19:59:19 -02
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.
# Disabled. I'm currently using GNOME Keyring for SSH
#enable-ssh-support
# do not grab the keyboard
#no-grab
# cache settings (4h, max 10h)
default-cache-ttl 14400
max-cache-ttl 36000
default-cache-ttl-ssh 14400
max-cache-ttl-ssh 36000
# preferred PIN entry program
#pinentry-program /usr/bin/pinentry-x11
#debug-level basic
#log-file socket:///home/semente/.gnupg/gpg-agent.log
# OpenPGP Best Practices
# https://help.riseup.net/en/gpg-best-practices
use-agent
default-key BD9325BC
default-recipient-self
#encrypt-to some-key-id
# ensure that all keys are refreshed through the selected keyserver
keyserver-options no-honor-keyserver-url
# enable debug
#keyserver-options debug
cert-digest-algo SHA512
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
-----BEGIN CERTIFICATE-----
MIIFizCCA3OgAwIBAgIJAK9zyLTPn4CPMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV
BAYTAk5PMQ0wCwYDVQQIDARPc2x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GDAWgBTkwyoJFGfY
TVISTpM8E+igjdq28zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4ICAQAR
OXnYwu3g1ZjHyley3fZI5aLPsaE17cOImVTehC8DcIphm2HOMR/hYTTL+V0G4P+u
gH+6xeRLKSHMHZTtSBIa6GDL03434y9CBuwGvAFCMU2GV8w92/Z7apkAhdLToZA/
X/iWP2jeaVJhxgEcH8uPrnSlqoPBcKC9PrgUzQYfSZJkLmB+3jEa3HKruy1abJP5
gAdQvwvcPpvYRnIzUc9fZODsVmlHVFBCl2dlu/iHh2h4GmL4Da2rRkUMlbVTdioB
UYIvMycdOkpH5wJftzw7cpjsudGas0PARDXCFfGyKhwBRFY7Xp7lbjtU5Rz0Gc04
lPrhDf0pFE98Aw4jJRpFeWMjpXUEaG1cq7D641RpgcMfPFvOHY47rvDTS7XJOaUT
BwRjmDt896s6vMDcaG/uXJbQjuzmmx3W2Idyh3s5SI0GTHb0IwMKYb4eBUIpQOnB
cE77VnCYqKvN1NVYAqhWjXbY7XasZvszCRcOG+W3FqNaHOK/n/0ueb0uijdLan+U
f4p1bjbAox8eAOQS/8a3bzkJzdyBNUKGx1BIK2IBL9bn/HravSDOiNRSnZ/R3l9G
ZauX0tu7IIDlRCILXSyeazu0aj/vdT3YFQXPcvt5Fkf5wiNTo53f72/jYEJd6qph
WrpoKqrwGwTpRUCMhYIUt65hsTxCiJJ5nKe39h46sg==
-----END CERTIFICATE-----
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=1
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=1
highlight_threads=1
tree_view=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_zero=0
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=1
delay=15
left_meters=LeftCPUs Memory Swap
left_meter_modes=1 1 1
right_meters=RightCPUs Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2
# -*- mode: shell-script -*-
# When not using a X display manager, it will just log me out from the tty when
# I quit X
alias startx='cd ~ && exec startx'
# safer management of files
alias rm='rm -I'
alias mv='mv -i'
alias cp='cp -i'
# editor
export EDITOR="/usr/bin/emacs -nw -q"
export FCEDIT="$EDITOR"
export SUDO_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
export ALTERNATE_EDITOR=""
alias editor="$EDITOR"
# less
export LESS='-F -i -J -M -R -W -x4 -X -z-4'
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# ls
# LS_ARGS="-CF --classify --ignore-backups"
LS_ARGS="-CF --classify"
if [ $TERM != "dump" ]; then
eval "`dircolors -b`"
LS_ARGS="$LS_ARGS --color=auto"
fi
function lt() { /bin/ls -ltrsh "[email protected]" | tail; }
alias la="/bin/ls $LS_ARGS --almost-all"
alias ll="/bin/ls $LS_ARGS -l"
alias ls="/bin/ls $LS_ARGS"
alias sl=ls
alias l=ls
# grep
GREP_ARGS="--color=always --exclude=\*~ --exclude-dir=\.svn --exclude-dir=\.git"
alias grep="grep $GREP_ARGS"
alias rgrep="rgrep $GREP_ARGS"
alias fgrep="fgrep $GREP_ARGS"
alias egrep="egrep $GREP_ARGS"
alias agrep="ack"
alias few='egrep -v "(^[ ]*$|^[ ]*#)"' # useful for config files
# APT
alias lsnodpkgs='aptitude search "?installed?not(?origin(Debian))" | less'
alias lsnewpkgs='aptitude search ~N | less'
alias lssecpkgs='debsecan --suite sid --format packages --only-fixed'
function lsdpkgsizes {
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' \
| grep -v deinstall | sort -n | awk '{print $1" "$2}'
}
# char code converter
alias iso2utf='iconv -f iso-8859-1 -t utf-8'
alias utf2iso='iconv -f utf-8 -t iso-8859-1'
# enable aliases to be sudo’ed
alias sudo='sudo '
# reload the shell (i.e. invoke as a login shell)
alias reload="exec $SHELL -l"
# run `dig' and display the most useful info
function adig() { dig +nocmd "$1" any +multiline +noall +answer; }
# print my public IP
alias what-is-my-ip="dig +short myip.opendns.com @resolver1.opendns.com"
# s() shortcuts
function _run_or_xdgopen {
{ $1 || xdg-open "$1"; } &> /dev/null &disown
}
function _ps-and-grep() {
ps auxf | head -1
ps axuf | grep -v grep | grep -E "[email protected]" -i --color=auto
}
function _find-file-by-name() {
find . -iname "*[email protected]*"
}
function _ia-save() {
curl -s -I "https://web.archive.org/save/$1" |
grep Content-Location |
awk '{printf( "https://web.archive.org/%s\n",$2)}'
}
function s() {
echo
echo " t tree"
echo " e emacsclient"
echo " q quick start an Emacs with --no-init-file"
echo " d open Emacs dired on current/working directory"
echo " f TERM find file by name"
echo " o run or xdg-open"
echo " p REGEX ps and grep"
echo " a URL save URL to the Internet Archive"
echo
echo "System maintenance:"
echo " u update package lists and (full-)upgrade system"
echo
echo "Other: "
echo " r reload the shell (invoke as a login shell)"
echo " s, h this help"
echo
}
alias t='tree -Ftr --dirsfirst --noreport'
alias e='emacsclient --tty'
alias q='emacs --no-init-file --no-window-system'
alias d='emacsclient --tty "$(pwd)"'
alias f='_find-file-by-name'
alias o='_run_or_xdgopen'
alias p='_ps-and-grep'
alias a='_ia-save'
alias u='sudo aptitude update && sudo aptitude -y safe-upgrade && sudo aptitude full-upgrade && sudo apt autoremove'
alias r="exec $SHELL -l"
alias h=s
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
#
# For Zsh sessions add the following lines in your ~/.zprofile, so you
# can share this initialization file between Bash and Zsh:
#
# emulate sh -c 'source ~/.profile'
#
#
umask 022
# the search path for commands
PATH="$HOME/bin:$HOME/.local/bin:$PATH:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin"
# rust
export PATH="$HOME/.cargo/bin:$PATH"
# golang
export PATH="$HOME/.go/bin:$PATH"
export GOPATH="$HOME/.go"
# cp, ln, ...
#export VERSION_CONTROL=numbered
_gpg_tty () {
# link gpg-agent to the connected terminal (manpage gpg-agent(1))
GPG_TTY=$(tty)
export GPG_TTY
}
# if running BASH
if [ -n "$BASH_VERSION" ]; then
_gpg_tty
[ -f ~/.bashrc ] && . ~/.bashrc
fi
# if running zsh
if [ -n "$ZSH_VERSION" ]; then
_gpg_tty
# Zsh reads ~/.zshrc in all interactive shells, whether they
# are login shells or not, we don't need load ~/.zshrc here
:
fi
# ~/.bash_logout is executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# history length
HISTSIZE=1000
HISTFILESIZE=2000
# history time format
HISTTIMEFORMAT="[%F %T] "
# make some commands not show up in history
# export HISTIGNORE="ls:cd:cd -:pwd:exit:date";
# check the window size after each command and update the values of
# LINES and COLUMNS
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# autocorrect typos in path names when using `cd`
shopt -s cdspell;
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\[email protected]\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable programmable completion features
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Number of trailing directory components to retain when expanding the
# \w and \W prompt string escapes. Characters removed are replaced
# with an ellipsis.
PROMPT_DIRTRIM=4
# tells the shell to understand Emacs editing commands (default)
set -o emacs
# the search path for the cd command
CDPATH=.:$HOME
# it won't run on non-interactive shells...
if [ "$TERM" != "dumb" ]; then
# set a 8 min timeout policy when not under X
if [ -z "$DISPLAY" ]; then
TMOUT=480
readonly TMOUT
fi
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
fi
# load aliases
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"
# -*- mode: shell-script -*-
# ~/.inputrc: individual readline initialization file
# See readline(3readline) and `info rluserman' for more information.
#set bell-style none
set bell-style visible
# make Tab autocomplete regardless of filename case
set completion-ignore-case on
# list all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to
# directories
set mark-symlinked-directories on
# Use the text that has already been typed as the prefix for searching
# through commands (i.e. more intelligent Up/Down behavior)
"\e[B": history-search-forward
"\e[A": history-search-backward
# Do not autocomplete hidden files unless the pattern explicitly
# begins with a dot
set match-hidden-files off
# Show all autocomplete results at once
set page-completions off
# If there are more than 200 possible completions for a word, ask to
# show them all
set completion-query-items 200
# Show extra file information when completing, like `ls -F` does
set visible-stats on
# Be more intelligent when autocompleting by also looking at the text
# after the cursor. For example, when the current line is "cd
# ~/src/mozil", and the cursor is on the "z", pressing Tab will not
# autocomplete it to "cd ~/src/mozillail", but to "cd ~/src/mozilla"
set skip-completed-text on
[ -f "$HOME/.profile" ] && emulate sh -c "source $HOME/.profile"
# the search path for the cd command
# XXX: breaks emacs directory tracking
#CDPATH=.:$HOME
# skip on dumb terminals
[ "$TERM" = "dumb" -a -z "$INSIDE_EMACS" ] && return
# load aliases (shared with bash)
[ -f "$HOME/.aliases" ] && emulate sh -c "source $HOME/.aliases"
autoload -U colors
colors
# super globs
setopt extendedglob
# changes the definition of "word", e.g. with ALT + {left,right,backspace}
autoload -U select-word-style
select-word-style bash
#WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>'
# report CPU usage for commands running longer than N seconds
REPORTTIME=8
# history
HISTFILE=~/.zhistory
HISTSIZE=SAVEHIST=8192
setopt histignoredups
setopt histignorespace
# save each command''s beginning timestamp
setopt extendedhistory
# this option both imports new commands from the history file, and
# also causes your typed commands to be appended to the history file
setopt sharehistory
# allow comments even in interactive shells
setopt interactivecomments # like that...
# perform history expansion and reload the line into the editing
# buffer instead of execute the line directly
setopt histverify
# matches current input to history items
bindkey '^[[A' history-beginning-search-backward
bindkey '^[[B' history-beginning-search-forward
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# misc
setopt autocd
setopt autopushd
setopt notify
unsetopt beep
unsetopt nomatch
# if [[ "${INSIDE_EMACS}" == *"comint"* ]]; then
if [ -n "$INSIDE_EMACS" ]; then
unsetopt zle
PROMPT=" » "
RPROMPT="%B%{$fg[blue]%}%~%{$reset_color%}%B%{$fg[blue]%}\$(_GetGitStatusPS)%{$reset_color%}"
export PAGER="cat"
else
# set a 8 min timeout policy when not under X
if [ -z "$DISPLAY" ]; then
TMOUT=480
readonly TMOUT
fi
# tells the shell to understand Emacs editing commands
bindkey -e
# prompt
setopt PROMPT_SUBST
function _GetGitStatusPS() {
[ -d .git ] || git rev-parse --is-inside-work-tree > /dev/null 2>&1
if [ $? -eq 0 ]; then
local gitBranch=$(git symbolic-ref --short HEAD)
local gitBehindAhead=$(git rev-list --count --left-right "@{upstream}"...HEAD 2>/dev/null | tr "\t" "/" | grep -v "^0/0")
local gitModMark=$(! git diff-index --quiet HEAD -- && echo "(*)")
[ -n "$gitBehindAhead" ] && gitModMark="(${gitBehindAhead}${gitModMark})"
echo -n ":${gitBranch}${gitModMark}"
fi
}
# colors are based on Solarized-dark theme
PROMPT="
%B%{$fg[magenta]%} » %{$reset_color%}%B%{$fg[green]%}%{$reset_color%}"
RPROMPT="%B%{$fg[blue]%}%~%{$reset_color%}%B%{$fg[blue]%}\$(_GetGitStatusPS)%{$reset_color%}"
# more extensive tab completion
autoload -U compinit
compinit
# tab completion from both ends
setopt completeinword
# make the alias a distinct command for completion purposes
# setopt completealiases
# case-insensitive tab completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# better tab completion for `killall' command
zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd'
# colorize file listing in completion
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# menu style selection and an arrow-key driven completion
zstyle ':completion:*' menu select
fi
# -*- mode: conf -*-
# (!) Do not setup hosts here! This file is published in a public Git repository.
Host *
ServerAliveInterval 60
ServerAliveCountMax 10
# upgrade $TERM
set -g default-terminal "tmux-256color"
# uncomment if you want start tmux as a non-login shell
#set -g default-command /bin/zsh
# unbind control-b, and replace it with control-z
unbind-key C-b