├── .cabal └── config ├── .cgdb └── cgdbrc ├── .common_zshrc ├── .config ├── awesome │ └── rc.lua ├── dwb │ ├── keys │ ├── searchengines │ └── settings └── taffybar │ ├── desktop_taffybar.hs │ ├── taffybar.rc │ ├── work_taffybar.hs │ └── zenbook_taffybar.hs ├── .desktop_xinitrc ├── .desktop_xmobarrc ├── .desktop_zshrc ├── .gitconfig ├── .gitignore ├── .gitignore_global ├── .gitmodules ├── .moc └── config ├── .muttrc.gpg ├── .nixpkgs ├── common.nix ├── desktop_config.nix ├── moc_patches │ ├── moc-r2758+pulse_audio-1.1.patch.gz │ └── moc-r2758+pulse_audio-1.patch.gz ├── mpdas │ └── default.nix ├── vimrc.nix ├── work_config.nix └── zenbook_config.nix ├── .rainbow_config.json ├── .vimperatorrc ├── .vimrc ├── .weechat ├── alias.conf ├── buffers.conf ├── irc.conf.gpg └── weechat.conf ├── .work_xinitrc ├── .work_xmobarrc ├── .work_zshrc ├── .xmonad ├── desktop_xmonad.hs ├── work_xmonad.hs └── zenbook_xmonad.hs ├── .zenbook_xinitrc ├── .zenbook_xmobarrc ├── .zenbook_zshrc ├── .zkbd ├── konsole-:0 └── xterm-:0.0 ├── .zsh ├── MyAntigen.hs └── git-prompt │ ├── LICENSE.md │ ├── README.md │ ├── Setup.hs │ ├── default.nix │ ├── git-prompt.cabal │ ├── git-prompt.nix │ ├── gitstatus.py │ ├── screenshot.png │ ├── src │ ├── BranchParse.hs │ ├── Main.hs │ └── StatusParse.hs │ └── zshrc.sh ├── 2guys.txt ├── README.md ├── myscripts ├── autocpu.sh ├── brightness.sh ├── currentlayout.sh ├── de_reload.sh ├── getcoretemp.sh ├── getmocpinfo.sh ├── getvolume.sh ├── getvpninfo.sh ├── lovemoc │ ├── Keys.hs.gpg │ ├── Main.hs │ ├── Setup.hs │ ├── default.nix │ ├── lovemoc.cabal │ └── project.nix ├── low_battery.sh ├── screen-translate.sh └── wallpaper.sh └── nixconfigs ├── background.png ├── common_configuration.nix ├── desktop_configuration.nix ├── desktop_hardware-configuration.nix ├── literals.nix ├── private.nix.gpg ├── work_configuration.nix ├── work_hardware-configuration.nix ├── zenbook_configuration.nix └── zenbook_hardware-configuration.nix /.cabal/config: -------------------------------------------------------------------------------- 1 | -- This is the configuration file for the 'cabal' command line tool. 2 | 3 | -- The available configuration options are listed below. 4 | -- Some of them have default values listed. 5 | 6 | -- Lines (like this one) beginning with '--' are comments. 7 | -- Be careful with spaces and indentation because they are 8 | -- used to indicate layout for nested sections. 9 | 10 | 11 | remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive 12 | remote-repo-cache: /home/jaga/.cabal/packages 13 | -- local-repo: 14 | -- logs-dir: 15 | world-file: /home/jaga/.cabal/world 16 | -- verbose: 1 17 | -- compiler: ghc 18 | -- with-compiler: 19 | -- with-hc-pkg: 20 | -- scratchdir: 21 | -- program-prefix: 22 | -- program-suffix: 23 | -- library-vanilla: True 24 | -- library-profiling: False 25 | -- shared: 26 | -- executable-dynamic: False 27 | -- executable-profiling: False 28 | -- optimization: True 29 | -- library-for-ghci: False 30 | -- split-objs: False 31 | -- executable-stripping: True 32 | -- user-install: True 33 | -- package-db: 34 | -- flags: 35 | -- extra-include-dirs: 36 | -- extra-lib-dirs: 37 | extra-prog-path: /home/jaga/.cabal/bin 38 | -- tests: False 39 | -- library-coverage: False 40 | -- benchmarks: False 41 | -- cabal-lib-version: 42 | -- constraint: 43 | -- preference: 44 | -- solver: choose 45 | -- documentation: False 46 | -- doc-index-file: $datadir/doc/index.html 47 | -- max-backjumps: 200 48 | -- reorder-goals: False 49 | -- shadow-installed-packages: 50 | -- reinstall: False 51 | -- avoid-reinstalls: False 52 | -- force-reinstalls: False 53 | -- upgrade-dependencies: False 54 | -- root-cmd: 55 | -- symlink-bindir: 56 | build-summary: /home/jaga/.cabal/logs/build.log 57 | -- build-log: 58 | remote-build-reporting: anonymous 59 | -- one-shot: False 60 | jobs: $ncpus 61 | -- username: 62 | -- password: 63 | 64 | install-dirs user 65 | -- prefix: /home/jaga/.cabal 66 | -- bindir: $prefix/bin 67 | -- libdir: $prefix/lib 68 | -- libsubdir: $arch-$os-$compiler/$pkgid 69 | -- libexecdir: $prefix/libexec 70 | -- datadir: $prefix/share 71 | -- datasubdir: $arch-$os-$compiler/$pkgid 72 | -- docdir: $datadir/doc/$arch-$os-$compiler/$pkgid 73 | -- htmldir: $docdir/html 74 | -- haddockdir: $htmldir 75 | -- sysconfdir: $prefix/etc 76 | 77 | install-dirs global 78 | -- prefix: /usr/local 79 | -- bindir: $prefix/bin 80 | -- libdir: $prefix/lib 81 | -- libsubdir: $arch-$os-$compiler/$pkgid 82 | -- libexecdir: $prefix/libexec 83 | -- datadir: $prefix/share 84 | -- datasubdir: $arch-$os-$compiler/$pkgid 85 | -- docdir: $datadir/doc/$arch-$os-$compiler/$pkgid 86 | -- htmldir: $docdir/html 87 | -- haddockdir: $htmldir 88 | -- sysconfdir: $prefix/etc 89 | 90 | program-locations 91 | -- alex-location: 92 | -- ar-location: 93 | -- c2hs-location: 94 | -- cpphs-location: 95 | -- ffihugs-location: 96 | -- gcc-location: 97 | -- ghc-location: 98 | -- ghc-pkg-location: 99 | -- greencard-location: 100 | -- haddock-location: 101 | -- happy-location: 102 | -- hmake-location: 103 | -- hpc-location: 104 | -- hsc2hs-location: 105 | -- hscolour-location: 106 | -- hugs-location: 107 | -- jhc-location: 108 | -- ld-location: 109 | -- lhc-location: 110 | -- lhc-pkg-location: 111 | -- nhc98-location: 112 | -- pkg-config-location: 113 | -- ranlib-location: 114 | -- strip-location: 115 | -- tar-location: 116 | -- uhc-location: 117 | 118 | program-default-options 119 | -- alex-options: 120 | -- ar-options: 121 | -- c2hs-options: 122 | -- cpphs-options: 123 | -- ffihugs-options: 124 | -- gcc-options: 125 | -- ghc-options: 126 | -- ghc-pkg-options: 127 | -- greencard-options: 128 | -- haddock-options: 129 | -- happy-options: 130 | -- hmake-options: 131 | -- hpc-options: 132 | -- hsc2hs-options: 133 | -- hscolour-options: 134 | -- hugs-options: 135 | -- jhc-options: 136 | -- ld-options: 137 | -- lhc-options: 138 | -- lhc-pkg-options: 139 | -- nhc98-options: 140 | -- pkg-config-options: 141 | -- ranlib-options: 142 | -- strip-options: 143 | -- tar-options: 144 | -- uhc-options: 145 | -------------------------------------------------------------------------------- /.cgdb/cgdbrc: -------------------------------------------------------------------------------- 1 | map iinforegisters 2 | map s :setsyntax=asm 3 | map :setwinsplit=top_big 4 | map :setwinsplit=bottom_big 5 | -------------------------------------------------------------------------------- /.common_zshrc: -------------------------------------------------------------------------------- 1 | # Lines configured by zsh-newuser-install 2 | HISTFILE=~/.zhistory 3 | HISTSIZE=999999999 4 | SAVEHIST=$HISTSIZE 5 | bindkey -e 6 | 7 | autoload -U compinit 8 | compinit 9 | zstyle :compinstall filename '/home/jaga/.zshrc' 10 | 11 | zmodload -a zsh/stat stat 12 | zmodload -a zsh/zpty zpty 13 | zmodload -a zsh/zprof zprof 14 | zmodload -ap zsh/mapfile mapfile 15 | 16 | # Completions 17 | zstyle ':completion:*::::' completer _expand _complete _ignored _approximate 18 | zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' 19 | zstyle ':completion:*:expand:*' tag-order all-expansions 20 | zstyle ':completion:*' verbose yes 21 | zstyle ':completion:*:descriptions' format '%B%d%b' 22 | zstyle ':completion:*:messages' format '%d' 23 | zstyle ':completion:*:warnings' format 'No matches for: %d' 24 | zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' 25 | zstyle ':completion:*' group-name '' 26 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 27 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 28 | zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~''*?.old' '*?.pro' 29 | zstyle ':completion:*:functions' ignored-patterns '_*' 30 | 31 | zstyle ':completion:*' menu yes select 32 | 33 | setopt APPEND_HISTORY 34 | 35 | setopt HIST_IGNORE_ALL_DUPS 36 | 37 | setopt HIST_IGNORE_SPACE 38 | 39 | setopt NO_BEEP 40 | 41 | setopt AUTO_CD 42 | 43 | setopt CORRECT_ALL 44 | 45 | #setopt SH_WORD_SPLIT 46 | 47 | setopt histexpiredupsfirst histfindnodups 48 | 49 | setopt histignoredups histnostore histverify histignorespace extended_history share_history 50 | 51 | setopt notify globdots correct pushdtohome cdablevars autolist 52 | setopt correctall autocd recexact longlistjobs 53 | setopt autoresume histignoredups pushdsilent noclobber 54 | setopt autopushd pushdminus extendedglob rcquotes mailwarning 55 | unsetopt bgnice autoparamslash 56 | 57 | setopt IGNORE_EOF 58 | 59 | typeset -U path cdpath fpath manpath 60 | 61 | autoload colors && colors 62 | 63 | zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=$color[cyan]=$color[red]" 64 | 65 | typeset -g -A key 66 | 67 | autoload -U url-quote-magic 68 | zle -N self-insert url-quote-magic 69 | 70 | autoload -U predict-on 71 | zle -N predict-on 72 | zle -N predict-off 73 | bindkey -M emacs "^X^Z" predict-on 74 | bindkey -M emacs "^Z" predict-off 75 | 76 | bindkey -v 77 | 78 | bindkey '^P' up-history 79 | bindkey '^N' down-history 80 | bindkey '^?' backward-delete-char 81 | bindkey '^h' backward-delete-char 82 | bindkey '^w' backward-kill-word 83 | bindkey '^r' history-incremental-search-backward 84 | export KEYTIMEOUT=1 85 | 86 | autoload -U edit-command-line 87 | 88 | zle -N edit-command-line 89 | bindkey -M emacs "^X^E" edit-command-line 90 | 91 | bindkey -M emacs "^N" complete-word 92 | 93 | mkcd(){ mkdir $1; cd $1 } 94 | 95 | rmcd(){ local P="`pwd`"; cd .. && rmdir "$P" || cd "$P"; } 96 | 97 | name() { 98 | name=$1 99 | vared -c -p 'rename to: ' name 100 | command mv $1 $name 101 | } 102 | 103 | extract () { 104 | if [ -f $1 ] ; then 105 | case $1 in 106 | *.tar.bz2) tar xjf $1 ;; 107 | *.tar.gz) tar xzf $1 ;; 108 | *.bz2) bunzip2 $1 ;; 109 | *.rar) unrar x $1 ;; 110 | *.gz) gunzip $1 ;; 111 | *.tar) tar xf $1 ;; 112 | *.tbz2) tar xjf $1 ;; 113 | *.tgz) tar xzf $1 ;; 114 | *.zip) unzip $1 ;; 115 | *.Z) uncompress $1 ;; 116 | *.7z) 7z x $1 ;; 117 | *) echo "Unknown filetype '$1'..." ;; 118 | esac 119 | else 120 | echo "'$1' is not a valid file" 121 | fi 122 | } 123 | 124 | pk () { 125 | if [ $1 ] ; then 126 | case $1 in 127 | tbz) tar cjvf $2.tar.bz2 $2 ;; 128 | tgz) tar czvf $2.tar.gz $2 ;; 129 | tar) tar cpvf $2.tar $2 ;; 130 | bz2) bzip2 $2 ;; 131 | gz) gzip -c -9 -n $2 > $2.gz ;; 132 | zip) zip -r $2.zip $2 ;; 133 | 7z) 7z a $2.7z $2 ;; 134 | *) echo "'$1' cannot be packed via pk()" ;; 135 | esac 136 | else 137 | echo "'$1' is not a valid file" 138 | fi 139 | } 140 | 141 | READNULLCMD=${PAGER} 142 | 143 | export GREP_COLOR="1;33" 144 | 145 | [[ -x $(whence -p most) ]] && export PAGER=$(whence -p most) 146 | 147 | export EDITOR=vim 148 | 149 | autoload zkbd 150 | [[ ! -f ${ZDOTDIR:-$HOME}/.zkbd/xterm-:0.0 ]] && zkbd 151 | source ${ZDOTDIR:-$HOME}/.zkbd/xterm-:0.0 152 | 153 | [[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line 154 | [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line 155 | [[ -n ${key[Insert]} ]] && bindkey "${key[Insert]}" overwrite-mode 156 | [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char 157 | [[ -n ${key[Backspace]} ]] && bindkey "${key[Backspace]}" backward-delete-char 158 | [[ -n ${key[PageUp]} ]] && bindkey "${key[PageUp]}" up-line-or-history 159 | [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char 160 | [[ -n ${key[PageDown]} ]] && bindkey "${key[PageDown]}" down-line-or-history 161 | [[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char 162 | [[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char 163 | #[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search 164 | #[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search 165 | autoload -U up-line-or-beginning-search 166 | autoload -U down-line-or-beginning-search 167 | zle -N up-line-or-beginning-search 168 | zle -N down-line-or-beginning-search 169 | bindkey "^[[A" up-line-or-beginning-search # Up 170 | bindkey "^[[B" down-line-or-beginning-search # Down 171 | bindkey '\e[3~' delete-char # del 172 | bindkey ';5D' backward-word # ctrl+left 173 | bindkey ';5C' forward-word #ctrl+right 174 | 175 | PATH=$PATH:~/.cabal/bin:~/.cabal-dev/bin; 176 | export PATH; 177 | 178 | export OOO_FORCE_DESKTOP=gnome 179 | 180 | export LESSCHARSET=UTF-8 181 | 182 | export LS_COLORS='no=00;37:fi=00;37:di=01;36:ln=04;36:pi=33:so=01;35:do=01;35:bd=33;01:cd=33;01:or=31;01:su=37:sg=30:tw=30:ow=34:st=37:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.btm=01;31:*.sh=01;31:*.run=01;31:*.tar=33:*.tgz=33:*.arj=33:*.taz=33:*.lzh=33:*.zip=33:*.z=33:*.Z=33:*.gz=33:*.bz2=33:*.deb=33:*.rpm=33:*.jar=33:*.rar=33:*.jpg=32:*.jpeg=32:*.gif=32:*.bmp=32:*.pbm=32:*.pgm=32:*.ppm=32:*.tga=32:*.xbm=32:*.xpm=32:*.tif=32:*.tiff=32:*.png=32:*.mov=34:*.mpg=34:*.mpeg=34:*.avi=34:*.fli=34:*.flv=34:*.3gp=34:*.mp4=34:*.divx=34:*.gl=32:*.dl=32:*.xcf=32:*.xwd=32:*.flac=35:*.mp3=35:*.mpc=35:*.ogg=35:*.wav=35:*.m3u=35:'; 183 | zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 184 | 185 | alias grep='grep --color=auto' 186 | 187 | alias df='df -h' 188 | alias du='du -h' 189 | 190 | alias mv='nocorrect mv -i' 191 | 192 | alias cp='nocorrect cp -iR' 193 | 194 | alias rm='nocorrect rm -i' 195 | 196 | alias rmf='nocorrect rm -f' 197 | 198 | alias rmrf='nocorrect rm -fR' 199 | 200 | alias mkdir='nocorrect mkdir' 201 | 202 | alias ls='ls -lhF --color=auto' 203 | 204 | [[ -f /usr/bin/grc ]] && { 205 | alias ping="grc --colour=auto ping" 206 | alias traceroute="grc --colour=auto traceroute" 207 | alias make="grc --colour=auto make" 208 | alias diff="grc --colour=auto diff" 209 | alias cvs="grc --colour=auto cvs" 210 | alias netstat="grc --colour=auto netstat" 211 | } 212 | 213 | alias logc="grc cat" 214 | alias logt="grc tail" 215 | alias logh="grc head" 216 | 217 | alias -s {png,gif,jpg,jpeg}=mirage 218 | alias -s {pdf,djvu}=evince 219 | 220 | autoload -U pick-web-browser 221 | alias -s {html,htm}=pick-web-browser 222 | 223 | alias -g H="| head" 224 | alias -g T="| tail" 225 | alias -g G="| grep" 226 | alias -g L="| less" 227 | alias -g M="| most" 228 | alias -g B="&|" 229 | alias -g HL="--help" 230 | alias -g LL="2>&1 | less" 231 | alias -g CA="2>&1 | cat -A" 232 | alias -g NE="2> /dev/null" 233 | alias -g NUL="> /dev/null 2>&1" 234 | 235 | 236 | # 237 | # sudo 238 | alias halt="sudo halt" 239 | alias reboot="sudo reboot" 240 | alias gparted="sudo gparted" 241 | 242 | alias dirf='find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"' 243 | 244 | alias psgrep='ps aux | grep $(echo $1 | sed "s/^\(.\)/[\1]/g")' 245 | 246 | alias delspacecomm="sed '/ *#/d; /^ *$/d' $1" 247 | source ~/.zsh/git-prompt/zshrc.sh 248 | GIT_PROMPT_EXECUTABLE="haskell" 249 | 250 | PROMPT=$'\n%{\e[1;31m%}⎧%{\e[1;37m%}%~ \n%{\e[1;31m%}⎩%{\e[1;32m%}%n %{\e[1;36m%}「%?」' 251 | #if [[ $PWD == $HOME ]]; then 252 | PROMPT+=$' $(git_super_status)' 253 | curshel=$(ps -ocommand= -p $PPID | awk -F/ '{print $NF}' | awk '{print $1}') 254 | if [[ $curshel == "rc" ]]; then 255 | PROMPT+=$' NIX-SHELL' 256 | fi 257 | 258 | if [[ $EUID == 0 ]] 259 | then 260 | PROMPT+=$' #%{\e[0m%} ' # user dir % 261 | else 262 | PROMPT+=$' %#%{\e[0m%} ' # root dir # 263 | fi 264 | RPROMPT=$'%{\e[1;36m%}{%D{%H:%M:%S}}%{\e[0m' 265 | function zle-line-init zle-keymap-select { 266 | RPROMPT="${${KEYMAP/vicmd/%{$fg_bold[red]%\}༽}/(main|viins)/%{$fg_bold[blue]%\}༼}%{$reset_color%}" 267 | RPROMPT+=$'%{\e[1;36m%}᚜%D{%H:%M:%S}᚛%{\e[0m' 268 | zle reset-prompt 269 | } 270 | zle -N zle-line-init 271 | zle -N zle-keymap-select 272 | 273 | alias ls='ls -F --color=auto' 274 | alias l='ls -lhF --group-directories-first --color=auto' 275 | alias grep='grep --colour=auto' 276 | 277 | 278 | alias h='htop' 279 | alias n='sudo nethogs' 280 | alias io='sudo iotop' 281 | alias editawesome='vim /etc/xdg/awesome/rc.lua' 282 | alias screenshot='sleep 10;import -window root myscreen.png' 283 | alias pacman='sudo pacman' 284 | alias open='xdg-open' 285 | alias connect='sudo netcfg -r Jaga-Jaga' 286 | alias showdisk='sudo fdisk -l' 287 | alias cp='cp' 288 | alias :q='exit' 289 | alias update='sudo bash -c "NIX_PATH=$NIX_PATH nixos-rebuild switch --upgrade"; nix-env -u --leq' #WTF 290 | 291 | 292 | unsetopt correct_all ignoreeof 293 | zstyle ':completion:*:processes' command 'ps -au$USER' 294 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32' 295 | export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' 296 | cat 2guys.txt 297 | alias show_random_file_or_directory='ls | sed -n "$((RANDOM%$(ls | wc -l)+1))p"' 298 | alias vim='vim -p' 299 | 300 | toBackup() {cp "$1" "$1.backup"} 301 | fromBackup() {cp "$1.backup" "$1"} 302 | swapBackup() {cp "$1" "$1.backup.temp"; cp "$1.backup" "$1"; mv -f "$1.backup.temp" "$1.backup"} 303 | alias getstats="cat ~/.zhistory | grep -E '^:\s([0-9]+):([0-9]+);([a-zA-Z]+)(.*)' | sed -r -e 's/^: ([0-9]+):0;([a-zA-Z]+)(.*)/\2/g' | sort | uniq -c | sort -n" 304 | export NIXPKGS_ALL=/home/jaga/nixpkgs 305 | query(){ nix-env -qa \* -P -f $NIXPKGS_ALL | grep -i "$1"; } 306 | export TERM=xterm-256color 307 | alias nix-zsh="nix-shell --command zsh" 308 | 309 | function ghc-pkg-clean() { 310 | for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` 311 | do 312 | echo unregistering $p; ghc-pkg $* unregister $p 313 | done 314 | } 315 | export FPATH=.nix-profile/share/zsh/site-functions:~/.zsh/functions:$FPATH 316 | 317 | function calc() { 318 | echo "$@" | octave -q --silent 319 | } 320 | 321 | countFiles () { 322 | # call the recursive function, throw away stdout and send stderr to stdout 323 | # then sort numerically 324 | countFiles_rec "$1" 2>&1 >/dev/null | sort -nr 325 | } 326 | 327 | countFiles_rec () { 328 | local -i nfiles 329 | dir="$1" 330 | 331 | # count the number of files in this directory only 332 | nfiles=$(find "$dir" -mindepth 1 -maxdepth 1 -type f -print | wc -l) 333 | 334 | # loop over the subdirectories of this directory 335 | while IFS= read -r subdir; do 336 | 337 | # invoke the recursive function for each one 338 | # save the output in the positional parameters 339 | set -- $(countFiles_rec "$subdir") 340 | 341 | # accumulate the number of files found under the subdirectory 342 | (( nfiles += $1 )) 343 | 344 | done < <(find "$dir" -mindepth 1 -maxdepth 1 -type d -print) 345 | 346 | # print the number of files here, to both stdout and stderr 347 | printf "%d %s\n" $nfiles "$dir" | tee /dev/stderr 348 | } 349 | 350 | unset SSH_ASKPASS 351 | setopt interactivecomments 352 | alias tmux='tmux attach || tmux new' 353 | ssh-add ~/.ssh/git_rsa 2>/dev/null 354 | alias bump='git commit -am "bump" -S' 355 | 356 | fpath=(~/nix-zsh-completions $fpath) 357 | source ~/nix-zsh-completions/nix.plugin.zsh 358 | autoload -U compinit && compinit 359 | NIX_GHC_VERSION=$(ghc --numeric-version) 360 | export NIX_GHC="$HOME/.nix-profile/bin/ghc" 361 | export NIX_GHCPKG="$HOME/.nix-profile/bin/ghc-pkg" 362 | export NIX_GHC_DOCDIR="$HOME/.nix-profile/share/doc/ghc/html" 363 | export NIX_GHC_LIBDIR="$HOME/.nix-profile/lib/ghc-${NIX_GHC_VERSION}" 364 | alias xclip='xclip -selection clipboard' 365 | alias weather="curl -4 http://wttr\.in/Saint-Petersburg" 366 | source ~/.zsh/antigen-hs/init.zsh 367 | -------------------------------------------------------------------------------- /.config/dwb/keys: -------------------------------------------------------------------------------- 1 | [default] 2 | allow_cookie= CC 3 | allow_session_cookie= CS 4 | allow_session_cookie_tmp= CT 5 | backopen= xo 6 | backopen_url= xO 7 | bookmark= M 8 | bookmarks= gb 9 | buffers= gt 10 | cancel_download= ad 11 | clear_tab= gc 12 | close_tab= d 13 | command_mode= : 14 | complete_bookmarks=Control B 15 | complete_history=Control H 16 | complete_path=Control p 17 | complete_searchengines=Control S 18 | complete_userscript=Control U 19 | download= gd 20 | download_set_execute=Control x 21 | dump= 22 | entry_confirm=Control g 23 | entry_delete_letter=Control h 24 | entry_delete_line=Control u 25 | entry_delete_line_end=Control e 26 | entry_delete_word=Control w 27 | entry_delete_word_forward=Control e 28 | entry_escape=Control c 29 | entry_history_back=Control k 30 | entry_history_forward=Control j 31 | entry_word_back=Control b 32 | entry_word_forward=Control f 33 | eval= 34 | execute_javascript= 35 | execute_userscript= eu 36 | find_backward= ? 37 | find_backward_ic= c? 38 | find_forward= / 39 | find_forward_ic= c/ 40 | find_next= n 41 | find_previous= N 42 | focus_input= gi 43 | focus_next= J 44 | focus_prev= K 45 | focus_tab= T 46 | fullscreen= @F11@ 47 | hints= f 48 | hints_background= ;b 49 | hints_clipboard= ;y 50 | hints_download= ;d 51 | hints_editable= ;e 52 | hints_images= ;i 53 | hints_images_background= ;Ib 54 | hints_images_tab= ;It 55 | hints_links= ;; 56 | hints_primary= ;Y 57 | hints_rapid= ;r 58 | hints_rapid_win= ;R 59 | hints_tab= F 60 | hints_url= ;o 61 | hints_url_background= ;Ob 62 | hints_url_tab= ;Ot 63 | hints_win= wf 64 | history_back= H 65 | history_forward= L 66 | insert_mode= i 67 | load_html= 68 | load_html_tab= 69 | local_set= 70 | lock_domain= xd 71 | lock_uri= xu 72 | new_tab=Control T 73 | new_win= W 74 | normal_mode=Control n 75 | only= co 76 | open= o 77 | open_editor=Control e 78 | open_url= go 79 | paste= pp 80 | paste_primary= pP 81 | presentation_mode= @F12@ 82 | print=Control Mod1 p 83 | print_preview= 84 | protect=Control P 85 | proxy=Control p 86 | quickmark= b 87 | quit=Control q 88 | reload= r 89 | reload_bookmarks= 90 | reload_bypass_cache= R 91 | reload_quickmarks= 92 | reload_userscripts= 93 | sanitize= 94 | save= sf 95 | save_named_session= gZZ 96 | save_quickmark= m 97 | save_search_field= gs 98 | save_session= ZZ 99 | scroll_bottom= G 100 | scroll_down= j 101 | scroll_halfpage_down=Control d 102 | scroll_halfpage_up=Control u 103 | scroll_left= h 104 | scroll_page_down=Control f 105 | scroll_page_up=Control b 106 | scroll_right= l 107 | scroll_top= gg 108 | scroll_up= k 109 | set= 110 | set_key= sk 111 | set_local_setting= sl 112 | set_setting= ss 113 | show_bookmarks= Sb 114 | show_downloads= Sd 115 | show_history= Sh 116 | show_keys= Sk 117 | show_quickmarks= Sq 118 | show_settings= Ss 119 | start_page=Control h 120 | stop_loading=Control s 121 | tab_bookmarks= gB 122 | tab_hist_back= th 123 | tab_hist_forward= tl 124 | tab_move= gm 125 | tab_move_left= gl 126 | tab_move_right= gr 127 | tab_new= ga 128 | tab_paste= Pp 129 | tab_paste_primary= PP 130 | tab_quickmark= B 131 | tabdo= 132 | tabopen= O 133 | tabopen_url= gO 134 | toggle_bars= xx 135 | toggle_hidden_files= g. 136 | toggle_local_setting= 137 | toggle_plugins_host= ph 138 | toggle_plugins_host_tmp= pth 139 | toggle_plugins_uri= pu 140 | toggle_plugins_uri_tmp= ptu 141 | toggle_scripts_host= tsh 142 | toggle_scripts_host_tmp= tth 143 | toggle_scripts_uri= tsu 144 | toggle_scripts_uri_tmp= ttu 145 | toggle_setting= 146 | toggle_statusbar= xb 147 | toggle_tab=Control @Tab@ 148 | toggle_tabbar= xt 149 | undo= u 150 | view_source= gf 151 | visible= xv 152 | web_inspector= wi 153 | win_bookmarks= wB 154 | win_hist_back= wh 155 | win_hist_forward= wl 156 | win_paste= wp 157 | win_paste_primary= wP 158 | win_quickmark= wb 159 | winopen= wo 160 | winopen_url= wO 161 | yank= yy 162 | yank_primary= yY 163 | yank_title= yt 164 | yank_title_primary= yT 165 | zoom= = 166 | zoom_in= + 167 | zoom_out= - 168 | adblock_reload_rules= 169 | entry_delete_active=Control d 170 | hints_selector= 171 | jump= ` 172 | mark= ' 173 | repeat= . 174 | tabgrep= 175 | visual_mode= v 176 | reload_searchengines= 177 | restart= 178 | -------------------------------------------------------------------------------- /.config/dwb/searchengines: -------------------------------------------------------------------------------- 1 | glg https://www.google.com/search?newwindow=1&output=search&sclient=psy-ab&q=_dwb_search_submit_&oq=&gs_l=&pbx=1 2 | -------------------------------------------------------------------------------- /.config/dwb/settings: -------------------------------------------------------------------------------- 1 | [default] 2 | javascript-can-access-clipboard=false 3 | complete-userscripts=true 4 | file-sync-interval=120 5 | download-gradient-end=#00aa00 6 | status-allowed-color=#00ff00 7 | tab-number-color=#7ac5cd 8 | enable-default-context-menu=true 9 | editable=false 10 | background-tabs=true 11 | enable-webgl=false 12 | minimum-logical-font-size=5 13 | enable-page-cache=true 14 | cache-model=webbrowser 15 | sans-serif-font-family=sans-serif 16 | prompt-color=#00ff00 17 | complete-searchengines=true 18 | update-search-delay=20 19 | fantasy-font-family=serif 20 | hint-fg-color=#000000 21 | sync-files=all 22 | default-height=600 23 | scrollbars=false 24 | hint-bg-color=#ffffff 25 | show-single-tab=true 26 | private-color=#505050 27 | enable-developer-extras=false 28 | complete-bookmarks=true 29 | zoom-level=1.00 30 | download-use-external-program=false 31 | enable-xss-auditor=true 32 | custom-encoding= 33 | print-previewer= 34 | normal-completion-fg-color=#eeeeee 35 | close-tab-focus-policy=left 36 | enable-dns-prefetching=false 37 | new-tab-position-policy=right 38 | auto-shrink-images=true 39 | print-backgrounds=true 40 | enable-caret-browsing=false 41 | enable-scripts=true 42 | adblocker-filterlist=/home/jaga/.config/dwb/adblock_lists 43 | proxy=true 44 | user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.1944.0 Safari/537.36 45 | full-content-zoom=false 46 | editor=gvim 47 | enable-accelerated-compositing=false 48 | hsts=false 49 | enable-private-browsing=false 50 | enable-favicon=true 51 | hint-active-color=#00ff00 52 | resizable-text-areas=true 53 | javascript-schemes=true 54 | load-on-focus=false 55 | download-gradient-start=#0000aa 56 | hint-normal-color=#ffff99 57 | spell-checking-languages=ru,en 58 | cookies-accept-policy=always 59 | font-nofocus= 60 | status-blocked-color=#ffffff 61 | download-fg-color=#ffffff 62 | enable-plugins=true 63 | enable-frame-flattening=false 64 | ssl-use-system-ca-file=true 65 | cookies-store-policy=persistent 66 | bars-padding=0 67 | active-completion-fg-color=#53868b 68 | hint-font=14px monospace 69 | progress-bar-full-color=#ffffff 70 | tabbed-browsing=true 71 | hint-highlight-links=false 72 | active-completion-bg-color=#000000 73 | enable-spell-checking=true 74 | font-hidden-statusbar=normal 10px helvetica 75 | tab-normal-fg-color-2=#dddddd 76 | tab-normal-fg-color-1=#cccccc 77 | default-monospace-font-size=10 78 | save-session=true 79 | tabbar-visible=2.00 80 | auto-insert-mode=true 81 | tab-normal-bg-color-2=#707070 82 | tab-normal-bg-color-1=#505050 83 | serif-font-family=serif 84 | accept-language= 85 | enable-html5-local-storage=true 86 | tab-protected-color=#ff0000 87 | hint-letter-seq=FDSARTGBVECWXQYIOPMNHZULKJ 88 | progress-bar-style=simple 89 | use-ntlm=false 90 | passthrough-keys=webkit 91 | enable-html5-database=true 92 | hint-autofollow=true 93 | enable-dom-paste=false 94 | javascript-can-open-windows-automatically=true 95 | max-visible-completions=11 96 | hint-border=1px solid #000000 97 | widget-packing=twsd 98 | ssl-trusted-color=#00ff00 99 | enable-java-applet=true 100 | hints-key-lock=250 101 | navigation-history-max=500 102 | hint-style=letter 103 | enable-site-specific-quirks=false 104 | auto-resize-window=true 105 | zoom-step=0.10 106 | default-font-family=sans-serif 107 | ssl-untrusted-color=#ff0000 108 | plugin-blocker=true 109 | startpage=dwb:bookmarks 110 | normal-completion-bg-color=#151515 111 | cursive-font-family=serif 112 | default-encoding= 113 | error-color=#ff0000 114 | searchengine-submit-pattern= 115 | hint-opacity=1.00 116 | font-entry= 117 | proxy-url= 118 | font=monospace 9 119 | monospace-font-family=monospace 120 | addressbar-dns-lookup=true 121 | enable-universal-access-from-file-uris=true 122 | background-color=#000000 123 | do-not-track=true 124 | progress-bar-empty-color=#ffffff 125 | default-width=800 126 | single-instance=true 127 | auto-completion=true 128 | minimum-font-size=5 129 | font-completion= 130 | enable-spatial-navigation=false 131 | download-directory=~/Downloads 132 | adblocker=true 133 | download-external-command=curl 134 | user-stylesheet-uri= 135 | auto-load-images=true 136 | tab-active-fg-color=#ffffff 137 | history-length=5000 138 | tab-active-bg-color=#009600 139 | download-bg-color=#000000 140 | download-no-confirm=true 141 | enable-file-access-from-file-uris=true 142 | complete-history=true 143 | tab-key-cycles-through-elements=true 144 | enforce-96-dpi=false 145 | ssl-strict=true 146 | scroll-step=0.00 147 | close-last-tab-policy=ignore 148 | foreground-color=#ffffff 149 | message-delay=2 150 | scheme-handler= 151 | default-font-size=12 152 | enable-offline-web-application-cache=true 153 | hint-offset-top=0 154 | javascript-api=automatic 155 | mouse-cycles-through-tabs=true 156 | adblocker-element-hider=true 157 | enable-ipc=true 158 | maximum-tabs=0 159 | cookie-expiration=0 160 | block-insecure-content=true 161 | hint-offset-left=0 162 | tabbar-height=0 163 | statusbar-height=0 164 | favicon-size=0 165 | tab-orientation=horizontal 166 | tab-width=100 167 | langmap= 168 | tls-database= 169 | -------------------------------------------------------------------------------- /.config/taffybar/desktop_taffybar.hs: -------------------------------------------------------------------------------- 1 | import System.Taffybar 2 | 3 | {-import System.Taffybar.FreedesktopNotifications-} 4 | import System.Taffybar.CommandRunner 5 | import System.Taffybar.NetMonitor 6 | import System.Taffybar.Pager 7 | import System.Taffybar.SimpleClock 8 | import System.Taffybar.Systray 9 | import System.Taffybar.Weather 10 | import System.Taffybar.WorkspaceSwitcher 11 | 12 | import System.Taffybar.Widgets.PollingBar 13 | import System.Taffybar.Widgets.PollingGraph 14 | 15 | import System.Environment 16 | import System.Information.CPU2 17 | import System.Information.DiskIO 18 | import System.Information.Memory 19 | 20 | import Graphics.UI.Gtk 21 | 22 | import Data.List 23 | 24 | 25 | memCallback :: IO Double 26 | memCallback = do 27 | mi <- parseMeminfo 28 | return $ memoryUsedRatio mi 29 | 30 | tempCallback :: Fractional b => [String] -> IO b 31 | tempCallback cpu = do 32 | [a] <- getCPUTemp cpu 33 | return $ (fromIntegral a) / 100.0 34 | 35 | mySep :: PagerConfig -> IO Label 36 | mySep cfg = do 37 | sep <- labelNew (Nothing :: Maybe String) 38 | labelSetMarkup sep (widgetSep cfg) 39 | return $ sep 40 | 41 | diskIOCallback :: String -> String -> IO [Double] 42 | diskIOCallback disk1 disk2 = do 43 | a <- getDiskTransfer disk1 44 | b <- getDiskTransfer disk2 45 | return $ a ++ b 46 | 47 | colorOrange :: String 48 | colorOrange = "#C98F0A" 49 | 50 | colorLightGreen :: String 51 | colorLightGreen = "#429942" 52 | 53 | myTaffy :: PagerConfig 54 | myTaffy = defaultPagerConfig { 55 | activeWorkspace = colorize colorLightGreen "" .wrap "⎨" "⎬" . escape 56 | , hiddenWorkspace = colorize colorOrange "" . escape 57 | , emptyWorkspace = colorize "#003347" "" . escape 58 | , urgentWorkspace = colorize "#FFFF00" "" . wrap "[" "]" . escape 59 | , activeLayout = colorize "#003347" "" . escape 60 | , widgetSep = colorize colorLightGreen "" " | " 61 | } 62 | 63 | colorFunc :: (Num t, Num t1) => t -> (t, t, t1) 64 | colorFunc pct = (pct, 1 - pct, 0) 65 | 66 | colorFuncTemp :: (Fractional a, Num t, Ord a) => a -> (a, a, t) 67 | colorFuncTemp pct 68 | | pct <= 0.55 = (0, 1 - pct, 0) 69 | | pct < 0.70 = (pct, 1 - pct, 0) 70 | | pct < 1 = (pct, 0, 0) 71 | | otherwise = (1, 1, 1) 72 | 73 | separator :: IO Widget 74 | separator = do 75 | sp2 <- mySep myTaffy 76 | box <- hBoxNew False 0 77 | boxPackStart box sp2 PackNatural 0 78 | widgetShowAll box 79 | return (toWidget box) 80 | 81 | simpleText :: String -> String -> IO Widget 82 | simpleText text' color = do 83 | let text = colorize color "" text' 84 | sep <- labelNew (Nothing :: Maybe String) 85 | labelSetMarkup sep text 86 | box <- hBoxNew False 0 87 | boxPackStart box sep PackNatural 0 88 | widgetShowAll box 89 | return (toWidget box) 90 | 91 | {- 92 | TODO (to implement) 93 | cpu freq, moc song, keyboard layout, swap, uptime, essid, locks... 94 | https://github.com/jaor/xmobar/tree/master/src/Plugins 95 | -} 96 | 97 | main :: IO () 98 | main = do 99 | args <- init <$> words <$> unlines <$> getArgs 100 | let x = case args of 101 | ["-x", a] -> read a :: Int 102 | _ -> 0 103 | pager <- pagerNew myTaffy 104 | let 105 | wss = wspaceSwitcherNew pager 106 | cpuCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1) 107 | , (1, 0, 1, 0.9) 108 | , (0, 0, 1, 0.9) 109 | ] 110 | , graphWidth = 35 111 | , graphLabel = Nothing 112 | } 113 | ioCfg = defaultGraphConfig { graphDataColors = [ (0.3, 1, 0.3, 1) 114 | , (0.6, 1, 0.6, 1) 115 | , (0.3, 0.3, 1, 0.7) 116 | , (0.6, 0.6, 1, 0.7) 117 | ] 118 | , graphWidth = 35 119 | , graphLabel = Nothing 120 | } 121 | clock = textClockNew Nothing "%a %b %d %H:%M:%S" 1 122 | netMonitor = netMonitorNewWith 2.0 "wlp3s0" 0 $ colorize colorOrange "" "WiFi: ⇣" ++ colorize colorLightGreen "" "$inKB$" ++ colorize colorOrange "" " : ⇡" ++ colorize colorLightGreen "" "$outKB$" 123 | wea = weatherNew (defaultWeatherConfig "ULLI") { weatherTemplate = "$tempC$°C" } 100 124 | iohdd = pollingGraphNew ioCfg 1 (diskIOCallback "sdd" "md127") 125 | mem = pollingBarNew (defaultBarConfig colorFunc) {barWidth = 10} 3 memCallback 126 | ---TODO notification note = notifyAreaNew defaultNotificationConfig 127 | cpuText = simpleText "Cpu"colorOrange 128 | diskText = simpleText "IO »"colorOrange 129 | ramText = simpleText "Ram"colorOrange 130 | cpu = pollingGraphNew cpuCfg 0.5 $ getCPULoad "cpu" 131 | temp = pollingBarNew (defaultBarConfig colorFuncTemp) {barWidth = 10} 2 $ tempCallback ["cpu0"] 132 | tray = systrayNew 133 | mocp = commandRunnerNew 1 "/home/jaga/myscripts/getmocpinfo.sh" [] "Moc: OFF" "#FFFFFF" 134 | layout = commandRunnerNew 2 "/home/jaga/myscripts/currentlayout.sh" [] "No xkblayout-state" colorOrange 135 | vpn = commandRunnerNew 20 "/home/jaga/myscripts/getvpninfo.sh" [] "" colorOrange 136 | defaultTaffybar defaultTaffybarConfig { startWidgets = [ wss ] 137 | , endWidgets = intercalate [separator] [ 138 | [clock], [tray], [wea], [mem, 139 | ramText], [temp, cpu, cpuText], 140 | [iohdd, diskText], [netMonitor], 141 | [vpn, layout], [mocp] ] 142 | , widgetSpacing = 5 143 | , barHeight = 23 144 | , monitorNumber = x 145 | } 146 | -------------------------------------------------------------------------------- /.config/taffybar/taffybar.rc: -------------------------------------------------------------------------------- 1 | style "default" { 2 | bg[NORMAL] = "#000000" 3 | fg[NORMAL] = "#333355" 4 | text[NORMAL] = "#333355" 5 | } 6 | 7 | style "notification-button" = "default" { 8 | text[NORMAL] = "#FF0000" 9 | fg[NORMAL] = "#FF0000" 10 | } 11 | 12 | widget "Taffybar*" style "default" 13 | widget "*NotificationCloseButton" style "notification-button" 14 | gtk-font-name = "Terminus 11" 15 | -------------------------------------------------------------------------------- /.config/taffybar/work_taffybar.hs: -------------------------------------------------------------------------------- 1 | import System.Taffybar 2 | 3 | {-import System.Taffybar.FreedesktopNotifications-} 4 | import System.Taffybar.NetMonitor 5 | import System.Taffybar.Pager 6 | import System.Taffybar.SimpleClock 7 | import System.Taffybar.Systray 8 | import System.Taffybar.TaffyPager 9 | import System.Taffybar.Weather 10 | import System.Taffybar.CommandRunner 11 | 12 | import System.Taffybar.Widgets.PollingBar 13 | import System.Taffybar.Widgets.PollingGraph 14 | 15 | import System.Information.CPU2 16 | import System.Information.DiskIO 17 | import System.Information.Memory 18 | import System.Environment 19 | 20 | import Graphics.UI.Gtk 21 | 22 | import Data.List 23 | 24 | import Control.Applicative 25 | 26 | import Debug.Trace 27 | 28 | memCallback :: IO Double 29 | memCallback = do 30 | mi <- parseMeminfo 31 | return $ memoryUsedRatio mi 32 | 33 | tempCallback :: Fractional b => [String] -> IO b 34 | tempCallback cpu = do 35 | [a] <- getCPUTemp cpu 36 | return $ (fromIntegral a) / 100.0 37 | 38 | mySep :: PagerConfig -> IO Label 39 | mySep cfg = do 40 | sep <- labelNew (Nothing :: Maybe String) 41 | labelSetMarkup sep (widgetSep cfg) 42 | return $ sep 43 | 44 | diskIOCallback :: String -> String -> IO [Double] 45 | diskIOCallback disk1 disk2 = do 46 | a <- getDiskTransfer disk1 47 | b <- getDiskTransfer disk2 48 | return $ a ++ b 49 | 50 | colorOrange :: String 51 | colorOrange = "#C98F0A" 52 | 53 | colorLightGreen :: String 54 | colorLightGreen = "#429942" 55 | 56 | myTaffy :: PagerConfig 57 | myTaffy = defaultPagerConfig { 58 | activeWorkspace = colorize colorLightGreen "" .wrap "⎨" "⎬" . escape 59 | , hiddenWorkspace = colorize colorOrange "" . escape 60 | , emptyWorkspace = colorize "#003347" "" . escape 61 | , urgentWorkspace = colorize "#FFFF00" "" . wrap "[" "]" . escape 62 | , activeLayout = colorize "#003347" "" . escape 63 | , widgetSep = colorize colorLightGreen "" " | " 64 | } 65 | 66 | colorFunc :: (Num t, Num t1) => t -> (t, t, t1) 67 | colorFunc pct = (pct, 1 - pct, 0) 68 | 69 | colorFuncTemp :: (Fractional a, Num t, Ord a) => a -> (a, a, t) 70 | colorFuncTemp pct 71 | | pct <= 0.55 = (0, 1 - pct, 0) 72 | | pct < 0.70 = (pct, 1 - pct, 0) 73 | | pct < 1 = (pct, 0, 0) 74 | | otherwise = (1, 1, 1) 75 | 76 | separator :: IO Widget 77 | separator = do 78 | sp2 <- mySep myTaffy 79 | box <- hBoxNew False 0 80 | boxPackStart box sp2 PackNatural 0 81 | widgetShowAll box 82 | return (toWidget box) 83 | 84 | simpleText :: String -> String -> IO Widget 85 | simpleText text' color = do 86 | let text = colorize color "" text' 87 | sep <- labelNew (Nothing :: Maybe String) 88 | labelSetMarkup sep text 89 | box <- hBoxNew False 0 90 | boxPackStart box sep PackNatural 0 91 | widgetShowAll box 92 | return (toWidget box) 93 | 94 | {- 95 | TODO (to implement) 96 | cpu freq, moc song, keyboard layout, swap, uptime, essid, locks... 97 | https://github.com/jaor/xmobar/tree/master/src/Plugins 98 | -} 99 | 100 | main :: IO () 101 | main = do 102 | args <- init <$> words <$> unlines <$> getArgs 103 | let x = case args of 104 | ["-x", a] -> read a :: Int 105 | _ -> 0 106 | traceShow x $ return () 107 | let pager = taffyPagerNew myTaffy 108 | cpuCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1) 109 | , (1, 0, 1, 0.9) 110 | , (0, 0, 1, 0.9) 111 | ] 112 | , graphWidth = 35 113 | , graphLabel = Nothing 114 | } 115 | ioCfg = defaultGraphConfig { graphDataColors = [ (0.3, 1, 0.3, 1) 116 | , (0.6, 1, 0.6, 1) 117 | , (0.3, 0.3, 1, 0.7) 118 | , (0.6, 0.6, 1, 0.7) 119 | ] 120 | , graphWidth = 35 121 | , graphLabel = Nothing 122 | } 123 | clock = textClockNew Nothing "%a %b %d %H:%M:%S" 1 124 | netMonitor = netMonitorNewWith 2.0 "enp2s0" 0 $ colorize colorOrange "" "WiFi: ⇣" ++ colorize colorLightGreen "" "$inKB$" ++ colorize colorOrange "" " : ⇡" ++ colorize colorLightGreen "" "$outKB$" 125 | wea = weatherNew (defaultWeatherConfig "ULLI") { weatherTemplate = "$tempC$°C" } 100 126 | iohdd = pollingGraphNew ioCfg 1 (diskIOCallback "sdd" "sda1") 127 | mem = pollingBarNew (defaultBarConfig colorFunc) {barWidth = 10} 3 memCallback 128 | ---TODO notification note = notifyAreaNew defaultNotificationConfig 129 | cpuText = simpleText "Cpu"colorOrange 130 | diskText = simpleText "IO »"colorOrange 131 | ramText = simpleText "Ram"colorOrange 132 | cpu = pollingGraphNew cpuCfg 0.5 $ getCPULoad "cpu" 133 | temp = pollingBarNew (defaultBarConfig colorFuncTemp) {barWidth = 10} 2 $ tempCallback ["cpu0"] 134 | tray = systrayNew 135 | mocp = commandRunnerNew 1 "/home/jaga/myscripts/getmocpinfo.sh" [] "Moc: OFF" "#FFFFFF" 136 | defaultTaffybar defaultTaffybarConfig { startWidgets = [ pager ] 137 | , endWidgets = intercalate [separator] [ [clock], [tray], [wea], [mem, ramText], [temp, cpu, cpuText], [iohdd, diskText], [netMonitor], [mocp] ] 138 | , widgetSpacing = 5 139 | , monitorNumber = x 140 | , barHeight = 23 141 | } 142 | -------------------------------------------------------------------------------- /.config/taffybar/zenbook_taffybar.hs: -------------------------------------------------------------------------------- 1 | import System.Taffybar 2 | 3 | {-import System.Taffybar.FreedesktopNotifications-} 4 | import System.Taffybar.Battery 5 | import System.Taffybar.CommandRunner 6 | import System.Taffybar.NetMonitor 7 | import System.Taffybar.Pager 8 | import System.Taffybar.SimpleClock 9 | import System.Taffybar.Systray 10 | import System.Taffybar.TaffyPager 11 | import System.Taffybar.Weather 12 | import System.Taffybar.LayoutSwitcher 13 | import System.Taffybar.WorkspaceSwitcher 14 | 15 | import System.Taffybar.Widgets.PollingBar 16 | import System.Taffybar.Widgets.PollingGraph 17 | 18 | import System.Information.CPU2 19 | import System.Information.DiskIO 20 | import System.Information.Memory 21 | 22 | import Graphics.UI.Gtk 23 | 24 | import Data.List 25 | 26 | memCallback :: IO Double 27 | memCallback = do 28 | mi <- parseMeminfo 29 | return $ memoryUsedRatio mi 30 | 31 | tempCallback :: Fractional b => [String] -> IO b 32 | tempCallback cpu = do 33 | [a] <- getCPUTemp cpu 34 | return $ (fromIntegral a) / 100.0 35 | 36 | mySep :: PagerConfig -> IO Label 37 | mySep cfg = do 38 | sep <- labelNew (Nothing :: Maybe String) 39 | labelSetMarkup sep (widgetSep cfg) 40 | return $ sep 41 | 42 | diskIOCallback :: String -> String -> IO [Double] 43 | diskIOCallback disk1 disk2 = do 44 | a <- getDiskTransfer disk1 45 | b <- getDiskTransfer disk2 46 | return $ a ++ b 47 | 48 | colorOrange :: String 49 | colorOrange = "#C98F0A" 50 | 51 | colorLightGreen :: String 52 | colorLightGreen = "#429942" 53 | 54 | myTaffy :: PagerConfig 55 | myTaffy = defaultPagerConfig { 56 | activeWorkspace = colorize colorLightGreen "" .wrap "⎨" "⎬" . escape 57 | , hiddenWorkspace = colorize colorOrange "" . escape 58 | , emptyWorkspace = colorize "#003347" "" . escape 59 | , urgentWorkspace = colorize "#FFFF00" "" . wrap "[" "]" . escape 60 | , activeLayout = colorize "#003347" "" . escape 61 | , widgetSep = colorize colorLightGreen "" " | " 62 | } 63 | 64 | colorFunc :: (Num t, Num t1) => t -> (t, t, t1) 65 | colorFunc pct = (pct, 1 - pct, 0) 66 | colorFuncTemp :: (Fractional a, Num t, Ord a) => a -> (a, a, t) 67 | colorFuncTemp pct 68 | | pct <= 0.47 = (0, 1 - pct, 0) 69 | | pct < 0.65 = (pct, 1 - pct, 0) 70 | | pct < 1 = (pct, 0, 0) 71 | | otherwise = (1, 1, 1) 72 | 73 | separator :: IO Widget 74 | separator = do 75 | sp2 <- mySep myTaffy 76 | box <- hBoxNew False 0 77 | boxPackStart box sp2 PackNatural 0 78 | widgetShowAll box 79 | return (toWidget box) 80 | 81 | simpleText :: String -> String -> IO Widget 82 | simpleText text' color = do 83 | let text = colorize color "" text' 84 | sep <- labelNew (Nothing :: Maybe String) 85 | labelSetMarkup sep text 86 | box <- hBoxNew False 0 87 | boxPackStart box sep PackNatural 0 88 | widgetShowAll box 89 | return (toWidget box) 90 | 91 | {- 92 | TODO (to implement) 93 | cpu freq, moc song, keyboard layout, swap, uptime, essid, locks... 94 | https://github.com/jaor/xmobar/tree/master/src/Plugins 95 | -} 96 | 97 | main :: IO () 98 | main = do 99 | pager <- pagerNew myTaffy 100 | let 101 | wss = wspaceSwitcherNew pager 102 | cpuCfg = defaultGraphConfig { graphDataColors = [ (0, 1, 0, 1) 103 | , (1, 0, 1, 0.9) 104 | , (0, 0, 1, 0.9) 105 | ] 106 | , graphWidth = 35 107 | , graphLabel = Nothing 108 | } 109 | ioCfg = defaultGraphConfig { graphDataColors = [ (0.3, 1, 0.3, 1) 110 | , (0.6, 1, 0.6, 1) 111 | , (0.3, 0.3, 1, 0.7) 112 | , (0.6, 0.6, 1, 0.7) 113 | ] 114 | , graphWidth = 35 115 | , graphLabel = Nothing 116 | } 117 | clock = textClockNew Nothing ("%a %b %d " 118 | ++"%H:%M:%S") 1 119 | battery = textBatteryNew (colorize colorOrange "" "$percentage$% ⌛ " ++ 120 | colorize colorLightGreen "" "$time$") 20 121 | netMonitor = netMonitorNewWith 2.0 "wlp2s0" 0 $ 122 | colorize colorOrange "" "WiFi: ⇣" 123 | ++ colorize colorLightGreen "" "$inKB$" 124 | ++ colorize colorOrange "" " : ⇡" 125 | ++ colorize colorLightGreen "" "$outKB$" 126 | wea = weatherNew (defaultWeatherConfig "ULLI") { 127 | weatherTemplate = "$tempC$°C" } 100 128 | iohdd = pollingGraphNew ioCfg 1 (diskIOCallback "sda" "2") 129 | mem = pollingBarNew (defaultBarConfig colorFunc) {barWidth = 10} 3 130 | memCallback 131 | ---TODO notification note = notifyAreaNew defaultNotificationConfig 132 | cpuText = simpleText "Cpu"colorOrange 133 | diskText = simpleText "IO »"colorOrange 134 | ramText = simpleText "Ram"colorOrange 135 | cpu = pollingGraphNew cpuCfg 0.5 $ getCPULoad "cpu" 136 | temp = pollingBarNew (defaultBarConfig colorFuncTemp) {barWidth = 137 | 10} 2 $ tempCallback ["cpu0"] 138 | tray = systrayNew 139 | mocp = commandRunnerNew 1 "/home/jaga/myscripts/getmocpinfo.sh" [] "Moc: OFF" "#FFFFFF" 140 | defaultTaffybar defaultTaffybarConfig { startWidgets = [ wss ] 141 | , endWidgets = intercalate [separator] [ 142 | [clock], [tray], [wea], [battery], [mem, 143 | ramText], [temp, cpu, cpuText], [iohdd, 144 | diskText], [netMonitor], [mocp] ] 145 | , widgetSpacing = 5 146 | , barHeight = 23 147 | } 148 | -------------------------------------------------------------------------------- /.desktop_xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xsetroot -cursor_name left_ptr 3 | 4 | #skype & 5 | dropbox & 6 | wicd-client --tray & 7 | #~/myscripts/wallpaper.sh & 8 | #autocpu -s 9 | #sh /home/jaga/myscripts/brightness.sh 10 | #smbnetfs /media/samba & 11 | #devmon & 12 | trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype percent --width 9 --transparent true --alpha 0 --tint 0x000000 --height 19 & 13 | feh --bg-scale ~/Pictures/5408x3464.png_\#000000_1_1920x1080.png 14 | #pulseaudio --start 15 | #devilspie & 16 | #xfce4-terminal --title=cmatrix -e cmatrix --maximize & 17 | xmodmap -e keysym Menu = Super_L 18 | #setxkbmap -layout usρu\(winkeys\) -option grp:caps_toggle 19 | exec xmonad 20 | -------------------------------------------------------------------------------- /.desktop_xmobarrc: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "xft:DejaVu Sans:size=10:antialias=true" 3 | , bgColor = "black" 4 | , fgColor = "grey" 5 | , position = TopW L 90 6 | , commands = [ Run Weather "ULLI"["-t" , "SPB: °C" , 7 | "-L" , "3" , 8 | "-H" , "20" , 9 | "--high" , "orange" , 10 | "--normal" , "lightgreen" , 11 | "--low" , "lightblue"] 1800 12 | , Run MultiCpu ["-L" , "4" , 13 | "-H" , "65" , 14 | "--normal" , "lightgreen" , 15 | "--low" , "lightblue", 16 | "--high" , "red"] 20 17 | , Run CoreTemp ["-L" , "40" , 18 | "-H" , "57" , 19 | "--normal" , "lightgreen" , 20 | "--high" , "red", 21 | "--low" , "lightblue", 22 | "-t", "°C"] 50 23 | , Run Kbd [("us", "us"), ("ru(winkeys)", "ru")] 24 | , Run Com "/home/jaga/myscripts/getmocpinfo.sh" [] "mocSong" 10 25 | , Run Com "bash" ["/home/jaga/myscripts/getvolume.sh"] "volume" 10 26 | , Run Date "%a %b %d %H:%M:%S" "date" 10 27 | , Run DiskIO [("/home", "Home » "), 28 | ("/dev/md126p1", "SSD » |")] 29 | [ "-L" , "400" , 30 | "-H" , "32768" , 31 | "--normal" , "lightgreen" , 32 | "--high" , "red" , 33 | "--low" , "lightblue" 34 | ] 10 35 | 36 | , Run Locks 37 | , Run Network "wlp3s0" ["-L", "8", 38 | "-H", "150", 39 | "-n", "#429942" , 40 | "-h", "lightgreen", 41 | "-t", "WiFi: : "] 20 42 | , Run Memory ["-L","3", 43 | "-H","85", 44 | "--normal","lightgreen", 45 | "--high","red", 46 | "-t","Ram: %"] 20 47 | , Run Swap ["-L","3", 48 | "-H","85", 49 | "--normal","lightgreen", 50 | "--high","red", 51 | "-t","[%]"] 50 52 | , Run StdinReader 53 | , Run Volume "default" "Master" [ "-t", "", "-S", "On" ] 5 54 | ] 55 | , alignSep = "}{" 56 | , sepChar = "%" 57 | , template = "%StdinReader% }{ %mocSong% %locks%%kbd% | %multicpu% %coretemp% | %memory% %swap% | %diskio% | %wlp3s0% | ♫: %volume% | %ULLI% | %date%" 58 | } 59 | -------------------------------------------------------------------------------- /.desktop_zshrc: -------------------------------------------------------------------------------- 1 | source ~/.common_zshrc 2 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Arseniy Seroka 3 | email = ars.seroka@gmail.com 4 | signingkey = 7F7B40E3 5 | [alias] 6 | lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all 7 | lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all 8 | lg = !"git lg1" 9 | [push] 10 | default = simple 11 | [github] 12 | user = JagaJaga 13 | [core] 14 | excludesfile = ~/.gitignore_global 15 | [gpg] 16 | program = gpg2 17 | [commit] 18 | gpgsign = true 19 | [http] 20 | sslverify = false 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /.gitignore_global: -------------------------------------------------------------------------------- 1 | *.class 2 | *.dll 3 | *.exe 4 | *.o 5 | *.so 6 | 7 | *.jar 8 | 9 | *un~ 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".password-store"] 2 | path = .password-store 3 | url = git@github.com:jagajaga/passwd.git 4 | -------------------------------------------------------------------------------- /.muttrc.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/.muttrc.gpg -------------------------------------------------------------------------------- /.nixpkgs/common.nix: -------------------------------------------------------------------------------- 1 | {pkgs}: 2 | let 3 | vimrc = import ./vimrc.nix { pkgs = pkgs; }; 4 | in 5 | with pkgs; rec { 6 | setPrio = num: drv: lib.addMetaAttrs { priority = num; } drv; 7 | haskellPackages = pkgs.haskellPackages; 8 | lushtags = pkgs.haskell.lib.overrideCabal haskellPackages.lushtags (oldAttrs: { 9 | src = pkgs.fetchgit { 10 | url = https://github.com/mkasa/lushtags; 11 | rev = "ef6410cd66c6729e6f4795222bdc0e406251f27a"; 12 | sha256 = "094cl57zfqjq7gpv4151zxipb6kd1czwx4nv6x8wsl3n0z4p3jkx"; 13 | }; 14 | }); 15 | 16 | mocPulse = moc.overrideDerivation (old: { 17 | patches = [ 18 | ./moc_patches/moc-r2758+pulse_audio-1.patch.gz 19 | ./moc_patches/moc-r2758+pulse_audio-1.1.patch.gz 20 | ]; 21 | preConfigure = ''autoreconf -f -i''; 22 | nativeBuildInputs = old.nativeBuildInputs ++ [ libpulseaudio automake libtool autoconf gettext ]; 23 | }); 24 | 25 | myAndroidSdk = pkgs.androidenv.androidsdk { 26 | platformVersions = [ "23" ]; 27 | abiVersions = [ "armeabi-v7a" ]; 28 | useGoogleAPIs = true; 29 | useExtraSupportLibs = true; 30 | useGooglePlayServices = true; 31 | }; 32 | 33 | my-pidgin-with-plugins = pkgs.pidgin-with-plugins.override { 34 | plugins = [ telegram-purple ]; 35 | }; 36 | 37 | loveMoc = haskellPackages.callPackage ../myscripts/lovemoc/project.nix { }; 38 | antigen-hs = haskellPackages.callPackage ({ mkDerivation, base, directory, filepath, process, stdenv, text 39 | }: 40 | mkDerivation { 41 | pname = "antigen-hs"; 42 | version = "0.1.0.0"; 43 | src = fetchgit { 44 | url = https://github.com/Tarrasch/antigen-hs; 45 | rev = "c089a2b8b394af3c6766808693bd4b6f53167f38"; 46 | sha256 = "0kaxa7d9bhn22fic1qam98chbxylwps155sd6qlis9jgs2z7n074"; 47 | }; 48 | libraryHaskellDepends = [ base directory filepath process text ]; 49 | homepage = "https://github.com/Tarrasch/antigen-hs"; 50 | description = "A fast zsh plugin manager"; 51 | license = stdenv.lib.licenses.mit; 52 | }) {}; 53 | /*taffybar = haskellPackages.callPackage ../Dropbox/Programming/Haskell/taffybar/project.nix { }; # until temp fix is not accepted upstream*/ 54 | 55 | vimrcConfig = { 56 | vam.knownPlugins = vimPlugins; # optional 57 | vam.pluginDictionaries = [ 58 | #check ftdetect bug 59 | { names = [ 60 | "YUNOcommit-vim" 61 | "airline" 62 | "colors-solarized" 63 | "ctrlp" 64 | "easy-align" 65 | "easymotion" 66 | "fugitive" 67 | "ghcmod" 68 | "gitgutter" 69 | "haskellconceal" 70 | "hoogle" 71 | "idris-vim" 72 | "latex-live-preview" 73 | /*"lushtags"*/ 74 | "neco-ghc" 75 | "nerdcommenter" 76 | "nerdtree" 77 | "quickfixstatus" 78 | "quickrun" 79 | "rainbow_parentheses" 80 | "rust-vim" 81 | "shabadou-vim" 82 | "signature" 83 | "surround" 84 | "syntastic" 85 | "table-mode" 86 | "tabmerge" 87 | "tagbar" 88 | "taglist" 89 | "thumbnail-vim" 90 | "undotree" 91 | "vim-addon-nix" 92 | "vim-autoformat" 93 | "vim-gista" 94 | "vim-hardtime" 95 | "vim-hier" 96 | "vim-racer" 97 | "vim-wakatime" 98 | "vim-xkbswitch" 99 | "vimproc-vim" 100 | "vundle" 101 | "watchdogs" 102 | "webapi-vim" 103 | "youcompleteme" 104 | "vim-orgmode" 105 | /*"latex-box"*/ 106 | ];} 107 | ]; 108 | customRC = vimrc.config; 109 | }; 110 | my_vim = vim_configurable.customize { name = "vim"; inherit vimrcConfig; }; 111 | vimEnv = lib.lowPrio ( 112 | buildEnv { 113 | name = "vim-env"; 114 | ignoreCollisions = true; 115 | paths = [ 116 | astyle 117 | haskellPackages.stylish-haskell 118 | my_vim 119 | rustracer 120 | rustfmt 121 | ]; 122 | } 123 | ); 124 | 125 | emacsEnv = setPrio "9" ( 126 | buildEnv { 127 | name = "emacs-env"; 128 | ignoreCollisions = true; 129 | paths = [ 130 | (emacsWithPackages (with emacsPackages; with emacsPackagesNg; [ 131 | company 132 | company-ghc 133 | evil 134 | evil-leader 135 | #evil-surround 136 | flycheck 137 | haskell-mode 138 | helm 139 | markdown-mode 140 | monokai-theme 141 | org 142 | rainbow-delimiters 143 | undo-tree 144 | use-package 145 | ])) 146 | ]; 147 | } 148 | ); 149 | 150 | hugeEnv = buildEnv { 151 | name = "huge-env"; 152 | ignoreCollisions = true; 153 | paths = [ 154 | chromium 155 | firefoxWrapper 156 | gimp 157 | /*inkscape*/ 158 | ]; 159 | }; 160 | 161 | steamEnv = buildEnv { 162 | name = "steam-env"; 163 | ignoreCollisions = true; 164 | paths = [ 165 | steam 166 | ]; 167 | }; 168 | 169 | baseEnv = lib.lowPrio ( 170 | buildEnv { 171 | name = "base-env"; 172 | ignoreCollisions = true; 173 | paths = [ 174 | my-pidgin-with-plugins 175 | /*androidenv.platformTools*/ 176 | perlPackages.ack 177 | aspell 178 | aspellDicts.en 179 | aspellDicts.ru 180 | bc 181 | djview4 182 | evince 183 | file 184 | flac 185 | freetype 186 | dejavu_fonts 187 | gnome3.zenity 188 | gnupg 189 | gparted 190 | iftop 191 | lastfmsubmitd 192 | libnotify 193 | lm_sensors 194 | mocPulse 195 | mutt 196 | nethogs 197 | p7zip 198 | pass 199 | pinentry 200 | psmisc 201 | python27Packages.goobook 202 | qutebrowser 203 | skype 204 | sxiv 205 | telnet 206 | tightvnc 207 | tmux 208 | traceroute 209 | tree 210 | unrar 211 | unzip 212 | usbutils 213 | vlc 214 | weechat 215 | which 216 | wineUnstable 217 | winetricks 218 | wmname 219 | xclip 220 | xkblayout-state 221 | xlibs.xev 222 | xlibs.xprop 223 | xfce.xfce4notifyd 224 | xfce.xfce4terminal 225 | zip 226 | ]; 227 | } 228 | ); 229 | 230 | myHs = haskellPackages.ghcWithPackages ( 231 | pkgs: with pkgs; [ 232 | # cabal2nix 233 | /*cabal-install*/ 234 | /*ghc-mod*/ 235 | # hlint 236 | # hoogle 237 | /*lushtags*/ 238 | /*pandoc*/ 239 | taffybar 240 | xmonad 241 | xmonad-contrib 242 | ]); 243 | 244 | hsEnv = buildEnv { 245 | name = "haskell-env"; 246 | ignoreCollisions = true; 247 | paths = [ 248 | myHs 249 | /*loveMoc*/ 250 | antigen-hs 251 | ]; 252 | }; 253 | 254 | develEnv = lib.lowPrio ( 255 | pkgs.buildEnv { 256 | name = "development-env"; 257 | ignoreCollisions = true; 258 | paths = [ 259 | /*myAndroidSdk*/ 260 | /*idea.android-studio*/ 261 | /*gradle*/ 262 | #==== 263 | automake 264 | clang 265 | cmake 266 | ctags 267 | freeglut 268 | gdb 269 | gcc 270 | gnumake 271 | jdk 272 | llvm 273 | manpages 274 | mesa 275 | pciutils 276 | pkgconfig 277 | python 278 | python34 279 | rustc 280 | cargo 281 | smartmontools 282 | subversion 283 | swiProlog 284 | xlibs.libX11 285 | zlib 286 | ]; 287 | } 288 | ); 289 | } 290 | -------------------------------------------------------------------------------- /.nixpkgs/desktop_config.nix: -------------------------------------------------------------------------------- 1 | pkgs : { 2 | allowUnfree = true; 3 | allowBroken = true; 4 | firefox.enableGoogleTalkPlugin = true; 5 | firefox.enableEsteid = true; 6 | /*allowBroken = true;*/ 7 | packageOverrides = pkgs : with pkgs; rec { 8 | common = import ./common.nix { pkgs = pkgs; }; 9 | inherit (common) vimEnv hsEnv hugeEnv emacsEnv baseEnv develEnv steamEnv mocPulse; 10 | desktopEnv = pkgs.buildEnv 11 | { 12 | name = "desktop-env"; 13 | ignoreCollisions = true; 14 | paths = [ 15 | /*calibre*/ 16 | google-musicmanager 17 | /*gtkvnc*/ 18 | /*teamviewer*/ 19 | /*texLiveFull*/ 20 | /*viber*/ 21 | desktop_file_utils 22 | e2fsprogs 23 | electrum 24 | ffmpeg 25 | fpc 26 | gnome3.cheese 27 | gnome3.gnome-video-effects 28 | graphviz 29 | guvcview 30 | hdparm 31 | imagemagick 32 | inkscape 33 | jmtpfs 34 | k3b 35 | lshw 36 | lsof 37 | mbox 38 | megatools 39 | mplayer 40 | nix-prefetch-scripts 41 | nix-repl 42 | nox 43 | /*octave*/ 44 | openvpn 45 | parted 46 | pastebinit 47 | pavucontrol 48 | pdftk 49 | perlPackages.FileMimeInfo 50 | psmisc 51 | pwgen 52 | python27Packages.pytz 53 | qemu 54 | shared_mime_info 55 | spaceFM 56 | /*spotify*/ 57 | tightvnc 58 | tor 59 | transmission_gtk 60 | transmission_remote_gtk 61 | unetbootin 62 | xlibs.xf86inputjoystick 63 | ]; 64 | }; 65 | }; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /.nixpkgs/moc_patches/moc-r2758+pulse_audio-1.1.patch.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/.nixpkgs/moc_patches/moc-r2758+pulse_audio-1.1.patch.gz -------------------------------------------------------------------------------- /.nixpkgs/moc_patches/moc-r2758+pulse_audio-1.patch.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/.nixpkgs/moc_patches/moc-r2758+pulse_audio-1.patch.gz -------------------------------------------------------------------------------- /.nixpkgs/mpdas/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchgit, fetchurl, curl, mpd_clientlib, pkgconfig }: 2 | 3 | stdenv.mkDerivation rec { 4 | name = "mpdas-${version}"; 5 | version = "0.4-alpha"; 6 | 7 | src = fetchgit { 8 | url = "https://github.com/hrkfdn/mpdas"; 9 | rev = "8900f5b437109ac8fd27b95330938abec47aa246"; 10 | sha256 = "1l4hfmcp1l0a08cjf3lmvnlksagrkpvnvfbhdlzziva5dddprs31"; 11 | }; 12 | 13 | buildInputs = [ curl mpd_clientlib pkgconfig ]; 14 | 15 | installPhase = '' 16 | install -d $out/bin 17 | install -d $out 18 | install -m 755 mpdas $out/bin 19 | install -m 644 mpdas.1 $out/mpdas.1 20 | ''; 21 | 22 | meta = { 23 | homepage = "http://50hz.ws/mpdas/"; 24 | description = "A C++ client to submit tracks to audioscrobbler, supports new protocol"; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /.nixpkgs/work_config.nix: -------------------------------------------------------------------------------- 1 | pkgs : { 2 | packageOverrides = pkgs : with pkgs; rec { 3 | common = import ./common.nix { pkgs = pkgs; }; 4 | workEnv = pkgs.buildEnv 5 | { 6 | name = "work-env"; 7 | paths = [ 8 | ]; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /.nixpkgs/zenbook_config.nix: -------------------------------------------------------------------------------- 1 | pkgs : { 2 | allowUnfree = true; 3 | allowBroken = true; 4 | firefox.enableGoogleTalkPlugin = true; 5 | firefox.enableEsteid = true; 6 | packageOverrides = pkgs : with pkgs; rec { 7 | common = import ./common.nix { pkgs = pkgs; }; 8 | inherit (common) vimEnv hsEnv hugeEnv emacsEnv baseEnv develEnv steamEnv; 9 | zenbookEnv = pkgs.buildEnv 10 | { 11 | name = "zenbook-env"; 12 | paths = [ 13 | qemu 14 | rsync 15 | ]; 16 | }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /.rainbow_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "HEARTBEAT_TIMEOUT": 120, 3 | "IMAGE_ON_TERM": false, 4 | "THEME": "solarized", 5 | "ASCII_ART": true, 6 | "HIDE_PROMPT": true, 7 | "PREFIX": "@tis00", 8 | "SEARCH_TYPE": "mixed", 9 | "SEARCH_MAX_RECORD": 5, 10 | "HOME_TWEET_NUM": 10, 11 | "RETWEETS_SHOW_NUM": 5, 12 | "CONVERSATION_MAX": 30, 13 | "QUOTE_FORMAT": "#comment RT #owner: #tweet", 14 | "THREAD_META_LEFT": "(#id) #clock", 15 | "THREAD_META_RIGHT": "#clock (#id)", 16 | "THREAD_MIN_WIDTH": 20, 17 | "NOTIFY_FORMAT": " #source_user #notify #clock", 18 | "MESSAGES_DISPLAY": 5, 19 | "TREND_MAX": 10, 20 | "LIST_MAX": 5, 21 | "ONLY_LIST": [], 22 | "IGNORE_LIST": [], 23 | "HISTORY_FILENAME": "completer.hist", 24 | "IMAGE_SHIFT": 2, 25 | "IMAGE_MAX_HEIGHT": 90, 26 | "STREAM_DELAY": 0, 27 | "USER_DOMAIN": "userstream.twitter.com", 28 | "PUBLIC_DOMAIN": "stream.twitter.com", 29 | "SITE_DOMAIN": "sitestream.twitter.com", 30 | "FORMAT": { 31 | "TWEET": { 32 | "CLOCK_FORMAT": "%Y/%m/%d %H:%M:%S", 33 | "DISPLAY": "\n #name #nick #clock \n id:#id \u20aa:#rt_count \u2665:#fa_count #fav\n #tweet" 34 | }, 35 | "MESSAGE": { 36 | "CLOCK_FORMAT": "%Y/%m/%d %H:%M:%S", 37 | "DISPLAY": "\n #sender_name #sender_nick #to #recipient_name #recipient_nick :\n #clock message_id:#id\n #message" 38 | } 39 | }, 40 | "IMAGE_RESIZE_TO_FIT": false 41 | } -------------------------------------------------------------------------------- /.vimperatorrc: -------------------------------------------------------------------------------- 1 | noremap K :tabprevious 2 | noremap J :tabnext 3 | 4 | noremap :vimperatortoggle 5 | 6 | autocmd LocationChange .* js modes.passAllKeys = false 7 | autocmd LocationChange mail\\.google\\.com js modes.passAllKeys = true 8 | autocmd LocationChange www\\.google\\.com/calendar js modes.passAllKeys = true 9 | autocmd LocationChange www\\.google\\.com/reader js modes.passAllKeys = true 10 | autocmd LocationChange telegram\\.org js modes.passAllKeys = true 11 | autocmd LocationChange slack\\.com js modes.passAllKeys = true 12 | autocmd LocationChange mail\\.google\\.com/tasks js modes.passAllKeys = false 13 | 14 | inoremap 15 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | "see .nixpkgs/vimrc.nix 2 | 3 | -------------------------------------------------------------------------------- /.weechat/alias.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat -- alias.conf 3 | # 4 | # WARNING: It is NOT recommended to edit this file by hand, 5 | # especially if WeeChat is running. 6 | # 7 | # Use /set or similar command to change settings in WeeChat. 8 | # 9 | # For more info, see: https://weechat.org/doc/quickstart 10 | # 11 | 12 | [cmd] 13 | AAWAY = "allserv /away" 14 | AME = "allchan /me" 15 | AMSG = "allchan /msg *" 16 | ANICK = "allserv /nick" 17 | BEEP = "print -stderr \a" 18 | BYE = "quit" 19 | C = "buffer clear" 20 | CHAT = "dcc chat" 21 | CL = "buffer clear" 22 | CLOSE = "buffer close" 23 | EXIT = "quit" 24 | IG = "ignore" 25 | J = "join" 26 | K = "kick" 27 | KB = "kickban" 28 | LEAVE = "part" 29 | M = "msg" 30 | MUB = "unban *" 31 | N = "names" 32 | Q = "query" 33 | REDRAW = "window refresh" 34 | SAY = "msg *" 35 | SIGNOFF = "quit" 36 | su = "/window scroll_unread" 37 | T = "topic" 38 | UB = "unban" 39 | UMODE = "mode $nick" 40 | V = "command core version" 41 | W = "who" 42 | WC = "window merge" 43 | WI = "whois" 44 | WII = "whois $1 $1" 45 | WW = "whowas" 46 | 47 | [completion] 48 | -------------------------------------------------------------------------------- /.weechat/buffers.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat -- buffers.conf 3 | # 4 | # WARNING: It is NOT recommended to edit this file by hand, 5 | # especially if WeeChat is running. 6 | # 7 | # Use /set or similar command to change settings in WeeChat. 8 | # 9 | # For more info, see: https://weechat.org/doc/quickstart 10 | # 11 | 12 | [color] 13 | current_bg = red 14 | current_fg = lightcyan 15 | default_bg = default 16 | default_fg = default 17 | hotlist_highlight_bg = default 18 | hotlist_highlight_fg = magenta 19 | hotlist_low_bg = default 20 | hotlist_low_fg = white 21 | hotlist_message_bg = default 22 | hotlist_message_fg = yellow 23 | hotlist_private_bg = default 24 | hotlist_private_fg = lightgreen 25 | none_channel_bg = default 26 | none_channel_fg = default 27 | number = lightgreen 28 | number_char = lightgreen 29 | prefix_bufname = default 30 | queries_default_bg = default 31 | queries_default_fg = default 32 | queries_highlight_bg = default 33 | queries_highlight_fg = default 34 | queries_message_bg = default 35 | queries_message_fg = default 36 | suffix_bufname = default 37 | whitelist_default_bg = default 38 | whitelist_default_fg = default 39 | whitelist_highlight_bg = default 40 | whitelist_highlight_fg = default 41 | whitelist_low_bg = default 42 | whitelist_low_fg = default 43 | whitelist_message_bg = default 44 | whitelist_message_fg = default 45 | whitelist_private_bg = default 46 | whitelist_private_fg = default 47 | 48 | [look] 49 | core_to_front = off 50 | detach = 0 51 | detach_buffer_immediately = "" 52 | detach_display_window_number = off 53 | detach_displayed_buffers = on 54 | detach_free_content = off 55 | detach_query = off 56 | hide_merged_buffers = none 57 | hotlist_counter = off 58 | immune_detach_buffers = "" 59 | indenting = on 60 | indenting_number = on 61 | jump_prev_next_visited_buffer = off 62 | mark_inactive = off 63 | mouse_move_buffer = on 64 | name_crop_suffix = "+" 65 | name_size_max = 0 66 | number_char = "." 67 | prefix = off 68 | prefix_bufname = "" 69 | prefix_empty = on 70 | prefix_for_query = "" 71 | short_names = on 72 | show_lag = off 73 | show_number = on 74 | sort = number 75 | suffix_bufname = "" 76 | toogle_bar = on 77 | whitelist_buffers = "" 78 | -------------------------------------------------------------------------------- /.weechat/irc.conf.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/.weechat/irc.conf.gpg -------------------------------------------------------------------------------- /.weechat/weechat.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat -- weechat.conf 3 | # 4 | # WARNING: It is NOT recommended to edit this file by hand, 5 | # especially if WeeChat is running. 6 | # 7 | # Use /set or similar command to change settings in WeeChat. 8 | # 9 | # For more info, see: https://weechat.org/doc/quickstart 10 | # 11 | 12 | [debug] 13 | 14 | [startup] 15 | command_after_plugins = "" 16 | command_before_plugins = "" 17 | display_logo = on 18 | display_version = on 19 | sys_rlimit = "" 20 | 21 | [look] 22 | align_end_of_lines = message 23 | align_multiline_words = on 24 | bar_more_down = "++" 25 | bar_more_left = "<<" 26 | bar_more_right = ">>" 27 | bar_more_up = "--" 28 | bare_display_exit_on_input = on 29 | bare_display_time_format = "%H:%M" 30 | buffer_auto_renumber = on 31 | buffer_notify_default = all 32 | buffer_position = end 33 | buffer_search_case_sensitive = off 34 | buffer_search_force_default = off 35 | buffer_search_regex = off 36 | buffer_search_where = message 37 | buffer_time_format = "%H:%M:%S" 38 | color_basic_force_bold = off 39 | color_inactive_buffer = on 40 | color_inactive_message = on 41 | color_inactive_prefix = on 42 | color_inactive_prefix_buffer = on 43 | color_inactive_time = off 44 | color_inactive_window = on 45 | color_nick_offline = off 46 | color_pairs_auto_reset = 5 47 | color_real_white = off 48 | command_chars = "" 49 | command_incomplete = off 50 | confirm_quit = off 51 | confirm_upgrade = off 52 | day_change = on 53 | day_change_message_1date = "-- %a, %d %b %Y --" 54 | day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --" 55 | eat_newline_glitch = off 56 | emphasized_attributes = "" 57 | highlight = "" 58 | highlight_regex = "" 59 | highlight_tags = "" 60 | hotlist_add_conditions = "${away} || ${buffer.num_displayed} == 0" 61 | hotlist_buffer_separator = ", " 62 | hotlist_count_max = 2 63 | hotlist_count_min_msg = 2 64 | hotlist_names_count = 3 65 | hotlist_names_length = 0 66 | hotlist_names_level = 12 67 | hotlist_names_merged_buffers = off 68 | hotlist_prefix = "H: " 69 | hotlist_remove = merged 70 | hotlist_short_names = on 71 | hotlist_sort = group_time_asc 72 | hotlist_suffix = "" 73 | hotlist_unique_numbers = on 74 | input_cursor_scroll = 20 75 | input_share = none 76 | input_share_overwrite = off 77 | input_undo_max = 32 78 | item_away_message = on 79 | item_buffer_filter = "*" 80 | item_buffer_zoom = "!" 81 | item_mouse_status = "M" 82 | item_time_format = "%H:%M" 83 | jump_current_to_previous_buffer = on 84 | jump_previous_buffer_when_closing = on 85 | jump_smart_back_to_buffer = on 86 | key_bind_safe = on 87 | key_grab_delay = 800 88 | mouse = off 89 | mouse_timer_delay = 100 90 | nick_color_force = "" 91 | nick_color_hash = djb2 92 | nick_color_stop_chars = "_|[" 93 | nick_prefix = "" 94 | nick_suffix = "" 95 | paste_auto_add_newline = on 96 | paste_bracketed = on 97 | paste_bracketed_timer_delay = 10 98 | paste_max_lines = 1 99 | prefix_action = " *" 100 | prefix_align = right 101 | prefix_align_max = 0 102 | prefix_align_min = 0 103 | prefix_align_more = "+" 104 | prefix_align_more_after = on 105 | prefix_buffer_align = right 106 | prefix_buffer_align_max = 0 107 | prefix_buffer_align_more = "+" 108 | prefix_buffer_align_more_after = on 109 | prefix_error = "=!=" 110 | prefix_join = "-->" 111 | prefix_network = "--" 112 | prefix_quit = "<--" 113 | prefix_same_nick = "" 114 | prefix_suffix = "|" 115 | quote_nick_prefix = "<" 116 | quote_nick_suffix = ">" 117 | quote_time_format = "%H:%M:%S" 118 | read_marker = line 119 | read_marker_always_show = off 120 | read_marker_string = "- " 121 | save_config_on_exit = on 122 | save_layout_on_exit = none 123 | scroll_amount = 3 124 | scroll_bottom_after_switch = off 125 | scroll_page_percent = 100 126 | search_text_not_found_alert = on 127 | separator_horizontal = "-" 128 | separator_vertical = "" 129 | tab_width = 1 130 | time_format = "%a, %d %b %Y %T" 131 | window_auto_zoom = off 132 | window_separator_horizontal = on 133 | window_separator_vertical = on 134 | window_title = "WeeChat ${info:version}" 135 | word_chars_highlight = "!\u00A0,-,_,|,alnum" 136 | word_chars_input = "!\u00A0,-,_,|,alnum" 137 | 138 | [palette] 139 | 140 | [color] 141 | bar_more = lightmagenta 142 | chat = default 143 | chat_bg = default 144 | chat_buffer = white 145 | chat_channel = white 146 | chat_day_change = cyan 147 | chat_delimiters = green 148 | chat_highlight = yellow 149 | chat_highlight_bg = magenta 150 | chat_host = cyan 151 | chat_inactive_buffer = default 152 | chat_inactive_window = default 153 | chat_nick = lightcyan 154 | chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,35,...,45" 155 | chat_nick_offline = default 156 | chat_nick_offline_highlight = default 157 | chat_nick_offline_highlight_bg = blue 158 | chat_nick_other = cyan 159 | chat_nick_prefix = green 160 | chat_nick_self = white 161 | chat_nick_suffix = green 162 | chat_prefix_action = white 163 | chat_prefix_buffer = brown 164 | chat_prefix_buffer_inactive_buffer = default 165 | chat_prefix_error = yellow 166 | chat_prefix_join = lightgreen 167 | chat_prefix_more = lightmagenta 168 | chat_prefix_network = magenta 169 | chat_prefix_quit = lightred 170 | chat_prefix_suffix = green 171 | chat_read_marker = magenta 172 | chat_read_marker_bg = default 173 | chat_server = brown 174 | chat_tags = red 175 | chat_text_found = yellow 176 | chat_text_found_bg = lightmagenta 177 | chat_time = default 178 | chat_time_delimiters = brown 179 | chat_value = cyan 180 | chat_value_null = blue 181 | emphasized = yellow 182 | emphasized_bg = magenta 183 | input_actions = lightgreen 184 | input_text_not_found = red 185 | item_away = yellow 186 | nicklist_away = cyan 187 | nicklist_group = green 188 | separator = blue 189 | status_count_highlight = magenta 190 | status_count_msg = brown 191 | status_count_other = default 192 | status_count_private = green 193 | status_data_highlight = lightmagenta 194 | status_data_msg = yellow 195 | status_data_other = default 196 | status_data_private = lightgreen 197 | status_filter = green 198 | status_more = yellow 199 | status_mouse = green 200 | status_name = white 201 | status_name_ssl = lightgreen 202 | status_nicklist_count = default 203 | status_number = yellow 204 | status_time = default 205 | 206 | [completion] 207 | base_word_until_cursor = on 208 | command_inline = on 209 | default_template = "%(nicks)|%(irc_channels)" 210 | nick_add_space = on 211 | nick_completer = ":" 212 | nick_first_only = off 213 | nick_ignore_chars = "[]`_-^" 214 | partial_completion_alert = on 215 | partial_completion_command = off 216 | partial_completion_command_arg = off 217 | partial_completion_count = on 218 | partial_completion_other = off 219 | 220 | [history] 221 | display_default = 5 222 | max_buffer_lines_minutes = 0 223 | max_buffer_lines_number = 4096 224 | max_commands = 100 225 | max_visited_buffers = 50 226 | 227 | [proxy] 228 | 229 | [network] 230 | connection_timeout = 60 231 | gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt" 232 | gnutls_handshake_timeout = 30 233 | proxy_curl = "" 234 | 235 | [plugin] 236 | autoload = "*" 237 | debug = off 238 | extension = ".so,.dll" 239 | path = "%h/plugins" 240 | save_config_on_unload = on 241 | 242 | [bar] 243 | buffers.color_bg = default 244 | buffers.color_delim = default 245 | buffers.color_fg = default 246 | buffers.conditions = "" 247 | buffers.filling_left_right = vertical 248 | buffers.filling_top_bottom = columns_vertical 249 | buffers.hidden = on 250 | buffers.items = "buffers" 251 | buffers.position = left 252 | buffers.priority = 0 253 | buffers.separator = on 254 | buffers.size = 0 255 | buffers.size_max = 0 256 | buffers.type = root 257 | input.color_bg = default 258 | input.color_delim = cyan 259 | input.color_fg = default 260 | input.conditions = "" 261 | input.filling_left_right = vertical 262 | input.filling_top_bottom = horizontal 263 | input.hidden = off 264 | input.items = "[input_prompt]+(away),[input_search],[input_paste],input_text" 265 | input.position = bottom 266 | input.priority = 1000 267 | input.separator = off 268 | input.size = 1 269 | input.size_max = 0 270 | input.type = window 271 | isetbar.color_bg = default 272 | isetbar.color_delim = cyan 273 | isetbar.color_fg = default 274 | isetbar.conditions = "" 275 | isetbar.filling_left_right = vertical 276 | isetbar.filling_top_bottom = horizontal 277 | isetbar.hidden = on 278 | isetbar.items = "isetbar_help" 279 | isetbar.position = top 280 | isetbar.priority = 0 281 | isetbar.separator = on 282 | isetbar.size = 3 283 | isetbar.size_max = 3 284 | isetbar.type = window 285 | nicklist.color_bg = default 286 | nicklist.color_delim = cyan 287 | nicklist.color_fg = default 288 | nicklist.conditions = "${nicklist}" 289 | nicklist.filling_left_right = vertical 290 | nicklist.filling_top_bottom = columns_vertical 291 | nicklist.hidden = on 292 | nicklist.items = "buffer_nicklist" 293 | nicklist.position = right 294 | nicklist.priority = 200 295 | nicklist.separator = on 296 | nicklist.size = 0 297 | nicklist.size_max = 0 298 | nicklist.type = window 299 | status.color_bg = blue 300 | status.color_delim = cyan 301 | status.color_fg = default 302 | status.conditions = "" 303 | status.filling_left_right = vertical 304 | status.filling_top_bottom = horizontal 305 | status.hidden = off 306 | status.items = "[buffer_count],[buffer_plugin],buffer_number+:+buffer_name+buffer_filter,[lag],[hotlist],completion,scroll,aspell_suggest" 307 | status.position = bottom 308 | status.priority = 500 309 | status.separator = off 310 | status.size = 1 311 | status.size_max = 0 312 | status.type = window 313 | title.color_bg = blue 314 | title.color_delim = cyan 315 | title.color_fg = default 316 | title.conditions = "" 317 | title.filling_left_right = vertical 318 | title.filling_top_bottom = horizontal 319 | title.hidden = off 320 | title.items = "buffer_title" 321 | title.position = top 322 | title.priority = 500 323 | title.separator = off 324 | title.size = 1 325 | title.size_max = 0 326 | title.type = window 327 | 328 | [layout] 329 | _zoom.window = "1;0;0;0;irc;freenode.#nixos" 330 | 331 | [notify] 332 | 333 | [filter] 334 | irc_smart = on;*;irc_smart_filter;* 335 | 336 | [key] 337 | ctrl-? = "/input delete_previous_char" 338 | ctrl-A = "/input move_beginning_of_line" 339 | ctrl-B = "/input move_previous_char" 340 | ctrl-C_ = "/input insert \x1F" 341 | ctrl-Cb = "/input insert \x02" 342 | ctrl-Cc = "/input insert \x03" 343 | ctrl-Ci = "/input insert \x1D" 344 | ctrl-Co = "/input insert \x0F" 345 | ctrl-Cv = "/input insert \x16" 346 | ctrl-D = "/input delete_next_char" 347 | ctrl-E = "/input move_end_of_line" 348 | ctrl-F = "/input move_next_char" 349 | ctrl-H = "/input delete_previous_char" 350 | ctrl-I = "/input complete_next" 351 | ctrl-J = "/input return" 352 | ctrl-K = "/input delete_end_of_line" 353 | ctrl-L = "/window refresh" 354 | ctrl-M = "/input return" 355 | ctrl-N = "/buffer +1" 356 | ctrl-P = "/buffer -1" 357 | ctrl-R = "/input search_text" 358 | ctrl-Sctrl-U = "/input set_unread" 359 | ctrl-T = "/input transpose_chars" 360 | ctrl-U = "/input delete_beginning_of_line" 361 | ctrl-W = "/input delete_previous_word" 362 | ctrl-X = "/input switch_active_buffer" 363 | ctrl-Y = "/input clipboard_paste" 364 | meta-meta2-1~ = "/window scroll_top" 365 | meta-meta2-23~ = "/bar scroll nicklist * b" 366 | meta-meta2-24~ = "/bar scroll nicklist * e" 367 | meta-meta2-4~ = "/window scroll_bottom" 368 | meta-meta2-5~ = "/window scroll_up" 369 | meta-meta2-6~ = "/window scroll_down" 370 | meta-meta2-7~ = "/window scroll_top" 371 | meta-meta2-8~ = "/window scroll_bottom" 372 | meta-meta2-A = "/buffer -1" 373 | meta-meta2-B = "/buffer +1" 374 | meta-meta2-C = "/buffer +1" 375 | meta-meta2-D = "/buffer -1" 376 | meta-/ = "/input jump_last_buffer_displayed" 377 | meta-0 = "/buffer *10" 378 | meta-1 = "/buffer *1" 379 | meta-2 = "/buffer *2" 380 | meta-3 = "/buffer *3" 381 | meta-4 = "/buffer *4" 382 | meta-5 = "/buffer *5" 383 | meta-6 = "/buffer *6" 384 | meta-7 = "/buffer *7" 385 | meta-8 = "/buffer *8" 386 | meta-9 = "/buffer *9" 387 | meta-< = "/input jump_previously_visited_buffer" 388 | meta-= = "/filter toggle" 389 | meta-> = "/input jump_next_visited_buffer" 390 | meta-OA = "/input history_global_previous" 391 | meta-OB = "/input history_global_next" 392 | meta-OC = "/input move_next_word" 393 | meta-OD = "/input move_previous_word" 394 | meta-OF = "/input move_end_of_line" 395 | meta-OH = "/input move_beginning_of_line" 396 | meta-Oa = "/input history_global_previous" 397 | meta-Ob = "/input history_global_next" 398 | meta-Oc = "/input move_next_word" 399 | meta-Od = "/input move_previous_word" 400 | meta2-15~ = "/buffer -1" 401 | meta2-17~ = "/buffer +1" 402 | meta2-18~ = "/window -1" 403 | meta2-19~ = "/window +1" 404 | meta2-1;3A = "/buffer -1" 405 | meta2-1;3B = "/buffer +1" 406 | meta2-1;3C = "/buffer +1" 407 | meta2-1;3D = "/buffer -1" 408 | meta2-1;3F = "/window scroll_bottom" 409 | meta2-1;3H = "/window scroll_top" 410 | meta2-1;5A = "/input history_global_previous" 411 | meta2-1;5B = "/input history_global_next" 412 | meta2-1;5C = "/input move_next_word" 413 | meta2-1;5D = "/input move_previous_word" 414 | meta2-1~ = "/input move_beginning_of_line" 415 | meta2-200~ = "/input paste_start" 416 | meta2-201~ = "/input paste_stop" 417 | meta2-20~ = "/bar scroll title * -30%" 418 | meta2-21~ = "/bar scroll title * +30%" 419 | meta2-23;3~ = "/bar scroll nicklist * b" 420 | meta2-23~ = "/bar scroll nicklist * -100%" 421 | meta2-24;3~ = "/bar scroll nicklist * e" 422 | meta2-24~ = "/bar scroll nicklist * +100%" 423 | meta2-3~ = "/input delete_next_char" 424 | meta2-4~ = "/input move_end_of_line" 425 | meta2-5;3~ = "/window scroll_up" 426 | meta2-5~ = "/window page_up" 427 | meta2-6;3~ = "/window scroll_down" 428 | meta2-6~ = "/window page_down" 429 | meta2-7~ = "/input move_beginning_of_line" 430 | meta2-8~ = "/input move_end_of_line" 431 | meta2-A = "/input history_previous" 432 | meta2-B = "/input history_next" 433 | meta2-C = "/input move_next_char" 434 | meta2-D = "/input move_previous_char" 435 | meta2-F = "/input move_end_of_line" 436 | meta2-G = "/window page_down" 437 | meta2-H = "/input move_beginning_of_line" 438 | meta2-I = "/window page_up" 439 | meta2-Z = "/input complete_previous" 440 | meta2-[E = "/buffer -1" 441 | meta-_ = "/input redo" 442 | meta-a = "/input jump_smart" 443 | meta-b = "/input move_previous_word" 444 | meta-d = "/input delete_next_word" 445 | meta-f = "/input move_next_word" 446 | meta-h = "/input hotlist_clear" 447 | meta-jmeta-l = "/input jump_last_buffer" 448 | meta-jmeta-r = "/server raw" 449 | meta-jmeta-s = "/server jump" 450 | meta-j01 = "/buffer 1" 451 | meta-j02 = "/buffer 2" 452 | meta-j03 = "/buffer 3" 453 | meta-j04 = "/buffer 4" 454 | meta-j05 = "/buffer 5" 455 | meta-j06 = "/buffer 6" 456 | meta-j07 = "/buffer 7" 457 | meta-j08 = "/buffer 8" 458 | meta-j09 = "/buffer 9" 459 | meta-j10 = "/buffer 10" 460 | meta-j11 = "/buffer 11" 461 | meta-j12 = "/buffer 12" 462 | meta-j13 = "/buffer 13" 463 | meta-j14 = "/buffer 14" 464 | meta-j15 = "/buffer 15" 465 | meta-j16 = "/buffer 16" 466 | meta-j17 = "/buffer 17" 467 | meta-j18 = "/buffer 18" 468 | meta-j19 = "/buffer 19" 469 | meta-j20 = "/buffer 20" 470 | meta-j21 = "/buffer 21" 471 | meta-j22 = "/buffer 22" 472 | meta-j23 = "/buffer 23" 473 | meta-j24 = "/buffer 24" 474 | meta-j25 = "/buffer 25" 475 | meta-j26 = "/buffer 26" 476 | meta-j27 = "/buffer 27" 477 | meta-j28 = "/buffer 28" 478 | meta-j29 = "/buffer 29" 479 | meta-j30 = "/buffer 30" 480 | meta-j31 = "/buffer 31" 481 | meta-j32 = "/buffer 32" 482 | meta-j33 = "/buffer 33" 483 | meta-j34 = "/buffer 34" 484 | meta-j35 = "/buffer 35" 485 | meta-j36 = "/buffer 36" 486 | meta-j37 = "/buffer 37" 487 | meta-j38 = "/buffer 38" 488 | meta-j39 = "/buffer 39" 489 | meta-j40 = "/buffer 40" 490 | meta-j41 = "/buffer 41" 491 | meta-j42 = "/buffer 42" 492 | meta-j43 = "/buffer 43" 493 | meta-j44 = "/buffer 44" 494 | meta-j45 = "/buffer 45" 495 | meta-j46 = "/buffer 46" 496 | meta-j47 = "/buffer 47" 497 | meta-j48 = "/buffer 48" 498 | meta-j49 = "/buffer 49" 499 | meta-j50 = "/buffer 50" 500 | meta-j51 = "/buffer 51" 501 | meta-j52 = "/buffer 52" 502 | meta-j53 = "/buffer 53" 503 | meta-j54 = "/buffer 54" 504 | meta-j55 = "/buffer 55" 505 | meta-j56 = "/buffer 56" 506 | meta-j57 = "/buffer 57" 507 | meta-j58 = "/buffer 58" 508 | meta-j59 = "/buffer 59" 509 | meta-j60 = "/buffer 60" 510 | meta-j61 = "/buffer 61" 511 | meta-j62 = "/buffer 62" 512 | meta-j63 = "/buffer 63" 513 | meta-j64 = "/buffer 64" 514 | meta-j65 = "/buffer 65" 515 | meta-j66 = "/buffer 66" 516 | meta-j67 = "/buffer 67" 517 | meta-j68 = "/buffer 68" 518 | meta-j69 = "/buffer 69" 519 | meta-j70 = "/buffer 70" 520 | meta-j71 = "/buffer 71" 521 | meta-j72 = "/buffer 72" 522 | meta-j73 = "/buffer 73" 523 | meta-j74 = "/buffer 74" 524 | meta-j75 = "/buffer 75" 525 | meta-j76 = "/buffer 76" 526 | meta-j77 = "/buffer 77" 527 | meta-j78 = "/buffer 78" 528 | meta-j79 = "/buffer 79" 529 | meta-j80 = "/buffer 80" 530 | meta-j81 = "/buffer 81" 531 | meta-j82 = "/buffer 82" 532 | meta-j83 = "/buffer 83" 533 | meta-j84 = "/buffer 84" 534 | meta-j85 = "/buffer 85" 535 | meta-j86 = "/buffer 86" 536 | meta-j87 = "/buffer 87" 537 | meta-j88 = "/buffer 88" 538 | meta-j89 = "/buffer 89" 539 | meta-j90 = "/buffer 90" 540 | meta-j91 = "/buffer 91" 541 | meta-j92 = "/buffer 92" 542 | meta-j93 = "/buffer 93" 543 | meta-j94 = "/buffer 94" 544 | meta-j95 = "/buffer 95" 545 | meta-j96 = "/buffer 96" 546 | meta-j97 = "/buffer 97" 547 | meta-j98 = "/buffer 98" 548 | meta-j99 = "/buffer 99" 549 | meta-k = "/input grab_key_command" 550 | meta-l = "/window bare" 551 | meta-m = "/mute mouse toggle" 552 | meta-n = "/window scroll_next_highlight" 553 | meta-p = "/window scroll_previous_highlight" 554 | meta-r = "/input delete_line" 555 | meta-s = "/mute aspell toggle" 556 | meta-u = "/window scroll_unread" 557 | meta-wmeta-meta2-A = "/window up" 558 | meta-wmeta-meta2-B = "/window down" 559 | meta-wmeta-meta2-C = "/window right" 560 | meta-wmeta-meta2-D = "/window left" 561 | meta-wmeta2-1;3A = "/window up" 562 | meta-wmeta2-1;3B = "/window down" 563 | meta-wmeta2-1;3C = "/window right" 564 | meta-wmeta2-1;3D = "/window left" 565 | meta-wmeta-b = "/window balance" 566 | meta-wmeta-s = "/window swap" 567 | meta-x = "/bar toggle nicklist" 568 | meta-z = "/window zoom" 569 | ctrl-_ = "/input undo" 570 | 571 | [key_search] 572 | ctrl-I = "/input search_switch_where" 573 | ctrl-J = "/input search_stop" 574 | ctrl-M = "/input search_stop" 575 | ctrl-R = "/input search_switch_regex" 576 | meta2-A = "/input search_previous" 577 | meta2-B = "/input search_next" 578 | meta-c = "/input search_switch_case" 579 | 580 | [key_cursor] 581 | ctrl-J = "/cursor stop" 582 | ctrl-M = "/cursor stop" 583 | meta-meta2-A = "/cursor move area_up" 584 | meta-meta2-B = "/cursor move area_down" 585 | meta-meta2-C = "/cursor move area_right" 586 | meta-meta2-D = "/cursor move area_left" 587 | meta2-1;3A = "/cursor move area_up" 588 | meta2-1;3B = "/cursor move area_down" 589 | meta2-1;3C = "/cursor move area_right" 590 | meta2-1;3D = "/cursor move area_left" 591 | meta2-A = "/cursor move up" 592 | meta2-B = "/cursor move down" 593 | meta2-C = "/cursor move right" 594 | meta2-D = "/cursor move left" 595 | @item(buffer_nicklist):K = "/window ${_window_number};/kickban ${nick}" 596 | @item(buffer_nicklist):b = "/window ${_window_number};/ban ${nick}" 597 | @item(buffer_nicklist):k = "/window ${_window_number};/kick ${nick}" 598 | @item(buffer_nicklist):q = "/window ${_window_number};/query ${nick};/cursor stop" 599 | @item(buffer_nicklist):w = "/window ${_window_number};/whois ${nick}" 600 | @chat:Q = "hsignal:chat_quote_time_prefix_message;/cursor stop" 601 | @chat:m = "hsignal:chat_quote_message;/cursor stop" 602 | @chat:q = "hsignal:chat_quote_prefix_message;/cursor stop" 603 | 604 | [key_mouse] 605 | @bar(input):button2 = "/input grab_mouse_area" 606 | @bar(nicklist):button1-gesture-down = "/bar scroll nicklist ${_window_number} +100%" 607 | @bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e" 608 | @bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%" 609 | @bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b" 610 | @chat(perl.iset):button1 = "hsignal:iset_mouse" 611 | @chat(perl.iset):button2* = "hsignal:iset_mouse" 612 | @chat(perl.iset):wheeldown = "/repeat 5 /iset **down" 613 | @chat(perl.iset):wheelup = "/repeat 5 /iset **up" 614 | @chat(script.scripts):button1 = "/window ${_window_number};/script go ${_chat_line_y}" 615 | @chat(script.scripts):button2 = "/window ${_window_number};/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}" 616 | @chat(script.scripts):wheeldown = "/script down 5" 617 | @chat(script.scripts):wheelup = "/script up 5" 618 | @item(buffer_nicklist):button1 = "/window ${_window_number};/query ${nick}" 619 | @item(buffer_nicklist):button1-gesture-left = "/window ${_window_number};/kick ${nick}" 620 | @item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}" 621 | @item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}" 622 | @item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}" 623 | @item(buffers):button1* = "hsignal:buffers_mouse" 624 | @item(buffers):button2* = "hsignal:buffers_mouse" 625 | @bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%" 626 | @bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%" 627 | @chat:button1 = "/window ${_window_number}" 628 | @chat:button1-gesture-left = "/window ${_window_number};/buffer -1" 629 | @chat:button1-gesture-left-long = "/window ${_window_number};/buffer 1" 630 | @chat:button1-gesture-right = "/window ${_window_number};/buffer +1" 631 | @chat:button1-gesture-right-long = "/window ${_window_number};/input jump_last_buffer" 632 | @chat:ctrl-wheeldown = "/window scroll_horiz -window ${_window_number} +10%" 633 | @chat:ctrl-wheelup = "/window scroll_horiz -window ${_window_number} -10%" 634 | @chat:wheeldown = "/window scroll_down -window ${_window_number}" 635 | @chat:wheelup = "/window scroll_up -window ${_window_number}" 636 | @*:button3 = "/cursor go ${_x},${_y}" 637 | -------------------------------------------------------------------------------- /.work_xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xsetroot -cursor_name left_ptr 3 | 4 | #skype & 5 | dropbox & 6 | wicd-client --tray & 7 | #~/myscripts/wallpaper.sh & 8 | #autocpu -s 9 | #sh /home/jaga/myscripts/brightness.sh 10 | #smbnetfs /media/samba & 11 | #devmon & 12 | trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype percent --width 9 --transparent true --alpha 0 --tint 0x000000 --height 19 & 13 | feh --bg-scale ~/Pictures/5408x3464.png_\#000000_1_1920x1080.png 14 | #pulseaudio --start 15 | #devilspie & 16 | #xfce4-terminal --title=cmatrix -e cmatrix --maximize & 17 | xmodmap -e keysym Menu = Super_L 18 | #setxkbmap -layout usρu\(winkeys\) -option grp:caps_toggle 19 | exec xmonad 20 | -------------------------------------------------------------------------------- /.work_xmobarrc: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "xft:DejaVu Sans:size=10:antialias=true" 3 | , bgColor = "black" 4 | , fgColor = "grey" 5 | , position = TopW L 90 6 | , commands = [ Run Weather "ULLI"["-t" , "SPB: °C" , 7 | "-L" , "3" , 8 | "-H" , "20" , 9 | "--high" , "orange" , 10 | "--normal" , "lightgreen" , 11 | "--low" , "lightblue"] 1800 12 | , Run MultiCpu ["-L" , "4" , 13 | "-H" , "65" , 14 | "--normal" , "lightgreen" , 15 | "--low" , "lightblue", 16 | "--high" , "red"] 20 17 | , Run CoreTemp ["-L" , "40" , 18 | "-H" , "57" , 19 | "--normal" , "lightgreen" , 20 | "--high" , "red", 21 | "--low" , "lightblue", 22 | "-t", "°C"] 50 23 | , Run Kbd [("us", "us"), ("ru(winkeys)", "ru")] 24 | , Run Com "/home/jaga/myscripts/getmocpinfo.sh" [] "mocSong" 10 25 | , Run Com "bash" ["/home/jaga/myscripts/getvolume.sh"] "volume" 10 26 | , Run Date "%a %b %d %H:%M:%S" "date" 10 27 | , Run DiskIO [("/home", "Home » "), 28 | ("/dev/md126p1", "SSD » |")] 29 | [ "-L" , "400" , 30 | "-H" , "32768" , 31 | "--normal" , "lightgreen" , 32 | "--high" , "red" , 33 | "--low" , "lightblue" 34 | ] 10 35 | 36 | , Run Locks 37 | , Run Network "wlp3s0" ["-L", "8", 38 | "-H", "150", 39 | "-n", "#429942" , 40 | "-h", "lightgreen", 41 | "-t", "WiFi: : "] 20 42 | , Run Memory ["-L","3", 43 | "-H","85", 44 | "--normal","lightgreen", 45 | "--high","red", 46 | "-t","Ram: %"] 20 47 | , Run Swap ["-L","3", 48 | "-H","85", 49 | "--normal","lightgreen", 50 | "--high","red", 51 | "-t","[%]"] 50 52 | , Run StdinReader 53 | , Run Volume "default" "Master" [ "-t", "", "-S", "On" ] 5 54 | ] 55 | , alignSep = "}{" 56 | , sepChar = "%" 57 | , template = "%StdinReader% }{ %mocSong% %locks%%kbd% | %multicpu% %coretemp% | %memory% %swap% | %diskio% | %wlp3s0% | ♫: %volume% | %ULLI% | %date%" 58 | } 59 | -------------------------------------------------------------------------------- /.work_zshrc: -------------------------------------------------------------------------------- 1 | source ~/.common_zshrc 2 | -------------------------------------------------------------------------------- /.xmonad/desktop_xmonad.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.Map as M 2 | import Graphics.X11.ExtraTypes.XF86 3 | import Graphics.X11.Types 4 | import Prelude 5 | import System.Exit 6 | import XMonad 7 | import XMonad.Actions.CycleWS 8 | import XMonad.Actions.DynamicWorkspaces 9 | import XMonad.Actions.GridSelect 10 | import XMonad.Actions.NoBorders 11 | import XMonad.Actions.PerWorkspaceKeys 12 | import XMonad.Actions.SpawnOn 13 | import XMonad.Actions.UpdatePointer 14 | import XMonad.Hooks.DynamicLog 15 | import XMonad.Hooks.EwmhDesktops 16 | import XMonad.Hooks.ManageHelpers 17 | import XMonad.Hooks.SetWMName 18 | import XMonad.Hooks.UrgencyHook 19 | import XMonad.Layout.Grid 20 | import XMonad.Layout.IM 21 | import XMonad.Layout.IndependentScreens 22 | import XMonad.Layout.Maximize 23 | import XMonad.Layout.Minimize 24 | import XMonad.Layout.MultiColumns 25 | import XMonad.Layout.NoBorders 26 | import XMonad.Layout.OneBig 27 | import XMonad.Layout.PerWorkspace 28 | import XMonad.Layout.Reflect 29 | import XMonad.Layout.Renamed 30 | import XMonad.Layout.ResizableTile 31 | import XMonad.Layout.Tabbed 32 | import XMonad.Prompt 33 | import XMonad.Prompt.Input 34 | import XMonad.Prompt.Pass 35 | import qualified XMonad.StackSet as W 36 | import XMonad.Util.Run 37 | 38 | import XMonad.Prompt.Shell 39 | import XMonad.Prompt.Window 40 | 41 | main :: IO () 42 | main = do 43 | xmonad =<< statusBar cmd pp kb conf 44 | where 45 | uhook = withUrgencyHookC NoUrgencyHook urgentConfig 46 | cmd = "taffybar" 47 | pp = defaultPP 48 | kb = toggleStrutsKey 49 | conf = ewmh $ uhook myConfig 50 | 51 | myConfig = defaultConfig { workspaces = myWorkspaces 52 | , modMask = modMask' 53 | , borderWidth = borderWidth' 54 | , normalBorderColor = normalBorderColor' 55 | , focusedBorderColor = focusedBorderColor' 56 | , terminal = terminal' 57 | , keys = keys' 58 | , layoutHook = layoutHook' 59 | , manageHook = manageHook' 60 | , handleEventHook = fullscreenEventHook <+> ewmhDesktopsEventHook 61 | , logHook = ewmhDesktopsLogHook >> updatePointer (0.5, 0.5) (0.25, 0.25) 62 | , startupHook = startup <+> ewmhDesktopsStartup 63 | } 64 | 65 | startup :: X () 66 | startup = do 67 | setWMName "LG3D" 68 | safeSpawn "amixer" ["-q", "set", "Master", "on"] 69 | spawn "xmodmap -e \"keysym Menu = Super_L\"" 70 | spawn "xfce4-terminal -e \"setxkbmap -layout us,ru -variant colemak, -option grp:caps_toggle && exit\"" 71 | spawnOn "ς" "skype" 72 | spawnOn "ς" "pidgin" 73 | spawnOn "ς" "slack" 74 | spawnOn "ζ" "steam" 75 | spawnOn "ψ" "xfce4-terminal --title=weechat -e weechat" 76 | spawnOn "μ" "xfce4-terminal --title=mocp -e mocp" 77 | {-spawn "killall cmatrix || xfce4-terminal --title=cmatrix -e \"cmatrix -bxu 5\" --maximize --geometry=200x100+0+17"-} 78 | 79 | manageHook' = composeAll [ 80 | isFullscreen --> doFullFloat 81 | , className =? "Skype" --> doShift "ς" 82 | , className =? "Slack" --> doShift "ς" 83 | , className =? "Pidgin" --> doShift "ς" 84 | , className =? "Steam" --> doShift "ζ" 85 | , className =? "Vlc" --> doCenterFloat 86 | , className =? "Xfce4-notifyd" --> doF W.focusDown 87 | {-, title =? "cmatrix" --> [>doIgnore <+><] (doRectFloat $ W.RationalRect 0 (17/900) 1 1) <+> doF W.focusDown <+> doF copyToAll-} 88 | {-, title =? "cmatrix" --> placeHook placeOnBottom-} 89 | , title =? "cmatrix" --> doIgnore 90 | , title =? "weechat" --> doShift "ψ" 91 | , title =? "twitter" --> doShift "ψ" 92 | , title =? "mocp" --> doShift "μ" 93 | , transience' 94 | , isDialog --> doCenterFloat 95 | , role =? "pop-up" --> doCenterFloat 96 | ] 97 | where role = stringProperty "WM_WINDOW_ROLE" 98 | 99 | myGSNavigation :: TwoD a (Maybe a) 100 | myGSNavigation = makeXEventhandler $ shadowWithKeymap navKeyMap navDefaultHandler 101 | where navKeyMap = M.fromList [ 102 | ((0,xK_Escape), cancel) 103 | ,((0,xK_Return) , select) 104 | ,((0,xK_slash) , substringSearch myGSNavigation) 105 | ,((0,xK_Left) , move (-1,0) >> myGSNavigation) 106 | ,((0,xK_h) , move (-1,0) >> myGSNavigation) 107 | ,((0,xK_Right) , move (1,0) >> myGSNavigation) 108 | ,((0,xK_l) , move (1,0) >> myGSNavigation) 109 | ,((0,xK_Down) , move (0,1) >> myGSNavigation) 110 | ,((0,xK_j) , move (0,1) >> myGSNavigation) 111 | ,((0,xK_Up) , move (0,-1) >> myGSNavigation) 112 | ,((0,xK_k) , move (0,-1) >> myGSNavigation) 113 | ,((0,xK_y) , move (-1,-1) >> myGSNavigation) 114 | ,((0,xK_i) , move (1,-1) >> myGSNavigation) 115 | ,((0,xK_n) , move (-1,1) >> myGSNavigation) 116 | ,((0,xK_m) , move (1,-1) >> myGSNavigation) 117 | ] 118 | -- The navigation handler ignores unknown key symbols 119 | navDefaultHandler = const myGSNavigation 120 | 121 | -- GridSelect 122 | myGSConfig :: HasColorizer a => GSConfig a 123 | myGSConfig = defaultGSConfig { gs_cellwidth = 160 124 | , gs_navigate = myGSNavigation 125 | } 126 | 127 | workspacesPrompt :: (String -> X ()) -> X () 128 | workspacesPrompt action = do 129 | ws <- allWorkspaces 130 | let compl = mkComplFunFromList ws 131 | inputPromptWithCompl defaultXPConfig "Workspace name" compl ?+ action 132 | 133 | allWorkspaces :: X [WorkspaceId] 134 | allWorkspaces = withWindowSet (return . map W.tag . W.workspaces) 135 | 136 | shiftFocused :: WorkspaceId -> X () 137 | shiftFocused = windows . W.shift 138 | 139 | -- urgent notification 140 | urgentConfig :: UrgencyConfig 141 | urgentConfig = UrgencyConfig { suppressWhen = Focused, remindWhen = Dont } 142 | 143 | -- borders 144 | borderWidth' = 1 145 | normalBorderColor' = "#333333" 146 | focusedBorderColor' = "#00FF00" 147 | 148 | -- tabs 149 | tabTheme1 :: Theme 150 | tabTheme1 = defaultTheme { decoHeight = 16 151 | , activeColor = "lightgreen" 152 | , activeBorderColor = "#a6c292" 153 | , activeTextColor = "#000000" 154 | , inactiveBorderColor = "#000000" 155 | } 156 | 157 | -- workspaces 158 | myWorkspaces = wspaces ++ (map show $ drop (length wspaces) [1..9]) 159 | where 160 | wspaces = ["α", "λ", "ξ", "ς", "ψ", "μ", "ζ", "ο"] 161 | 162 | myLayoutPrompt = inputPromptWithCompl defaultXPConfig "name of processes" (mkComplFunFromList' ["emacs", "qutebrowser"]) ?+ (\r -> spawn $ "pkill -x " ++ r) 163 | 164 | -- layouts 165 | layoutHook' = onWorkspace "ζ" steamLayout 166 | $ onWorkspace "ς" skypeLayout 167 | $ tile ||| mtile ||| tab ||| full ||| oneBig 168 | where 169 | rt = ResizableTall 1 (2/100) (1/2) [] 170 | skypeLayout = renamed [Replace "[][]"] 171 | $ withIM 0.18 (ClassName "Skype" `And` Not (Role "ConversationsWindow")) 172 | $ reflectHoriz 173 | $ withIM 0.18 (ClassName "Pidgin" `And` Role "buddy_list") 174 | $ reflectHoriz 175 | $ smartBorders 176 | $ multiCol [2] 4 0.01 0.5 177 | steamLayout = renamed [Replace "λ"] 178 | $ withIM 0.18 (ClassName "ζ" `And` Title "Friends") 179 | $ multiCol [1] 4 0.01 0.25 180 | tile = renamed [Replace "[]="] $ maximize $ minimize $ smartBorders rt 181 | mtile = renamed [Replace "M[]="] $ maximize $ minimize $ smartBorders $ Mirror rt 182 | oneBig = renamed [Replace "M[]="] $ maximize $ minimize $ smartBorders $ OneBig (3/4) (3/4) 183 | tab = renamed [Replace "T"] $ noBorders $ tabbed shrinkText tabTheme1 184 | full = renamed [Replace "[]"] $ noBorders Full 185 | 186 | ------------------------------------------------------------------------------- 187 | -- Terminal -- 188 | terminal' = "xfce4-terminal" 189 | 190 | ------------------------------------------------------------------------------- 191 | -- Keys/Button bindings -- 192 | -- modmask 193 | modMask' = mod4Mask 194 | 195 | -- keys 196 | toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym) 197 | toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b) 198 | 199 | keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) 200 | keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 201 | -- launching and killing programs 202 | [ ((modMask, xK_e ), safeSpawn (XMonad.terminal conf) []) 203 | , ((modMask, xK_r ), shellPrompt defaultXPConfig) 204 | , ((modMask, xK_w ), bindOn [("ζ", spawn "steam"), ("", spawn "qutebrowser")]) 205 | , ((modMask .|. shiftMask, xK_w ), safeSpawn "firefox" []) 206 | , ((modMask, xK_c ), kill) 207 | , ((modMask .|. controlMask, xK_space ), windowPromptGoto defaultXPConfig ) 208 | , ((modMask .|. controlMask, xK_p ), passPrompt defaultXPConfig ) 209 | , ((modMask, xK_a ), safeSpawn "spacefm" []) 210 | 211 | -- multimedia 212 | -- Alsa mixer bindings 213 | , ((0, xF86XK_AudioRaiseVolume ) , spawn "amixer -q set Master 3+ && /home/jaga/myscripts/getvolume.sh -s") 214 | , ((0, xF86XK_AudioLowerVolume ) , spawn "amixer -q set Master 3- && /home/jaga/myscripts/getvolume.sh -s") 215 | , ((0, xF86XK_AudioMute ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 216 | , ((modMask, xK_F12 ) , spawn "amixer -q set Master 9+ && bash /home/jaga/myscripts/getvolume.sh -s") 217 | , ((modMask, xK_F11 ) , spawn "amixer -q set Master 9- && bash \"/home/jaga/myscripts/getvolume.sh -s\"") 218 | , ((modMask, xK_F9 ) , spawn "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')") 219 | 220 | , ((modMask, xK_F10 ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 221 | --} 222 | , ((0, xF86XK_AudioPlay ) , safeSpawn "mocp" ["-G"]) 223 | , ((0, xF86XK_AudioNext ) , safeSpawn "mocp" ["-f"]) 224 | , ((0, xF86XK_AudioPrev ) , safeSpawn "mocp" ["-r"]) 225 | , ((0, xF86XK_AudioStop ) , safeSpawn "mocp" ["-s"]) 226 | , ((0, xF86XK_Tools ) , safeSpawn "lovemoc" [ ]) 227 | , ((0, xF86XK_Sleep ) , spawn "bash /home/jaga/myscripts/lockandsuspend.sh") 228 | , ((0, xK_Pause ) , safeSpawn "bash /home/jaga/myscripts/autocpu.sh" []) 229 | , ((0, xK_Print ) , spawn "import -window root /home/jaga/Dropbox/screenshots/`date +%F_%T`.png" ) 230 | , ((modMask, xF86XK_Launch6 ) , safeSpawn "autocpu" ["-n"]) 231 | , ((modMask, xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh") 232 | , ((modMask .|. shiftMask, xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh en") 233 | 234 | -- grid 235 | , ((modMask, xK_s ), goToSelected myGSConfig) 236 | 237 | -- layouts 238 | , ((modMask, xK_space ), sendMessage NextLayout) 239 | , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) 240 | 241 | -- floating layer stuff 242 | , ((modMask .|. shiftMask, xK_f ), withFocused $ windows . W.sink) 243 | , ((modMask, xK_f ), withFocused $ windows . flip W.float (W.RationalRect 0 (1/50) 1 1)) 244 | , ((modMask, xK_z ), toggleWS) 245 | , ((modMask .|. shiftMask, xK_b ), withFocused toggleBorder) 246 | 247 | , ((modMask, xK_backslash), workspacesPrompt addWorkspace) 248 | , ((modMask .|. controlMask, xK_backslash), removeEmptyWorkspace) 249 | 250 | , ((modMask .|. shiftMask, xK_backslash), workspacesPrompt $ \wid -> addHiddenWorkspace wid >> shiftFocused wid) 251 | 252 | 253 | -- focus 254 | , ((modMask, xK_Tab ), windows W.focusDown) 255 | , ((modMask, xK_j ), windows W.focusDown) 256 | , ((modMask, xK_k ), windows W.focusUp) 257 | , ((modMask, xK_y ), windows W.focusMaster) 258 | , ((modMask, xK_n ), withFocused minimizeWindow) 259 | , ((modMask .|. shiftMask, xK_n ), sendMessage RestoreNextMinimizedWin) 260 | , ((modMask, xK_m ), withFocused $ sendMessage . maximizeRestore) 261 | 262 | 263 | -- swapping 264 | , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster) 265 | , ((modMask .|. shiftMask, xK_j ), windows W.swapDown ) 266 | , ((modMask .|. shiftMask, xK_k ), windows W.swapUp ) 267 | 268 | -- increase or decrease number of windows in the master area 269 | , ((modMask, xK_comma ), sendMessage (IncMasterN 1)) 270 | , ((modMask, xK_period), sendMessage (IncMasterN (-1))) 271 | 272 | -- resizing 273 | , ((modMask, xK_h ), sendMessage Shrink) 274 | , ((modMask, xK_l ), sendMessage Expand) 275 | , ((modMask .|. shiftMask, xK_h ), sendMessage MirrorShrink) 276 | , ((modMask .|. shiftMask, xK_l ), sendMessage MirrorExpand) 277 | 278 | -- quit, or restart 279 | , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) 280 | , ((modMask, xK_q ), spawn "xmonad --recompile; xmonad --restart") 281 | ] 282 | -- mod-[1..9] %! Switch to workspace N 283 | -- mod-shift-[1..9] %! Move client to workspace N 284 | ++ 285 | zip (zip (repeat modMask) [xK_1..xK_9]) (map (withNthWorkspace W.view) [0..]) 286 | ++ 287 | zip (zip (repeat (modMask .|. shiftMask)) [xK_1..xK_9]) (map (withNthWorkspace W.shift) [0..]) 288 | ++ 289 | [((m .|. modMask .|. controlMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) 290 | | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..] 291 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] 292 | ++ 293 | [] 294 | -------------------------------------------------------------------------------- /.xmonad/work_xmonad.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.Map as M 2 | import Graphics.X11.ExtraTypes.XF86 3 | import Graphics.X11.Types 4 | import Prelude 5 | import System.Exit 6 | import XMonad 7 | import XMonad.Actions.CycleWS 8 | import XMonad.Actions.GridSelect 9 | import XMonad.Actions.SpawnOn 10 | import XMonad.Hooks.DynamicLog 11 | import XMonad.Hooks.DynamicBars 12 | import XMonad.Hooks.EwmhDesktops 13 | import XMonad.Hooks.ManageHelpers 14 | import XMonad.Hooks.SetWMName 15 | import XMonad.Hooks.UrgencyHook 16 | import XMonad.Layout.Grid 17 | import XMonad.Layout.IM 18 | import XMonad.Layout.Maximize 19 | import XMonad.Layout.Minimize 20 | import XMonad.Layout.NoBorders 21 | import XMonad.Layout.PerWorkspace 22 | import XMonad.Layout.Reflect 23 | import XMonad.Layout.Renamed 24 | import XMonad.Layout.ResizableTile 25 | import XMonad.Layout.Tabbed 26 | import XMonad.Prompt 27 | import XMonad.Prompt.Input 28 | import qualified XMonad.StackSet as W 29 | import XMonad.Util.Run 30 | 31 | import XMonad.Prompt.Shell 32 | import XMonad.Prompt.Window 33 | 34 | main :: IO () 35 | main = do 36 | spawnPipe "xrandr --output VGA-0 --auto --left-of DVI-0" 37 | xmonad =<< statusBar cmd pp kb conf 38 | where 39 | uhook = withUrgencyHookC NoUrgencyHook urgentConfig 40 | cmd = "taffybar" 41 | pp = defaultPP 42 | kb = toggleStrutsKey 43 | conf = ewmh $ uhook $ myConfig 44 | 45 | ------------------------------------------------------------------------------- 46 | -- Configs -- 47 | myConfig = defaultConfig { workspaces = workspaces' 48 | , modMask = modMask' 49 | , borderWidth = borderWidth' 50 | , normalBorderColor = normalBorderColor' 51 | , focusedBorderColor = focusedBorderColor' 52 | , terminal = terminal' 53 | , keys = keys' 54 | , layoutHook = layoutHook' 55 | , manageHook = manageHook' 56 | , handleEventHook = fullscreenEventHook <+> ewmhDesktopsEventHook <+> dynStatusBarEventHook myStatusBar myStatusBarCleanup 57 | , logHook = ewmhDesktopsLogHook 58 | , startupHook = startup <+> ewmhDesktopsStartup <+> dynStatusBarStartup myStatusBar myStatusBarCleanup 59 | } 60 | 61 | myStatusBar (S 0) = spawnPipe "taffybar -x 0" 62 | myStatusBar (S s) = spawnPipe $ "taffybar -x " ++ show s 63 | 64 | myStatusBarCleanup :: IO () 65 | myStatusBarCleanup = return () 66 | 67 | startup :: X () 68 | startup = do 69 | setWMName "LG3D" 70 | safeSpawn "amixer" ["-q", "set", "Master", "on"] 71 | spawn "killall -9 taffybar-linux-x86_64" 72 | spawn "xmodmap -e \"keysym Menu = Super_L\"" 73 | spawn "xfce4-terminal -e \"setxkbmap -layout us,ru(winkeys) -option grp:caps_toggle && exit\"" 74 | spawnOn "IM" "killall gajim; skype" 75 | spawnOn "IM" "killall gajim; gajim" 76 | spawnOn "IRC" ("xfce4-terminal --title=weechat -e weechat") 77 | {-spawn "killall cmatrix || xfce4-terminal --title=cmatrix -e \"cmatrix -bxu 5\" --maximize --geometry=200x100+0+17"-} 78 | 79 | 80 | ------------------------------------------------------------------------------- 81 | -- Window Management -- 82 | manageHook' = composeAll [ isFullscreen --> doFullFloat 83 | , className =? "Gimp" --> doFloat 84 | , className =? "Skype" --> doShift "IM" 85 | , className =? "Gajim" --> doShift "IM" 86 | , className =? "Steam" --> doShift "Steam" 87 | , className =? "Vlc" --> doCenterFloat 88 | , className =? "Xfce4-notifyd" --> doF W.focusDown 89 | {-, title =? "cmatrix" --> [>doIgnore <+><] (doRectFloat $ W.RationalRect 0 (17/900) 1 1) <+> doF W.focusDown <+> doF copyToAll-} 90 | {-, title =? "cmatrix" --> placeHook placeOnBottom-} 91 | , title =? "cmatrix" --> doIgnore 92 | , title =? "weechat" --> doShift "IRC" 93 | , transience' 94 | , isDialog --> doCenterFloat 95 | , role =? "pop-up" --> doCenterFloat 96 | ] 97 | where role = stringProperty "WM_WINDOW_ROLE" 98 | 99 | myGSNavigation :: TwoD a (Maybe a) 100 | myGSNavigation = makeXEventhandler $ shadowWithKeymap navKeyMap navDefaultHandler 101 | where navKeyMap = M.fromList [ 102 | ((0,xK_Escape), cancel) 103 | ,((0,xK_Return) , select) 104 | ,((0,xK_slash) , substringSearch myGSNavigation) 105 | ,((0,xK_Left) , move (-1,0) >> myGSNavigation) 106 | ,((0,xK_h) , move (-1,0) >> myGSNavigation) 107 | ,((0,xK_Right) , move (1,0) >> myGSNavigation) 108 | ,((0,xK_l) , move (1,0) >> myGSNavigation) 109 | ,((0,xK_Down) , move (0,1) >> myGSNavigation) 110 | ,((0,xK_j) , move (0,1) >> myGSNavigation) 111 | ,((0,xK_Up) , move (0,-1) >> myGSNavigation) 112 | ,((0,xK_k) , move (0,-1) >> myGSNavigation) 113 | ,((0,xK_y) , move (-1,-1) >> myGSNavigation) 114 | ,((0,xK_i) , move (1,-1) >> myGSNavigation) 115 | ,((0,xK_n) , move (-1,1) >> myGSNavigation) 116 | ,((0,xK_m) , move (1,-1) >> myGSNavigation) 117 | ] 118 | -- The navigation handler ignores unknown key symbols 119 | navDefaultHandler = const myGSNavigation 120 | 121 | -- GridSelect 122 | myGSConfig :: HasColorizer a => GSConfig a 123 | myGSConfig = defaultGSConfig { gs_cellwidth = 160 124 | , gs_navigate = myGSNavigation 125 | } 126 | 127 | -- urgent notification 128 | urgentConfig :: UrgencyConfig 129 | urgentConfig = UrgencyConfig { suppressWhen = Focused, remindWhen = Dont } 130 | 131 | -- borders 132 | borderWidth' = 1 133 | normalBorderColor' = "#333333" 134 | focusedBorderColor' = "#00FF00" 135 | 136 | -- tabs 137 | tabTheme1 :: Theme 138 | tabTheme1 = defaultTheme { decoHeight = 16 139 | , activeColor = "lightgreen" 140 | , activeBorderColor = "#a6c292" 141 | , activeTextColor = "#000000" 142 | , inactiveBorderColor = "#000000" 143 | } 144 | 145 | -- workspaces 146 | workspaces' = wspaces ++ (map show $ drop (length wspaces) [1..9]) 147 | where 148 | wspaces = ["General", "Programming", "Work", "IM", "IRC", "Media", "Steam", "Game"] 149 | 150 | myLayoutPrompt = inputPromptWithCompl defaultXPConfig "name of processes" (mkComplFunFromList' ["emacs", "dwb"]) ?+ (\r -> spawn $ "pkill -x " ++ r) 151 | 152 | -- layouts 153 | layoutHook' = onWorkspace "IM" skypeLayout (tile ||| mtile ||| tab ||| full) 154 | where 155 | rt = ResizableTall 1 (2/100) (1/2) [] 156 | skypeLayout = renamed [Replace "[][]"] $ withIM 0.18 (ClassName "Skype" `And` (Not (Role "ConversationsWindow"))) $ reflectHoriz $ withIM 0.18 (ClassName "Gajim") $ reflectHoriz $ Grid 157 | tile = renamed [Replace "[]="] $ maximize $ minimize $ smartBorders rt 158 | mtile = renamed [Replace "M[]="] $ maximize $ minimize $ smartBorders $ Mirror rt 159 | tab = renamed [Replace "T"] $ noBorders $ tabbed shrinkText tabTheme1 160 | full = renamed [Replace "[]"] $ noBorders Full 161 | 162 | ------------------------------------------------------------------------------- 163 | -- Terminal -- 164 | terminal' = "xfce4-terminal" 165 | 166 | ------------------------------------------------------------------------------- 167 | -- Keys/Button bindings -- 168 | -- modmask 169 | modMask' = mod4Mask 170 | 171 | -- keys 172 | toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym) 173 | toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b) 174 | 175 | interactiveRunInTerm c config = do 176 | cmds <- io getCommands 177 | mkXPrompt Shell config (getShellCompl cmds) run 178 | where run a = unsafeSpawn $ c ++ " " ++ a 179 | 180 | keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) 181 | keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 182 | -- launching and killing programs 183 | [ ((modMask, xK_e ), safeSpawn (XMonad.terminal conf) []) 184 | , ((modMask , xK_r ), shellPrompt defaultXPConfig) 185 | , ((modMask .|. shiftMask , xK_r ), interactiveRunInTerm (XMonad.terminal conf ++ " -e") defaultXPConfig ) 186 | , ((modMask , xK_w ), safeSpawn "dwb" []) 187 | , ((modMask .|. shiftMask , xK_w ), safeSpawn "chromium" []) 188 | , ((modMask , xK_c ), kill) 189 | , ((modMask .|. controlMask, xK_space ), windowPromptGoto defaultXPConfig ) 190 | , ((modMask , xK_a ), safeSpawn "xfe" []) 191 | 192 | -- multimedia 193 | -- Alsa mixer bindings 194 | , ((0 , xF86XK_AudioRaiseVolume ) , spawn "amixer -q set Master 3+ && /home/jaga/myscripts/getvolume.sh -s") 195 | , ((0 , xF86XK_AudioLowerVolume ) , spawn "amixer -q set Master 3- && /home/jaga/myscripts/getvolume.sh -s") 196 | , ((0 , xF86XK_AudioMute ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 197 | , ((modMask , xK_F12 ) , spawn "amixer -q set Master 9+ && bash /home/jaga/myscripts/getvolume.sh -s") 198 | , ((modMask , xK_p ) , spawn "xrandr --output DVI-0 --off --output VGA-0 --auto && slimlock && xrandr --output VGA-0 --auto --left-of DVI-0 --output DVI-0 --auto") 199 | , ((modMask , xK_F11 ) , spawn "amixer -q set Master 9- && bash \"/home/jaga/myscripts/getvolume.sh -s\"") 200 | , ((modMask , xK_F9 ) , spawn "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')") 201 | 202 | , ((modMask , xK_F10 ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 203 | --} 204 | , ((0 , xF86XK_AudioPlay ) , safeSpawn "mocp" ["-G"]) 205 | , ((0 , xF86XK_AudioNext ) , safeSpawn "mocp" ["-f"]) 206 | , ((0 , xF86XK_AudioPrev ) , safeSpawn "mocp" ["-r"]) 207 | , ((0 , xF86XK_AudioStop ) , safeSpawn "mocp" ["-s"]) 208 | , ((0 , xF86XK_AudioMedia ) , spawn "xfce4-terminal -e mocp") 209 | , ((0 , xF86XK_Sleep ) , spawn "bash /home/jaga/myscripts/lockandsuspend.sh") 210 | , ((0 , xK_Pause ) , safeSpawn "bash /home/jaga/myscripts/autocpu.sh" []) 211 | , ((0 , xK_Print ) , spawn "import -window root /home/jaga/Dropbox/screenshots/`date +%F_%T`.png" ) 212 | , ((modMask , xF86XK_Launch6 ) , safeSpawn "autocpu" ["-n"]) 213 | , ((modMask , xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh") 214 | , ((modMask .|. shiftMask , xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh en") 215 | 216 | -- grid 217 | , ((modMask , xK_s ), goToSelected myGSConfig) 218 | 219 | -- layouts 220 | , ((modMask , xK_space ), sendMessage NextLayout) 221 | , ((modMask .|. shiftMask , xK_space ), setLayout $ XMonad.layoutHook conf) 222 | 223 | -- floating layer stuff 224 | , ((modMask .|. shiftMask , xK_f ), withFocused $ windows . W.sink) 225 | , ((modMask , xK_f ), withFocused $ windows . (flip W.float) (W.RationalRect (0) (1/50) (1/1) (1/1))) --TODO 226 | , ((modMask , xK_z ), toggleWS) 227 | 228 | 229 | -- focus 230 | , ((modMask , xK_Tab ), windows W.focusDown) 231 | , ((modMask , xK_j ), windows W.focusDown) 232 | , ((modMask , xK_k ), windows W.focusUp) 233 | , ((modMask , xK_y ), windows W.focusMaster) 234 | , ((modMask , xK_n ), withFocused minimizeWindow) 235 | , ((modMask .|. shiftMask , xK_n ), sendMessage RestoreNextMinimizedWin) 236 | , ((modMask , xK_m ), withFocused $ sendMessage . maximizeRestore) 237 | 238 | 239 | -- swapping 240 | , ((modMask .|. shiftMask , xK_Return), windows W.swapMaster) 241 | , ((modMask .|. shiftMask , xK_j ), windows W.swapDown ) 242 | , ((modMask .|. shiftMask , xK_k ), windows W.swapUp ) 243 | 244 | -- increase or decrease number of windows in the master area 245 | , ((modMask , xK_comma ), sendMessage (IncMasterN 1)) 246 | , ((modMask , xK_period), sendMessage (IncMasterN (-1))) 247 | 248 | -- resizing 249 | , ((modMask , xK_h ), sendMessage Shrink) 250 | , ((modMask , xK_l ), sendMessage Expand) 251 | , ((modMask .|. shiftMask , xK_h ), sendMessage MirrorShrink) 252 | , ((modMask .|. shiftMask , xK_l ), sendMessage MirrorExpand) 253 | 254 | -- quit, or restart 255 | , ((modMask .|. shiftMask , xK_q ), io (exitWith ExitSuccess)) 256 | , ((modMask , xK_q ), spawn "xmonad --recompile; xmonad --restart") 257 | ] 258 | ++ 259 | -- mod-[1..9] %! Switch to workspace N 260 | -- mod-shift-[1..9] %! Move client to workspace N 261 | [((m .|. modMask, k), windows $ f i) 262 | | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] 263 | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 264 | ++ 265 | [] 266 | 267 | ------------------------------------------------------------------------------- 268 | 269 | -------------------------------------------------------------------------------- /.xmonad/zenbook_xmonad.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.Map as M 2 | import Graphics.X11.ExtraTypes.XF86 3 | import Graphics.X11.Types 4 | import Prelude 5 | import System.Exit 6 | import XMonad 7 | import XMonad.Actions.CycleWS 8 | import XMonad.Actions.GridSelect 9 | import XMonad.Actions.SpawnOn 10 | import XMonad.Hooks.DynamicLog 11 | import XMonad.Hooks.EwmhDesktops 12 | import XMonad.Hooks.ManageHelpers 13 | import XMonad.Hooks.SetWMName 14 | import XMonad.Hooks.UrgencyHook 15 | import XMonad.Layout.Grid 16 | import XMonad.Layout.IM 17 | import XMonad.Layout.Maximize 18 | import XMonad.Layout.Minimize 19 | import XMonad.Layout.NoBorders 20 | import XMonad.Layout.PerWorkspace 21 | import XMonad.Layout.Reflect 22 | import XMonad.Layout.Renamed 23 | import XMonad.Layout.ResizableTile 24 | import XMonad.Layout.Tabbed 25 | import XMonad.Prompt 26 | import XMonad.Prompt.Input 27 | import qualified XMonad.StackSet as W 28 | import XMonad.Util.Run 29 | 30 | import XMonad.Prompt.Shell 31 | import XMonad.Prompt.Window 32 | 33 | main :: IO () 34 | main = do 35 | xmonad =<< statusBar cmd pp kb conf 36 | where 37 | uhook = withUrgencyHookC NoUrgencyHook urgentConfig 38 | cmd = "taffybar" 39 | pp = defaultPP 40 | kb = toggleStrutsKey 41 | conf = ewmh $ uhook $ myConfig 42 | 43 | ------------------------------------------------------------------------------- 44 | -- Configs -- 45 | myConfig = defaultConfig { workspaces = workspaces' 46 | , modMask = modMask' 47 | , borderWidth = borderWidth' 48 | , normalBorderColor = normalBorderColor' 49 | , focusedBorderColor = focusedBorderColor' 50 | , terminal = terminal' 51 | , keys = keys' 52 | , layoutHook = layoutHook' 53 | , manageHook = manageHook' 54 | , handleEventHook = fullscreenEventHook <+> ewmhDesktopsEventHook 55 | , logHook = ewmhDesktopsLogHook 56 | , startupHook = startup <+> ewmhDesktopsStartup 57 | } 58 | 59 | 60 | startup :: X () 61 | startup = do 62 | setWMName "LG3D" 63 | safeSpawn "amixer" ["-q", "set", "Master", "on"] 64 | spawn "killall taffybar-linux-x86_64 && taffybar" 65 | spawn "xmodmap -e \"keysym Menu = Super_L\"" 66 | spawn "xfce4-terminal -e \"setxkbmap -layout us,ru(winkeys) -option grp:caps_toggle && exit\"" 67 | spawnOn "IM" "skype" 68 | spawnOn "IM" "gajim" 69 | spawnOn "IRC" ("xfce4-terminal --title=weechat -e weechat") 70 | {-spawn "killall cmatrix || xfce4-terminal --title=cmatrix -e \"cmatrix -bxu 5\" --maximize --geometry=200x100+0+17"-} 71 | 72 | 73 | ------------------------------------------------------------------------------- 74 | -- Window Management -- 75 | manageHook' = composeAll [ isFullscreen --> doFullFloat 76 | , className =? "Gimp" --> doFloat 77 | , className =? "Skype" --> doShift "IM" 78 | , className =? "Gajim" --> doShift "IM" 79 | , className =? "Steam" --> doShift "Steam" 80 | , className =? "Vlc" --> doCenterFloat 81 | , className =? "Xfce4-notifyd" --> doF W.focusDown 82 | {-, title =? "cmatrix" --> [>doIgnore <+><] (doRectFloat $ W.RationalRect 0 (17/900) 1 1) <+> doF W.focusDown <+> doF copyToAll-} 83 | {-, title =? "cmatrix" --> placeHook placeOnBottom-} 84 | , title =? "cmatrix" --> doIgnore 85 | , title =? "weechat" --> doShift "IRC" 86 | , transience' 87 | , isDialog --> doCenterFloat 88 | , role =? "pop-up" --> doCenterFloat 89 | ] 90 | where role = stringProperty "WM_WINDOW_ROLE" 91 | 92 | myGSNavigation :: TwoD a (Maybe a) 93 | myGSNavigation = makeXEventhandler $ shadowWithKeymap navKeyMap navDefaultHandler 94 | where navKeyMap = M.fromList [ 95 | ((0,xK_Escape), cancel) 96 | ,((0,xK_Return) , select) 97 | ,((0,xK_slash) , substringSearch myGSNavigation) 98 | ,((0,xK_Left) , move (-1,0) >> myGSNavigation) 99 | ,((0,xK_h) , move (-1,0) >> myGSNavigation) 100 | ,((0,xK_Right) , move (1,0) >> myGSNavigation) 101 | ,((0,xK_l) , move (1,0) >> myGSNavigation) 102 | ,((0,xK_Down) , move (0,1) >> myGSNavigation) 103 | ,((0,xK_j) , move (0,1) >> myGSNavigation) 104 | ,((0,xK_Up) , move (0,-1) >> myGSNavigation) 105 | ,((0,xK_k) , move (0,-1) >> myGSNavigation) 106 | ,((0,xK_y) , move (-1,-1) >> myGSNavigation) 107 | ,((0,xK_i) , move (1,-1) >> myGSNavigation) 108 | ,((0,xK_n) , move (-1,1) >> myGSNavigation) 109 | ,((0,xK_m) , move (1,-1) >> myGSNavigation) 110 | ] 111 | -- The navigation handler ignores unknown key symbols 112 | navDefaultHandler = const myGSNavigation 113 | 114 | -- GridSelect 115 | myGSConfig :: HasColorizer a => GSConfig a 116 | myGSConfig = defaultGSConfig { gs_cellwidth = 160 117 | , gs_navigate = myGSNavigation 118 | } 119 | 120 | -- urgent notification 121 | urgentConfig :: UrgencyConfig 122 | urgentConfig = UrgencyConfig { suppressWhen = Focused, remindWhen = Dont } 123 | 124 | -- borders 125 | borderWidth' = 1 126 | normalBorderColor' = "#333333" 127 | focusedBorderColor' = "#00FF00" 128 | 129 | -- tabs 130 | tabTheme1 :: Theme 131 | tabTheme1 = defaultTheme { decoHeight = 16 132 | , activeColor = "lightgreen" 133 | , activeBorderColor = "#a6c292" 134 | , activeTextColor = "#000000" 135 | , inactiveBorderColor = "#000000" 136 | } 137 | 138 | -- workspaces 139 | workspaces' = wspaces ++ (map show $ drop (length wspaces) [1..9]) 140 | where 141 | wspaces = ["General", "Programming", "Work", "IM", "IRC", "Media", "Steam", "Game"] 142 | 143 | myLayoutPrompt = inputPromptWithCompl defaultXPConfig "name of processes" (mkComplFunFromList' ["emacs", "dwb"]) ?+ (\r -> spawn $ "pkill -x " ++ r) 144 | 145 | -- layouts 146 | layoutHook' = onWorkspace "IM" skypeLayout (tile ||| mtile ||| tab ||| full) 147 | where 148 | rt = ResizableTall 1 (2/100) (1/2) [] 149 | skypeLayout = renamed [Replace "[][]"] $ withIM 0.18 (ClassName "Skype" `And` (Not (Role "ConversationsWindow"))) $ reflectHoriz $ withIM 0.18 (ClassName "Gajim") $ reflectHoriz $ Grid 150 | tile = renamed [Replace "[]="] $ maximize $ minimize $ smartBorders rt 151 | mtile = renamed [Replace "M[]="] $ maximize $ minimize $ smartBorders $ Mirror rt 152 | tab = renamed [Replace "T"] $ noBorders $ tabbed shrinkText tabTheme1 153 | full = renamed [Replace "[]"] $ noBorders Full 154 | 155 | ------------------------------------------------------------------------------- 156 | -- Terminal -- 157 | terminal' = "xfce4-terminal" 158 | 159 | ------------------------------------------------------------------------------- 160 | -- Keys/Button bindings -- 161 | -- modmask 162 | modMask' = mod4Mask 163 | 164 | -- keys 165 | toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym) 166 | toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b) 167 | 168 | {-interactiveRunInTerm c config = do-} 169 | {-cmds <- io getCommands-} 170 | {-mkXPrompt Shell config (getShellCompl cmds) run-} 171 | {-where run a = unsafeSpawn $ c ++ " " ++ a-} 172 | 173 | keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) 174 | keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 175 | -- launching and killing programs 176 | [ ((modMask, xK_e ), safeSpawn (XMonad.terminal conf) []) 177 | , ((modMask , xK_r ), shellPrompt defaultXPConfig) 178 | {-, ((modMask .|. shiftMask , xK_r ), interactiveRunInTerm (XMonad.terminal conf ++ " -e") defaultXPConfig )-} 179 | , ((modMask , xK_w ), safeSpawn "dwb" []) 180 | , ((modMask .|. shiftMask , xK_w ), safeSpawn "chromium" []) 181 | , ((modMask, xK_a ), safeSpawn (XMonad.terminal conf) ["-x", "mc"]) 182 | , ((modMask , xK_c ), kill) 183 | , ((modMask .|. controlMask, xK_space ), windowPromptGoto defaultXPConfig ) 184 | 185 | -- multimedia 186 | -- Alsa mixer bindings 187 | , ((0 , xF86XK_AudioRaiseVolume ) , spawn "amixer -q set Master 3%+ && /home/jaga/myscripts/getvolume.sh -s") 188 | , ((0 , xF86XK_AudioLowerVolume ) , spawn "amixer -q set Master 3%- && /home/jaga/myscripts/getvolume.sh -s") 189 | , ((0 , xF86XK_AudioMute ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 190 | , ((modMask , xK_F12 ) , spawn "amixer -q set Master 9%+ && /home/jaga/myscripts/getvolume.sh -s") 191 | , ((modMask , xK_F11 ) , spawn "amixer -q set Master 9%- && /home/jaga/myscripts/getvolume.sh -s") 192 | , ((modMask , xK_F9 ) , spawn "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')") 193 | 194 | , ((modMask , xK_F10 ) , safeSpawn "amixer" ["-q", "set", "Master", "0"]) 195 | --} 196 | , ((0 , xF86XK_AudioPlay ) , safeSpawn "mocp" ["-G"]) 197 | , ((0 , xF86XK_AudioNext ) , safeSpawn "mocp" ["-f"]) 198 | , ((0 , xF86XK_AudioPrev ) , safeSpawn "mocp" ["-r"]) 199 | , ((0 , xF86XK_AudioStop ) , safeSpawn "mocp" ["-s"]) 200 | , ((0 , xF86XK_AudioMedia ) , spawn "xfce4-terminal -e mocp") 201 | , ((0 , xF86XK_Sleep ) , spawn "bash /home/jaga/myscripts/lockandsuspend.sh") 202 | , ((0 , xK_Pause ) , safeSpawn "bash /home/jaga/myscripts/autocpu.sh" []) 203 | , ((0 , xK_Print ) , spawn "import -window root /home/jaga/Dropbox/screenshots/`date +%F_%T`.png" ) 204 | , ((modMask , xF86XK_Launch6 ) , safeSpawn "autocpu" ["-n"]) 205 | , ((modMask , xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh") 206 | 207 | --} 208 | , ((modMask, xK_F3 ), safeSpawn "mocp" ["-G"]) 209 | , ((modMask, xK_F4 ), safeSpawn "mocp" ["-f"]) 210 | , ((modMask .|. shiftMask, xK_F4 ), safeSpawn "mocp" ["-r"]) 211 | , ((0, xF86XK_Launch6 ), safeSpawn "autocpu" []) 212 | , ((modMask, xF86XK_Launch6 ), safeSpawn "autocpu" ["-n"]) 213 | , ((modMask , xK_t ) , spawn "bash /home/jaga/myscripts/screen-translate.sh") 214 | -- grid 215 | , ((modMask , xK_s ), goToSelected myGSConfig) 216 | 217 | -- layouts 218 | , ((modMask , xK_space ), sendMessage NextLayout) 219 | , ((modMask .|. shiftMask , xK_space ), setLayout $ XMonad.layoutHook conf) 220 | 221 | -- floating layer stuff 222 | , ((modMask .|. shiftMask , xK_f ), withFocused $ windows . W.sink) 223 | , ((modMask , xK_f ), withFocused $ windows . (flip W.float) (W.RationalRect (0) (1/50) (1/1) (1/1))) --TODO 224 | , ((modMask , xK_z ), toggleWS) 225 | 226 | 227 | -- focus 228 | , ((modMask , xK_Tab ), windows W.focusDown) 229 | , ((modMask , xK_j ), windows W.focusDown) 230 | , ((modMask , xK_k ), windows W.focusUp) 231 | , ((modMask , xK_y ), windows W.focusMaster) 232 | , ((modMask , xK_n ), withFocused minimizeWindow) 233 | , ((modMask .|. shiftMask , xK_n ), sendMessage RestoreNextMinimizedWin) 234 | , ((modMask , xK_m ), withFocused $ sendMessage . maximizeRestore) 235 | 236 | 237 | -- swapping 238 | , ((modMask .|. shiftMask , xK_Return), windows W.swapMaster) 239 | , ((modMask .|. shiftMask , xK_j ), windows W.swapDown ) 240 | , ((modMask .|. shiftMask , xK_k ), windows W.swapUp ) 241 | 242 | -- increase or decrease number of windows in the master area 243 | , ((modMask , xK_comma ), sendMessage (IncMasterN 1)) 244 | , ((modMask , xK_period), sendMessage (IncMasterN (-1))) 245 | 246 | -- resizing 247 | , ((modMask , xK_h ), sendMessage Shrink) 248 | , ((modMask , xK_l ), sendMessage Expand) 249 | , ((modMask .|. shiftMask , xK_h ), sendMessage MirrorShrink) 250 | , ((modMask .|. shiftMask , xK_l ), sendMessage MirrorExpand) 251 | 252 | -- quit, or restart 253 | , ((modMask .|. shiftMask , xK_q ), io (exitWith ExitSuccess)) 254 | , ((modMask , xK_q ), spawn "xmonad --recompile; xmonad --restart") 255 | ] 256 | ++ 257 | -- mod-[1..9] %! Switch to workspace N 258 | -- mod-shift-[1..9] %! Move client to workspace N 259 | [((m .|. modMask, k), windows $ f i) 260 | | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] 261 | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 262 | ++ 263 | [] 264 | 265 | ------------------------------------------------------------------------------- 266 | 267 | -------------------------------------------------------------------------------- /.zenbook_xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xsetroot -cursor_name left_ptr 3 | 4 | #skype & 5 | dropboxd & 6 | wicd-client --tray & 7 | sudo mount /dev/sda2 & 8 | #~/myscripts/wallpaper.sh & 9 | #autocpu -s 10 | #sh /home/jaga/myscripts/brightness.sh 11 | #smbnetfs /media/samba & 12 | #devmon & 13 | mount-tray & 14 | lastfmsubmitd --no-daemon & 15 | trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype percent --width 6 --transparent true --alpha 0 --tint 0x000000 --height 17 & 16 | feh --bg-scale ~/Dropbox/Camera\ Uploads/etc/haskellwall.jpg 17 | #devilspie & 18 | #xfce4-terminal --title=cmatrix -e cmatrix --maximize & 19 | xmodmap -e keysym Menu = Super_L 20 | exec xmonad 21 | -------------------------------------------------------------------------------- /.zenbook_xmobarrc: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "xft:DejaVu Sans:size=8:antialias=true" 3 | , bgColor = "black" 4 | , fgColor = "grey" 5 | , position = TopW L 94 6 | , commands = [ Run Weather "ULLI"["-t" , "SPB °C" , 7 | "-L" , "3" , 8 | "-H" , "20" , 9 | "--high" , "orange" , 10 | "--normal" , "lightgreen" , 11 | "--low" , "lightblue"] 10800 12 | , Run MultiCpu ["-L" , "4" , 13 | "-H" , "65" , 14 | "--normal" , "lightgreen" , 15 | "--low" , "lightblue", 16 | "--high" , "red"] 20 17 | , Run CoreTemp ["-L" , "40" , 18 | "-H" , "57" , 19 | "--normal" , "lightgreen" , 20 | "--high" , "red", 21 | "--low" , "lightblue", 22 | "-t", "°C"] 50 23 | , Run Battery [ "-t","% · ", 24 | "-L","20", 25 | "-H","90", 26 | "-h","green", 27 | "-n", "lightgreen", 28 | "-l","red"] 100 29 | , Run Com "/home/jaga/myscripts/getvolume.sh" [] "myVolume" 20 30 | , Run Com "/home/jaga/myscripts/currentlayout.sh" [] "myLayout" 20 31 | , Run Com "/home/jaga/myscripts/autocpu.sh -c" [] "myGov" 50 32 | , Run Com "/home/jaga/myscripts/getmocpinfo.sh" [] "mocSong" 50 33 | , Run Com "/home/jaga/myscripts/low_battery.sh" [] "checkingBattery" 1200 34 | , Run Date "%a %b %d %H:%M:%S" "date" 10 35 | , Run DiskIO [("sda4", "SSD » ")] 36 | [ "-L" , "400" , 37 | "-H" , "327680" , 38 | "--normal" , "lightgreen" , 39 | "--high" , "red" , 40 | "--low" , "lightblue" 41 | ] 20 42 | , Run Locks 43 | , Run Network "wlan0" ["-L", "8", 44 | "-H", "150", 45 | "-n", "#429942" , 46 | "-h", "lightgreen", 47 | "-t", "WiFi: : "] 20 48 | , Run Memory ["-L","3", 49 | "-H","85", 50 | "--normal","lightgreen", 51 | "--high","red", 52 | "-t","Ram: %"] 50 53 | , Run Swap ["-L","3", 54 | "-H","85", 55 | "--normal","lightgreen", 56 | "--high","red", 57 | "-t","[%]"] 50 58 | , Run StdinReader 59 | ] 60 | , sepChar = "%" 61 | , alignSep = "}{" 62 | , template = "%StdinReader% }{ %mocSong%%checkingBattery% %locks%%myLayout% | %multicpu% [%myGov%] %coretemp% | %memory% %swap% | %diskio% | %wlan0% | %battery% | ♫: %myVolume% | %ULLI% | %date%" 63 | } 64 | -------------------------------------------------------------------------------- /.zenbook_zshrc: -------------------------------------------------------------------------------- 1 | source ~/.common_zshrc 2 | -------------------------------------------------------------------------------- /.zkbd/konsole-:0: -------------------------------------------------------------------------------- 1 | typeset -g -A key 2 | 3 | key[F1]='^[OP' 4 | key[F2]='^[OQ' 5 | key[F3]='^[OR' 6 | key[F4]='^[OS' 7 | key[F5]='^[[15~' 8 | key[F6]='^[[17~' 9 | key[F7]='^[[18~' 10 | key[F8]='^[[19~' 11 | key[F9]='^[[20~' 12 | key[F10]='^[[21~' 13 | key[F11]='^[[23~' 14 | key[F12]='^[[24~' 15 | key[Backspace]='^?' 16 | key[Insert]='^[[2~' 17 | key[Home]='^[[H' 18 | key[PageUp]='^[[5~' 19 | key[Delete]='^[[3~' 20 | key[End]='^[[F' 21 | key[PageDown]='^[[6~' 22 | key[Up]='^[[A' 23 | key[Left]='^[[D' 24 | key[Down]='^[[B' 25 | key[Right]='^[[C' 26 | key[Menu]='''' 27 | -------------------------------------------------------------------------------- /.zkbd/xterm-:0.0: -------------------------------------------------------------------------------- 1 | typeset -g -A key 2 | 3 | key[F1]='^[OP' 4 | key[F2]='^[OQ' 5 | key[F3]='^[OR' 6 | key[F4]='^[OS' 7 | key[F5]='^[[15~' 8 | key[F6]='^[[17~' 9 | key[F7]='^[[18~' 10 | key[F8]='^[[19~' 11 | key[F9]='^[[20~' 12 | key[F10]='^[[21~' 13 | key[F11]='^[[23~' 14 | key[F12]='^[[24~' 15 | key[Backspace]='^?' 16 | key[Insert]='^[[2~' 17 | key[Home]='^[OH' 18 | key[PageUp]='^[[5~' 19 | key[Delete]='^[[3~' 20 | key[End]='^[OF' 21 | key[PageDown]='^[[6~' 22 | key[Up]='^[[A' 23 | key[Left]='^[[D' 24 | key[Down]='^[[B' 25 | key[Right]='^[[C' 26 | key[Menu]='''' 27 | -------------------------------------------------------------------------------- /.zsh/MyAntigen.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | module MyAntigen where 3 | 4 | import Antigen ( 5 | -- Rudimentary imports 6 | AntigenConfig (..) 7 | , defaultConfig 8 | , bundle 9 | , antigen 10 | -- If you want to source a bit trickier plugins 11 | , ZshPlugin (..) 12 | , antigenSourcingStrategy 13 | , filePathsSourcingStrategy 14 | ) 15 | 16 | bundles = 17 | [ bundle "Tarrasch/zsh-bd" 18 | , bundle "zsh-users/zsh-syntax-highlighting" 19 | 20 | -- If you use a plugin that doesn't have a *.plugin.zsh file. You can set a 21 | -- more liberal sourcing strategy. 22 | -- 23 | -- , (bundle "some/stupid-plugin") { sourcingStrategy = antigenSourcingStrategy } 24 | 25 | -- If you use a plugin that has sub-plugins. You can specify that as well 26 | -- 27 | -- NOTE: If you want to use oh-my-zsh for real (please don't), you still need 28 | -- to set the $ZSH env var manually. 29 | -- , (bundle "robbyrussell/oh-my-zsh") 30 | -- { sourcingLocations = [ "plugins/wd" 31 | -- , "plugins/colorize"] } 32 | 33 | -- Sourcing a list of files 34 | -- , (bundle "alfredodeza/zsh-plugins") 35 | -- { sourcingStrategy = filePathsSourcingStrategy 36 | -- [ "vi/zle_vi_visual.zsh" 37 | -- , "pytest/pytest.plugin.zsh" 38 | -- ] } 39 | 40 | -- Alternatively, this way will give you the same result 41 | -- , (bundle "alfredodeza/zsh-plugins") 42 | -- { sourcingStrategy = antigenSourcingStrategy 43 | -- , sourcingLocations = [ "vi" 44 | -- , "pytest" 45 | -- ] } 46 | 47 | -- vvv Add your plugins here vvv 48 | ] 49 | 50 | config = defaultConfig { plugins = bundles } 51 | 52 | main :: IO () 53 | main = antigen config 54 | -------------------------------------------------------------------------------- /.zsh/git-prompt/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Olivier Verdier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.zsh/git-prompt/README.md: -------------------------------------------------------------------------------- 1 | # Informative git prompt for zsh 2 | 3 | A `zsh` prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc. 4 | 5 | (an original idea from this [blog post][]). 6 | 7 | ## Examples 8 | 9 | The prompt may look like the following: 10 | 11 | - `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged 12 | - `(status|●2)`: on branch `status`, 2 files staged 13 | - `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked 14 | - `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed 15 | - `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean 16 | - `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; 17 | the repository is otherwise clean 18 | 19 | Here is how it could look like when you are ahead by 4 commits, behind by 5 commits, and have 1 staged files, 1 changed but unstaged file, and some untracked files, on branch `dev`: 20 | 21 | ![Example][] 22 | 23 | ## Prompt Structure 24 | 25 | By default, the general appearance of the prompt is: 26 | 27 | ``` 28 | (|) 29 | ``` 30 | 31 | The symbols are as follows: 32 | 33 | ### Local Status Symbols 34 | 35 | |Symbol|Meaning 36 | |------|------| 37 | |✔ | repository clean 38 | |●n | there are `n` staged files 39 | |✖n | there are `n` unmerged files 40 | |✚n | there are `n` changed but *unstaged* files 41 | |… | there are some untracked files 42 | 43 | 44 | ### Branch Tracking Symbols 45 | 46 | Symbol | Meaning 47 | -------|------- 48 | ↑n | ahead of remote by `n` commits 49 | ↓n | behind remote by `n` commits 50 | ↓m↑n | branches diverged, other by `m` commits, yours by `n` commits 51 | 52 | ### Branch Symbol 53 | 54 | When the branch name starts with a colon `:`, it means it’s actually a hash, not a branch (although it should be pretty clear, unless you name your branches like hashes :-) 55 | 56 | ## Install 57 | 58 | 1. Clone this repository somewhere on your hard drive. 59 | 2. Source the file `zshrc.sh` from your `~/.zshrc` config file, and 60 | configure your prompt. So, somewhere in `~/.zshrc`, you should have: 61 | 62 | ```sh 63 | source path/to/zshrc.sh 64 | # an example prompt 65 | PROMPT='%B%m%~%b$(git_super_status) %# ' 66 | ``` 67 | 3. Go in a git repository and test it! 68 | 69 | ### Haskell (optional) 70 | 71 | There is now a Haskell implementation as well, which can be four to six times faster than the Python one. The reason is not that Haskell is faster in itself (although it is), but that this implementation calls `git` only once. To install, do the following: 72 | 73 | 1. Make sure Haskell is installed on your system 74 | 2. Run `cabal build` from this folder 75 | 3. Define the variable `GIT_PROMPT_EXECUTABLE="haskell"` somewhere in 76 | your `.zshrc` 77 | 78 | ## Customisation 79 | 80 | - You may redefine the function `git_super_status` (after the `source` statement) to adapt it to your needs (to change the order in which the information is displayed). 81 | - Define the variable `ZSH_THEME_GIT_PROMPT_CACHE` in order to enable caching. 82 | - You may also change a number of variables (which name start with `ZSH_THEME_GIT_PROMPT_`) to change the appearance of the prompt. Take a look in the file `zshrc.sh` to see how the function `git_super_status` is defined, and what variables are available. 83 | 84 | **Enjoy!** 85 | 86 | [blog post]: http://sebastiancelis.com/2009/nov/16/zsh-prompt-git-users/ 87 | [Example]: https://github.com/olivierverdier/zsh-git-prompt/raw/master/screenshot.png 88 | 89 | -------------------------------------------------------------------------------- /.zsh/git-prompt/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /.zsh/git-prompt/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | pkgs.haskellPackages.callPackage ./git-prompt.nix {} 3 | -------------------------------------------------------------------------------- /.zsh/git-prompt/git-prompt.cabal: -------------------------------------------------------------------------------- 1 | name: git-prompt 2 | 3 | -- PVP summary: +-+------- breaking API changes 4 | -- | | +----- non-breaking API additions 5 | -- | | | +--- code changes with no API change 6 | version: 0.1.0.0 7 | 8 | synopsis: Informative git prompt for zsh 9 | 10 | -- description: 11 | 12 | homepage: https://github.com/olivierverdier/zsh-git-prompt 13 | 14 | license: MIT 15 | 16 | license-file: LICENSE.md 17 | 18 | author: Olivier Verdier 19 | 20 | maintainer: olivier.verdier@gmail.com 21 | 22 | build-type: Simple 23 | 24 | extra-source-files: README.rst 25 | 26 | cabal-version: >=1.10 27 | 28 | 29 | executable gitstatus 30 | main-is: Main.hs 31 | 32 | -- other-modules: 33 | 34 | -- other-extensions: 35 | 36 | build-depends: base, parsec >=3.1 && <3.2, process>=1.1.0.2 37 | 38 | -- hs-source-dirs: 39 | 40 | -- Base language which the package is written in. 41 | default-language: Haskell2010 42 | 43 | ghc-options: -Wall -O2 44 | cc-options: -O3 45 | 46 | hs-source-dirs: src 47 | 48 | 49 | -------------------------------------------------------------------------------- /.zsh/git-prompt/git-prompt.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, parsec, process, stdenv }: 2 | mkDerivation { 3 | pname = "git-prompt"; 4 | version = "0.1.0.0"; 5 | src = ./.; 6 | isLibrary = false; 7 | isExecutable = true; 8 | buildDepends = [ base parsec process ]; 9 | homepage = "https://github.com/olivierverdier/zsh-git-prompt"; 10 | description = "Informative git prompt for zsh"; 11 | license = stdenv.lib.licenses.mit; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /.zsh/git-prompt/gitstatus.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | 4 | # change this symbol to whatever you prefer 5 | prehash = ':' 6 | 7 | from subprocess import Popen, PIPE 8 | 9 | import sys 10 | gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE) 11 | branch, error = gitsym.communicate() 12 | 13 | error_string = error.decode('utf-8') 14 | 15 | if 'fatal: Not a git repository' in error_string: 16 | sys.exit(0) 17 | 18 | branch = branch.decode("utf-8").strip()[11:] 19 | 20 | res, err = Popen(['git','diff','--name-status'], stdout=PIPE, stderr=PIPE).communicate() 21 | err_string = err.decode('utf-8') 22 | if 'fatal' in err_string: 23 | sys.exit(0) 24 | changed_files = [namestat[0] for namestat in res.decode("utf-8").splitlines()] 25 | staged_files = [namestat[0] for namestat in Popen(['git','diff', '--staged','--name-status'], stdout=PIPE).communicate()[0].splitlines()] 26 | nb_changed = len(changed_files) - changed_files.count('U') 27 | nb_U = staged_files.count('U') 28 | nb_staged = len(staged_files) - nb_U 29 | staged = str(nb_staged) 30 | conflicts = str(nb_U) 31 | changed = str(nb_changed) 32 | nb_untracked = len([0 for status in Popen(['git','status','--porcelain',],stdout=PIPE).communicate()[0].decode("utf-8").splitlines() if status.startswith('??')]) 33 | untracked = str(nb_untracked) 34 | 35 | ahead, behind = 0,0 36 | 37 | if not branch: # not on any branch 38 | branch = prehash + Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0].decode("utf-8")[:-1] 39 | else: 40 | remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].decode("utf-8").strip() 41 | if remote_name: 42 | merge_name = Popen(['git','config','branch.%s.merge' % branch], stdout=PIPE).communicate()[0].decode("utf-8").strip() 43 | if remote_name == '.': # local 44 | remote_ref = merge_name 45 | else: 46 | remote_ref = 'refs/remotes/%s/%s' % (remote_name, merge_name[11:]) 47 | revgit = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % remote_ref],stdout=PIPE, stderr=PIPE) 48 | revlist = revgit.communicate()[0] 49 | if revgit.poll(): # fallback to local 50 | revlist = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % merge_name],stdout=PIPE, stderr=PIPE).communicate()[0] 51 | behead = revlist.decode("utf-8").splitlines() 52 | ahead = len([x for x in behead if x[0]=='>']) 53 | behind = len(behead) - ahead 54 | 55 | out = '\n'.join([ 56 | branch, 57 | str(ahead), 58 | str(behind), 59 | staged, 60 | conflicts, 61 | changed, 62 | untracked, 63 | ]) 64 | print(out) 65 | 66 | -------------------------------------------------------------------------------- /.zsh/git-prompt/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/.zsh/git-prompt/screenshot.png -------------------------------------------------------------------------------- /.zsh/git-prompt/src/BranchParse.hs: -------------------------------------------------------------------------------- 1 | module BranchParse (branchInfo, BranchInfo, noBranchInfo, Branch) where 2 | 3 | import Control.Applicative hiding ((<|>), many, optional) 4 | import Text.Parsec 5 | import Text.Parsec.String 6 | 7 | {- 8 | The idea is to parse the first line of the git status command. 9 | Such a line may look like: 10 | ## master 11 | or 12 | ## master...origin/master 13 | or 14 | ## master...origin/master [ahead 3, behind 4] 15 | -} 16 | 17 | type AheadBehind = (Int, Int) 18 | type Branch = String 19 | type BranchInfo = ((Maybe Branch, Maybe Branch), Maybe AheadBehind) 20 | 21 | noBranchInfo :: BranchInfo 22 | noBranchInfo = ((Nothing, Nothing), Nothing) 23 | 24 | newRepo :: Parser BranchInfo 25 | newRepo = 26 | fmap (\ branch -> ((Just branch, Nothing), Nothing)) 27 | $ string "Initial commit on " *> many anyChar <* eof 28 | 29 | noBranch :: Parser BranchInfo 30 | noBranch = 31 | noBranchInfo 32 | <$ many (noneOf "(") <* string "(no branch)" <* eof 33 | 34 | trackedBranch :: Parser Branch 35 | trackedBranch = manyTill anyChar (try $ string "...") 36 | 37 | branchRemoteTracking :: Parser BranchInfo 38 | branchRemoteTracking = 39 | (\ branch tracking behead -> ((Just branch, Just tracking), Just behead)) 40 | <$> trackedBranch 41 | <*> many (noneOf " ") <* char ' ' 42 | <*> inBrackets 43 | 44 | branchRemote :: Parser BranchInfo 45 | branchRemote = 46 | (\ branch tracking -> ((Just branch, Just tracking), Nothing)) 47 | <$> trackedBranch 48 | <*> many (noneOf " ") <* eof 49 | 50 | branchOnly :: Parser BranchInfo 51 | branchOnly = 52 | (\ branch -> ((Just branch, Nothing), Nothing)) 53 | <$> many (noneOf " ") <* eof 54 | 55 | branchParser :: Parser BranchInfo 56 | branchParser = 57 | try noBranch 58 | <|> try newRepo 59 | <|> try branchRemoteTracking 60 | <|> try branchRemote 61 | <|> branchOnly 62 | 63 | 64 | inBrackets :: Parser AheadBehind 65 | inBrackets = between (char '[') (char ']') (behind <|> try aheadBehind <|> ahead) 66 | 67 | makeAheadBehind :: String -> (Int -> AheadBehind) -> Parser AheadBehind 68 | makeAheadBehind name constructor = 69 | constructor . read <$> (string (name ++ " ") *> many1 digit) 70 | 71 | ahead :: Parser AheadBehind 72 | ahead = makeAheadBehind "ahead" (\ n -> (n,0)) 73 | behind :: Parser AheadBehind 74 | behind = makeAheadBehind "behind" (\ n -> (0,n)) 75 | aheadBehind :: Parser AheadBehind 76 | aheadBehind = 77 | (\ (aheadBy,_) (_,behindBy) -> (aheadBy, behindBy)) 78 | <$> ahead 79 | <* string ", " 80 | <*> behind 81 | 82 | branchInfo :: String -> Either ParseError BranchInfo 83 | branchInfo = parse branchParser "" 84 | -------------------------------------------------------------------------------- /.zsh/git-prompt/src/Main.hs: -------------------------------------------------------------------------------- 1 | import System.Process 2 | import System.Exit 3 | import Control.Applicative 4 | import Data.Maybe 5 | import BranchParse 6 | import StatusParse 7 | 8 | {- Type aliases -} 9 | 10 | type Hash = String 11 | type Numbers = [String] 12 | 13 | {- Combining branch and status parsing -} 14 | 15 | processBranch :: String -> BranchInfo 16 | processBranch = either (const noBranchInfo) id . branchInfo . drop 3 17 | 18 | processGitStatus :: [String] -> (BranchInfo, StatusT Int) 19 | processGitStatus [] = undefined 20 | processGitStatus (branchLine:statusLines) = (processBranch branchLine, processStatus statusLines) 21 | 22 | allInfo :: (BranchInfo, StatusT Int) -> (Maybe Branch, Numbers) 23 | allInfo (((branch, _), behead), StatusC s x c t) = (branch , fmap show [ahead, behind, s, x, c, t]) 24 | where 25 | (ahead, behind) = fromMaybe (0,0) behead 26 | 27 | makeHash :: Maybe Hash -> String 28 | makeHash = (':' :) . maybe "" init 29 | 30 | 31 | {- Git commands -} 32 | 33 | maybeResult :: (ExitCode, a, b) -> Maybe a 34 | maybeResult (exitCode, output, _) = 35 | if exitCode == ExitSuccess then Just output else Nothing 36 | 37 | safeRun :: String -> [String] -> IO (Maybe String) 38 | safeRun command arguments = maybeResult <$> readProcessWithExitCode command arguments "" 39 | 40 | gitstatus :: IO (Maybe String) 41 | gitstatus = safeRun "git" ["status", "--porcelain", "--branch"] 42 | 43 | gitrevparse :: IO (Maybe Hash) 44 | gitrevparse = safeRun "git" ["rev-parse", "--short", "HEAD"] 45 | 46 | {- IO -} 47 | 48 | printHash :: IO () 49 | printHash = putStrLn . makeHash =<< gitrevparse 50 | 51 | printBranch :: Maybe Branch -> IO () 52 | printBranch branch = 53 | case branch of 54 | Nothing -> printHash 55 | Just bn -> putStrLn bn 56 | 57 | printNumbers :: Numbers -> IO () 58 | printNumbers = mapM_ putStrLn 59 | 60 | 61 | printAll :: Maybe String -> IO () 62 | printAll status = 63 | case fmap (allInfo . processGitStatus . lines) status of 64 | Nothing -> return () 65 | Just (branch,numbers) -> printBranch branch >> printNumbers numbers 66 | -- maybe (return ()) (\(b,n) -> printBranch b >> printNumbers n) $ fmap (allInfo . processGitStatus . lines) status 67 | 68 | -- main 69 | 70 | main :: IO () 71 | main = gitstatus >>= printAll 72 | -------------------------------------------------------------------------------- /.zsh/git-prompt/src/StatusParse.hs: -------------------------------------------------------------------------------- 1 | module StatusParse (processStatus, StatusT(StatusC, staged, conflict, changed, untracked)) where 2 | 3 | {- Full status information -} 4 | data StatusT a = StatusC { 5 | staged :: a, 6 | conflict :: a, 7 | changed :: a, 8 | untracked :: a} deriving (Eq, Show) 9 | 10 | {- The two characters starting a git status line: -} 11 | type MiniStatus = (Char, Char) 12 | 13 | {- Interpretation of mini status -} 14 | isChanged :: MiniStatus -> Bool 15 | isChanged (index,work) = 16 | work == 'M' || (work == 'D' && index /= 'D') 17 | 18 | isStaged :: MiniStatus -> Bool 19 | isStaged (index,work) = 20 | (index `elem` "MRC") || (index == 'D' && work /= 'D') || (index == 'A' && work /= 'A') 21 | 22 | isConflict :: MiniStatus -> Bool 23 | isConflict (index,work) = 24 | index == 'U' || work == 'U' || (index == 'A' && work == 'A') || (index == 'D' && work == 'D') 25 | 26 | isUntracked :: MiniStatus -> Bool 27 | isUntracked (index,_) = 28 | index == '?' 29 | 30 | countByType :: (MiniStatus -> Bool) -> [MiniStatus] -> Int 31 | countByType isType = length . filter isType 32 | 33 | countStatus :: [MiniStatus] -> StatusT Int 34 | countStatus l = StatusC 35 | { 36 | staged=countByType isStaged l, 37 | conflict=countByType isConflict l, 38 | changed=countByType isChanged l, 39 | untracked=countByType isUntracked l 40 | } 41 | 42 | extractMiniStatus :: String -> MiniStatus 43 | extractMiniStatus [] = undefined 44 | extractMiniStatus [_] = undefined 45 | extractMiniStatus (index:work:_) = (index,work) 46 | 47 | processStatus :: [String] -> StatusT Int 48 | processStatus = countStatus . fmap extractMiniStatus 49 | 50 | -------------------------------------------------------------------------------- /.zsh/git-prompt/zshrc.sh: -------------------------------------------------------------------------------- 1 | # To install source this file from your .zshrc file 2 | 3 | # see documentation at http://linux.die.net/man/1/zshexpn 4 | # A: finds the absolute path, even if this is symlinked 5 | # h: equivalent to dirname 6 | export __GIT_PROMPT_DIR=${0:A:h} 7 | 8 | export GIT_PROMPT_EXECUTABLE=${GIT_PROMPT_USE_PYTHON:-"python"} 9 | 10 | # Initialize colors. 11 | autoload -U colors 12 | colors 13 | 14 | # Allow for functions in the prompt. 15 | setopt PROMPT_SUBST 16 | 17 | autoload -U add-zsh-hook 18 | 19 | add-zsh-hook chpwd chpwd_update_git_vars 20 | add-zsh-hook preexec preexec_update_git_vars 21 | add-zsh-hook precmd precmd_update_git_vars 22 | 23 | ## Function definitions 24 | function preexec_update_git_vars() { 25 | case "$2" in 26 | git*|hub*|gh*|stg*) 27 | __EXECUTED_GIT_COMMAND=1 28 | ;; 29 | esac 30 | } 31 | 32 | function precmd_update_git_vars() { 33 | if [ -n "$__EXECUTED_GIT_COMMAND" ] || [ ! -n "$ZSH_THEME_GIT_PROMPT_CACHE" ]; then 34 | update_current_git_vars 35 | unset __EXECUTED_GIT_COMMAND 36 | fi 37 | } 38 | 39 | function chpwd_update_git_vars() { 40 | update_current_git_vars 41 | } 42 | 43 | function update_current_git_vars() { 44 | unset __CURRENT_GIT_STATUS 45 | 46 | if [[ "$GIT_PROMPT_EXECUTABLE" == "python" ]]; then 47 | local gitstatus="$__GIT_PROMPT_DIR/gitstatus.py" 48 | _GIT_STATUS=`python ${gitstatus} 2>/dev/null` 49 | fi 50 | if [[ "$GIT_PROMPT_EXECUTABLE" == "haskell" ]]; then 51 | local gitstatus="$__GIT_PROMPT_DIR/result/bin/gitstatus" 52 | _GIT_STATUS=`${gitstatus}` 53 | fi 54 | __CURRENT_GIT_STATUS=("${(@f)_GIT_STATUS}") 55 | GIT_BRANCH=$__CURRENT_GIT_STATUS[1] 56 | GIT_AHEAD=$__CURRENT_GIT_STATUS[2] 57 | GIT_BEHIND=$__CURRENT_GIT_STATUS[3] 58 | GIT_STAGED=$__CURRENT_GIT_STATUS[4] 59 | GIT_CONFLICTS=$__CURRENT_GIT_STATUS[5] 60 | GIT_CHANGED=$__CURRENT_GIT_STATUS[6] 61 | GIT_UNTRACKED=$__CURRENT_GIT_STATUS[7] 62 | } 63 | 64 | 65 | git_super_status() { 66 | precmd_update_git_vars 67 | if [ -n "$__CURRENT_GIT_STATUS" ]; then 68 | STATUS="$ZSH_THEME_GIT_PROMPT_PREFIX$ZSH_THEME_GIT_PROMPT_BRANCH$GIT_BRANCH%{${reset_color}%}" 69 | if [ "$GIT_BEHIND" -ne "0" ]; then 70 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND$GIT_BEHIND%{${reset_color}%}" 71 | fi 72 | if [ "$GIT_AHEAD" -ne "0" ]; then 73 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD$GIT_AHEAD%{${reset_color}%}" 74 | fi 75 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_SEPARATOR" 76 | if [ "$GIT_STAGED" -ne "0" ]; then 77 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED$GIT_STAGED%{${reset_color}%}" 78 | fi 79 | if [ "$GIT_CONFLICTS" -ne "0" ]; then 80 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CONFLICTS$GIT_CONFLICTS%{${reset_color}%}" 81 | fi 82 | if [ "$GIT_CHANGED" -ne "0" ]; then 83 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CHANGED$GIT_CHANGED%{${reset_color}%}" 84 | fi 85 | if [ "$GIT_UNTRACKED" -ne "0" ]; then 86 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED%{${reset_color}%}" 87 | fi 88 | if [ "$GIT_CHANGED" -eq "0" ] && [ "$GIT_CONFLICTS" -eq "0" ] && [ "$GIT_STAGED" -eq "0" ] && [ "$GIT_UNTRACKED" -eq "0" ]; then 89 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CLEAN" 90 | fi 91 | STATUS="$STATUS%{${reset_color}%}$ZSH_THEME_GIT_PROMPT_SUFFIX" 92 | echo "$STATUS" 93 | fi 94 | } 95 | 96 | # Default values for the appearance of the prompt. Configure at will. 97 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[white]%}⧙" 98 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[white]%}⧘" 99 | ZSH_THEME_GIT_PROMPT_SEPARATOR="%{$fg_bold[white]%}|" 100 | ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[magenta]%}" 101 | ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%G%}" 102 | ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%G%}" 103 | ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[blue]%}%{✚%G%}" 104 | ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%G%}" 105 | ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%G%}" 106 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{…%G%}" 107 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%G%}" 108 | 109 | 110 | -------------------------------------------------------------------------------- /2guys.txt: -------------------------------------------------------------------------------- 1 | 2 | ....................,........................................................... 3 | ...............,............................,.....,,............................ 4 | ......................,.,...................,.,,.,..,.,......................... 5 | .............,,............,.,.......,.,..,,,,,,::~,,,,,,.,.,................... 6 | .........................,...........,,,~=+++==~=~~==~~~~~:,.,.................. 7 | ...................,..,.........,...::~~~~+++==~~+~:~~~===~~::.,.,.............. 8 | ...........,.......,,..,.....,,...:~=:~~=~=========+=====~~~~~:~:.,............. 9 | ..............,.,..,....,.,,,,,...::+~~~=~~==~~===+++==+==~~~~~~=~=:..,,........ 10 | ............,.,....,,.,...,,,,,..,~:~====:~=====+++=++++===~~~~:===~,...,,,.,.,. 11 | ...,,~~~~~~~~=~~~===~,,,,,,,.,,,..~~~====:===~=++++++++++==~~~~:==~,.,..,....... 12 | ,.,::~~===========+=~=~+:,,....,.,~~=====:====~~=++++++++==~~~~~~:.............. 13 | ~=:::~======++====+=~+===~~:,,,,..:~~===+~==?===~++++++++===~~~~::.............. 14 | ..~:~~===++++=======~=+===~~~:,,...~~===+~~======+++++++=====~~~::,............. 15 | ..::~~==+++++=~~===~~~++====~~,..,..~======~=+=====++++=======~~:::,............ 16 | ..:~~~===+===~~====~~=+++===~:~,.....~===~~~~========++======~~~~:.,............ 17 | ..,~=~=======~~=~==~~=+++==~~:,......:~=~:::~~=:~~~==========~~~,,.............. 18 | ...~=~======~~====~~~==++==~:.........:~=~:~~~~~=~~==========~~.,............... 19 | ...:~~==~~~~~=~~====~=====~~:..........:~~~:~~~~============~:,,................ 20 | ...,:~~~==~~:+==:~::~~=====~............,:~~~~==++++=======~.,.,,............... 21 | ..,,:~~===~~::+=~::~~~===~~..............,:~~===+++++===~~:,,,.................. 22 | ..,,,:~~====~~~~=~~~====~:,,...............:~=========~~:,,,.................... 23 | ,,,,,,:~======~=======~::.,,.......,....,,,,.~~==~~~~~:.,.................,..... 24 | ,,,,,,,,~====++======~:~:,,,.,,,.......,,,,..,,,,,,,,.,......................... 25 | ,,,,,.,,,~====+====~:~~:.,,,,,,,......,,,.......,.,,............................ 26 | ,,,,,,,,,,,~~====~:~=~,,,...,,,,,...,,,,,........,~............................. 27 | ,,.,.,,,,,,,,,,,,,,,.,,,,...,...,...,,,,.........,,,............................ 28 | ..,,,,,,,,,,,,,,,,,,........,.....,..,,,.........,.........................,.... 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | my_configs 2 | ========== 3 | 4 | My .*rc files and some stuff. Lots of garbage, use with caution. -------------------------------------------------------------------------------- /myscripts/autocpu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash -e 2 | 3 | COUNT=`cat /proc/cpuinfo | grep -c ^processor` 4 | currentGov=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` 5 | FLAG="false" 6 | while getopts "sopchn" opt; do 7 | FLAG="true" 8 | case "$opt" in 9 | s) 10 | sudo cpupower frequency-set -g powersave 11 | #notify-send powersave 12 | ;; 13 | o) 14 | sudo cpupower frequency-set -g ondemand 15 | #notify-send ondemand 16 | ;; 17 | p) 18 | sudo cpupower frequency-set -g performance 19 | #notify-send performance 20 | ;; 21 | c) 22 | echo $currentGov 23 | ;; 24 | n) 25 | echo $currentGov 26 | notify-send $currentGov 27 | ;; 28 | *) 29 | echo -e "autocpu 0.1\nA simple bash script to change your CPUs governors with 'cpupower'.\n\nUsage:\n-h Show this help\n-c Report current governor\n-s Powersave mode\n-o Ondemand mode\n-p Performance mode\n\nWith no switches it just changes your active governor to the next one\npowersave -> ondemand -> performance -> powersave etc." 30 | ;; 31 | 32 | esac 33 | done 34 | 35 | if [ $FLAG == "true" ] 36 | then 37 | exit 38 | fi 39 | 40 | if [ "$currentGov" == "powersave" ] 41 | then 42 | #sudo cpupower frequency-set -g ondemand; //ondemand doesn't work 43 | sudo cpupower frequency-set -g performance; 44 | #notify-send ondemand 45 | exit 46 | fi 47 | if [ "$currentGov" == "ondemand" ] 48 | then 49 | sudo cpupower frequency-set -g performance; 50 | #notify-send performance 51 | exit 52 | fi 53 | if [ "$currentGov" == "performance" ] 54 | then 55 | sudo cpupower frequency-set -g powersave; 56 | #notify-send powersave 57 | fi 58 | exit 59 | -------------------------------------------------------------------------------- /myscripts/brightness.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | echo "50" > /sys/class/backlight/intel_backlight/brightness 5 | -------------------------------------------------------------------------------- /myscripts/currentlayout.sh: -------------------------------------------------------------------------------- 1 | echo $(xkblayout-state print "%s") 2 | -------------------------------------------------------------------------------- /myscripts/de_reload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # author: yulya3102 4 | 5 | # FIXME: "$year" variable is so weird 6 | usage="Usage: de_reload.sh -l login -p password -s semester -g group [-c config_file] | de_reload.sh [-c config_file]" 7 | config=".de_config" 8 | 9 | while getopts l:p:s:g:c: option 10 | do 11 | case $option in 12 | l) 13 | login="$OPTARG" 14 | new_config=1;; 15 | p) 16 | password="$OPTARG" 17 | new_config=1;; 18 | s) 19 | semester="$OPTARG" 20 | new_config=1;; 21 | g) 22 | group="$OPTARG" 23 | new_config=1;; 24 | c) 25 | config="$OPTARG";; 26 | ?) 27 | echo "$usage" 28 | exit 1;; 29 | esac 30 | done 31 | 32 | if [ -z "$new_config" ]; then 33 | if [ -e "$config" ]; then 34 | source "$config" 35 | else 36 | echo "$usage" 37 | exit 1 38 | fi 39 | fi 40 | if [ -z "$login" ]; then 41 | echo "Option -l required" 42 | echo "$usage" 43 | exit 1 44 | elif [ -z "$password" ]; then 45 | echo "Option -p required" 46 | echo "$usage" 47 | exit 1 48 | elif [ -z "$semester" ]; then 49 | echo "Option -s required" 50 | echo "$usage" 51 | exit 1 52 | elif [ -z "$group" ]; then 53 | echo "Option -g required" 54 | echo "$usage" 55 | exit 1 56 | elif [ -n "$config" ]; then 57 | echo "login=$login" > "$config" 58 | echo "password=$password" >> "$config" 59 | echo "semester=$semester" >> "$config" 60 | echo "group=$group" >> "$config" 61 | fi 62 | 63 | if [ -z "$year" ]; then 64 | year=2012%2F2013 65 | fi 66 | if [ -z "$de_file" ]; then 67 | de_file=".de" 68 | fi 69 | 70 | reload_from_server() { 71 | local login="$1" 72 | local password="$2" 73 | local semester="$3" 74 | local group="$4" 75 | local year="$5" 76 | curl --cookie ~/.cookie --cookie-jar ~/.cookie -d "Rule=LOGON&LOGIN=$login&PASSWD=$password&loginbutton=%E2%EE%E9%F2%E8" https://de.ifmo.ru/servlet/ > /dev/null 77 | local de=`curl --cookie ~/.cookie -d "Rule=eRegisterGetStudentAllProgram&PERSONID=$login&PROGRAMID=&SEMID=$semester&ST_GRP=$group&APPRENTICESHIP=$year&UNIVER=1&BACK=%0D%0A++++++++++%3CBack+Rule%3D%22ERegister%22%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22ST_GRP%22+Value%3D%22$group%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22PERSONID%22+Value%3D%22$login%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22UNIVER%22+Value%3D%221%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22PROGRAMID%22+Value%3D%22-%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22APPRENTICESHIP%22+Value%3D%22$year%22%2F%3E%0D%0A+++++++++++++++%0D%0A++++++++++%3C%2FBack%3E%0D%0A+++++++&CURRENT=%0D%0A++++++++++%3CBack+Rule%3D%22ERegister%22%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22ST_GRP%22+Value%3D%22$group%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22PERSONID%22+Value%3D%22$login%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22UNIVER%22+Value%3D%221%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22PROGRAMID%22+Value%3D%22-%22%2F%3E%0D%0A++++++++++++++%0D%0A++++++++++++++++++%3CParameter+Name%3D%22APPRENTICESHIP%22+Value%3D%22$year%22%2F%3E%0D%0A+++++++++++++++%0D%0A++++++++++%3C%2FBack%3E%0D%0A+++++++" https://de.ifmo.ru/servlet/distributedCDE` 78 | 79 | #code this Windows-1251 shit to UTF-8 80 | local de=`iconv -f WINDOWS-1251 -t UTF-8 <( echo "$de" )` 81 | 82 | echo "$de" 83 | } 84 | 85 | name_column_width=55 86 | rating_column_width=5 87 | exam_column_width=15 88 | 89 | process_line() { 90 | local line="$1" 91 | local line=`echo "$line" | sed -e 's/<\/td>/&\n/g'` 92 | local name=`echo "$line" | sed -n '3 p' | sed -e 's///;s/<\/td>//;s/<\/a>.*//;s/.*">//'` 93 | local rating=`echo "$line" | sed -n '5 p' | sed -e 's///;s/<\/td>//'` 94 | local exam=`echo "$line" | sed -n '6 p' | sed -e 's///;s/<\/td>//'` 95 | local name=`iconv -f UTF-8 -t WINDOWS-1251 <( echo "$name" )` 96 | local exam=`iconv -f UTF-8 -t WINDOWS-1251 <( echo "$exam" )` 97 | printf %-"$name_column_width"s%-"$rating_column_width"s%-"$exam_column_width"s "$name" "$rating" "$exam" 98 | echo 99 | } 100 | 101 | de=`reload_from_server $login $password $semester $group $year | tr -d '\n' | sed -e 's/.*
//' | sed -e 's/<\/form>.*//' | sed -e 's/<\/tr>/&\n/g' | sed -n '2,$ p' | { while read i; do process_line "$i"; done }` 102 | iconv -f WINDOWS-1251 -t UTF-8 <( echo "$de" ) > "$de_file" 103 | echo -e "\n" >> "$de_file" 104 | echo `date` >> "$de_file" 105 | -------------------------------------------------------------------------------- /myscripts/getcoretemp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | temp1=`cat /sys/devices/platform/coretemp.0/temp2_input` 3 | temp2=`cat /sys/devices/platform/coretemp.0/temp3_input` 4 | echo `expr $temp1 / 1000`C `expr $temp2 / 1000`C 5 | 6 | -------------------------------------------------------------------------------- /myscripts/getmocpinfo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$(pidof mocp)" ] 4 | then 5 | INFO=`mocp --info` 6 | 7 | if [ $? == 2 ] 8 | then 9 | echo -n "" 10 | exit 11 | fi 12 | 13 | if [ "$INFO" == "State: STOP" ]; 14 | then 15 | echo -n "Stopped" 16 | else 17 | Artist=`mocp --info | grep Artist | cut -f2 -d ":"` 18 | Song=`mocp --info | grep SongTitle | cut -f2 -d ":"` 19 | Album=`mocp --info | grep Album | cut -f2 -d ":"` 20 | STATE=`mocp -i | grep State | cut -f2 -d ":" | cut -f2 -d " "` 21 | while getopts "asb" opt; do 22 | case "$opt" in 23 | a) 24 | echo "${Artist:1}" 25 | exit 0 26 | ;; 27 | s) 28 | echo "${Song:1}" 29 | exit 0 30 | ;; 31 | b) 32 | echo "${Album:1}" 33 | exit 0 34 | ;; 35 | esac 36 | done 37 | 38 | if [ "$STATE" == "PAUSE" ] 39 | then 40 | echo -n `expr substr "◼ $Artist - $Song" 1 200` 41 | exit 42 | fi 43 | 44 | echo -n `expr substr "\► $Artist - $Song" 2 200` 45 | 46 | fi 47 | else 48 | echo -n "" 49 | exit 1 50 | fi 51 | 52 | -------------------------------------------------------------------------------- /myscripts/getvolume.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | volume=$(amixer get Master | grep % | cut -d ' ' -f 6 | head -1) 3 | let volume=volume/650 4 | state=$(amixer get Master | grep off | cut -d ' ' -f 8 | grep -Eo '[a-z]*') 5 | if [ "$state" = "off" ] 6 | then 7 | echo "$state" 8 | exit 9 | fi 10 | echo "$volume""%" 11 | if [ "$1" == "-s" ] 12 | then 13 | bar="" 14 | if [ $volume == 0 ] 15 | then 16 | bar="Muted" 17 | else 18 | bar="" 19 | fi 20 | for i in $(seq 1 $(($volume / 10))) 21 | do 22 | bar=${bar}"|" 23 | done 24 | if [ "$bar" == "" ] 25 | then 26 | bar="Muted" 27 | fi 28 | killall xfce4-notifyd 29 | notify-send -t 1050 Volume " $bar" 30 | fi 31 | -------------------------------------------------------------------------------- /myscripts/getvpninfo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | vpn=`systemctl is-active openvpn-JJ` 3 | echo ${vpn:0:1} 4 | -------------------------------------------------------------------------------- /myscripts/lovemoc/Keys.hs.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/myscripts/lovemoc/Keys.hs.gpg -------------------------------------------------------------------------------- /myscripts/lovemoc/Main.hs: -------------------------------------------------------------------------------- 1 | -- Love current song from moc player 2 | -- Author: supki 3 | -- Modified by JagaJaga 4 | 5 | {-# LANGUAGE OverloadedStrings #-} 6 | module Main where 7 | import Control.Lens 8 | import Data.Aeson.Lens 9 | import Data.Monoid 10 | import Data.Text (Text, pack) 11 | import qualified Data.Text as T 12 | import qualified Keys as K 13 | import Libnotify 14 | import Lastfm 15 | import qualified Lastfm.Track as Track 16 | import System.Process 17 | 18 | 19 | main :: IO () 20 | main = do 21 | let (ak, sk, s) = (K.aPIKey, K.sessionKey, K.secret) 22 | [a, t] <- getSong 23 | correct a t ak >>= love a ak sk s 24 | 25 | {-getInfo :: MPD.Song -> [Text]-} 26 | {-getInfo s = map getTag [MPD.Artist, MPD.Title]-} 27 | {-where-} 28 | {-getTag t = T.fromStrict . MPD.toText . head $ MPD.sgTags s M.! t-} 29 | 30 | getSong :: IO [Text] 31 | getSong = do 32 | artist <- readProcess "/home/jaga/myscripts/getmocpinfo.sh" ["-a"] [] 33 | title <- readProcess "/home/jaga/myscripts/getmocpinfo.sh" ["-s"] [] 34 | return [pack artist, pack title] 35 | 36 | 37 | correct :: Text -> Text -> Text -> IO Text 38 | correct a t ak = withConnection $ \conn -> do 39 | r <- lastfm conn $ Track.getCorrection <*> artist a <*> track t <*> apiKey ak <* json 40 | case r ^? folded . key "corrections" . key "correction" . key "track" . key "name"._String of 41 | Just t' -> return t' 42 | Nothing -> return t 43 | 44 | love :: Text -> Text -> Text -> Text -> Text -> IO () 45 | love a ak sk s t = withConnection $ \conn -> do 46 | lastfm conn $ sign (Secret s) $ Track.love <*> artist a <*> track t <*> apiKey ak <*> sessionKey sk <* json 47 | display_ (summary "Last.fm" <> body ("Track loved:\n" ++ strip (T.unpack a) ++ "\n" ++ strip (T.unpack t))) 48 | return () 49 | where 50 | strip (x:xs) 51 | | x == '&' = "&" ++ strip xs 52 | | otherwise = x : strip xs 53 | strip [] = [] 54 | -------------------------------------------------------------------------------- /myscripts/lovemoc/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /myscripts/lovemoc/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | pkgs.haskellPackages.callPackage ./project.nix {} 3 | -------------------------------------------------------------------------------- /myscripts/lovemoc/lovemoc.cabal: -------------------------------------------------------------------------------- 1 | -- Initial lovemoc.cabal generated by cabal init. For further 2 | -- documentation, see http://haskell.org/cabal/users-guide/ 3 | 4 | name: lovemoc 5 | version: 0.1.0.0 6 | -- synopsis: 7 | -- description: 8 | -- license: 9 | -- license-file: 10 | author: Arseniy Seroka 11 | maintainer: ars.seroka@gmail.com 12 | -- copyright: 13 | category: Network 14 | build-type: Simple 15 | -- extra-source-files: 16 | cabal-version: >=1.10 17 | 18 | executable lovemoc 19 | main-is: Main.hs 20 | -- other-modules: 21 | other-extensions: OverloadedStrings 22 | build-depends: base, text, liblastfm, lens, lens-aeson, libnotify, process 23 | -- hs-source-dirs: 24 | default-language: Haskell2010 25 | -------------------------------------------------------------------------------- /myscripts/lovemoc/project.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, lens, lens-aeson, liblastfm, libnotify 2 | , process, stdenv, text 3 | }: 4 | mkDerivation { 5 | pname = "lovemoc"; 6 | version = "0.1.0.0"; 7 | src = ./.; 8 | isLibrary = false; 9 | isExecutable = true; 10 | buildDepends = [ 11 | lens lens-aeson liblastfm libnotify process text 12 | ]; 13 | license = stdenv.lib.licenses.unfree; 14 | } 15 | -------------------------------------------------------------------------------- /myscripts/low_battery.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # notify if battery is low 3 | 4 | battery_int=$(cat /sys/class/power_supply/BAT0/capacity) 5 | battery_state=$(cat /sys/class/power_supply/BAT0/status) 6 | #battery_int=$(echo "($battery_float+0.5)/1" | bc ) 7 | if [ "$battery_int" -le "9" ] 8 | then 9 | if [ "$battery_state" == "Discharging" ] 10 | then 11 | zenity --info --title "Low battery" --text "Battery is $battery_int%. Enable charging!" 12 | fi 13 | fi 14 | 15 | -------------------------------------------------------------------------------- /myscripts/screen-translate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # translate clipboard contents 3 | # usage: screen-translate.sh [desination language] 4 | # default transtation is to russian 5 | # requeries pbpaste to read from clipboard 6 | # requeries wget, grep 7 | export PATH=/usr/local/bin:$PATH 8 | 9 | query=$(pbpaste) 10 | if [[ $? -ne 0 ]]; then 11 | query="NULL" 12 | fi 13 | 14 | rawurlencode() { 15 | local string="${1}" 16 | local strlen=${#string} 17 | local encoded="" 18 | for (( pos=0 ; pos)[^<]+") 47 | echo $trans 48 | 49 | show-translation-notification "$langfrom → ru\n\n$query\n→\n$trans" 50 | if [[ $? -ne 0 ]]; then 51 | show-translation-notification "Failed to translate clipboard contents." 52 | fi 53 | exit 54 | -------------------------------------------------------------------------------- /myscripts/wallpaper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | shopt -s nullglob 4 | cd ~/Wallpapers 5 | 6 | while true; do 7 | files=() 8 | for i in *.jpg *.png; do 9 | [[ -f $i ]] && files+=("$i") 10 | done 11 | range=${#files[@]} 12 | 13 | ((range)) && feh --bg-fill "${files[RANDOM % range]}" 14 | 15 | sleep 15m 16 | done 17 | -------------------------------------------------------------------------------- /nixconfigs/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/nixconfigs/background.png -------------------------------------------------------------------------------- /nixconfigs/common_configuration.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # the system. Help is available in the configuration.nix(5) man page 3 | # or the NixOS manual available on virtual console 8 (Alt+F8). 4 | 5 | { config, pkgs, ... }: 6 | let 7 | literals = import ./literals.nix {pkgs = pkgs; 8 | ca = pkgs.writeText "ca.crt" (builtins.readFile /root/.vpn/ca.crt); 9 | cert = pkgs.writeText "alice" (builtins.readFile /root/.vpn/alice.crt); 10 | key = pkgs.writeText "alice.key" (builtins.readFile /root/.vpn/alice.key); 11 | }; 12 | in 13 | 14 | { 15 | require = [ 16 | ./private.nix 17 | ]; 18 | 19 | boot = { 20 | kernelPackages = pkgs.linuxPackages_latest; 21 | extraModprobeConfig = '' 22 | options snd slots=snd_usb_audio,snd-hda-intel 23 | options kvm-amd nested=1 24 | options kvm-intel nested=1 25 | ''; 26 | cleanTmpDir = true; 27 | loader.grub = { 28 | timeout = 1; 29 | enable = true; 30 | version = 2; 31 | }; 32 | }; 33 | /*https://hydra.nixos.org */ 34 | nix = { 35 | /*package = pkgs.nixUnstable;*/ 36 | binaryCaches = [ https://cache.nixos.org ]; 37 | trustedBinaryCaches = [ https://cache.nixos.org http://hydra.cryp.to https://hydra.serokell.io ]; 38 | binaryCachePublicKeys = [ 39 | "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" 40 | "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 41 | "hydra.serokell.io-1:he7AKwJKKiOiy8Sau9sPcso9T/PmlVNxcnNpRgcFsps=" 42 | ]; 43 | 44 | useSandbox = true; 45 | gc = { 46 | automatic = true; 47 | dates = "00:00"; 48 | }; 49 | }; 50 | 51 | nixpkgs.config = { 52 | allowUnfree = true; 53 | }; 54 | 55 | networking = { 56 | extraHosts = literals.extraHosts; 57 | networkmanager.enable = true; 58 | firewall.enable = false; 59 | }; 60 | 61 | i18n = { 62 | consoleFont = "lat9w-16"; 63 | consoleKeyMap = "ruwin_cplk-UTF-8"; 64 | defaultLocale = "en_US.UTF-8"; 65 | }; 66 | 67 | hardware = { 68 | cpu.intel.updateMicrocode = true; 69 | opengl = { 70 | driSupport32Bit = true; 71 | }; 72 | pulseaudio = { 73 | enable = true; 74 | }; 75 | }; 76 | 77 | security.sudo.configFile = literals.sudoConf; 78 | 79 | services = { 80 | cron.systemCronJobs = [ 81 | "20 * * * * jaga rsync --remove-source-files -rauz ${config.users.extraUsers.jaga.home}/{Dropbox/\"Camera Uploads\",yandex-disk/}" 82 | #"22 * * * * root systemctl restart yandex-disk.service" 83 | ]; 84 | dbus.enable = true; 85 | pcscd.enable = true; 86 | nixosManual.showManual = true; 87 | nix-serve.enable = true; 88 | journald.extraConfig = "SystemMaxUse=50M"; 89 | locate.enable = true; 90 | udisks2.enable = true; 91 | openssh.enable = true; 92 | openntpd.enable = true; 93 | openvpn = { 94 | servers.JJ = literals.openVPNConf.configJJ; 95 | }; 96 | }; 97 | 98 | services.xserver = { 99 | exportConfiguration = true; 100 | enable = true; 101 | layout = "us,ru"; 102 | xkbOptions = "grp:caps_toggle"; 103 | xkbVariant = "colemak"; 104 | displayManager.slim = { 105 | enable = true; 106 | autoLogin = false; 107 | defaultUser = "jaga"; 108 | }; 109 | displayManager.lightdm = { 110 | enable = false; 111 | }; 112 | desktopManager = { 113 | xterm.enable = false; 114 | }; 115 | windowManager = { 116 | default = "xmonad"; 117 | xmonad = { 118 | enable = true; 119 | enableContribAndExtras = true; 120 | }; 121 | }; 122 | displayManager.sessionCommands = with pkgs; lib.mkAfter '' 123 | gpg-connect-agent /bye 124 | GPG_TTY=$(tty) 125 | export GPG_TTY 126 | unset SSH_AGENT_PID 127 | export SSH_AUTH_SOCK="${config.users.extraUsers.jaga.home}/.gnupg/S.gpg-agent.ssh" 128 | ${xlibs.xsetroot}/bin/xsetroot -cursor_name left_ptr; 129 | ${coreutils}/bin/sleep 30 && ${dropbox}/bin/dropbox & 130 | ${networkmanagerapplet}/bin/nm-applet & 131 | ${feh}/bin/feh --bg-scale ${config.users.extraUsers.jaga.home}/yandex-disk/Camera\ Uploads/etc/fairy_forest_by_arsenixc-d6pqaej.jpg; 132 | exec ${haskellPackages.xmonad}/bin/xmonad 133 | ''; 134 | config = literals.trackBallConf; 135 | }; 136 | 137 | systemd.services.lastfmsubmitd = { 138 | wantedBy = [ "multi-user.target" ]; 139 | after = [ "network.target" ]; 140 | serviceConfig = { 141 | Type = "forking"; 142 | ExecStart = ''${pkgs.screen}/bin/screen -dmS lastfsubmit ${pkgs.lastfmsubmitd}/bin/lastfmsubmitd --no-daemon''; 143 | ExecReload = ''${pkgs.screen}/bin/screen -S lastfsubmit -X quit''; 144 | }; 145 | }; 146 | 147 | programs = { 148 | ssh.startAgent = true; 149 | zsh.enable = true; 150 | }; 151 | 152 | users.extraUsers.jaga = { 153 | description = "Arseniy Seroka"; 154 | createHome = true; 155 | home = "/home/jaga"; 156 | group = "users"; 157 | extraGroups = [ "wheel" "networkmanager" "adb" "video" "power" "vboxusers" "cdrom" ]; 158 | shell = "${pkgs.zsh}/bin/zsh"; 159 | uid = 1000; 160 | }; 161 | 162 | time.timeZone = "Europe/Moscow"; 163 | 164 | environment.systemPackages = with pkgs; [ 165 | bash 166 | dropbox 167 | exfat-utils 168 | fuse_exfat 169 | git 170 | htop 171 | iotop 172 | mc 173 | networkmanager 174 | networkmanagerapplet 175 | shared_mime_info 176 | pmutils 177 | stdenv 178 | wget 179 | xsel 180 | zsh 181 | ]; 182 | fonts = { 183 | fontconfig.enable = true; 184 | enableFontDir = true; 185 | enableGhostscriptFonts = true; 186 | fontconfig.defaultFonts.monospace = ["Terminus"]; 187 | fonts = [ 188 | pkgs.corefonts 189 | pkgs.clearlyU 190 | pkgs.cm_unicode 191 | pkgs.dejavu_fonts 192 | pkgs.freefont_ttf 193 | pkgs.terminus_font 194 | pkgs.ttf_bitstream_vera 195 | ]; 196 | }; 197 | 198 | } 199 | -------------------------------------------------------------------------------- /nixconfigs/desktop_configuration.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # the system. Help is available in the configuration.nix(5) man page 3 | # or the NixOS manual available on virtual console 8 (Alt+F8). 4 | 5 | { config, pkgs, ... }: 6 | let 7 | literals = import ./literals.nix { 8 | pkgs = pkgs; 9 | }; 10 | in 11 | { 12 | require = [ 13 | ./desktop_hardware-configuration.nix 14 | ]; 15 | 16 | imports = [ 17 | ./common_configuration.nix 18 | ]; 19 | 20 | boot.loader.grub.device = "/dev/sdd"; 21 | 22 | /*nixpkgs.config.virtualbox.enableExtensionPack = true;*/ 23 | 24 | virtualisation = { 25 | 26 | virtualbox.host.enable = true; 27 | 28 | docker = { 29 | enable = false; 30 | storageDriver = "devicemapper"; 31 | }; 32 | }; 33 | 34 | services = { 35 | # teamviewer.enable = true; 36 | }; 37 | 38 | services.xserver = { 39 | videoDrivers = [ "nvidia" ]; 40 | xrandrHeads = [ "DVI-I-0" "HDMI-0" ]; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /nixconfigs/desktop_hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "ehci_pci" "ata_piix" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; 12 | boot.kernelModules = [ "kvm-intel" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = 16 | { device = "/dev/disk/by-uuid/4a1989d0-e3ba-473d-95b2-e15ce999c3f5"; 17 | fsType = "ext4"; 18 | options = [ "defaults" "discard" "noatime" ]; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-uuid/4cecd5bb-d4bb-498a-8712-f790ee7a748a"; 23 | fsType = "ext4"; 24 | options = [ "defaults" "discard" "noatime" ]; 25 | }; 26 | 27 | fileSystems."/home" = 28 | { device = "/dev/disk/by-uuid/af2d1e7d-cec8-4077-9097-279a7c5e758c"; 29 | fsType = "ext4"; 30 | }; 31 | 32 | swapDevices = 33 | [ { device = "/dev/disk/by-uuid/9a383600-809c-4ee9-b611-00a150e36533"; } 34 | ]; 35 | 36 | nix.maxJobs = 8; 37 | } 38 | -------------------------------------------------------------------------------- /nixconfigs/literals.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ca ? null, cert ? null, key ? null 2 | , caSerokell ? null, certSerokell ? null, keySerokell ? null 3 | }: 4 | { 5 | openVPNConf = { 6 | configJJ = { 7 | config = '' 8 | client 9 | nobind 10 | dev tun 11 | proto udp 12 | remote germany.privateinternetaccess.com 1197 13 | remote-random 14 | nobind 15 | persist-key 16 | persist-tun 17 | cipher aes-256-cbc 18 | auth sha256 19 | tls-client 20 | remote-cert-tls server 21 | auth-user-pass 22 | comp-lzo 23 | verb 1 24 | reneg-sec 0 25 | crl-verify /root/.vpn/pia/crl.rsa.4096.pem 26 | ca /root/.vpn/pia/ca.rsa.4096.crt 27 | disable-occ 28 | auth-user-pass /root/.vpn/pia/pia-login.conf 29 | ''; 30 | up = "echo nameserver $nameserver | ''${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev"; 31 | down = "''${pkgs.openresolv}/sbin/resolvconf -d $dev"; 32 | }; 33 | configSerokell = { 34 | config = '' 35 | client 36 | dev tun 37 | proto udp 38 | remote memorici.de 10044 39 | resolv-retry infinite 40 | nobind 41 | persist-key 42 | persist-tun 43 | ca ${caSerokell} 44 | cert ${certSerokell} 45 | key ${keySerokell} 46 | comp-lzo 47 | verb 3 48 | ''; 49 | up = "echo nameserver $nameserver | ''${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev"; 50 | down = "''${pkgs.openresolv}/sbin/resolvconf -d $dev"; 51 | }; 52 | }; 53 | trackBallConf = '' 54 | Section "InputClass" 55 | Identifier "Kensington Slimblade Trackball" 56 | MatchProduct "Kensington Kensington Slimblade Trackball" 57 | Option "ButtonMapping" "1 8 3 4 5 6 7 2 9 10 11 12" 58 | Option "EmulateWheel" "True" 59 | Option "EmulateWheelButton" "8" 60 | Option "XAxisMapping" "6 7" 61 | Option "ZAxisMapping" "4 5" 62 | Option "EmulateWheelInertia" "75" 63 | EndSection 64 | ''; 65 | extraHosts = '' 66 | fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535 nodeinfo.hype 67 | fcbf:7bbc:32e4:716:bd00:e936:c927:fc14 socialno.de 68 | fcd5:76e1:c1c2:e946:b266:8543:c1d5:67ac hypeoverflow.com 69 | 127.0.0.1 local.host 70 | ''; 71 | workHosts = '' 72 | 192.168.0.9 godzilla 73 | 192.168.0.10 poni 74 | 192.168.0.81 sphinx 75 | 192.168.0.82 alserg 76 | 192.168.0.83 alant 77 | 192.168.0.84 svkazakov 78 | 192.168.0.85 svkazakov-win 79 | 192.168.0.86 melnikov2 80 | 192.168.0.87 tsarev 81 | 192.168.0.89 horse 82 | 192.168.0.108 owl 83 | 192.168.0.78 griffin 84 | 192.168.0.79 hydra 85 | ''; 86 | sudoConf = '' 87 | Cmnd_Alias SUSPEND = /var/run/current-system/sw/sbin/pm-suspend, /var/run/current-system/sw/bin/systemctl suspend 88 | 89 | %users ALL=NOPASSWD: SUSPEND 90 | ''; 91 | alsaConf = '' 92 | defaults.pcm.!card 3 93 | ''; 94 | 95 | } 96 | -------------------------------------------------------------------------------- /nixconfigs/private.nix.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagajaga/my_configs/d64c7a11f9581c715241744040b5976809909b04/nixconfigs/private.nix.gpg -------------------------------------------------------------------------------- /nixconfigs/work_configuration.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # the system. Help is available in the configuration.nix(5) man page 3 | # or the NixOS manual available on virtual console 8 (Alt+F8). 4 | 5 | { config, pkgs, ... }: 6 | let 7 | literals = import ./literals.nix {pkgs = pkgs;}; 8 | in 9 | 10 | { 11 | require = [ 12 | ./work_hardware-configuration.nix 13 | ./private.nix 14 | ]; 15 | 16 | boot = { 17 | kernelPackages = pkgs.linuxPackages_latest; 18 | loader.grub = { 19 | timeout = 1; 20 | enable = true; 21 | version = 2; 22 | device = "/dev/sda"; 23 | }; 24 | }; 25 | 26 | nix = { 27 | package = pkgs.nixUnstable; 28 | binaryCaches = [ http://cache.nixos.org ]; 29 | trustedBinaryCaches = [ http://cache.nixos.org ]; 30 | useChroot = true; 31 | gc = { 32 | automatic = true; 33 | dates = "2 weeks"; 34 | }; 35 | }; 36 | nixpkgs.config = { 37 | allowUnfree = true; 38 | }; 39 | 40 | networking = { 41 | firewall = { 42 | enable = false; 43 | allowedUDPPorts = [ 7777 ]; 44 | allowedTCPPorts = [ 7777 ]; 45 | }; 46 | hostName = "aseroka-nixos"; 47 | extraHosts = literals.workHosts; 48 | proxy.default = "rain.ifmo.ru:3128"; 49 | connman.enable = true; 50 | }; 51 | 52 | i18n = { 53 | consoleFont = "lat9w-16"; 54 | consoleKeyMap = "ruwin_cplk-UTF-8"; 55 | defaultLocale = "en_US.UTF-8"; 56 | }; 57 | 58 | hardware = { 59 | opengl = { 60 | driSupport32Bit = true; 61 | }; 62 | pulseaudio.enable = true; 63 | }; 64 | 65 | security.sudo.configFile = literals.sudoConf; 66 | 67 | programs.ssh.startAgent = false; 68 | 69 | services = { 70 | dbus.enable = true; 71 | nixosManual.showManual = true; 72 | locate.enable = true; 73 | udisks2.enable = true; 74 | openssh.enable = true; 75 | printing.enable = true; 76 | ntp.enable = true; 77 | }; 78 | 79 | services.xserver = { 80 | exportConfiguration = true; 81 | enable = true; 82 | layout = "us,ru(winkeys)"; 83 | xkbOptions = "grp:caps_toggle"; 84 | xkbVariant = "winkeys"; 85 | displayManager.slim = { 86 | enable = true; 87 | autoLogin = false; 88 | defaultUser = "jaga"; 89 | theme = pkgs.fetchurl { 90 | url = https://github.com/jagajaga/nixos-slim-theme/archive/1.1.tar.gz; 91 | sha256 = "66c3020a6716130a20c3898567339b990fbd7888a3b7bbcb688f6544d1c05c31"; 92 | }; 93 | }; 94 | desktopManager = { 95 | default = "none"; 96 | xterm.enable = false; 97 | }; 98 | windowManager = { 99 | default = "xmonad"; 100 | xmonad = { 101 | enable = true; 102 | enableContribAndExtras = true; 103 | }; 104 | }; 105 | startGnuPGAgent = true; 106 | }; 107 | 108 | virtualisation.libvirtd.enable = true; 109 | 110 | users.extraUsers.jaga = { 111 | description = "Arseniy Seroka"; 112 | createHome = true; 113 | home = "/home/jaga"; 114 | group = "users"; 115 | extraGroups = [ "wheel" "networkmanager" "adb" "video" "power" "vboxusers" "libvirtd" ]; 116 | shell = "${pkgs.zsh}/bin/zsh"; 117 | uid = 1000; 118 | }; 119 | 120 | time.timeZone = "Europe/Moscow"; 121 | 122 | environment.systemPackages = with pkgs; [ 123 | ]; 124 | fonts = { 125 | enableFontDir = true; 126 | enableGhostscriptFonts = true; 127 | fonts = [ 128 | ]; 129 | }; 130 | } 131 | -------------------------------------------------------------------------------- /nixconfigs/work_hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" ]; 12 | boot.kernelModules = [ "kvm-amd" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = { 16 | device = "/dev/sda1"; 17 | fsType = "ext4"; 18 | options = "rw,stripe=16,data=ordered,relatime"; 19 | }; 20 | 21 | fileSystems."/ceph" = { 22 | device = "192.168.0.81:/"; 23 | fsType = "ceph"; 24 | options = "name=admin,secretfile=/root/admin.key"; 25 | }; 26 | 27 | 28 | swapDevices = [ { 29 | device = "/dev/sda2"; 30 | } ]; 31 | 32 | nix.maxJobs = 2; 33 | } 34 | -------------------------------------------------------------------------------- /nixconfigs/zenbook_configuration.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # the system. Help is available in the configuration.nix(5) man page 3 | # or the NixOS manual available on virtual console 8 (Alt+F8). 4 | 5 | { config, pkgs, lib, ... }: 6 | 7 | { 8 | require = [ 9 | ./zenbook_hardware-configuration.nix 10 | ]; 11 | 12 | imports = [ 13 | ./common_configuration.nix 14 | ]; 15 | 16 | boot.loader.grub.device = "/dev/sda"; 17 | 18 | networking = { 19 | hostName = "nixosZ"; 20 | }; 21 | 22 | hardware = { 23 | bluetooth.enable = true; 24 | }; 25 | nixpkgs.config = { 26 | packageOverrides = pkgs: { 27 | bluez = pkgs.bluez5; 28 | }; 29 | }; 30 | 31 | hardware.pulseaudio.package = pkgs.pulseaudioFull; 32 | 33 | security.polkit.extraConfig = '' 34 | polkit.addRule(function(action) { 35 | if (action.id == "org.freedesktop.udisks2.filesystem-mount-system") { 36 | return polkit.Result.YES; 37 | } 38 | }); 39 | ''; 40 | 41 | services.acpid.enable = true; 42 | services.acpid.lidEventCommands = '' 43 | LID="/proc/acpi/button/lid/LID/state" 44 | state=`cat $LID | ${pkgs.gawk}/bin/awk '{print $2}'` 45 | case "$state" in 46 | *open*) echo $(whoami) > /home/jaga/whoami ;; 47 | *close*) 48 | # ${pkgs.su}/bin/su jaga -c ${pkgs.slim}/bin/slimlock & 49 | systemctl suspend 50 | ;; 51 | *) logger -t lid-handler "Failed to detect lid state ($state)" ;; 52 | esac 53 | ''; 54 | 55 | services.upower.enable = true; 56 | services.teamviewer.enable = false; 57 | 58 | services.xserver = { 59 | videoDrivers = [ "intel" ]; 60 | /*multitouch.enable = true;*/ 61 | synaptics = { 62 | enable = true; 63 | minSpeed = "0.4"; 64 | maxSpeed = "1.2"; 65 | accelFactor = "0.035"; 66 | palmDetect = true; 67 | horizontalScroll = false; 68 | twoFingerScroll = true; 69 | # buttonsMap = [ 1 3 2 ]; # Some bug, default settings doesn't recognize right touchpad button as it is, now it's two-finger-tap to call menu 70 | additionalOptions = '' 71 | Option "TapButton3" "2" 72 | Option "ClickPad" "true" 73 | Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" 74 | # Option "PalmMinWidth" "6" 75 | # Option "PalmMinZ" "100" 76 | ''; 77 | }; 78 | }; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /nixconfigs/zenbook_hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | 2 | # This is a generated file. Do not modify! 3 | # Make changes to /etc/nixos/configuration.nix instead. 4 | { config, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.kernelModules = [ "ehci_hcd" "ahci" "xhci_hcd" "usb_storage" ]; 12 | boot.kernelModules = [ "kvm-intel" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | nix.maxJobs = 4; 16 | 17 | fileSystems."/".device = "/dev/sda2"; 18 | fileSystems."/home".device = "/dev/sda3"; 19 | 20 | # List swap partitions activated at boot time. 21 | swapDevices = 22 | [ { device = "/dev/sda1"; } 23 | ]; 24 | 25 | } 26 | --------------------------------------------------------------------------------