├── .config ├── starship.toml ├── configs │ ├── templates │ │ ├── termite.ini.erb │ │ ├── rofi-colors.rasi.erb │ │ ├── i3.ini.erb │ │ ├── polybar.ini.erb │ │ └── dunstrc.erb │ └── configs.yml └── nvim │ ├── ftplugin │ ├── ruby.vim │ └── haskell.vim │ └── init.vim ├── screenshots ├── empty.png ├── rofi.png └── vim.png ├── .local └── share │ └── nvim │ └── site │ └── UltiSnips │ ├── haskell.snippets │ ├── javascript.snippets │ ├── markdown.snippets │ ├── vim.snippets │ ├── ruby.snippets │ └── coq.snippets ├── bin ├── cpu_fan.rb ├── autostart_firefox.rb ├── kbd_backlight.rb ├── autostart_weechat.rb ├── cpu_freq.rb └── gmail.rb ├── .xinitrc ├── .pryrc ├── .zshrc ├── .profile └── Readme.md /.config/starship.toml: -------------------------------------------------------------------------------- 1 | [ruby] 2 | symbol = " " 3 | -------------------------------------------------------------------------------- /screenshots/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulsonkoly/dotfiles/HEAD/screenshots/empty.png -------------------------------------------------------------------------------- /screenshots/rofi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulsonkoly/dotfiles/HEAD/screenshots/rofi.png -------------------------------------------------------------------------------- /screenshots/vim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulsonkoly/dotfiles/HEAD/screenshots/vim.png -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/haskell.snippets: -------------------------------------------------------------------------------- 1 | snippet ts "traceShow (..)" w 2 | traceShow ($0) (${VISUAL}) 3 | endsnippet 4 | 5 | snippet der "deriving (..)" 6 | deriving (${0:Show}) 7 | endsnippet 8 | -------------------------------------------------------------------------------- /bin/cpu_fan.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | `sensors`.each_line do |line| 6 | next unless (match = /cpu_fan:[\s]*(?[\d]+) RPM/.match line) 7 | 8 | rpm = match[:rpm].to_i 9 | puts "#{rpm} RPM" 10 | end 11 | -------------------------------------------------------------------------------- /.config/configs/templates/termite.ini.erb: -------------------------------------------------------------------------------- 1 | [options] 2 | font = <%= @font %> <%= @fontsize %> 3 | # disables F11 key press (does the same as i3 fullscreen). F11 now works in 4 | # weechat ( nicklist scroll ) 5 | fullscreen = 0 6 | 7 | [colors] 8 | <% @colors.each_pair do |key, value| %> 9 | <%= key %>=<%= value %> 10 | <% end %> 11 | 12 | # vim: ft=dosini cms=#%s 13 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # RVM paths need to be exported here so bin/stuff works 4 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 5 | 6 | setxkbmap gb 7 | [[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources 8 | 9 | source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh 10 | 11 | start-pulseaudio-x11 12 | 13 | # annoying bell off 14 | xset b off 15 | 16 | feh --bg-center --no-fehbg ~/Downloads/Hydrogen_Remixed.png 17 | 18 | exec i3 19 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | let g:xmpfilter_cmd = 'seeing_is_believing' 2 | 3 | nmap m (seeing_is_believing-mark) 4 | xmap m (seeing_is_believing-mark) 5 | imap m (seeing_is_believing-mark) 6 | 7 | nmap r (seeing_is_believing-run_-x) 8 | xmap r (seeing_is_believing-run_-x) 9 | imap r (seeing_is_believing-run_-x) 10 | 11 | " highlight operators in ruby 12 | let ruby_operators=1 13 | let ruby_spellcheck_strings=1 14 | -------------------------------------------------------------------------------- /.pryrc: -------------------------------------------------------------------------------- 1 | instance_eval do 2 | def shrink_object_name(name) 3 | splitted = name.to_s.split('::') 4 | splitted.map! { |split| split.gsub(/0x(\h)\h{14}(\h)/, '0x\1…\2') } 5 | 6 | if splitted.count <= 4 7 | splitted.join('::') 8 | else 9 | "#{splitted[0]}::…::#{splitted[-1]}" 10 | end 11 | end 12 | 13 | logo = Pry::Helpers::Text.green(Pry::Helpers::Text.bold('λ')) 14 | Pry.config.prompt = lambda do |obj, nest_level, _| 15 | obj_name_shrunk = shrink_object_name(obj) 16 | "[#{nest_level}](#{obj_name_shrunk}) #{logo} " 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /bin/autostart_firefox.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | require 'sys/proctable' 6 | require 'i3ipc' 7 | 8 | module Firefox 9 | EXECUTABLE = '/usr/lib/firefox/firefox' 10 | 11 | class << self 12 | def running? 13 | Sys::ProcTable.ps.any? do |process| 14 | process.cmdline.start_with? EXECUTABLE 15 | end 16 | end 17 | 18 | def run! 19 | Process.exec(EXECUTABLE) 20 | end 21 | end 22 | end 23 | 24 | i3 = I3Ipc::Connection.new 25 | i3.command('workspace 9: www') 26 | i3.close 27 | 28 | Firefox.run! unless Firefox.running? 29 | -------------------------------------------------------------------------------- /bin/kbd_backlight.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | module KbdBacklight 5 | MODES = %w[off low med high].freeze 6 | 7 | module_function 8 | 9 | def index 10 | response = `sudo asusctl -k` 11 | MODES.find_index { |mode| response.include? mode } 12 | end 13 | 14 | def set(mode) 15 | `sudo asusctl -k #{mode}` 16 | end 17 | 18 | def up 19 | new = MODES[index + 1] 20 | set new 21 | end 22 | 23 | def down 24 | new = MODES[index - 1] if index.positive? 25 | set new if new 26 | end 27 | end 28 | 29 | case ARGV[0] 30 | when 'up' then KbdBacklight.up 31 | when 'down' then KbdBacklight.down 32 | end 33 | -------------------------------------------------------------------------------- /bin/autostart_weechat.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | require 'sys/proctable' 6 | require 'i3ipc' 7 | 8 | module Weechat 9 | CMDLINE = "termite -t weechat -e 'ssh -tp44422 phaul@sdd.hu screen -r'" 10 | CMDLINE_MATCH = 'termite -t weechat' 11 | 12 | class << self 13 | def running? 14 | Sys::ProcTable.ps.any? do |process| 15 | process.cmdline.start_with? CMDLINE_MATCH 16 | end 17 | end 18 | 19 | def run! 20 | Process.exec(CMDLINE) 21 | end 22 | end 23 | end 24 | 25 | i3 = I3Ipc::Connection.new 26 | i3.command('workspace 3: chat') 27 | i3.close 28 | 29 | Weechat.run! unless Weechat.running? 30 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/haskell.vim: -------------------------------------------------------------------------------- 1 | augroup interoMaps 2 | au! 3 | " Automatically reload on save 4 | au BufWritePost *.hs InteroReload 5 | augroup END 6 | 7 | 8 | setlocal formatprg=brittany 9 | nmap :HoogleInfo 10 | nnoremap :InteroOpen 11 | 12 | " Load individual modules 13 | nnoremap :InteroLoadCurrentModule 14 | nnoremap :InteroLoadCurrentFile 15 | 16 | " Type-related information 17 | " Heads up! These next two differ from the rest. 18 | map InteroGenericType 19 | map InteroType 20 | nnoremap :InteroTypeInsert 21 | 22 | " Navigation 23 | nnoremap :InteroGoToDef 24 | 25 | " Managing targets 26 | " Prompts you to enter targets (no silent): 27 | nnoremap :InteroSetTargets 28 | 29 | nnoremap :Neomake hlint 30 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # The following lines were added by compinstall 2 | 3 | zstyle ':completion:*' completer _complete _ignored _approximate 4 | zstyle ':completion:*' format '%d' 5 | zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' 6 | zstyle :compinstall filename '/home/phaul/.zshrc' 7 | 8 | autoload -Uz compinit 9 | compinit 10 | # End of lines added by compinstall 11 | # Lines configured by zsh-newuser-install 12 | HISTFILE=~/.histfile 13 | HISTSIZE=1000 14 | SAVEHIST=1000 15 | setopt hist_ignore_all_dups 16 | bindkey -v 17 | # End of lines configured by zsh-newuser-install 18 | # 19 | 20 | autoload -U edit-command-line 21 | zle -N edit-command-line 22 | bindkey '^x^x' edit-command-line 23 | 24 | source $HOME/.profile 25 | source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 26 | export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=6" 27 | source /usr/share/fzf/completion.zsh 28 | source /usr/share/fzf/key-bindings.zsh 29 | 30 | eval "$(starship init zsh)" 31 | -------------------------------------------------------------------------------- /bin/cpu_freq.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # frozen_string_literal: true 4 | 5 | class Ramp 6 | RAMPSTRING = '▁▂▃▄▅▆▇█' 7 | 8 | def initialize(min, max) 9 | @min = min 10 | @max = max 11 | end 12 | 13 | def for_values(*values) 14 | values.map { |value| for_value(value) }.join 15 | end 16 | 17 | private 18 | 19 | def for_value(value) 20 | RAMPSTRING[indexify(value)] 21 | end 22 | 23 | def indexify(value) 24 | return 0 if value < @min 25 | 26 | (value - @min) / range.fdiv(RAMPSTRING.length) 27 | end 28 | 29 | def range 30 | @max - @min 31 | end 32 | end 33 | 34 | ramp = Ramp.new(1200, 3800) # khz 35 | 36 | File.open('/proc/cpuinfo') do |io| 37 | loop do 38 | # min, max = Float::MAX, 0 39 | frequencies = io.each_line.map do |line| 40 | next unless (match = /cpu MHz[\s]*: (?[\d.]+)/.match(line)) 41 | 42 | match[:freq].to_f 43 | end.compact 44 | puts ramp.for_values(*frequencies) 45 | STDOUT.flush 46 | io.rewind 47 | sleep 3 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/javascript.snippets: -------------------------------------------------------------------------------- 1 | # Copyright © 2018 Paul Sonkoly 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the "Software"), 5 | # to deal in the Software without restriction, including without limitation 6 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | # and/or sell copies of the Software, and to permit persons to whom the 8 | # Software is furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included 11 | # in all copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | priority 50 22 | 23 | snippet then ".then(.. => ..)" 24 | .then(${1:data} => ${0}) 25 | endsnippet 26 | 27 | -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/markdown.snippets: -------------------------------------------------------------------------------- 1 | # Paul's markdown snippets 2 | # Copyright © 2018 Paul Sonkoly 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining 5 | # a copy of this software and associated documentation files (the "Software"), 6 | # to deal in the Software without restriction, including without limitation 7 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | # and/or sell copies of the Software, and to permit persons to whom the 9 | # Software is furnished to do so, subject to the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | snippet kbd "html kbd tag for markdown" w 23 | ${0:${VISUAL}} 24 | endsnippet 25 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | # Non shell specific setup 2 | # vim:set ft=zsh: 3 | 4 | unset FZF_DEFAULT_OPTS # I like original don't need to alter fzf colours 5 | 6 | PATH="$PATH:$HOME/bin" 7 | 8 | export PATH 9 | 10 | export TERMINAL=termite 11 | export EDITOR=nvim 12 | 13 | export NNN_COPIER=$HOME/bin/nnn_copier.sh 14 | 15 | # If not running interactively, don't do anything 16 | [[ $- != *i* ]] && return 17 | 18 | alias ls='ls --color=auto' 19 | alias vim=nvim 20 | 21 | # colour man pages (https://wiki.archlinux.org/index.php/Color_output_in_console) 22 | man() { 23 | LESS_TERMCAP_md=$'\e[01;31m' \ 24 | LESS_TERMCAP_me=$'\e[0m' \ 25 | LESS_TERMCAP_se=$'\e[0m' \ 26 | LESS_TERMCAP_so=$'\e[01;03;33m' \ 27 | LESS_TERMCAP_ue=$'\e[0m' \ 28 | LESS_TERMCAP_us=$'\e[01;32m' \ 29 | command man "$@" 30 | } 31 | 32 | # multi select fzf for package names 33 | # use $ pacman ** to trigger 34 | _fzf_complete_yay() { 35 | _fzf_complete '-m' "$@" < <( 36 | command yay -Pc | cut -f1 -d' ' 37 | ) 38 | } 39 | 40 | _fzf_complete_yay_post() { 41 | awk '{print $1}' 42 | } 43 | 44 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 45 | PATH="$PATH:$HOME/.rvm/bin" 46 | 47 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 48 | -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/vim.snippets: -------------------------------------------------------------------------------- 1 | # Paul's vimscript snippets 2 | # Copyright © 2018 Paul Sonkoly 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining 5 | # a copy of this software and associated documentation files (the "Software"), 6 | # to deal in the Software without restriction, including without limitation 7 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | # and/or sell copies of the Software, and to permit persons to whom the 9 | # Software is furnished to do so, subject to the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | snippet au "augroup with visual" 23 | augroup ${0:AU_NAME} 24 | ${VISUAL} 25 | augroup end 26 | endsnippet 27 | 28 | snippet f "function" 29 | function! ${1:function_name}(${2:argument}) abort 30 | $0 31 | endfunction 32 | endsnippet 33 | 34 | snippet Plug "Plugged plug" 35 | Plug '$0' 36 | endsnippet 37 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | DOTFILES 2 | ======== 3 | 4 | This repository contains the personal configuration files I use on my \*nix 5 | systems. The configuration files include setup for the following programs: 6 | 7 | * zsh 8 | * dunst 9 | * fzf 10 | * gtk-3 11 | * i3-gaps 12 | * polybar 13 | * rubocop 14 | * termite 15 | * neovim 16 | * xinit 17 | 18 | The config structure received an overhaul whereby all config is generated from 19 | a single source. This is similar to how pywal would generate color scheme for 20 | all programs, but tailoring pywal output requires per program fiddling. Ie some 21 | programs can read xresouorces, some can read environment variables, some work 22 | with command line argument. 23 | 24 | This motivated [this](http://github.com/phaul/configs) ruby gem, that manages 25 | my dotfiles now. 26 | 27 | There are custom scripts under bin/ which require a working ruby environment. 28 | Some setup is related to arch-linux and the yay package manager. 29 | 30 | Screenshots 31 | =========== 32 | 33 | These screenshots were taken in Jul/2019 and since then the look of the setup 34 | has changed slightly. If you are after re-creating the looks on the screenshot 35 | probably you should check out the commit that has the shots posted. (021715c2) 36 | 37 | Rofi / dunst: 38 | ![rofi](screenshots/rofi.png) 39 | 40 | vim: 41 | ![vim](screenshots/vim.png) 42 | 43 | Empty: 44 | ![empty](screenshots/empty.png) 45 | 46 | Wallpaper 47 | ========= 48 | 49 | [link](http://simpledesktops.com/browse/desktops/2016/oct/12/hydrogen-remixed/) 50 | 51 | -------------------------------------------------------------------------------- /bin/gmail.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # A small script that checks unseen messages on gmail, used in polybar 3 | # Copyright © 2018 Paul Sonkoly 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the "Software"), 7 | # to deal in the Software without restriction, including without limitation 8 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | # and/or sell copies of the Software, and to permit persons to whom the 10 | # Software is furnished to do so, subject to the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 21 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | require 'yaml' 24 | require 'gmail' 25 | require 'libnotify' 26 | 27 | LOGIN_CONFIG = File.join(ENV['HOME'], 'gmail.yaml') 28 | 29 | $login = File.open(LOGIN_CONFIG, 'r') { |io| YAML.load(io.read) } 30 | 31 | def connect 32 | Gmail.connect($login['username'], $login['password']) 33 | end 34 | 35 | def loop_with_delay 36 | loop do 37 | yield 38 | sleep 90 39 | end 40 | end 41 | 42 | def with_connection 43 | gmail = nil 44 | loop_with_delay do 45 | if gmail && gmail.logged_in? 46 | yield(gmail) 47 | else 48 | gmail = connect 49 | redo if gmail.logged_in? 50 | end 51 | end 52 | end 53 | 54 | with_connection do |gmail| 55 | new_count = gmail.inbox.unseen.count 56 | if @count && @count < new_count 57 | Libnotify.new do |notify| 58 | notify.summary = 'Email' 59 | notify.body = "#{new_count - @count} new unseen" 60 | end.show! 61 | end 62 | if @count != new_count 63 | puts new_count 64 | STDOUT.flush 65 | @count = new_count 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/ruby.snippets: -------------------------------------------------------------------------------- 1 | # Copyright © 2017 Paul Sonkoly 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the "Software"), 5 | # to deal in the Software without restriction, including without limitation 6 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | # and/or sell copies of the Software, and to permit persons to whom the 8 | # Software is furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included 11 | # in all copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | priority 50 22 | 23 | snippet def "like the normal def snippet but with VISUAL for the content" 24 | def ${1:method_name} 25 | ${0:${VISUAL}} 26 | end 27 | endsnippet 28 | 29 | snippet reqra "require 'rspec/autorun'" 30 | require 'rspec/autorun' 31 | endsnippet 32 | 33 | snippet RS "RSpec.describe" 34 | RSpec.describe ${1:SomeModule} do 35 | ${0:${VISUAL}} 36 | end 37 | endsnippet 38 | 39 | snippet gem "gem definition in Gemfile" 'b' 40 | gem '$0' 41 | endsnippet 42 | 43 | snippet @!a "yard attribute" 44 | @!attribute [${2:r}] ${1:name} 45 | # @return [${3:String}] ${0:description} 46 | endsnippet 47 | 48 | snippet @!m "yard method (for metaprogramming defined methods)" 49 | @!method ${1:name}${2:(${3:*args})} 50 | endsnippet 51 | 52 | snippet @r "yard return" 53 | @return [${1:String}] ${0:description} 54 | endsnippet 55 | 56 | snippet @p "yard parameter" 57 | @param ${1:name} [${2:String}] ${0:description} 58 | endsnippet 59 | 60 | snippet pry "require pry; binding.pry" 61 | require 'pry'; binding.pry 62 | endsnippet 63 | 64 | snippet ba "before_action (rails)" b 65 | before_action ${0::method} 66 | endsnippet 67 | 68 | snippet wpsa "when platform settings are" b 69 | include_context 'when platform setting are', ${1:unit}: { ${2:setting}: ${3:true} } 70 | endsnippet 71 | 72 | snippet atr "rails form attribute" b 73 | attribute ${1::name}, ${0:Decimal} 74 | endsnippet 75 | -------------------------------------------------------------------------------- /.config/configs/configs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # inspired by colours found in https://cocopon.github.io/iceberg.vim/ 3 | aliases: 4 | color_bindings: &color_bindings 5 | background: &background "#1c1c1c" 6 | foreground: &foreground "#e3ecdc" 7 | border_color: &border_color "#b3c262" 8 | cursor: &cursor "#505050" 9 | color0: &color0 "#1e2132" 10 | color1: &color1 "#e27878" 11 | color2: &color2 "#b4be82" 12 | color3: &color3 "#e2a478" 13 | color4: &color4 "#84a0c6" 14 | color5: &color5 "#a093c7" 15 | color6: &color6 "#89b8c2" 16 | color7: &color7 "#c6c8d1" 17 | color8: &color8 "#6b7089" 18 | color9: &color9 "#e98989" 19 | color10: &color10 "#c0ca8e" 20 | color11: &color11 "#e9b189" 21 | color12: &color12 "#91acd1" 22 | color13: &color13 "#ada0d3" 23 | color14: &color14 "#95c4ce" 24 | color15: &color15 "#d2d4de" 25 | 26 | font: &font FantasqueSansMono Nerd Font 27 | fontsize: &fontsize 13 28 | 29 | termite: 30 | template: .config/configs/templates/termite.ini.erb 31 | output: .config/termite/config 32 | binding: 33 | colors: *color_bindings 34 | font: *font 35 | fontsize: *fontsize 36 | 37 | polybar: 38 | template: .config/configs/templates/polybar.ini.erb 39 | output: .config/polybar/config 40 | binding: 41 | <<: *color_bindings 42 | background: "#101010" 43 | focused_ws: *color6 44 | underline_color: *color6 45 | unfocused_ws: *color6 46 | warning_color: *color1 47 | cpu_color: "#7759b4" 48 | mem_color: *color14 49 | misc_color: *color4 50 | net_color: *color3 51 | sound_color: *color10 52 | font: *font 53 | 54 | i3: 55 | template: .config/configs/templates/i3.ini.erb 56 | output: .config/i3/config 57 | binding: 58 | border_color: *border_color 59 | text_color: *background 60 | 61 | rofi_top: 62 | template: .config/configs/templates/rofi.rasi.erb 63 | output: .config/rofi/config.rasi 64 | binding: 65 | font: *font 66 | fontsize: *fontsize 67 | 68 | rofi: 69 | template: .config/configs/templates/rofi-colors.rasi.erb 70 | output: .config/rofi/colors-rofi-dark.rasi 71 | binding: 72 | <<: *color_bindings 73 | background: "#101010" 74 | active: *color6 75 | 76 | dunst: 77 | template: .config/configs/templates/dunstrc.erb 78 | output: .config/dunst/dunstrc 79 | binding: 80 | font: *font 81 | fontsize: *fontsize 82 | background: "#101010" 83 | urgency_low: *color6 84 | urgency_normal: *color6 85 | urgency_critical: *color9 86 | frame_color: *border_color 87 | 88 | -------------------------------------------------------------------------------- /.local/share/nvim/site/UltiSnips/coq.snippets: -------------------------------------------------------------------------------- 1 | # coq snippets 2 | # Copyright © 2019 Paul Sonkoly 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining 5 | # a copy of this software and associated documentation files (the "Software"), 6 | # to deal in the Software without restriction, including without limitation 7 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | # and/or sell copies of the Software, and to permit persons to whom the 9 | # Software is furnished to do so, subject to the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | priority 50 23 | 24 | snippet ass "assert" 25 | assert (L: $1). { 26 | $0 27 | } 28 | endsnippet 29 | 30 | snippet gen "generalize dependent" 31 | generalize dependent $0. 32 | endsnippet 33 | 34 | 35 | snippet a "assumption." 36 | assumption. 37 | endsnippet 38 | 39 | snippet r "reflexivity." 40 | reflexivity. 41 | endsnippet 42 | 43 | snippet Q "Qed." 44 | Qed. 45 | endsnippet 46 | 47 | snippet ind "induction" 48 | induction $1${2: as [${0:|}]}. 49 | endsnippet 50 | 51 | snippet re "rewrite" 52 | rewrite ${1:<- }$2${3: in ${4}}. 53 | endsnippet 54 | 55 | snippet rep "replace" 56 | replace ($1) with ($2)$0. 57 | endsnippet 58 | 59 | snippet rem "remember" 60 | remember $1 as $2. 61 | endsnippet 62 | 63 | snippet inv "inversion" 64 | inversion $0. 65 | endsnippet 66 | 67 | snippet app "apply" 68 | apply $0. 69 | endsnippet 70 | 71 | snippet ex "exists" 72 | exists $0. 73 | endsnippet 74 | 75 | snippet des "destruct" 76 | destruct $0. 77 | endsnippet 78 | 79 | snippet dis "discriminate" 80 | discriminate $0. 81 | endsnippet 82 | 83 | snippet int "intros" 84 | intros $0. 85 | endsnippet 86 | 87 | snippet unf "unfold" 88 | unfold $0. 89 | endsnippet 90 | 91 | snippet spl "split" 92 | split. 93 | { 94 | $0 95 | } 96 | { 97 | } 98 | endsnippet 99 | 100 | snippet spec "specialize" 101 | specialize $1 with (${2} := ${3}) ${4:as ${5}}. 102 | endsnippet 103 | 104 | snippet Pr "Proof...Qed." 105 | Proof. 106 | $0 107 | Qed. 108 | endsnippet 109 | 110 | -------------------------------------------------------------------------------- /.config/configs/templates/rofi-colors.rasi.erb: -------------------------------------------------------------------------------- 1 | * { 2 | active-background: @active; 3 | active-foreground: @background; 4 | normal-background: @background; 5 | normal-foreground: @foreground; 6 | urgent-background: <%= @color1 %>; 7 | urgent-foreground: @foreground; 8 | 9 | alternate-active-background: @background; 10 | alternate-active-foreground: @foreground; 11 | alternate-normal-background: @background; 12 | alternate-normal-foreground: @foreground; 13 | alternate-urgent-background: @background; 14 | alternate-urgent-foreground: @foreground; 15 | 16 | selected-active-background: @active; 17 | selected-active-foreground: @background; 18 | selected-normal-background: @active; 19 | selected-normal-foreground: @background; 20 | selected-urgent-background: <%= @color9 %>; 21 | selected-urgent-foreground: @foreground; 22 | 23 | active: <%= @active %>; 24 | background-color: @background; 25 | background: <%= @background %>; 26 | foreground: <%= @foreground %>; 27 | border-color: @active; 28 | spacing: 2; 29 | } 30 | 31 | #window { 32 | background-color: @background; 33 | border: 0; 34 | padding: 2.5ch; 35 | } 36 | 37 | #mainbox { 38 | border: 0; 39 | padding: 0; 40 | } 41 | 42 | #message { 43 | border: 1px 0px 0px; 44 | border-color: @border-color; 45 | padding: 2px; 46 | } 47 | 48 | #textbox { 49 | text-color: @foreground; 50 | } 51 | 52 | #inputbar { 53 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; 54 | } 55 | 56 | #textbox-prompt-colon { 57 | expand: false; 58 | str: ":"; 59 | margin: 0px 0.3em 0em 0em; 60 | text-color: @normal-foreground; 61 | } 62 | 63 | #listview { 64 | fixed-height: 0; 65 | border: 1px 0px 0px; 66 | border-color: @border-color; 67 | spacing: 2px; 68 | scrollbar: true; 69 | padding: 2px 0px 0px; 70 | } 71 | 72 | #element { 73 | border: 0; 74 | padding: 1px; 75 | } 76 | 77 | #element.normal.normal { 78 | background-color: @normal-background; 79 | text-color: @normal-foreground; 80 | } 81 | 82 | #element.normal.urgent { 83 | background-color: @urgent-background; 84 | text-color: @urgent-foreground; 85 | } 86 | 87 | #element.normal.active { 88 | background-color: @active-background; 89 | text-color: @active-foreground; 90 | } 91 | 92 | #element.selected.normal { 93 | background-color: @selected-normal-background; 94 | text-color: @selected-normal-foreground; 95 | } 96 | 97 | #element.selected.urgent { 98 | background-color: @selected-urgent-background; 99 | text-color: @selected-urgent-foreground; 100 | } 101 | 102 | #element.selected.active { 103 | background-color: @selected-active-background; 104 | text-color: @selected-active-foreground; 105 | } 106 | 107 | #element.alternate.normal { 108 | background-color: @alternate-normal-background; 109 | text-color: @alternate-normal-foreground; 110 | } 111 | 112 | #element.alternate.urgent { 113 | background-color: @alternate-urgent-background; 114 | text-color: @alternate-urgent-foreground; 115 | } 116 | 117 | #element.alternate.active { 118 | background-color: @alternate-active-background; 119 | text-color: @alternate-active-foreground; 120 | } 121 | 122 | #scrollbar { 123 | width: 4px; 124 | border: 0; 125 | handle-width: 8px; 126 | padding: 0; 127 | } 128 | 129 | #sidebar { 130 | border: 1px 0px 0px; 131 | border-color: @border-color; 132 | } 133 | 134 | #button { 135 | text-color: @normal-foreground; 136 | } 137 | 138 | #button.selected { 139 | background-color: @selected-normal-background; 140 | text-color: @selected-normal-foreground; 141 | } 142 | 143 | #inputbar { 144 | spacing: 0; 145 | text-color: @normal-foreground; 146 | padding: 1px; 147 | } 148 | 149 | #case-indicator { 150 | spacing: 0; 151 | text-color: @normal-foreground; 152 | } 153 | 154 | #entry { 155 | spacing: 0; 156 | text-color: @normal-foreground; 157 | } 158 | 159 | #prompt { 160 | spacing: 0; 161 | text-color: @normal-foreground; 162 | } 163 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | " vim:fdm=marker 2 | scriptencoding utf-8 3 | 4 | " vim-plug {{{ 5 | call plug#begin('~/.local/share/nvim/plugged') 6 | 7 | Plug 'airblade/vim-gitgutter' 8 | Plug 'AndrewRadev/splitjoin.vim' 9 | Plug 'chrisbra/Colorizer' 10 | Plug 'cocopon/iceberg.vim' 11 | Plug 'inkarkat/vim-mark' | Plug 'inkarkat/vim-ingo-library' 12 | Plug 'itchyny/lightline.vim' 13 | Plug 'junegunn/fzf' | Plug 'junegunn/fzf.vim' 14 | Plug 'junegunn/vim-easy-align' 15 | Plug 'junegunn/vim-peekaboo' 16 | Plug 'kkoomen/vim-doge' 17 | Plug 'lambdalisue/gina.vim' 18 | Plug 'lambdalisue/vim-gista' 19 | Plug 'machakann/vim-highlightedyank' 20 | Plug 'mattn/emmet-vim' 21 | Plug 'mcchrish/nnn.vim' 22 | Plug 'michaeljsmith/vim-indent-object' 23 | Plug 'neomake/neomake' 24 | Plug 'noprompt/vim-yardoc', { 'for': 'ruby' } 25 | Plug 'rickhowe/diffchar.vim' 26 | Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 27 | Plug 't9md/vim-ruby-xmpfilter', { 'for': 'ruby' } 28 | Plug 'tpope/vim-commentary' 29 | Plug 'tpope/vim-endwise' 30 | Plug 'tpope/vim-surround' 31 | Plug 'wellle/targets.vim' 32 | 33 | call plug#end() 34 | " }}} vim-plug 35 | 36 | " generic global vim options {{{ 37 | set number 38 | set relativenumber 39 | 40 | set expandtab 41 | set shiftwidth=2 42 | set softtabstop=2 43 | set smartindent 44 | set colorcolumn=120 45 | set nohlsearch 46 | 47 | set hidden 48 | 49 | let mapleader = '#' 50 | 51 | " the default C-s freezes the terminal. C-z in insert is close enough. 52 | imap Isurround 53 | noremap ]g :cnext 54 | noremap [g :cprevious 55 | " }}} generic global vim options 56 | 57 | " window movement {{{ " 58 | noremap h 59 | noremap j 60 | noremap k 61 | noremap l 62 | " }}} window movement " 63 | 64 | " Colorcheme overrides {{{ 65 | " only works before the colorscheme selection 66 | augroup ColourScheme 67 | autocmd! 68 | autocmd ColorScheme * highlight NeomakeErrorSign ctermfg=203 ctermbg=235 69 | \ | highlight NeomakeVirtualtextError ctermfg=203 70 | \ | highlight link ExtraWhitespace ErrorMsg 71 | " Show leading white space that includes spaces, and trailing white space. 72 | autocmd BufWinEnter * match ExtraWhitespace /\s\+$\| \+\ze\t/ 73 | augroup END 74 | highlight ExtraWhitespace ctermbg=red guibg=red 75 | " }}} Colorscheme overrides 76 | 77 | " visual appearance {{{ 78 | set listchars=trail:· 79 | set list 80 | 81 | " -- Insert -- on the command line 82 | set noshowmode 83 | 84 | set termguicolors 85 | colorscheme iceberg 86 | set cursorline 87 | 88 | " }}} visual appearance 89 | 90 | " lightline {{{ 91 | let g:lightline = { 92 | \ 'active': { 93 | \ 'left': [ [ 'mode', 'paste' ], 94 | \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ], 95 | \ 'right': [ [ 'lineinfo' ], 96 | \ [ 'percent' ], 97 | \ [ 'fileformat', 'fileencoding', 'filetype' ] ] }, 98 | \ 'component_function': { 'gitbranch': 'gina#component#repo#branch' }, 99 | \ 'colorscheme': 'iceberg' 100 | \ } 101 | " }}} lightline 102 | 103 | " Neomake {{{ " 104 | call neomake#configure#automake('w') 105 | let g:neomake_error_sign = { 106 | \ 'text': '●', 107 | \ 'texthl': 'NeomakeErrorSign', 108 | \ } 109 | let g:neomake_warning_sign = { 110 | \ 'text': '●', 111 | \ 'texthl': 'NeomakeWarningSign', 112 | \ } 113 | let g:neomake_message_sign = { 114 | \ 'text': '●', 115 | \ 'texthl': 'NeomakeMessageSign', 116 | \ } 117 | let g:neomake_info_sign = { 118 | \ 'text': '●', 119 | \ 'texthl': 'NeomakeInfoSign' 120 | \ } 121 | " }}} Neomake " 122 | 123 | " easy align {{{ 124 | " Start interactive EasyAlign in visual mode (e.g. vipga) 125 | xmap ga (EasyAlign) 126 | 127 | " Start interactive EasyAlign for a motion/text object (e.g. gaip) 128 | nmap ga (EasyAlign) 129 | " }}} easy align 130 | 131 | " Git VCS {{{ 132 | map g :Gina status 133 | map c :Gina commit 134 | map l :Gina log --graph --all 135 | map h :Gina branch 136 | map s :Gina stash list 137 | 138 | " allow gina to discard directories with == on Gina status. It asks for 139 | " confirmation anyways 140 | let g:gina#action#index#discard_directories=1 141 | 142 | let g:gista#client#default_username='phaul' 143 | 144 | let g:gitgutter_sign_added='┃' 145 | let g:gitgutter_sign_modified='┃' 146 | augroup GinaStatus 147 | autocmd FileType gina-status setl number relativenumber 148 | augroup end 149 | " }}} Git VCS 150 | 151 | " Ultisnips {{{ 152 | " directory must be in the runtime path! 153 | let g:UltiSnipsSnippetsDir = '~/.local/share/nvim/site/UltiSnips' 154 | augroup SnippetAuto 155 | autocmd FileType snippets setlocal noexpandtab shiftwidth=2 tabstop=2 softtabstop=2 156 | augroup end 157 | " }}} Ultisnips 158 | 159 | " FZF {{{ 160 | map b :Buffers 161 | map f :GFiles 162 | map :GFiles? 163 | map t :Filetypes 164 | map :BLines 165 | map ; :History: 166 | " }}} FZF 167 | 168 | " {{{ SplitJoin 169 | let g:no_splitjoin_ruby_curly_braces=0 170 | " }}} SplitJoin 171 | 172 | " nnn {{{ 173 | let g:nnn#replace_netrw=1 174 | " Disable default mappings 175 | let g:nnn#set_default_mappings = 0 176 | " }}} nnn 177 | 178 | " mark {{{ " 179 | " this was mapping # which I use for :BLines 180 | nmap DisableMarkSearchCurrentPrev MarkSearchCurrentPrev 181 | " }}} mark " 182 | -------------------------------------------------------------------------------- /.config/configs/templates/i3.ini.erb: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # 4 | # Should you change your keyboard layout some time, delete 5 | # this file and re-run i3-config-wizard(1). 6 | # 7 | 8 | # i3 config file (v4) 9 | # 10 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 11 | 12 | set $mod Mod4 13 | 14 | # Font for window titles. Will also be used by the bar unless a different font 15 | # is used in the bar {} block below. 16 | # font pango:monospace 8 17 | 18 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 19 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 20 | font pango:Fira Mono Medium 8, Font Awesome 8 21 | 22 | # Before i3 v4.8, we used to recommend this one as the default: 23 | # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 24 | # The font above is very space-efficient, that is, it looks good, sharp and 25 | # clear in small sizes. However, its unicode glyph coverage is limited, the old 26 | # X core fonts rendering does not support right-to-left and this being a bitmap 27 | # font, it doesn’t scale on retina/hidpi displays. 28 | 29 | # Use Mouse+$mod to drag floating windows to their wanted position 30 | floating_modifier $mod 31 | 32 | # start a terminal 33 | bindsym $mod+Return exec i3-sensible-terminal 34 | 35 | # kill focused window 36 | bindsym $mod+Shift+c kill 37 | 38 | # start dmenu (a program launcher) 39 | bindsym $mod+p exec rofi -show run 40 | bindsym $mod+o exec rofi -show window 41 | bindsym $mod+w exec sudo netctl switch-to "`netctl list | rofi -dmenu -p network | sed 's/^ *//'`" 42 | bindsym $mod+m exec termite -t pacmixer -e pacmixer 43 | 44 | bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle 45 | bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +10% 46 | bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -10% 47 | bindsym XF86KbdBrightnessUp exec kbd_backlight.rb up 48 | bindsym XF86KbdBrightnessDown exec kbd_backlight.rb down 49 | 50 | # There also is the (new) i3-dmenu-desktop which only displays applications 51 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that 52 | # installed. 53 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 54 | 55 | # change focus 56 | bindsym $mod+h focus left 57 | bindsym $mod+j focus down 58 | bindsym $mod+k focus up 59 | bindsym $mod+l focus right 60 | 61 | # alternatively, you can use the cursor keys: 62 | bindsym $mod+Left focus left 63 | bindsym $mod+Down focus down 64 | bindsym $mod+Up focus up 65 | bindsym $mod+Right focus right 66 | 67 | # move focused window 68 | bindsym $mod+Shift+h move left 69 | bindsym $mod+Shift+j move down 70 | bindsym $mod+Shift+k move up 71 | bindsym $mod+Shift+l move right 72 | 73 | # alternatively, you can use the cursor keys: 74 | bindsym $mod+Shift+Left move left 75 | bindsym $mod+Shift+Down move down 76 | bindsym $mod+Shift+Up move up 77 | bindsym $mod+Shift+Right move right 78 | 79 | # split in horizontal orientation 80 | bindsym $mod+g split h 81 | 82 | # split in vertical orientation 83 | bindsym $mod+v split v 84 | 85 | # enter fullscreen mode for the focused container 86 | bindsym $mod+f fullscreen toggle 87 | 88 | # change container layout (stacked, tabbed, toggle split) 89 | bindsym $mod+s layout stacking 90 | bindsym $mod+t layout tabbed 91 | bindsym $mod+e layout toggle split 92 | 93 | # toggle tiling / floating 94 | bindsym $mod+Shift+space floating toggle 95 | 96 | # change focus between tiling / floating windows 97 | bindsym $mod+space focus mode_toggle 98 | 99 | # focus the parent container 100 | bindsym $mod+a focus parent 101 | 102 | # focus the child container 103 | #bindsym $mod+d focus child 104 | 105 | set $workspace1 "1: shell" 106 | set $workspace2 "2" 107 | set $workspace3 "3: chat" 108 | set $workspace4 "4" 109 | set $workspace5 "5" 110 | set $workspace6 "6" 111 | set $workspace7 "7" 112 | set $workspace8 "8" 113 | set $workspace9 "9: www" 114 | 115 | assign [title="weechat"] $workspace3 116 | assign [class="firefox"] $workspace9 117 | 118 | # switch to workspace 119 | <% [1, 2, 4, 5, 6, 7, 8].each do |ix| %> 120 | bindsym $mod+<%= ix %> workspace $workspace<%= ix %> 121 | <% end %> 122 | 123 | # auto start programs on their respective ws 124 | bindsym $mod+3 exec autostart_weechat.rb 125 | bindsym $mod+9 exec autostart_firefox.rb 126 | 127 | # move focused container to workspace 128 | <% (1..9).each do |ix| %> 129 | bindsym $mod+Shift+<%= ix %> move container to workspace $workspace<%= ix %> 130 | <% end %> 131 | 132 | # reload the configuration file 133 | bindsym $mod+Shift+t reload 134 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 135 | bindsym $mod+Shift+r restart 136 | # exit i3 (logs you out of your X session) 137 | 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'" 138 | 139 | # resize window (you can also use the mouse for that) 140 | mode "resize" { 141 | # These bindings trigger as soon as you enter the resize mode 142 | 143 | # Pressing left will shrink the window’s width. 144 | # Pressing right will grow the window’s width. 145 | # Pressing up will shrink the window’s height. 146 | # Pressing down will grow the window’s height. 147 | bindsym h resize shrink width 10 px or 10 ppt 148 | bindsym j resize grow height 10 px or 10 ppt 149 | bindsym k resize shrink height 10 px or 10 ppt 150 | bindsym l resize grow width 10 px or 10 ppt 151 | 152 | bindsym Shift+h resize shrink width 1 px or 1 ppt 153 | bindsym Shift+j resize grow height 1 px or 1 ppt 154 | bindsym Shift+k resize shrink height 1 px or 1 ppt 155 | bindsym Shift+l resize grow width 1 px or 1 ppt 156 | 157 | 158 | # back to normal: Enter or Escape 159 | bindsym Return mode "default" 160 | bindsym Escape mode "default" 161 | } 162 | 163 | bindsym $mod+r mode "resize" 164 | 165 | # class border backgr. text indicator child_border 166 | client.focused <%= @border_color %> <%= @border_color %> <%= @text_color %> <%= @border_color %> <%= @border_color %> 167 | <%# client.focused_inactive $normal_bg $normal_bg $normal_fg $normal_bg $normal_bg %> 168 | <%# client.unfocused $normal_bg $normal_bg $normal_fg $normal_bg $normal_bg %> 169 | 170 | client.background #ffffff 171 | 172 | for_window [class="^.*"] border pixel 1 173 | for_window [title="pacmixer"] floating enable 174 | hide_edge_borders smart 175 | 176 | for_window [class="[bB]lueberry.*"] floating enable 177 | 178 | exec --no-startup-id polybar bar0 179 | exec --no-startup-id dunst 180 | 181 | -------------------------------------------------------------------------------- /.config/configs/templates/polybar.ini.erb: -------------------------------------------------------------------------------- 1 | [bar/bar0] 2 | width = 100% 3 | height = 24 4 | fixed-center = false 5 | 6 | background = <%= @background %> 7 | foreground = <%= @foreground %> 8 | 9 | underline-size = 0 10 | 11 | border-bottom-size = 1 12 | border-bottom-color = <%= @underline_color %> 13 | 14 | padding-left = 0 15 | padding-right = 0 16 | 17 | module-margin-left = 3 18 | module-margin-right = 0 19 | 20 | font-0 = FantasqueSansMono Nerd Font:style=Regular:pixelsize=12; 2 21 | 22 | modules-left = i3 23 | modules-center = xwindow 24 | modules-right = gmail filesystem cpu cpu_freq cpu_fan memory temperature volume wlan eth battery date xkeyboard 25 | 26 | tray-position = right 27 | tray-padding = 2 28 | 29 | wm-restack = i3 30 | 31 | [module/xwindow] 32 | type = internal/xwindow 33 | label = %title:0:30:...% 34 | 35 | [module/xkeyboard] 36 | type = internal/xkeyboard 37 | blacklist-0 = num lock 38 | 39 | format-prefix = " " 40 | format-prefix-foreground = <%= @misc_color %> 41 | 42 | label-layout = %layout% 43 | 44 | label-indicator-padding = 2 45 | label-indicator-margin = 1 46 | label-indicator-background = <%= @warning_color %> 47 | label-indicator-underline = <%= @warning_color %> 48 | 49 | [module/filesystem] 50 | type = internal/fs 51 | interval = 25 52 | 53 | mount-0 = / 54 | 55 | format-mounted-prefix=" " 56 | format-unmounted-prefix=" " 57 | format-mounted-prefix-foreground = <%= @misc_color %> 58 | format-unmounted-prefix-foreground = <%= @misc_color %> 59 | format-mounted = 60 | format-unmounted = 61 | 62 | label-mounted = %free% 63 | label-unmounted = %mountpoint% not mounted 64 | label-unmounted-foreground = <%= @misc_color %> 65 | 66 | [module/i3] 67 | type = internal/i3 68 | format = 69 | index-sort = true 70 | wrapping-scroll = false 71 | 72 | ws-icon-0 = "1: shell;" 73 | ws-icon-1 = "3: chat; " 74 | ws-icon-2 = "9: www; " 75 | 76 | <%# focused = Active workspace on focused monitor %> 77 | label-focused = %index%: %icon% 78 | label-focused-foreground = <%= @background %> 79 | label-focused-background = <%= @focused_ws %> 80 | label-focused-padding = 1 81 | 82 | <%# unfocused = Inactive workspace on any monitor %> 83 | label-unfocused = %index%: %icon% 84 | label-unfocused-foreground = <%= @misc_color %> 85 | label-unfocused-background = <%= @background %> 86 | label-unfocused-padding = ${self.label-focused-padding} 87 | 88 | <%# visible = Active workspace on unfocused monitor %> 89 | label-visible = %index%: %icon% 90 | label-visible-background = ${self.label-focused-background} 91 | label-visible-padding = ${self.label-focused-padding} 92 | 93 | <%# urgent = Workspace with urgency hint set %> 94 | label-urgent = %index%: %icon% 95 | label-urgent-background = <%= @warning_color %> 96 | label-urgent-padding = ${self.label-focused-padding} 97 | 98 | [module/cpu] 99 | type = internal/cpu 100 | interval = 2 101 | format-prefix = " " 102 | format-prefix-foreground=<%= @cpu_color %> 103 | label = %percentage:2%% 104 | 105 | [module/memory] 106 | type = internal/memory 107 | interval = 2 108 | format-prefix = " " 109 | format-prefix-foreground=<%= @mem_color %> 110 | label = %percentage_used%% 111 | 112 | [module/wlan] 113 | type = internal/network 114 | interface = wlp3s0 115 | interval = 3.0 116 | 117 | format-connected-prefix=" " 118 | format-disconnected-prefix=" " 119 | format-connected-prefix-foreground=<%= @net_color %> 120 | format-disconnected-prefix-foreground=<%= @net_color %> 121 | 122 | format-connected = 123 | label-connected = %essid:0:10:..% 124 | 125 | format-disconnected = down 126 | 127 | ramp-signal-font = 6 128 | ramp-signal-foreground = <%= @net_color %> 129 | <% 10.times do |ix| %> 130 | ramp-signal-<%= ix %> = "<%= ("━" * ix) << "%{F#{@foreground}}" << ("╍" * (9 - ix)) << "%{F-}" %>" 131 | <% end %> 132 | 133 | [module/date] 134 | type = internal/date 135 | interval = 5 136 | 137 | date = 138 | date-alt = " %Y-%m-%d" 139 | 140 | time = %H:%M 141 | time-alt = %H:%M:%S 142 | 143 | label = %date% %time% 144 | 145 | [module/volume] 146 | type = internal/pulseaudio 147 | 148 | format-volume = 149 | format-volume-prefix = " " 150 | format-volume-prefix-foreground=<%= @sound_color %> 151 | label-volume-foreground = ${root.foreground} 152 | 153 | format-muted-prefix = " " 154 | format-muted-prefix-foreground=<%= @sound_color %> 155 | label-muted = sound muted 156 | 157 | bar-volume-width = 10 158 | bar-volume-gradient = false 159 | bar-volume-indicator = ━ 160 | bar-volume-indicator-foreground = <%= @sound_color %> 161 | bar-volume-fill = ━ 162 | bar-volume-fill-foreground = <%= @sound_color %> 163 | bar-volume-empty = ╍ 164 | bar-volume-empty-foreground = <% @foreground %> 165 | 166 | [module/battery] 167 | type = internal/battery 168 | battery = BAT0 169 | adapter = AC 170 | full-at = 98 171 | 172 | format-charging = 173 | 174 | format-discharging = 175 | 176 | format-full-prefix = " " 177 | format-full-prefix-foreground = <%= @misc_color %> 178 | 179 | ramp-capacity-foreground = <%= @misc_color %> 180 | ramp-capacity-0 = " " 181 | ramp-capacity-1 = " " 182 | ramp-capacity-2 = " " 183 | 184 | animation-charging-foreground = <%= @misc_color %> 185 | 186 | animation-charging-0 = " " 187 | animation-charging-1 = " " 188 | animation-charging-2 = " " 189 | animation-charging-3 = " " 190 | animation-charging-framerate = 750 191 | 192 | [module/temperature] 193 | type = internal/temperature 194 | thermal-zone = 0 195 | base-temperature = 30 196 | warn-temperature = 70 197 | 198 | format-prefix-foreground = <%= @cpu_color %> 199 | format-warn-prefix-foreground = <%= @warning_color %> 200 | 201 | ramp-0 =  202 | ramp-1 =  203 | ramp-2 =  204 | ramp-3 =  205 | ramp-4 =  206 | ramp-foreground= <%= @cpu_color %> 207 | 208 | format =