From bc86d775e2d7ea5f2440eeae315abb7cb300e850 Mon Sep 17 00:00:00 2001 From: Valentin Lavrinenko Date: Tue, 10 Jan 2017 17:54:33 +0200 Subject: [PATCH] add xmonad-related configs; some other changes --- .ackrc | 5 ++++ .bashrc | 3 +- .vimrc | 59 ++++++++++++++++++++------------------ .xmobarrc | 27 ++++++++++++++++++ .xprofile | 16 +++++++++++ xmonad.hs | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 166 insertions(+), 28 deletions(-) create mode 100644 .xmobarrc create mode 100644 .xprofile create mode 100644 xmonad.hs diff --git a/.ackrc b/.ackrc index 3c83f4d..0e0cda5 100644 --- a/.ackrc +++ b/.ackrc @@ -2,4 +2,9 @@ --context=3 --ignore-dir=.ropeproject --ignore-file=ext:log +--ignore-file=ext:svg +--ignore-file=ext:edn +--ignore-file=ext:pickle +--ignore-file=is:jstests.xml --ignore-file=is:.coverage +--ignore-file=is:nosetests.xml diff --git a/.bashrc b/.bashrc index 7bcf007..49a20cc 100644 --- a/.bashrc +++ b/.bashrc @@ -11,7 +11,7 @@ alias sqlplus='rlwrap sqlplus' alias sml='rlwrap sml' alias pyack='ack --python' alias pyag='ag --python' -alias vim='/usr/bin/launch-python-vim.sh' +# alias vim='/usr/bin/launch-python-vim.sh' alias :e='vim' PS1='[\u@\h \W]\$ ' export ORAENV_ASK=NO @@ -26,6 +26,7 @@ export MAKEFLAGS='-j 8' export HISTSIZE=10000 export HISTFILESIZE=10000 export HISTTIMEFORMAT="%h %d %H:%M:%S " +export _JAVA_AWT_WM_NONREPARENTING=1 PROMPT_COMMAND="$PROMPT_COMMAND; history -a" . /usr/bin/virtualenvwrapper.sh . /usr/lib/z.sh diff --git a/.vimrc b/.vimrc index 99fa126..453e48c 100644 --- a/.vimrc +++ b/.vimrc @@ -4,16 +4,19 @@ set nocompatible filetype off " required! set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() -Plugin 'gmarik/Vundle.vim' -Plugin 'mileszs/ack.vim' -Plugin 'klen/python-mode' +" Plugin 'klen/python-mode' +Plugin 'Shougo/neocomplete.vim' +Plugin 'davidhalter/jedi-vim' Plugin 'git://git.wincent.com/command-t.git' +Plugin 'gmarik/Vundle.vim' +Plugin 'hynek/vim-python-pep8-indent' Plugin 'jlanzarotta/bufexplorer' -Plugin 'tpope/vim-surround' +Plugin 'mileszs/ack.vim' +Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-sensible' -Plugin 'Shougo/neocomplete.vim' -Plugin 'davidhalter/jedi-vim' +Plugin 'tpope/vim-surround' +Plugin 'trusktr/seti.vim' call vundle#end() filetype plugin indent on " required! @@ -22,18 +25,7 @@ set hidden set spell spelllang=en_us set expandtab set shiftwidth=4 -colorscheme peachpuff - -if &t_Co > 2 || has("gui_running") - set hlsearch -endif - -hi clear SpellBad -hi clear SpellLocal -hi clear SpellRare -hi SpellBad cterm=inverse -hi SpellLocal cterm=italic -hi SpellRare cterm=underline +set hlsearch nmap :BufExplorer @@ -46,15 +38,11 @@ autocmd Filetype xml setlocal ts=2 sts=2 sw=2 autocmd Filetype html setlocal ts=2 sts=2 sw=2 autocmd Filetype htmldjango setlocal ts=2 sts=2 sw=2 -let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'pep257'] -let g:pymode_lint_onfly = 1 -let g:pymode_lint_unmodified = 1 -let g:pymode_lint_on_write = 1 -let g:pymode_lint_ignore = "D101,D102,D103,D205,D400,E731" -let g:pymode_options_max_line_length = 79 -let g:pymode_rope_goto_definition_cmd = 'e' -let g:pymode_rope = 0 -autocmd FileType python set nonumber +let g:syntastic_python_checkers = ['flake8'] +let g:syntastic_aggregate_errors = 1 +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +autocmd FileType python setlocal colorcolumn=80 let g:neocomplete#enable_at_startup = 1 let g:neocomplete#enable_fuzzy_completion = 0 @@ -72,3 +60,20 @@ set foldlevelstart=20 " Allow saving of files as sudo when I forgot to start vim using sudo. cmap w!! w !sudo tee > /dev/null % + +colorscheme seti + +fun! s:highlight() + hi clear SpellBad + hi clear SpellLocal + hi clear SpellRare + hi SpellBad ctermbg=53 + hi SpellLocal ctermbg=53 cterm=underline + hi SpellRare ctermbg=89 +endfun + +augroup myplugin_highlight + autocmd! + autocmd ColorScheme * call s:highlight() +augroup end +call s:highlight() diff --git a/.xmobarrc b/.xmobarrc new file mode 100644 index 0000000..fb1f97f --- /dev/null +++ b/.xmobarrc @@ -0,0 +1,27 @@ +Config + { font = "xft:Hack-10:bold" + , bgColor = "black" + , fgColor = "grey" + , position = TopSize L 90 24 + , commands = + [ Run Cpu ["-m", "2", "-L","3","-H","50","--normal","green","--high","red"] 10 + , Run Memory ["-t","Mem: %"] 10 + , Run Swap [] 10 + , Run BatteryP ["BAT0"] + [ "-t", "W, % / " + , "--" + , "-O", "AC" + , "-i", "--" + , "-o", "DC" + ] 50 + , Run Date "%a %Y-%d-%m %H:%M" "date" 10 + , Run StdinReader + , Run CoreTemp ["-t", "Tcore: °C"] 10 + , Run DynNetwork ["-m", "4", "-t", ": KB↓KB↑"] 5 + , Run Wireless "wlan0" [] 5 + , Run Kbd [("ru(ruu)", "RU"), ("us", "EN")] + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%StdinReader% }{ %dynnetwork% %wlan0wi% | %cpu% | %memory% * %swap% | %coretemp% | %battery% | %date% [%kbd%]" + } diff --git a/.xprofile b/.xprofile new file mode 100644 index 0000000..6c5a171 --- /dev/null +++ b/.xprofile @@ -0,0 +1,16 @@ +# xmodmap ~/.Xmodmap +xrdb -merge .Xresources +kbdd +trayer --edge top --align right --SetDockType true --SetPartialStrut true \ + --expand true --width 10 --transparent true --tint 0x191970 --height 24 & +thunar --daemon & +xcompmgr & + +feh --bg-scale /home/lvu/heavy/photo/droplet.jpg & +pasystray & +wicd-gtk --tray & +xscreensaver -no-splash & +chromium --app=https://getgoing.slack.com & +chromium --app=https://messenger.com & +keepass & +( sleep 10 && /usr/bin/skype ) & diff --git a/xmonad.hs b/xmonad.hs new file mode 100644 index 0000000..cd92086 --- /dev/null +++ b/xmonad.hs @@ -0,0 +1,84 @@ +import XMonad +import XMonad.Actions.FocusNth +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.FadeInactive +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Layout +import XMonad.Layout.Column +import XMonad.Layout.Combo +import XMonad.Layout.FixedColumn +import XMonad.Layout.IM +import XMonad.Layout.NoBorders +import XMonad.Layout.OneBig +import XMonad.Layout.PerWorkspace +import XMonad.Layout.Spiral +import XMonad.Layout.Tabbed +import XMonad.Layout.TwoPane +import XMonad.Layout.WindowNavigation +import qualified XMonad.StackSet as W +import XMonad.Util.Run(spawnPipe) +import XMonad.Util.EZConfig(additionalKeys) +import System.IO + +baseConfig = ewmh defaultConfig + +myWorkspaces = ["web", "dev", "im"] ++ map show [4 .. 8] ++ ["junk"] + +defaultLayout = FixedColumn 1 5 128 10 + +myIM = withIM (1/7) ((ClassName "Skype") `And` (Not (Role "ConversationsWindow"))) (Tall 1 0.01 0.5) + +-- too hard to maintain window numbers :( +myDevLayout = combineTwo (Mirror $ TwoPane 0.03 0.8) (FixedColumn 1 5 128 10) Full + +-- myTabbed = tabbed shrinkText def + +-- myDevLayout = spiralWithDir South CW 0.68 -- FixedColumn 1 5 130 10 + +myLayoutHook = windowNavigation $ noBorders + (onWorkspace "im" (myIM ||| Full ||| defaultLayout) $ + onWorkspace "dev" (myDevLayout ||| defaultLayout ||| Full) $ + defaultLayout ||| myDevLayout ||| Full + ) + +myManageHook = composeAll + [ (className =? "Chromium" <&&> resource =? "getgoing.slack.com") --> doShift "im" + , (className =? "Chromium" <&&> resource =? "messenger.com") --> doShift "im" + , className =? "Skype" --> doShift "im" + , className =? "KeePass2" --> doShift "junk" + , isDialog --> doCenterFloat + ] + +myBrowser = "chromium" +incognitoBrowser = "chromium --incognito" +myFileManager = "thunar" +myTerminal = "terminator" + +myKeys = + [ ((mod1Mask .|. controlMask, xK_Delete), spawn "xscreensaver-command -lock") + , ((mod4Mask .|. shiftMask, xK_s), spawn "systemctl suspend") + , ((mod4Mask, xK_b), spawn myBrowser) + , ((mod4Mask .|. shiftMask, xK_b), spawn incognitoBrowser) + , ((mod4Mask, xK_f), spawn myFileManager) + , ((mod4Mask, xK_Left), sendMessage $ Swap L) + , ((mod4Mask, xK_Right), sendMessage $ Swap R) + , ((mod4Mask, xK_Up), sendMessage $ Swap U) + , ((mod4Mask, xK_Down), sendMessage $ Swap D) + ] -- ++ [((mod1Mask, k), focusNth i) | (i, k) <- zip [0 .. 8] [xK_1 ..]] + +main = do + xmproc <- spawnPipe "xmobar" + xmonad $ baseConfig + { terminal = myTerminal + , modMask = mod4Mask + -- , focusFollowsMouse = False + , manageHook = myManageHook <+> manageDocks <+> manageHook defaultConfig + , layoutHook = avoidStruts $ myLayoutHook + , workspaces = myWorkspaces + , logHook = fadeInactiveLogHook 0.8 >> dynamicLogWithPP xmobarPP + { ppOutput = hPutStrLn xmproc + , ppTitle = xmobarColor "green" "" . shorten 50 + } + } `additionalKeys` myKeys