Last active
February 22, 2019 06:29
-
-
Save ioparaskev/88875c83bcab519f017b9cdd0b1960e7 to your computer and use it in GitHub Desktop.
useful scripts for personal configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
editor = vim | |
autocrlf = input | |
[alias] | |
#Add patch | |
ap = add -p | |
#Add only tracked files | |
au = add -u | |
# Show commits and their signatures | |
logs = log --show-signature -1 | |
#List commits in short form, with colors and branch/tag annotations | |
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate | |
#List commits showing changed files | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
#List oneline commits showing dates | |
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
#List oneline commits showing relative dates | |
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative | |
#List oneline branch commits | |
lol = log --graph --decorate --pretty=oneline --abbrev-commit | |
#List oneline commits for all branches | |
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all | |
#see all the commits related to a file, with the diff of the changes | |
fl = log -u | |
#Find a file path in codebase | |
f = "!git ls-files | grep -i" | |
#Search/grep your entire codebase for a string | |
gr = grep -Ii | |
#Grep from root folder | |
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f" | |
#list affected commit files | |
aff = diff-tree --no-commit-id --name-only -r | |
cp = cherry-pick | |
st = status -s | |
cl = clone | |
#difs | |
diff = diff --word-diff | |
dc = diff --cached | |
dl = "!git ll -1" | |
dlc = diff --cached HEAD^ | |
co = checkout | |
cob = "!git co -b" | |
ci = commit | |
cis = commit -S | |
civ = "!git ci -v" | |
civs = "!git cis -v" | |
cim = "!git ci -m" | |
cims = "!git cis -m" | |
civa = "!git civ --amend" | |
civas = "!git civs --amend" | |
cia = "!git ci --amend" | |
cias = "!git cis --amend" | |
br = branch | |
#merge strategies | |
mrp = merge -s recursive -X patience | |
mnf = merge --no-ff | |
#stash related | |
s = stash | |
sl = stash list | |
sa = stash apply | |
ss = stash save | |
ssp = "!git ss -p" | |
sd = stash drop | |
sp = stash show -p | |
#reset related | |
r = reset | |
rp = reset --patch | |
r1 = reset HEAD^ | |
r2 = reset HEAD^^ | |
rh = reset --hard | |
rh1 = reset HEAD^ --hard | |
rh2 = reset HEAD^^ --hard | |
#rebase related | |
rb = rebase | |
rbi = "!git rb -i" | |
rbm = "!git rb -i --preserve-merges" | |
#remote related | |
rv = remote -v | |
#pull related | |
pl = pull | |
plrb = "!git pull --rebase" | |
#push related | |
ps = push | |
pst = "!git push --tags" | |
psf = "!git push -f" | |
psft = "!git push -f --tags" | |
#tag related | |
t = tag | |
ta = tag -a | |
ts = tag -s | |
tm = tag -a -m | |
tms = tag -s -m | |
#list aliases | |
la = "!git config -l | grep alias | cut -c 6-" | |
[color] | |
ui = true | |
[push] | |
default = nothing | |
[commit] | |
gpgsign = true | |
[identity "gmail"] | |
name = John Paraskevopoulos | |
email = io.paraskev@gmail.com | |
signingkey = 85895DFE | |
[identity "noc"] | |
name = John Paraskevopoulos | |
email = jpr@noc.grnet.gr | |
signingkey = B4A6B21C | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set Zsh as your default Tmux shell | |
set-option -g default-shell /bin/zsh | |
# Tmux should be pretty, we need 256 color for that | |
set -g default-terminal "screen-256color" | |
# Tmux uses a 'control key', let's set it to 'Ctrl-a' | |
# Reason: 'Ctrl-a' is easier to reach than 'Ctrl-b' | |
set -g prefix C-a | |
unbind C-b | |
# command delay? We don't want that, make it short | |
set -sg escape-time 1 | |
# Set the numbering of windows to go from 1 instead | |
# of 0 - silly programmers :| | |
set-option -g base-index 1 | |
setw -g pane-base-index 1 | |
# Allow us to reload our Tmux configuration while | |
# using Tmux | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
# Getting interesting now, we use the vertical and horizontal | |
# symbols to split the screen | |
bind | split-window -h | |
bind - split-window -v | |
set-option -ga terminal-override ',rxvt-uni*:XT:Ms=\E]52;%p1%s;%p2%s\007' | |
set -g mouse on | |
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" | |
bind -n WheelDownPane select-pane -t= \; send-keys -M | |
#urxvt tab like window switching (-n: no prior escape seq) | |
bind -n S-Down new-window | |
bind -n S-Left prev | |
bind -n S-Right next | |
bind -n C-left swap-window -t -1 | |
bind -n C-right swap-window -t +1 | |
set-option -g destroy-unattached off | |
#set-option -g default-command "reattach-to-user-namespace -l $SHELL -l" | |
set -g mode-keys vi | |
##CLIPBOARD selection integration | |
##Requires prefix key before the command key | |
#Copy tmux paste buffer to CLIPBOARD | |
bind C-c run "tmux show-buffer | xsel -i -b" | |
#Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer | |
bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer" | |
set -g mode-keys vi | |
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e urlview /tmp/tmux-buffer" | |
# statusbar text windows and colors | |
set -g status-left "[#S]" | |
set -g status-right "#(date +'%R %A:%d %b:%m') @ #h" | |
set -g status-bg black | |
set -g status-fg white | |
set -g status-attr default | |
setw -g window-status-format " #[fg=yellow]#I#[fg=white]:#[fg=default]#W " | |
setw -g window-status-bg default | |
setw -g window-status-fg white | |
setw -g window-status-attr default | |
setw -g window-status-current-format " #[fg=yellow]#I#[fg=white]:#[fg=default]#W " | |
setw -g window-status-current-bg green | |
setw -g window-status-current-fg white | |
setw -g window-status-current-attr bold | |
setw -g window-status-bell-bg red | |
setw -g window-status-bell-fg white | |
setw -g window-status-bell-attr bold | |
set -g message-bg black | |
set -g message-fg yellow | |
set -g message-attr default | |
set -g pane-border-fg black | |
set -g pane-active-border-fg yellow | |
set -g display-panes-colour yellow | |
set -g display-panes-active-colour green | |
set -g clock-mode-colour green | |
set -g clock-mode-style 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ============================================================================ | |
" Vundle initialization | |
" Avoid modify this section, unless you are very sure of what you are doing | |
" no vi-compatible | |
set nocompatible | |
" Setting up Vundle - the vim plugin bundler | |
let iCanHazVundle=1 | |
let vundle_readme=expand('~/.vim/bundle/vundle/README.md') | |
if !filereadable(vundle_readme) | |
echo "Installing Vundle..." | |
echo "" | |
silent !mkdir -p ~/.vim/bundle | |
silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle | |
let iCanHazVundle=0 | |
endif | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
Bundle 'gmarik/vundle' | |
" enable mouse | |
if has('mouse') | |
set mouse=a | |
endif | |
" ============================================================================ | |
" Active plugins | |
" You can disable or add new ones here: | |
" Better file browser | |
Bundle 'scrooloose/nerdtree' | |
" Code commenter | |
Bundle 'scrooloose/nerdcommenter' | |
" Class/module browser | |
Bundle 'majutsushi/tagbar' | |
" Code and files fuzzy finder | |
Bundle 'kien/ctrlp.vim' | |
" Extension to ctrlp, for fuzzy command finder | |
Bundle 'fisadev/vim-ctrlp-cmdpalette' | |
" Zen coding | |
Bundle 'mattn/emmet-vim' | |
" Git integration | |
Bundle 'motemen/git-vim' | |
" Tab list panel | |
Bundle 'kien/tabman.vim' | |
" Airline | |
Bundle 'bling/vim-airline' | |
" Terminal Vim with 256 colors colorscheme | |
Bundle 'fisadev/fisa-vim-colorscheme' | |
" Consoles as buffers | |
Bundle 'rosenfeld/conque-term' | |
" Pending tasks list | |
Bundle 'fisadev/FixedTaskList.vim' | |
" Surround | |
Bundle 'tpope/vim-surround' | |
" Autoclose | |
Bundle 'Townk/vim-autoclose' | |
" Indent text object | |
Bundle 'michaeljsmith/vim-indent-object' | |
" Python mode (indentation, doc, refactor, lints, code checking, motion and | |
" operators, highlighting, run and ipdb breakpoints) | |
Bundle 'klen/python-mode' | |
" Better autocompletion | |
Bundle 'Shougo/neocomplcache.vim' | |
" Snippets manager (SnipMate), dependencies, and snippets repo | |
Bundle 'MarcWeber/vim-addon-mw-utils' | |
Bundle 'tomtom/tlib_vim' | |
Bundle 'honza/vim-snippets' | |
Bundle 'garbas/vim-snipmate' | |
" Git/mercurial/others diff icons on the side of the file lines | |
Bundle 'mhinz/vim-signify' | |
" Automatically sort python imports | |
Bundle 'fisadev/vim-isort' | |
" Drag visual blocks arround | |
Bundle 'fisadev/dragvisuals.vim' | |
" Window chooser | |
Bundle 't9md/vim-choosewin' | |
" Python and other languages code checker | |
Bundle 'scrooloose/syntastic' | |
" Paint css colors with the real color | |
Bundle 'lilydjwg/colorizer' | |
" Relative numbering of lines (0 is the current line) | |
" (disabled by default because is very intrusive and can't be easily toggled | |
" on/off. When the plugin is present, will always activate the relative | |
" numbering every time you go to normal mode. Author refuses to add a setting | |
" to avoid that) | |
" Bundle 'myusuf3/numbers.vim' | |
" Plugins from vim-scripts repos: | |
" Search results counter | |
Bundle 'IndexedSearch' | |
" XML/HTML tags navigation | |
Bundle 'matchit.zip' | |
" Gvim colorscheme | |
Bundle 'Wombat' | |
" Yank history navigation | |
Bundle 'YankRing.vim' | |
Plugin 'reedes/vim-thematic' | |
" ============================================================================ | |
" Install plugins the first time vim runs | |
if iCanHazVundle == 0 | |
echo "Installing Bundles, please ignore key map error messages" | |
echo "" | |
:BundleInstall | |
endif | |
" ============================================================================ | |
" Vim settings and mappings | |
" You can edit them as you wish | |
" allow plugins by file type (required for plugins!) | |
filetype plugin on | |
filetype indent on | |
" tabs and spaces handling | |
set expandtab | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
" tab length exceptions on some file types | |
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
" always show status bar | |
set ls=2 | |
" incremental search | |
set incsearch | |
" highlighted search results | |
set hlsearch | |
" syntax highlight on | |
syntax on | |
" show line numbers | |
set nu | |
" tab navigation mappings | |
map tn :tabn<CR> | |
map tp :tabp<CR> | |
map tm :tabm | |
map tt :tabnew | |
map ts :tab split<CR> | |
map <C-S-Right> :tabn<CR> | |
imap <C-S-Right> <ESC>:tabn<CR> | |
map <C-S-Left> :tabp<CR> | |
imap <C-S-Left> <ESC>:tabp<CR> | |
" navigate windows with meta+arrows | |
map <M-Right> <c-w>l | |
map <M-Left> <c-w>h | |
map <M-Up> <c-w>k | |
map <M-Down> <c-w>j | |
imap <M-Right> <ESC><c-w>l | |
imap <M-Left> <ESC><c-w>h | |
imap <M-Up> <ESC><c-w>k | |
imap <M-Down> <ESC><c-w>j | |
" old autocomplete keyboard shortcut | |
imap <C-J> <C-X><C-O> | |
" Comment this line to enable autocompletion preview window | |
" (displays documentation related to the selected completion option) | |
" Disabled by default because preview makes the window flicker | |
set completeopt-=preview | |
" save as sudo | |
ca w!! w !sudo tee "%" | |
" simple recursive grep | |
" both recursive grep commands with internal or external (fast) grep | |
command! -nargs=1 RecurGrep lvimgrep /<args>/gj ./**/*.* | lopen | set nowrap | |
command! -nargs=1 RecurGrepFast silent exec 'lgrep! <q-args> ./**/*.*' | lopen | |
" mappings to call them | |
nmap ,R :RecurGrep | |
nmap ,r :RecurGrepFast | |
" mappings to call them with the default word as search text | |
nmap ,wR :RecurGrep <cword><CR> | |
nmap ,wr :RecurGrepFast <cword><CR> | |
" use 256 colors when possible | |
if &term =~? 'mlterm\|xterm\|xterm-256\|screen-256' | |
let &t_Co = 256 | |
colorscheme fisa | |
else | |
colorscheme delek | |
endif | |
" colors for gvim | |
if has('gui_running') | |
colorscheme wombat | |
endif | |
" when scrolling, keep cursor 3 lines away from screen border | |
set scrolloff=3 | |
" autocompletion of files and commands behaves like shell | |
" (complete only the common part, list the options that match) | |
set wildmode=list:longest | |
" better backup, swap and undos storage | |
set directory=~/.vim/dirs/tmp " directory to place swap files in | |
set backup " make backup files | |
set backupdir=~/.vim/dirs/backups " where to put backup files | |
set undofile " persistent undos - undo after you re-open the file | |
set undodir=~/.vim/dirs/undos | |
set viminfo+=n~/.vim/dirs/viminfo | |
" store yankring history file there too | |
let g:yankring_history_dir = '~/.vim/dirs/' | |
" create needed directories if they don't exist | |
if !isdirectory(&backupdir) | |
call mkdir(&backupdir, "p") | |
endif | |
if !isdirectory(&directory) | |
call mkdir(&directory, "p") | |
endif | |
if !isdirectory(&undodir) | |
call mkdir(&undodir, "p") | |
endif | |
" ============================================================================ | |
" Plugins settings and mappings | |
" Edit them as you wish. | |
" Tagbar ----------------------------- | |
" toggle tagbar display | |
map <F4> :TagbarToggle<CR> | |
" autofocus on tagbar open | |
let g:tagbar_autofocus = 1 | |
" NERDTree ----------------------------- | |
" toggle nerdtree display | |
map <F3> :NERDTreeToggle<CR> | |
" open nerdtree with the current file selected | |
nmap ,t :NERDTreeFind<CR> | |
" don;t show these file types | |
let NERDTreeIgnore = ['\.pyc$', '\.pyo$'] | |
" Tasklist ------------------------------ | |
" show pending tasks list | |
map <F2> :TaskList<CR> | |
" Vim-debug ------------------------------ | |
" add some useful mappings | |
map <F5> :Dbg over<CR> | |
map <F6> :Dbg into<CR> | |
map <F7> :Dbg out<CR> | |
map <F8> :Dbg here<CR> | |
map <F9> :Dbg break<CR> | |
map <F10> :Dbg watch<CR> | |
map <F11> :Dbg down<CR> | |
map <F12> :Dbg up<CR> | |
" CtrlP ------------------------------ | |
" file finder mapping | |
let g:ctrlp_map = ',e' | |
" tags (symbols) in current file finder mapping | |
nmap ,g :CtrlPBufTag<CR> | |
" tags (symbols) in all files finder mapping | |
nmap ,G :CtrlPBufTagAll<CR> | |
" general code finder in all files mapping | |
nmap ,f :CtrlPLine<CR> | |
" recent files finder mapping | |
nmap ,m :CtrlPMRUFiles<CR> | |
" commands finder mapping | |
nmap ,c :CtrlPCmdPalette<CR> | |
" to be able to call CtrlP with default search text | |
function! CtrlPWithSearchText(search_text, ctrlp_command_end) | |
execute ':CtrlP' . a:ctrlp_command_end | |
call feedkeys(a:search_text) | |
endfunction | |
" same as previous mappings, but calling with current word as default text | |
nmap ,wg :call CtrlPWithSearchText(expand('<cword>'), 'BufTag')<CR> | |
nmap ,wG :call CtrlPWithSearchText(expand('<cword>'), 'BufTagAll')<CR> | |
nmap ,wf :call CtrlPWithSearchText(expand('<cword>'), 'Line')<CR> | |
nmap ,we :call CtrlPWithSearchText(expand('<cword>'), '')<CR> | |
nmap ,pe :call CtrlPWithSearchText(expand('<cfile>'), '')<CR> | |
nmap ,wm :call CtrlPWithSearchText(expand('<cword>'), 'MRUFiles')<CR> | |
nmap ,wc :call CtrlPWithSearchText(expand('<cword>'), 'CmdPalette')<CR> | |
" don't change working directory | |
let g:ctrlp_working_path_mode = 0 | |
" ignore these files and folders on file finder | |
let g:ctrlp_custom_ignore = { | |
\ 'dir': '\v[\/](\.git|\.hg|\.svn)$', | |
\ 'file': '\.pyc$\|\.pyo$', | |
\ } | |
" Syntastic ------------------------------ | |
" show list of errors and warnings on the current file | |
nmap <leader>e :Errors<CR> | |
" check also when just opened the file | |
let g:syntastic_check_on_open = 1 | |
" don't put icons on the sign column (it hides the vcs status icons of signify) | |
let g:syntastic_enable_signs = 0 | |
" custom icons (enable them if you use a patched font, and enable the previous | |
" setting) | |
"let g:syntastic_error_symbol = '✗' | |
"let g:syntastic_warning_symbol = '⚠' | |
"let g:syntastic_style_error_symbol = '✗' | |
"let g:syntastic_style_warning_symbol = '⚠' | |
" Python-mode ------------------------------ | |
" don't use linter, we use syntastic for that | |
let g:pymode_lint_on_write = 0 | |
let g:pymode_lint_signs = 0 | |
" don't fold python code on open | |
let g:pymode_folding = 0 | |
" don't load rope by default. Change to 1 to use rope | |
let g:pymode_rope = 0 | |
" open definitions on same window, and custom mappings for definitions and | |
" occurrences | |
let g:pymode_rope_goto_definition_bind = ',d' | |
let g:pymode_rope_goto_definition_cmd = 'e' | |
nmap ,D :tab split<CR>:PymodePython rope.goto()<CR> | |
nmap ,o :RopeFindOccurrences<CR> | |
" NeoComplCache ------------------------------ | |
" most of them not documented because I'm not sure how they work | |
" (docs aren't good, had to do a lot of trial and error to make | |
" it play nice) | |
let g:neocomplcache_enable_at_startup = 1 | |
let g:neocomplcache_enable_ignore_case = 1 | |
let g:neocomplcache_enable_smart_case = 1 | |
let g:neocomplcache_enable_auto_select = 1 | |
let g:neocomplcache_enable_fuzzy_completion = 1 | |
let g:neocomplcache_enable_camel_case_completion = 1 | |
let g:neocomplcache_enable_underbar_completion = 1 | |
let g:neocomplcache_fuzzy_completion_start_length = 1 | |
let g:neocomplcache_auto_completion_start_length = 1 | |
let g:neocomplcache_manual_completion_start_length = 1 | |
let g:neocomplcache_min_keyword_length = 1 | |
let g:neocomplcache_min_syntax_length = 1 | |
" complete with workds from any opened file | |
let g:neocomplcache_same_filetype_lists = {} | |
let g:neocomplcache_same_filetype_lists._ = '_' | |
" TabMan ------------------------------ | |
" mappings to toggle display, and to focus on it | |
let g:tabman_toggle = 'tl' | |
let g:tabman_focus = 'tf' | |
" Autoclose ------------------------------ | |
" Fix to let ESC work as espected with Autoclose plugin | |
let g:AutoClosePumvisible = {"ENTER": "\<C-Y>", "ESC": "\<ESC>"} | |
" DragVisuals ------------------------------ | |
" mappings to move blocks in 4 directions | |
vmap <expr> <S-M-LEFT> DVB_Drag('left') | |
vmap <expr> <S-M-RIGHT> DVB_Drag('right') | |
vmap <expr> <S-M-DOWN> DVB_Drag('down') | |
vmap <expr> <S-M-UP> DVB_Drag('up') | |
" mapping to duplicate block | |
vmap <expr> D DVB_Duplicate() | |
" Signify ------------------------------ | |
" this first setting decides in which order try to guess your current vcs | |
" UPDATE it to reflect your preferences, it will speed up opening files | |
let g:signify_vcs_list = [ 'git', 'hg' ] | |
" mappings to jump to changed blocks | |
nmap <leader>sn <plug>(signify-next-hunk) | |
nmap <leader>sp <plug>(signify-prev-hunk) | |
" nicer colors | |
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119 | |
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167 | |
highlight DiffChange cterm=bold ctermbg=none ctermfg=227 | |
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119 | |
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167 | |
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227 | |
" Window Chooser ------------------------------ | |
" mapping | |
nmap - <Plug>(choosewin) | |
" show big letters | |
let g:choosewin_overlay_enable = 1 | |
colo bubblegum-256-dark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xcursor.theme: Vanilla-DMZ-AA | |
!urxvt color scheme: | |
URxvt*background: #2B2B2B | |
URxvt*foreground: #DEDEDE | |
URxvt*colorUL: #86a2b0 | |
! black | |
URxvt*color0 : #2E3436 | |
URxvt*color8 : #555753 | |
! red | |
URxvt*color1 : #CC0000 | |
URxvt*color9 : #EF2929 | |
! green | |
URxvt*color2 : #4E9A06 | |
URxvt*color10 : #8AE234 | |
! yellow | |
URxvt*color3 : #C4A000 | |
URxvt*color11 : #FCE94F | |
! blue | |
URxvt*color4 : #3465A4 | |
URxvt*color12 : #729FCF | |
! magenta | |
URxvt*color5 : #75507B | |
URxvt*color13 : #AD7FA8 | |
! cyan | |
URxvt*color6 : #06989A | |
URxvt*color14 : #34E2E2 | |
! white | |
URxvt*color7 : #D3D7CF | |
URxvt*color15 : #EEEEEC | |
!urxvt fonts: | |
URxvt*font: xft:SourceCodePro-Regular:pixelsize=10S | |
URxvt*boldFont: xft:SourceCodePro-Bold:pixelsize=10 | |
!urxvt extensions: | |
URxvt.perl-lib: /usr/lib64/urxvt/perl/ | |
URxvt.perl-ext: default,url-select,tabbedex,clipboard | |
!enabling clickable links: | |
URxvt.keysym.C-i: perl:url-select:select_next | |
URxvt.url-select.launcher: /usr/bin/firefox | |
URxvt.url-select.underline: true | |
!urxvt scrolling options and cursor style: | |
URxvt*saveLines: 12000 | |
URxvt*scrollstyle:plain | |
URxvt*scrollBar: false | |
URxvt*cursorBlink: true | |
URxvt*cursorUnderline: true | |
! urxvt tabs settings: | |
URxvt.tabbed.tabbar-fg: 2 | |
URxvt.tabbed.tabbar-bg: 0 | |
URxvt.tabbed.tab-fg: 2 | |
URxvt.tabbed.tab-bg: 8 | |
URxvt.tabbed.autohide: yes | |
URxvt.tabbed.new-button: no | |
URxvt.tabbed.title: no | |
URxvt.keysym.Shift-Control-V: perl:clipboard:paste | |
URxvt.iso14755: False | |
URxvt.clipboard.autocopy: true | |
URxvt.clipboard.copycmd: xclip -i -selection clipboard | |
URxvt.clipboard.pastecmd: xclip -o -selection clipboard | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=${GZIP_BINDIR-'/bin'}:$PATH | |
exec 7z e -so -bd "$@" 2>/dev/null | cat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
version="7zless (7z) 1.0.0 " | |
usage="Usage: $0 [OPTION]... [FILE]... | |
Like 'less', but operate on the uncompressed contents of any FILEs that were compressed using 7z. | |
" | |
case $1 in | |
--help) exec echo "$usage";; | |
--version) exec echo "$version";; | |
esac | |
if test "${LESSMETACHARS+set}" != set; then | |
# Work around a bug in less 394 and earlier; | |
# it mishandles the metacharacters '$%=~'. | |
space=' ' | |
tab=' ' | |
newline=' | |
' | |
LESSMETACHARS="$space$tab$newline'"';*?"()<>[|&^`#\$%=~' | |
export LESSMETACHARS | |
fi | |
LESSOPEN="|7z e -so -bd -y -- %s"; export LESSOPEN | |
exec less "$@" 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec docker inspect --format '{{ .State.Pid }}' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adblock plus | |
calomel | |
downthemall! | |
firebug | |
foxyproxy | |
ghostery | |
https everywhere | |
noscript | |
tab groups | |
tab mix plus | |
vimfx | |
wikiwand | |
certificate patrol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=i3lock | |
Before=sleep.target | |
[Service] | |
User=knuth | |
Type=forking | |
Environment=DISPLAY=:0 | |
ExecStart=/usr/bin/i3lock -c000000 | |
[Install] | |
WantedBy=sleep.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnf install ImageMagick deluge linphone pidgin ettercap etherape exaile tomahawk filezilla gimp gnome-tweak-tool gparted i3lock vlc java-openjdk icedtea-web shutter youtube-dl unzip thunderbird wine gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 ffmpeg awesome zsh xmonad git dconf-editor chkrootkit rkhunter wireshark calibre p7zip p7zip-plugins unrar bleachbit the_silver_searcher rxvt-unicode tmux tor nmap vim keepassx ghc cabal-install adobe-source-code-pro-fonts keepass network-manager-applet pycurl curl-devel ffmpeg-libs ffmpeg-devel libcue libcue-devel pulseaudio-libs pulseaudio-libs-devel libsamplerate-devel libsamplerate socat backintime-gnome docker eclipse xautolock stockfish pychess qalculate-gtk python-virtualenvwrapper xsel haskell-platform clojure xfce-nm-applet network-manager-applet pidgin-otr chromium redhat-rpm-config proxychains nodejs scid scid_vs_pc kernel-devel ipython terminator inkscape redshift light acpi vicious util-linux-user meld apg help2man electrum mariadb-server dkms subsurface htop cmus midori libsecret-devel bind xbacklight openssl-devel ansible python-devel python3-devel wireshark-gtk nmap nmap-frontend audacity transmission-gtk | |
sudo dnf groupinstall 'C Development Tools and Libraries' | |
https://rpmfusion.org/Configuration/ | |
cd /etc/yum.repos.d | |
wget http://sea.fedorapeople.org/sea-devel.repo | |
yum install notepadqq | |
http://wps-community.org/download.html | |
https://github.com/sorin-ionescu/prezto | |
https://firejail.wordpress.com/ | |
https://github.com/madx/git-identity | |
https://github.com/baskerville/bubblegum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=intellijlicense | |
After=display-manager.service | |
[Service] | |
ExecStart=/home/knuth/IntellijLicencseServer/intellij.sh | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec xautolock -detectsleep | |
-time 5 -locker "i3lock -d -c000000" \ | |
-notify 30 \ | |
-notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- If LuaRocks is installed, make sure that packages installed through it are | |
-- found (e.g. lgi). If LuaRocks is not installed, do nothing. | |
pcall(require, "luarocks.loader") | |
-- Standard awesome library | |
local gears = require("gears") | |
local awful = require("awful") | |
awful.rules = require("awful.rules") | |
require("awful.autofocus") | |
-- Widget and layout library | |
local wibox = require("wibox") | |
-- Theme handling library | |
local beautiful = require("beautiful") | |
-- Notification library | |
local naughty = require("naughty") | |
local menubar = require("menubar") | |
local hotkeys_popup = require("awful.hotkeys_popup").widget | |
-- Enable hotkeys help widget for VIM and other apps | |
-- when client with a matching name is opened: | |
require("awful.hotkeys_popup.keys") | |
local vicious = require("vicious") | |
-- BATTERY Widget https://github.com/deficient/battery-widget | |
local battery_widget = require("battery-widget") | |
-- define your battery widget (you may need to use another adapter name as in | |
-- your /sys/class/power_supply) | |
local battery = battery_widget({adapter = "BAT0"}) | |
-- CALENDAR Widget https://github.com/deficient/calendar | |
local calendar = require("calendar") | |
-- VOLUME widget https://github.com/deficient/volume-control | |
local volume_control = require("volume-control") | |
-- define your volume control, using default settings: | |
volumecfg = volume_control({}) | |
----Cycle through display for multi monitor---- | |
-- Get active outputs | |
local function outputs() | |
local outputs = {} | |
local xrandr = io.popen("xrandr -q") | |
if xrandr then | |
for line in xrandr:lines() do | |
output = line:match("^([%w-]+) connected ") | |
if output then | |
outputs[#outputs + 1] = output | |
end | |
end | |
xrandr:close() | |
end | |
return outputs | |
end | |
--}}} | |
local function arrange(out) | |
-- We need to enumerate all the way to combinate output. We assume | |
-- we want only an horizontal layout. | |
local choices = {} | |
local previous = { {} } | |
for i = 1, #out do | |
-- Find all permutation of length `i`: we take the permutation | |
-- of length `i-1` and for each of them, we create new | |
-- permutations by adding each output at the end of it if it is | |
-- not already present. | |
local new = {} | |
for _, p in pairs(previous) do | |
for _, o in pairs(out) do | |
if not awful.util.table.hasitem(p, o) then | |
new[#new + 1] = awful.util.table.join(p, {o}) | |
end | |
end | |
end | |
choices = awful.util.table.join(choices, new) | |
previous = new | |
end | |
return choices | |
end | |
--}}} | |
-- Build available choices | |
local function menu() | |
local menu = {} | |
local out = outputs() | |
local choices = arrange(out) | |
for _, choice in pairs(choices) do | |
local cmd = "xrandr" | |
-- Enabled outputs | |
for i, o in pairs(choice) do | |
cmd = cmd .. " --output " .. o .. " --auto" | |
if i > 1 then | |
cmd = cmd .. " --right-of " .. choice[i-1] | |
end | |
end | |
-- Disabled outputs | |
for _, o in pairs(out) do | |
if not awful.util.table.hasitem(choice, o) then | |
cmd = cmd .. " --output " .. o .. " --off" | |
end | |
end | |
local label = "" | |
if #choice == 1 then | |
label = 'Only <span weight="bold">' .. choice[1] .. '</span>' | |
else | |
for i, o in pairs(choice) do | |
if i > 1 then label = label .. " + " end | |
label = label .. '<span weight="bold">' .. o .. '</span>' | |
end | |
end | |
menu[#menu + 1] = { label, | |
cmd, | |
"/usr/share/icons/Tango/32x32/devices/display.png"} | |
end | |
return menu | |
end | |
--}}} | |
-- Display xrandr notifications from choices | |
local state = { iterator = nil, | |
timer = nil, | |
cid = nil } | |
local function xrandr() | |
-- Stop any previous timer | |
if state.timer then | |
state.timer:stop() | |
state.timer = nil | |
end | |
-- Build the list of choices | |
if not state.iterator then | |
state.iterator = awful.util.table.iterate(menu(), | |
function() return true end) | |
end | |
-- Select one and display the appropriate notification | |
local next = state.iterator() | |
local label, action, icon | |
if not next then | |
label, icon = "Keep the current configuration", "/usr/share/icons/Tango/32x32/devices/display.png" | |
state.iterator = nil | |
else | |
label, action, icon = unpack(next) | |
end | |
state.cid = naughty.notify({ text = label, | |
icon = icon, | |
timeout = 4, | |
screen = mouse.screen, -- Important, not all screens may be visible | |
font = "Free Sans 18", | |
replaces_id = state.cid }).id | |
-- Setup the timer | |
state.timer = timer { timeout = 4 } | |
state.timer:connect_signal("timeout", | |
function() | |
state.timer:stop() | |
state.timer = nil | |
state.iterator = nil | |
if action then | |
awful.util.spawn(action, false) | |
end | |
end) | |
state.timer:start() | |
end | |
--}}} | |
-- Initialize widget | |
cpuwidget = wibox.widget.textbox() | |
-- Register widget | |
vicious.register(cpuwidget, vicious.widgets.cpu, " CPU $1% | ") | |
-- Initialize widget | |
memwidget = wibox.widget.textbox() | |
-- Register widget | |
vicious.register(memwidget, vicious.widgets.mem, "RAM $1% | ", 13) | |
-- {{{ Error handling | |
-- Check if awesome encountered an error during startup and fell back to | |
-- another config (This code will only ever execute for the fallback config) | |
if awesome.startup_errors then | |
naughty.notify({ preset = naughty.config.presets.critical, | |
title = "Oops, there were errors during startup!", | |
text = awesome.startup_errors }) | |
end | |
-- Handle runtime errors after startup | |
do | |
local in_error = false | |
awesome.connect_signal("debug::error", function (err) | |
-- Make sure we don't go into an endless error loop | |
if in_error then return end | |
in_error = true | |
naughty.notify({ preset = naughty.config.presets.critical, | |
title = "Oops, an error happened!", | |
text = tostring(err) }) | |
in_error = false | |
end) | |
end | |
-- }}} | |
-- {{{ Variable definitions | |
-- Themes define colours, icons, font and wallpapers. | |
beautiful.init("/usr/share/awesome/themes/custom/theme.lua") | |
-- This is used later as the default terminal and editor to run. | |
terminal = "urxvt" | |
editor = os.getenv("EDITOR") or "vi" | |
editor_cmd = terminal .. " -e " .. editor | |
-- Default modkey. | |
-- Usually, Mod4 is the key with a logo between Control and Alt. | |
-- If you do not like this or do not have such a key, | |
-- I suggest you to remap Mod4 to another key using xmodmap or other tools. | |
-- However, you can use another modifier like Mod1, but it may interact with others. | |
modkey = "Mod4" | |
-- Table of layouts to cover with awful.layout.inc, order matters. | |
awful.layout.layouts = { | |
awful.layout.suit.floating, | |
awful.layout.suit.tile, | |
awful.layout.suit.tile.left, | |
awful.layout.suit.tile.bottom, | |
awful.layout.suit.tile.top, | |
awful.layout.suit.fair, | |
awful.layout.suit.fair.horizontal, | |
awful.layout.suit.spiral, | |
awful.layout.suit.spiral.dwindle, | |
awful.layout.suit.max, | |
awful.layout.suit.max.fullscreen, | |
awful.layout.suit.magnifier, | |
awful.layout.suit.corner.nw, | |
-- awful.layout.suit.corner.ne, | |
-- awful.layout.suit.corner.sw, | |
-- awful.layout.suit.corner.se, | |
} | |
-- }}} | |
-- {{{ Helper functions | |
local function client_menu_toggle_fn() | |
local instance = nil | |
return function () | |
if instance and instance.wibox.visible then | |
instance:hide() | |
instance = nil | |
else | |
instance = awful.menu.clients({ theme = { width = 250 } }) | |
end | |
end | |
end | |
-- }}} | |
-- }}} | |
-- {{{ Menu | |
-- Create a launcher widget and a main menu | |
myawesomemenu = { | |
{ "hotkeys", function() return false, hotkeys_popup.show_help end}, | |
{ "manual", terminal .. " -e man awesome" }, | |
{ "edit config", editor_cmd .. " " .. awesome.conffile }, | |
{ "restart", awesome.restart }, | |
{ "quit", function() awesome.quit() end} | |
} | |
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, | |
{ "open terminal", terminal } | |
} | |
}) | |
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, | |
menu = mymainmenu }) | |
-- Menubar configuration | |
menubar.utils.terminal = terminal -- Set the terminal for applications that require it | |
-- }}} | |
-- Keyboard map indicator and switcher | |
mykeyboardlayout = awful.widget.keyboardlayout() | |
-- {{{ Wibar | |
-- Create a textclock widget | |
mytextclock = wibox.widget.textclock() | |
-- Create a wibox for each screen and add it | |
local taglist_buttons = gears.table.join( | |
awful.button({ }, 1, function(t) t:view_only() end), | |
awful.button({ modkey }, 1, function(t) | |
if client.focus then | |
client.focus:move_to_tag(t) | |
end | |
end), | |
awful.button({ }, 3, awful.tag.viewtoggle), | |
awful.button({ modkey }, 3, function(t) | |
if client.focus then | |
client.focus:toggle_tag(t) | |
end | |
end), | |
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), | |
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) | |
) | |
local tasklist_buttons = gears.table.join( | |
awful.button({ }, 1, function (c) | |
if c == client.focus then | |
c.minimized = true | |
else | |
-- Without this, the following | |
-- :isvisible() makes no sense | |
c.minimized = false | |
if not c:isvisible() and c.first_tag then | |
c.first_tag:view_only() | |
end | |
-- This will also un-minimize | |
-- the client, if needed | |
client.focus = c | |
c:raise() | |
end | |
end), | |
awful.button({ }, 3, client_menu_toggle_fn()), | |
awful.button({ }, 4, function () | |
awful.client.focus.byidx(1) | |
end), | |
awful.button({ }, 5, function () | |
awful.client.focus.byidx(-1) | |
end)) | |
local function set_wallpaper(s) | |
-- Wallpaper | |
if beautiful.wallpaper then | |
local wallpaper = beautiful.wallpaper | |
-- If wallpaper is a function, call it with the screen | |
if type(wallpaper) == "function" then | |
wallpaper = wallpaper(s) | |
end | |
gears.wallpaper.maximized(wallpaper, s, true) | |
end | |
end | |
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) | |
screen.connect_signal("property::geometry", set_wallpaper) | |
awful.screen.connect_for_each_screen(function(s) | |
-- Wallpaper | |
set_wallpaper(s) | |
-- Each screen has its own tag table. | |
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) | |
-- Create a promptbox for each screen | |
s.mypromptbox = awful.widget.prompt() | |
-- Create an imagebox widget which will contain an icon indicating which layout we're using. | |
-- We need one layoutbox per screen. | |
s.mylayoutbox = awful.widget.layoutbox(s) | |
s.mylayoutbox:buttons(gears.table.join( | |
awful.button({ }, 1, function () awful.layout.inc( 1) end), | |
awful.button({ }, 3, function () awful.layout.inc(-1) end), | |
awful.button({ }, 4, function () awful.layout.inc( 1) end), | |
awful.button({ }, 5, function () awful.layout.inc(-1) end))) | |
-- Create a taglist widget | |
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons) | |
-- Create a tasklist widget | |
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons) | |
-- Create the wibox | |
s.mywibox = awful.wibar({ position = "top", screen = s }) | |
-- Add widgets to the wibox | |
s.mywibox:setup { | |
layout = wibox.layout.align.horizontal, | |
{ -- Left widgets | |
layout = wibox.layout.fixed.horizontal, | |
mylauncher, | |
s.mytaglist, | |
s.mypromptbox, | |
}, | |
s.mytasklist, -- Middle widget | |
{ -- Right widgets | |
layout = wibox.layout.fixed.horizontal, | |
cpuwidget, | |
memwidget, | |
battery, | |
volumecfg, | |
mytextclock, | |
mykeyboardlayout, | |
wibox.widget.systray(), | |
s.mylayoutbox, | |
}, | |
} | |
end) | |
-- }}} | |
-- {{{ Mouse bindings | |
root.buttons(gears.table.join( | |
awful.button({ }, 3, function () mymainmenu:toggle() end), | |
awful.button({ }, 4, awful.tag.viewnext), | |
awful.button({ }, 5, awful.tag.viewprev) | |
)) | |
-- }}} | |
-- {{{ Key bindings | |
globalkeys = gears.table.join( | |
awful.key({ modkey, }, "s", hotkeys_popup.show_help, | |
{description="show help", group="awesome"}), | |
awful.key({ modkey, }, "Left", awful.tag.viewprev, | |
{description = "view previous", group = "tag"}), | |
awful.key({ modkey, }, "Right", awful.tag.viewnext, | |
{description = "view next", group = "tag"}), | |
awful.key({ modkey, }, "Escape", awful.tag.history.restore, | |
{description = "go back", group = "tag"}), | |
awful.key({ modkey, }, "j", | |
function () | |
awful.client.focus.byidx( 1) | |
end, | |
{description = "focus next by index", group = "client"} | |
), | |
awful.key({ modkey, }, "k", | |
function () | |
awful.client.focus.byidx(-1) | |
end, | |
{description = "focus previous by index", group = "client"} | |
), | |
awful.key({ modkey, }, "w", function () mymainmenu:show() end, | |
{description = "show main menu", group = "awesome"}), | |
-- Layout manipulation | |
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, | |
{description = "swap with next client by index", group = "client"}), | |
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, | |
{description = "swap with previous client by index", group = "client"}), | |
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, | |
{description = "focus the next screen", group = "screen"}), | |
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, | |
{description = "focus the previous screen", group = "screen"}), | |
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, | |
{description = "jump to urgent client", group = "client"}), | |
awful.key({ modkey, }, "Tab", | |
function () | |
awful.client.focus.history.previous() | |
if client.focus then | |
client.focus:raise() | |
end | |
end, | |
{description = "go back", group = "client"}), | |
-- Standard program | |
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, | |
{description = "open a terminal", group = "launcher"}), | |
awful.key({ modkey, "Control" }, "r", awesome.restart, | |
{description = "reload awesome", group = "awesome"}), | |
awful.key({ modkey, "Shift" }, "q", awesome.quit, | |
{description = "quit awesome", group = "awesome"}), | |
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, | |
{description = "increase master width factor", group = "layout"}), | |
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, | |
{description = "decrease master width factor", group = "layout"}), | |
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, | |
{description = "increase the number of master clients", group = "layout"}), | |
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, | |
{description = "decrease the number of master clients", group = "layout"}), | |
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, | |
{description = "increase the number of columns", group = "layout"}), | |
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, | |
{description = "decrease the number of columns", group = "layout"}), | |
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, | |
{description = "select next", group = "layout"}), | |
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, | |
{description = "select previous", group = "layout"}), | |
awful.key({ modkey, "Control" }, "n", | |
function () | |
local c = awful.client.restore() | |
-- Focus restored client | |
if c then | |
client.focus = c | |
c:raise() | |
end | |
end, | |
{description = "restore minimized", group = "client"}), | |
-- Prompt | |
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, | |
{description = "run prompt", group = "launcher"}), | |
awful.key({ modkey }, "x", | |
function () | |
awful.prompt.run { | |
prompt = "Run Lua code: ", | |
textbox = awful.screen.focused().mypromptbox.widget, | |
exe_callback = awful.util.eval, | |
history_path = awful.util.get_cache_dir() .. "/history_eval" | |
} | |
end, | |
{description = "lua execute prompt", group = "awesome"}), | |
-- Menubar | |
awful.key({ modkey }, "p", function() menubar.show() end, | |
{description = "show the menubar", group = "launcher"}), | |
-- Brightness | |
awful.key({ }, "XF86MonBrightnessDown", function () | |
awful.util.spawn("light -U 2") end), | |
awful.key({ }, "XF86MonBrightnessUp", function () | |
awful.util.spawn("light -A 2") end), | |
-- Volume | |
awful.key({ }, "XF86AudioRaiseVolume", function () | |
volumecfg:up() end), | |
awful.key({ }, "XF86AudioLowerVolume", function () | |
volumecfg:down() end), | |
awful.key({ }, "XF86AudioMute", function () | |
volumecfg:toggle() end), | |
-- Lock screen | |
awful.key({ modkey, "Control" }, "l", function () | |
awful.util.spawn("i3lock -d -n -c000000") end), | |
awful.key({ modkey, "Shift" }, "`", xrandr) | |
) | |
clientkeys = gears.table.join( | |
awful.key({ modkey, }, "f", | |
function (c) | |
c.fullscreen = not c.fullscreen | |
c:raise() | |
end, | |
{description = "toggle fullscreen", group = "client"}), | |
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, | |
{description = "close", group = "client"}), | |
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , | |
{description = "toggle floating", group = "client"}), | |
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, | |
{description = "move to master", group = "client"}), | |
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, | |
{description = "move to screen", group = "client"}), | |
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, | |
{description = "toggle keep on top", group = "client"}), | |
awful.key({ modkey, }, "n", | |
function (c) | |
-- The client currently has the input focus, so it cannot be | |
-- minimized, since minimized clients can't have the focus. | |
c.minimized = true | |
end , | |
{description = "minimize", group = "client"}), | |
awful.key({ modkey, }, "m", | |
function (c) | |
c.maximized = not c.maximized | |
c:raise() | |
end , | |
{description = "(un)maximize", group = "client"}), | |
awful.key({ modkey, "Control" }, "m", | |
function (c) | |
c.maximized_vertical = not c.maximized_vertical | |
c:raise() | |
end , | |
{description = "(un)maximize vertically", group = "client"}), | |
awful.key({ modkey, "Shift" }, "m", | |
function (c) | |
c.maximized_horizontal = not c.maximized_horizontal | |
c:raise() | |
end , | |
{description = "(un)maximize horizontally", group = "client"}) | |
) | |
-- Bind all key numbers to tags. | |
-- Be careful: we use keycodes to make it work on any keyboard layout. | |
-- This should map on the top row of your keyboard, usually 1 to 9. | |
for i = 1, 9 do | |
globalkeys = gears.table.join(globalkeys, | |
-- View tag only. | |
awful.key({ modkey }, "#" .. i + 9, | |
function () | |
local screen = awful.screen.focused() | |
local tag = screen.tags[i] | |
if tag then | |
tag:view_only() | |
end | |
end, | |
{description = "view tag #"..i, group = "tag"}), | |
-- Toggle tag display. | |
awful.key({ modkey, "Control" }, "#" .. i + 9, | |
function () | |
local screen = awful.screen.focused() | |
local tag = screen.tags[i] | |
if tag then | |
awful.tag.viewtoggle(tag) | |
end | |
end, | |
{description = "toggle tag #" .. i, group = "tag"}), | |
-- Move client to tag. | |
awful.key({ modkey, "Shift" }, "#" .. i + 9, | |
function () | |
if client.focus then | |
local tag = client.focus.screen.tags[i] | |
if tag then | |
client.focus:move_to_tag(tag) | |
end | |
end | |
end, | |
{description = "move focused client to tag #"..i, group = "tag"}), | |
-- Toggle tag on focused client. | |
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, | |
function () | |
if client.focus then | |
local tag = client.focus.screen.tags[i] | |
if tag then | |
client.focus:toggle_tag(tag) | |
end | |
end | |
end, | |
{description = "toggle focused client on tag #" .. i, group = "tag"}) | |
) | |
end | |
clientbuttons = gears.table.join( | |
awful.button({ }, 1, function (c) client.focus = c; c:raise() end), | |
awful.button({ modkey }, 1, awful.mouse.client.move), | |
awful.button({ modkey }, 3, awful.mouse.client.resize)) | |
-- Set keys | |
root.keys(globalkeys) | |
-- }}} | |
-- {{{ Rules | |
-- Rules to apply to new clients (through the "manage" signal). | |
awful.rules.rules = { | |
-- All clients will match this rule. | |
{ rule = { }, | |
properties = { border_width = beautiful.border_width, | |
border_color = beautiful.border_normal, | |
focus = awful.client.focus.filter, | |
raise = true, | |
keys = clientkeys, | |
buttons = clientbuttons, | |
screen = awful.screen.preferred, | |
placement = awful.placement.no_overlap+awful.placement.no_offscreen | |
} | |
}, | |
-- Floating clients. | |
{ rule_any = { | |
instance = { | |
"DTA", -- Firefox addon DownThemAll. | |
"copyq", -- Includes session name in class. | |
"pinentry", | |
}, | |
class = { | |
"Arandr", | |
"Blueman-manager", | |
"Gpick", | |
"Kruler", | |
"MessageWin", -- kalarm. | |
"Sxiv", | |
"Wpa_gui", | |
"veromix", | |
"xtightvncviewer"}, | |
name = { | |
"Event Tester", -- xev. | |
}, | |
role = { | |
"AlarmWindow", -- Thunderbird's calendar. | |
"ConfigManager", -- Thunderbird's about:config. | |
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. | |
} | |
}, properties = { floating = true }}, | |
-- Add titlebars to normal clients and dialogs | |
{ rule_any = {type = { "normal", "dialog" } | |
}, properties = { titlebars_enabled = true } | |
}, | |
-- Set Firefox to always map on the tag named "2" on screen 1. | |
-- { rule = { class = "Firefox" }, | |
-- properties = { screen = 1, tag = "2" } }, | |
} | |
-- }}} | |
-- {{{ Signals | |
-- Signal function to execute when a new client appears. | |
client.connect_signal("manage", function (c) | |
-- Set the windows at the slave, | |
-- i.e. put it at the end of others instead of setting it master. | |
-- if not awesome.startup then awful.client.setslave(c) end | |
if awesome.startup and | |
not c.size_hints.user_position | |
and not c.size_hints.program_position then | |
-- Prevent clients from being unreachable after screen count changes. | |
awful.placement.no_offscreen(c) | |
end | |
end) | |
-- Add a titlebar if titlebars_enabled is set to true in the rules. | |
client.connect_signal("request::titlebars", function(c) | |
-- buttons for the titlebar | |
local buttons = gears.table.join( | |
awful.button({ }, 1, function() | |
client.focus = c | |
c:raise() | |
awful.mouse.client.move(c) | |
end), | |
awful.button({ }, 3, function() | |
client.focus = c | |
c:raise() | |
awful.mouse.client.resize(c) | |
end) | |
) | |
awful.titlebar(c) : setup { | |
{ -- Left | |
awful.titlebar.widget.iconwidget(c), | |
buttons = buttons, | |
layout = wibox.layout.fixed.horizontal | |
}, | |
{ -- Middle | |
{ -- Title | |
align = "center", | |
widget = awful.titlebar.widget.titlewidget(c) | |
}, | |
buttons = buttons, | |
layout = wibox.layout.flex.horizontal | |
}, | |
{ -- Right | |
awful.titlebar.widget.floatingbutton (c), | |
awful.titlebar.widget.maximizedbutton(c), | |
awful.titlebar.widget.stickybutton (c), | |
awful.titlebar.widget.ontopbutton (c), | |
awful.titlebar.widget.closebutton (c), | |
layout = wibox.layout.fixed.horizontal() | |
}, | |
layout = wibox.layout.align.horizontal | |
} | |
end) | |
-- Enable sloppy focus, so that focus follows mouse. | |
client.connect_signal("mouse::enter", function(c) | |
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier | |
and awful.client.focus.filter(c) then | |
client.focus = c | |
end | |
end) | |
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) | |
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) | |
-- }}} | |
-- attach calendar it as popup to your text clock widget: | |
calendar({}):attach(mytextclock) | |
function run_once(prg) | |
awful.util.spawn_with_shell("pgrep -u $USER -x " .. prg .. " || (" .. prg .. ")") | |
end | |
awful.util.spawn_with_shell('~/.config/awesome/locker') | |
--i use big notification image for drawing attention for screenlock notification | |
awful.util.spawn_with_shell("setxkbmap -rules evdev -model pc105 -layout \"us,gr\" -option \"grp:lalt_lshift_toggle,eurosign:e,lv3:ralt_switch\"") | |
awful.util.spawn_with_shell("xset b off") | |
run_once("nm-applet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Redshift display colour temperature adjustment | |
Documentation=http://jonls.dk/redshift/ | |
After=display-manager.service | |
[Service] | |
ExecStart=/usr/bin/redshift -l 37.9833333:23.7333333 -m randr | |
Restart=always | |
RestartSec=2 | |
[Install] | |
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enigmail | |
torbirdy | |
profileswitcher | |
color folders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Lock the screen automatically after a timeout. | |
After=display-manager.service | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/xautolock -time 10 -locker "i3lock -c000000" -notify 60 -notifier "notify-send -t 5000 -u critical 'Screen will lock in 1 minute' -i /usr/share/icons/Fedora/96x96/places/start-here.png" -detectsleep | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sets Prezto options. | |
# | |
# Authors: | |
# Sorin Ionescu <sorin.ionescu@gmail.com> | |
# | |
# | |
# General | |
# | |
# Set case-sensitivity for completion, history lookup, etc. | |
# zstyle ':prezto:*:*' case-sensitive 'yes' | |
# Color output (auto set to 'no' on dumb terminals). | |
zstyle ':prezto:*:*' color 'yes' | |
# Set the Zsh modules to load (man zshmodules). | |
# zstyle ':prezto:load' zmodule 'attr' 'stat' | |
# Set the Zsh functions to load (man zshcontrib). | |
# zstyle ':prezto:load' zfunction 'zargs' 'zmv' | |
# Set the Prezto modules to load (browse modules). | |
# The order matters. | |
zstyle ':prezto:load' pmodule \ | |
'archive'\ | |
'autosuggestions' \ | |
'environment' \ | |
'tmux' \ | |
'terminal' \ | |
'editor' \ | |
'directory' \ | |
'spectrum' \ | |
'utility' \ | |
'completion' \ | |
'git' \ | |
'syntax-highlighting' \ | |
'history' \ | |
'history-substring-search' \ | |
'prompt' | |
# | |
# Editor | |
# | |
# Set the key mapping style to 'emacs' or 'vi'. | |
zstyle ':prezto:module:editor' key-bindings 'vi' | |
# Auto convert .... to ../.. | |
zstyle ':prezto:module:editor' dot-expansion 'yes' | |
# | |
# Git | |
# | |
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'. | |
#zstyle ':prezto:module:git:status:ignore' submodules 'all' | |
# | |
# GNU Utility | |
# | |
# Set the command prefix on non-GNU systems. | |
# zstyle ':prezto:module:gnu-utility' prefix 'g' | |
# | |
# History Substring Search | |
# | |
# Set the query found color. | |
# zstyle ':prezto:module:history-substring-search:color' found '' | |
# Set the query not found color. | |
# zstyle ':prezto:module:history-substring-search:color' not-found '' | |
# Set the search globbing flags. | |
# zstyle ':prezto:module:history-substring-search' globbing-flags '' | |
# | |
# Pacman | |
# | |
# Set the Pacman frontend. | |
# zstyle ':prezto:module:pacman' frontend 'yaourt' | |
# | |
# Prompt | |
# | |
# Set the prompt theme to load. | |
# Setting it to 'random' loads a random theme. | |
# Auto set to 'off' on dumb terminals. | |
zstyle ':prezto:module:prompt' theme 'skwp' | |
# | |
# Ruby | |
# | |
# Auto switch the Ruby version on directory change. | |
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' | |
# | |
# Screen | |
# | |
# Auto start a session when Zsh is launched in a local terminal. | |
# zstyle ':prezto:module:screen:auto-start' local 'yes' | |
# Auto start a session when Zsh is launched in a SSH connection. | |
# zstyle ':prezto:module:screen:auto-start' remote 'yes' | |
# | |
# SSH | |
# | |
# Set the SSH identities to load into the agent. | |
# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' | |
# | |
# Syntax Highlighting | |
# | |
# Set syntax highlighters. | |
# By default, only the main highlighter is enabled. | |
zstyle ':prezto:module:syntax-highlighting' highlighters \ | |
'main' \ | |
'brackets' \ | |
'pattern' \ | |
'cursor' \ | |
'root' | |
# Set syntax highlighting styles. | |
# zstyle ':prezto:module:syntax-highlighting' styles \ | |
# 'builtin' 'bg=blue' \ | |
# 'command' 'bg=blue' \ | |
# 'function' 'bg=blue' | |
# | |
# Terminal | |
# | |
# Auto set the tab and window titles. | |
zstyle ':prezto:module:terminal' auto-title 'yes' | |
# Set the window title format. | |
zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' | |
# Set the tab title format. | |
zstyle ':prezto:module:terminal:tab-title' format '%m: %s' | |
# | |
# Tmux | |
# | |
# Auto start a session when Zsh is launched in a local terminal. | |
zstyle ':prezto:module:tmux:auto-start' local 'yes' | |
# Auto start a session when Zsh is launched in a SSH connection. | |
zstyle ':prezto:module:tmux:auto-start' remote 'yes' | |
# Integrate with iTerm2. | |
# zstyle ':prezto:module:tmux:iterm' integrate 'yes' | |
# | |
setopt SHARE_HISTORY | |
setopt HIST_IGNORE_DUPS | |
setopt HIST_SAVE_NO_DUPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Executes commands at the start of an interactive session. | |
# | |
# Authors: | |
# Sorin Ionescu <sorin.ionescu@gmail.com> | |
# | |
# Source Prezto. | |
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" | |
fi | |
# Customize to your needs... | |
function setwork(){ | |
playground="/home/knuth/Projects/Involved/Other" | |
current_work="/home/knuth/Projects/Involved/NOC" | |
`tmux new-window -n 'FOSS'` | |
`tmux new-window -c $playground -n 'OTHER-DEV'` | |
`tmux new-window -c $current_work -n 'WORK-DEV' ` | |
`tmux new-window -n 'PRODUCTION'` | |
`tmux new-window -n 'CMUS' ` | |
`tmux send-keys -t 'CMUS' 'cmus' 'C-m'` | |
} | |
function setdefaultrunning(){ | |
setwork | |
`tmux new-window -c "/home/knuth/" -n 'test' "nohup thunderbird 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test2' "nohup google-chrome 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test3' "nohup systemctl --user restart intellij.service 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test5' "nohup idea 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test6' "nohup tbrowser 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test6' "nohup keepassxc 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test7' "nohup gajim 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test8' "nohup slack 2>/dev/null"` | |
`tmux new-window -c "/home/knuth/" -n 'test9' "nohup rememberthemilk 2>/dev/null"` | |
} | |
function show_contribution() { | |
if [ "$#" -ne 3 ]; then | |
echo "Need 3 arguments: author from_commit to_commit" | |
else | |
git log --author="$1" --numstat --pretty="%H" "$2".."$3" | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' | |
fi | |
} | |
function show_contributors(){ | |
if [ "$#" -ne 2 ]; then | |
echo "Need 2 arguments: from_commit to_commit" | |
return 1 | |
fi | |
authors="$(git log --format='%aE' | sort -u)" | |
for author in "${authors[@]}"; do | |
echo "$author: $(show_contribution $author $1 $2)" | |
done | |
} | |
function cleartmuxbuffer(){ | |
buffers=($(tmux list-buffer | cut -f1 -d ":")) | |
for i in "${buffers[@]}"; do | |
tmux delete-buffer -b "$i" | |
done | |
} | |
function cache_ssh_keys(){ | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Specify cache seconds and key to cache (use . for all keys)" | |
return 1 | |
fi | |
eval "$(ssh-agent)" | |
ssh-add -t $1 `ls ~/.ssh/* | grep ".pub" | sed s/.pub//g | grep "$2"` | |
} | |
function work_cache_ssh(){ | |
# cache for 9 hours | |
cache_ssh_keys 32400 noc | |
} | |
function gen_month_report(){ | |
find . -name .git -type d -exec echo Project: {} \; -exec git --git-dir={} log --no-merges --since=${1:-`date --date="-1 month" +%b`} --until=${2:-`date +%b`} --author="jpr" --format="- %s (%h)%n%b" \; | sed "/\(Reviewers\|Reviewed\|Differential\|Subscriber\).*/D" | sed "s/Summary: //g" | sed "/^$/D" | sed "s/\(\.\/\|\/\.git\)//g" | awk '/Project:.*/{p=$0 ORS;next} {printf "%s", p; p=""; print} END {if (p !~ /Project:.*/) printf "%s", p}' | |
} | |
export EDITOR='vim' | |
export VISUAL='vim' | |
export WORKON_HOME=~/.virtualenvs | |
alias gitcontrib=show_contribution | |
alias gitdate='export GIT_COMMITTER_DATE="`date`" | git commit --amend --date "`date`"' | |
alias worktmux=setwork | |
alias startwork=setdefaultrunning | |
alias timeit='t1=$(date +%s); $(cmd); t2=$(date +%s); echo $(((t2-t1)/60)) seconds' | |
alias ctm=cleartmuxbuffer | |
alias wssh=work_cache_ssh | |
alias cssh=cache_ssh_keys | |
alias work='cd /home/knuth/Projects/Involved/NOC/' | |
alias motd='fortune | cowsay -f "$(find /usr/share/cowsay/ -iname "*.cow" | xargs shuf -n1 -e)"' | |
alias cmotd='while true; do (fortune | cowsay -f "$(find /usr/share/cowsay/ -iname "*.cow" | xargs shuf -n1 -e)"); sleep 10; done' | |
projects='/home/knuth/Projects/' | |
alias projo='cd $projects;cd Other' | |
alias projio='cd $projects;cd Involved/Other' | |
alias genmrep=gen_month_report | |
alias youtubemp3='youtube-dl --extract-audio --audio-format mp3' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment