summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-02-10 19:34:18 +0100
committerMiguel <m.i@gmx.at>2019-02-10 19:34:18 +0100
commit3c634f69fe1e67c109c20a8dc5a594dc10bff0fe (patch)
treeb257b4d23fcbeee213ab9b6854d60395305ef778
parentb97ba813265e58c362c3b30b3c00c9674e11c6be (diff)
dotfiles updated
-rw-r--r--vim/vimrc20
-rwxr-xr-xxmonad/checkmail.sh8
-rwxr-xr-xxmonad/nvidia-temp.sh2
-rw-r--r--xmonad/xmobarrc14
-rw-r--r--xmonad/xmonad.hs162
5 files changed, 70 insertions, 136 deletions
diff --git a/vim/vimrc b/vim/vimrc
index f8e6a87..20a0f21 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -5,14 +5,27 @@
"""""""""""""""""""""""""""""""""""""
" {{{ NOTES
-
+" https://wiki.haskell.org/99_questions/Solutions/34
+" http://www.stephendiehl.com/posts/vim_2016.html
+" https://github.com/lukerandall/haskellmode-vim
+" :h compiler-plugin
+" :help equalprg
+" 15:15:33 gagbo | and then you can map it on key like nnoremap │ aauren
+" | <F7> :compiler clang-tidy<CR>:make and nnoremap │ abbec
+" | <F8> :compiler clang<CR>:make in like │ Accord
+" | ~/.vim/after/ftplugin/cpp.vim for example
+" https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/
+" https://mendo.zone/fun/neovim-setup-haskell/
+" https://github.com/aloiscochard/codex
+" https://github.com/haskell/haskell-ide-engine#using-hie-with-vim-or-neovim ?
+" ghc-mod, hlint (haskell)
+" https://wiki.haskell.org/Vim
" http://www.alexeyshmalko.com/2014/using-vim-as-c-cpp-ide/
" https://github.com/vim-airline/vim-airline
" https://github.com/spf13/spf13-vim
" http://antjanus.com/blog/thoughts-and-opinions/use-vim/
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/
" http://derekingrouville.com/2012/vim-is-my-ide/
-" http://www.stephendiehl.com/posts/vim_2016.html
" https://github.com/VundleVim/Vundle.vim
" draculatheme.com
" learnvimscriptthehardway.stevelosh.com "
@@ -22,7 +35,7 @@
" change mappings to more specific mappings and use noremap!
" toggle 'cursorline' via hotkey for nicer reading experience.
" ft=c.doxygen etc.
-" include dependancies as git submodules (wherever possible?? seriously?) (check licenses first)
+" include dependancies as git submodules (wherever possible?? seriously?) (licenses?)
" :help complete-functions
" quickfix
" compiler/debugger invocation
@@ -86,6 +99,7 @@ Plugin 'fholgado/minibufexpl.vim'
Plugin 'majutsushi/tagbar'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-sensible'
+Plugin 'Shougo/vimproc.vim'
" Plugin 'vim-scripts/Conque-GDB'
" Plugin 'dracula/vim'
" Plugin 'git://ex40.softwarefools.com/vim-potion.git'
diff --git a/xmonad/checkmail.sh b/xmonad/checkmail.sh
index 5fb596d..a8037e5 100755
--- a/xmonad/checkmail.sh
+++ b/xmonad/checkmail.sh
@@ -4,13 +4,15 @@ A="<action=xterm -e mutt>"
B="</action>"
case $MAILS in
*new*)
- echo "$A<icon=/home/miguel/git/dotfiles/xmonad/mail.xpm/><fc="#dc322f">$MAILS</fc>$B"
+ #echo "$A<icon=/home/miguel/git/dotfiles/xmonad/mail.xpm/><fc="#dc322f">$MAILS</fc>$B"
+ echo "$A<fc="#b58900"><fn=1></fn> $MAILS</fc>$B"
;;
*unread*)
- echo "$A<fc="#b58900">$MAILS</fc>$B"
+ echo "$A<fc="#b58900"><fn=1></fn> $MAILS</fc>$B"
;;
*)
- echo "$A<fc="#93a1a1">no mail</fc>$B"
+ #echo "$A<fc="#93a1a1"><fn=1></fn>$MAILS</fc>$B"
+ echo "$A<fc="#93a1a1"><fn=1></fn></fc>$B"
;;
esac
diff --git a/xmonad/nvidia-temp.sh b/xmonad/nvidia-temp.sh
index 9adc421..fa40e91 100755
--- a/xmonad/nvidia-temp.sh
+++ b/xmonad/nvidia-temp.sh
@@ -32,5 +32,5 @@ get_color()
TEMP_COL=$(get_color $TEMP $TEMP_LOW $TEMP_HIGH)
GPU_COL=$(get_color $GPU $GPU_LOW $GPU_HIGH)
-echo "<fc=$GPU_COL>$GPU</fc>% (<fc=$TEMP_COL>$TEMP</fc>°C)"
+echo "<fc=$GPU_COL>$GPU</fc>% <fc=$TEMP_COL>$TEMP</fc>°C"
diff --git a/xmonad/xmobarrc b/xmonad/xmobarrc
index dd713da..f81f60f 100644
--- a/xmonad/xmobarrc
+++ b/xmonad/xmobarrc
@@ -2,7 +2,7 @@
Config {
font = "xft:Sans-10:bold"
- , additionalFonts = ["xft:FontAwesome-10"]
+ , additionalFonts = ["xft:FontAwesome-11"]
, bgColor = "#002b36"
, fgColor = "#657b83"
, position = TopW L 95
@@ -15,7 +15,7 @@ Config {
, Run MultiCpu ["-t","<total0> <total1> <total2> <total3> <total4> <total5> <total6> <total7>%",
"-L","10","-H","65","--low","#93a1a1","--normal","#268bd2","--high","#dc322f"] 10
- , Run Network "eth0" ["-t","rx <rx> tx <tx>",
+ , Run Network "eno1" ["-t","rx <rx> tx <tx>",
"-L","100","-H","5000","--low","#93a1a1","--normal","#268bd2","--high","#dc322f"] 10
, Run Memory ["-t","<usedratio>%",
@@ -26,10 +26,10 @@ Config {
, Run Date "%a %d %b %Y %H:%M:%S" "date" 10
- , Run DiskU [ ("/", "/:<fc=#93a1a1><free></fc>"),
- ("/mnt/DATA", "/dat:<fc=#93a1a1><free></fc>"),
- ("/mnt/BACKUP", "/bkp:<fc=#93a1a1><free></fc>"),
- ("/mnt/PENIS", "/pns:<fc=#93a1a1><free></fc>")] [] 20
+ , Run DiskU [ ("/", "root:<fc=#93a1a1><free></fc>"),
+ ("/mnt/sdd1", "data:<fc=#93a1a1><free></fc>"),
+ ("/mnt/sdc2", "bckp:<fc=#93a1a1><free></fc>"),
+ ("/mnt/win", "fat:<fc=#93a1a1><free></fc>")] [] 20
, Run CoreTemp ["-t", "<core0> <core1> <core2> <core3>",
"-L", "30", "-H", "60", "-l", "#93a1a1", "-n", "#268bd2", "-h", "#dc322f"] 50
@@ -41,5 +41,5 @@ Config {
, sepChar = "%"
, alignSep = "}{"
- , template = "%StdinReader%}{%mymails% - %eth0% KB/s - cpu %multicpu% (%coretemp%°C) - gpu %gputemp% - mem %memory% (%swap%) - %disku% - <fc=#93a1a1>%date%</fc> <action=`zenity --question --text=yesorno && xmessage -geometry 200x200+300+300 dupa -buttons YES:0,nope&&xterm`><fn=1></fn></action>"
+ , template = "%StdinReader%}{%mymails% - %eno1% KB/s <action=xterm -e htop><fn=1></fn> %multicpu% %coretemp%°C</action> <action=nvidia-settings><fn=1></fn> %gputemp%</action> <fn=1></fn> %memory% (%swap%) %disku% - <fc=#93a1a1>%date%</fc> <action=`pavucontrol`><fn=1></fn> </action><action=`systemctl suspend`><fn=1></fn></action>"
}
diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs
index b38e18e..3119cf8 100644
--- a/xmonad/xmonad.hs
+++ b/xmonad/xmonad.hs
@@ -1,6 +1,6 @@
--
-- Miguel's Xmonad Config.
--- Last Update: 2019-01-27
+-- Last Update: 2019-02-10
--
import XMonad
@@ -33,39 +33,6 @@ import XMonad.Layout.Tabbed
configPath="/home/miguel/git/dotfiles/xmonad"
--- DREAMS / TODO
--- notify-send replace/ always same workspace
--- bells for different apps: mutt, slrn , cmabber
--- xterm-float that will float with 80x20 chars?
--- help shift-mod-/
--- ...
--- TODO: would still like fullscreen flash vids to not crop and leave xmobar drawn
--- TODO: hook in TopicSpaces, start specific apps on specific workspaces
--- | The available layouts. Note that each layout is separated by |||, which
--- denotes layout choice.||| Circle||| OneBig (3/4) (3/4) ||| spiral (1/1.61803) ||| tabbedBottom shrinkText def {fontName="xft:Sans-13:bold",decoHeight=60}
-
--- http://xmonad.org/manpage.html
--- xmona key-bindings :
-
--- mod-shift-return - launch terminal
--- mod-p - launch dmenu
--- mod-shift-p - launch gmrun (!!?)
--- mod-shift-c - close focused
--- mod-space - rotate through layout algos
--- mod-shift-space - reset layout to def (!!?)
--- mod-tab / mod-shift-tab
--- mod-j/k (+shifted)
--- mod-l/h
--- mod-return
--- mod-t
--- mod-,/.
--- mod-`1234567890-=< (+shifted)
--- mod-qwer (+shifted)
--- mouse-1/2/3
---
--- https://superuser.com/questions/478498/start-applications-on-specific-workspaces-in-xmonad
--- spawnOn appears to be broken !?
-
spawnToWorkspace :: String -> String -> X ()
spawnToWorkspace program workspace = do spawn program
windows $ W.greedyView workspace
@@ -76,27 +43,18 @@ data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show)
instance UrgencyHook LibNotifyUrgencyHook where
urgencyHook LibNotifyUrgencyHook w = do
name <- getName w
--- Just idx <- fmap (W.findTag w) $ gets windowset
--- safeSpawn "notify-send" [show name, "workspace " ++ idx]
+-- Just idx <- fmap (W.findTag w) $ gets windowset
+-- safeSpawn "notify-send" [show name, "workspace " ++ idx]
spawn "xterm"
-
layout = tiled ||| Mirror tiled ||| noBorders Full ||| Grid ||| ThreeColMid 1 (3/100) (1/2)
where
- -- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-
- -- The default number of windows in the master pane
nmaster = 1
-
- -- Default proportion of screen occupied by master pane
ratio = 1/2
-
- -- Percent of screen to increment by when resizing panes
delta = 3/100
-
-myExtraWorkspaces =
+myWorkspaces =
[
(xK_quoteleft, "~"),
(xK_1, "1"),
@@ -120,21 +78,17 @@ main = do
xmonad $ withUrgencyHookC BorderUrgencyHook { urgencyBorderColor = "#ff0000" } urgencyConfig {suppressWhen=UH.Never,remindWhen=UH.Dont} -- remind does not work anyway :(
-- $ docks
$ ewmh defaultConfig {
-
- workspaces = (map snd myExtraWorkspaces)
+ workspaces = (map snd myWorkspaces)
,borderWidth = 2
,normalBorderColor = "#586e75"
- --focusedBorderColor = "#cb4b16",
,focusedBorderColor = "#eee8d5"
--- focusFollowsMouse = False,
+-- ,focusFollowsMouse = False
,modMask = mod4Mask
- --terminal = "urxvt",
,terminal = "xterm -e tmux"
-- if you are using xmonad 0.9, you can avoid web flash videos getting cropped in fullscreen like so:
- --,manageHook = ( isFullscreen --> doFullFloat ) <+> manageDocks <+> manageHook defaultConfig,
-
--- (no longer needed in 0.10)
- --,manageHook = composeAll [] <+> manageSpawn
+-- ,manageHook = ( isFullscreen --> doFullFloat ) <+> manageDocks <+> manageHook defaultConfig,
+-- no longer needed in 0.10
+-- ,manageHook = composeAll [] <+> manageSpawn
,manageHook = composeAll[
className =? "Xmessage" --> doFloat
] <+> manageSpawn <+> manageDocks <+> manageHook def
@@ -144,104 +98,68 @@ main = do
,layoutHook = avoidStruts $ layout
,startupHook = do spawnOnSingle "6" "mutt"
--- spawnOnSingle "6" "slrn"
--- spawnOnSingle "6" "newsbeuter"
spawnOnSingle "6" "mcabber"
spawnOnSingle "6" "weechat"
-
--- spawnToWorkspace "xterm" (map snd myExtraWorkspaces !! 6)
--- spawnOn "6" "xterm -e irssi"
--- spawnOn "6" "xterm -e slrn"
--- spawnOn "6" "xterm -e mutt"
-
--- spawnOn "9" "chromium --new-window https://people.live.com/ https://www.facebook.com/"
-
--- setWMName "LG3D"
-
+-- setWMName "LG3D"
,logHook =
takeTopFocus >>( dynamicLogWithPP $ xmobarPP
{
-- ppOrder = reverse,
--- ppSort = mkWsSort $ getXineramaPhysicalWsCompare horizontalScreenOrderer, --getSortByXineramaPhysicalRule def,
+-- ppSort = mkWsSort $ getXineramaPhysicalWsCompare horizontalScreenOrderer, --getSortByXineramaPhysicalRule def,
ppSort = getSortByXineramaPhysicalRule,
--- ppSort = mkWsSort $ getXineramaPhysicalWsCompare,
--- ppSort = mkWsSort $ getXineramaWsCompare,
+-- ppSort = mkWsSort $ getXineramaPhysicalWsCompare,
+-- ppSort = mkWsSort $ getXineramaWsCompare,
ppOutput = hPutStrLn xmproc,
- ppTitle = xmobarColor "#859900" "" . shorten 50, --green
- ppCurrent = (\x -> "<fc=#dc322f>"++x++"</fc>"), --red
- ppVisible = (\x -> "<fc=#859900>"++x++"</fc>"), --green
+ ppTitle = xmobarColor "#859900" "" . shorten 50, --green
+ ppCurrent = (\x -> "<fc=#dc322f>"++x++"</fc>"), --red
+ ppVisible = (\x -> "<fc=#859900>"++x++"</fc>"), --green
ppHidden = (\x -> "<fc=#b58900>"++x++"</fc>"), --yellow
ppHiddenNoWindows = (\x -> "<fc=#93a1a1>"++x++"</fc>") --gray
- -- ,ppVisibleNoWindows = Just (\x-> "<fc=#268bd2>"++x++"</fc>") --blue
+-- ppVisibleNoWindows = Just (\x-> "<fc=#268bd2>"++x++"</fc>") --blue
})
} `additionalKeys`
(
[
- ((mod4Mask, xK_F1 ), spawn "xterm -e vim ~/.xmonad/xmonad.hs")
- ,((mod4Mask , xK_b ), sendMessage ToggleStruts)
-
--- , ((mod4Mask, xK_m ), spawn "notify-send \"$( fetchmail )\"")
- , ((mod4Mask, xK_m ), spawn "xterm -e \"fetchmail&&sleep 2\"")
- , ((mod4Mask, xK_c ), spawn "notify-send \"$(xclip -o)\"")
- , ((mod4Mask, xK_p ), spawn "dmenu_run -nb '#073642' -nf '#fdf6e3' -sb '#268bd2' -sf '#073642' -fn 'DejaVu Sans-10'")
-
+ ((mod4Mask, xK_F1 ), spawn "xterm -e vim ~/.xmonad/xmonad.hs")
+ ,((mod4Mask , xK_b ), sendMessage ToggleStruts)
+ ,((mod4Mask, xK_p ), spawn "dmenu_run -nb '#073642' -nf '#fdf6e3' -sb '#268bd2' -sf '#073642' -fn 'DejaVu Sans-10'")
+ ,((mod4Mask, xK_x ), spawn "slock")
+ ,((mod4Mask, xK_m ), spawn "xterm -e \"fetchmail&&sleep 2\"")
+ ,((mod4Mask, xK_c ), spawn "xterm -e \"echo clipboard&&xclip -o -selection clipboard&&echo&&echo&&echo primary&&xclip -o -selection p&&echo&&echo&&echo [press enter]&&read\"")
+ ,((mod4Mask, xK_s ), spawn "import /tmp/screen.png && feh -. /tmp/screen.png")
+
+-- , ((mod4Mask, xK_m ), spawn "notify-send \"$( fetchmail )\"")
+ --,((mod4Mask .|. shiftMask, xK_x ), spawn "ans=$(zenity --list --text 'wanna restart?' --radiolist --column 'Pick' --column 'Opinion' TRUE '' FALSE 'sudo shutdown -r now' FALSE 'sudo shutdown -h now' ); $ans")
-- mods-s screenshot window
-- , ((mod4Mask, xK_s ), spawn "xwd | convert - /tmp/screen.png && gimp /tmp/screen.png")
--
-- mods-s spawn surf wrapper
+-- ,((mod4Mask, xK_v ), spawn "bash -l -c \"/home/miguel/opt/vim/bin/gvim -c \\\":cd `echo -e '/home/miguel/_int/dev/FoolOs\n/home/miguel/' | dmenu` \\\" \"")
-- , ((mod4Mask, xK_s ), spawn "surf")
-
-- mods-f fullscreen screenshot
- , ((mod4Mask, xK_f ), spawn "xwd -root | convert - /tmp/screen.png && gimp /tmp/screen.png")
-
-- mod-g - go/ jump to window
-- , ((mod4Mask, xK_g ), spawn "wmctrl -a \"$(wmctrl -l | sed s/[^[:blank:]]*..[^[:blank:]]*.[^[:blank:]]*.// | dmenu)\"")
- , ((mod4Mask, xK_v ), spawn "bash -l -c \"/home/miguel/opt/vim/bin/gvim -c \\\":cd `echo -e '/home/miguel/_int/dev/FoolOs\n/home/miguel/' | dmenu` \\\" \"")
-- , ((mod4Mask, xK_q ), spawn "notify-send \"mod-q disabled\"")
- , ((mod4Mask, xK_x ), spawn "slock")
- , ((mod4Mask .|. shiftMask, xK_x ), spawn "ans=$(zenity --list --text 'wanna restart?' --radiolist --column 'Pick' --column 'Opinion' TRUE '' FALSE 'sudo shutdown -r now' FALSE 'sudo shutdown -h now' ); $ans")
-
-- , ((mod4Mask .|. shiftMask, xK_space ), spawn "xterm -e /home/miguel/bin/msrv")
-
-
-- window list
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Prompt-Window.html
-
-- , ((mod4Mask .|. shiftMask, xK_g ), gotoMenu)
-- , ((mod4Mask .|. shiftMask, xK_b ), bringMenu)
-
]
-
- -- https://wiki.haskell.org/Xmonad/Frequently_asked_questions / 3.3.3 Screens are in wrong order
-
- ++
-
- [
+ ++
+ [
((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust (windows . f)) -- Replace 'mod1Mask' with your mod key of choice.
- | (key, sc) <- zip [xK_q,xK_w, xK_e, xK_r] [2,0,1,3] -- was [0..] *** change to match your screen order ***
+ | (key, sc) <- zip [xK_q,xK_w, xK_e, xK_r] [3,2,0,1] -- change to match your screen order
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
- ]
-
- --
- -- mod-[1..9], Switch to workspace N
- -- mod-shift-[1..9], Move client to workspace N
- --
--- [((m .|. mod4Mask, k), windows $ f i)
- -- | (i, k) <- zip (XMonad.workspaces defaultConfig) [xK_grave, xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9, xK_0, xK_minus, xK_equal, xK_BackSpace]
- -- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
-
- ++
-
- [
+ ]
+ ++
+ [
((mod4Mask, key), (windows $ W.greedyView ws))
- | (key,ws) <- myExtraWorkspaces
- ]
-
- ++
-
- [
+ | (key,ws) <- myWorkspaces
+ ]
+ ++
+ [
((mod4Mask .|. shiftMask, key), (windows $ W.shift ws))
- | (key,ws) <- myExtraWorkspaces
- ]
-
+ | (key,ws) <- myWorkspaces
+ ]
)