Skip to content

Commit

Permalink
add xmonad-related configs; some other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lvu committed Jan 10, 2017
1 parent dc725ca commit bc86d77
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .ackrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
59 changes: 32 additions & 27 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand All @@ -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 <F5> <Esc>:BufExplorer<cr>
Expand All @@ -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
Expand All @@ -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()
27 changes: 27 additions & 0 deletions .xmobarrc
Original file line number Diff line number Diff line change
@@ -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: <usedratio>%"] 10
, Run Swap [] 10
, Run BatteryP ["BAT0"]
[ "-t", "<watts>W, <left>% / <timeleft> <acstatus>"
, "--"
, "-O", "<fc=#88ff88>AC</fc>"
, "-i", "<fc=#8888ff>--</fc>"
, "-o", "<fc=#ffaaaa>DC</fc>"
] 50
, Run Date "%a %Y-%d-%m %H:%M" "date" 10
, Run StdinReader
, Run CoreTemp ["-t", "Tcore: <core0>°C"] 10
, Run DynNetwork ["-m", "4", "-t", "<dev>: <rx>KB↓<tx>KB↑"] 5
, Run Wireless "wlan0" [] 5
, Run Kbd [("ru(ruu)", "RU"), ("us", "EN")]
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %dynnetwork% %wlan0wi% | %cpu% | %memory% * %swap% | %coretemp% | %battery% | <fc=#ee9a00>%date%</fc> <fc=#88ff88>[%kbd%]</fc>"
}
16 changes: 16 additions & 0 deletions .xprofile
Original file line number Diff line number Diff line change
@@ -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 ) &
84 changes: 84 additions & 0 deletions xmonad.hs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bc86d77

Please sign in to comment.