From 271fd84de384f1c97627ec1dc0c410ed8538c57c Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Sat, 6 Jun 2020 18:40:47 -0500 Subject: [PATCH] Minor edits. --- .bashrc | 3 + .config/nvim/init.vim | 43 +++++++------- .doom.d/config.el | 3 + .xmonad/xmonad.hs | 127 +++++++++++++++++++++++++----------------- 4 files changed, 103 insertions(+), 73 deletions(-) diff --git a/.bashrc b/.bashrc index 16660bc..0a7cf63 100644 --- a/.bashrc +++ b/.bashrc @@ -199,5 +199,8 @@ fi ### FORCE ALL KAKOUNE WINDOWS TO BE IN ONE SESSION alias kak="kak -c mysession" +### CLEAR THE TERMINAL +# alias clear='[ $[$RANDOM % 10] = 0 ] && cd /home/dt/vt100 && ./slowcat.pl $(/bin/ls | grep .vt | shuf -n 1) || clear' + ### RANDOM COLOR SCRIPT ### /opt/shell-color-scripts/colorscript.sh random diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8037920..3712fdf 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -13,36 +13,35 @@ filetype off " required " => Vundle For Managing Plugins """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim +call plug#begin('~/.vim/plugged') -call vundle#begin() " required, all plugins must appear after this line. "{{ The Basics }} - Plugin 'gmarik/Vundle.vim' " Vundle - Plugin 'itchyny/lightline.vim' " Lightline statusbar - Plugin 'suan/vim-instant-markdown', {'rtp': 'after'} " Markdown Preview - Plugin 'frazrepo/vim-rainbow' + Plug 'gmarik/Vundle.vim' " Vundle + Plug 'itchyny/lightline.vim' " Lightline statusbar + Plug 'suan/vim-instant-markdown', {'rtp': 'after'} " Markdown Preview + Plug 'neoclide/coc.nvim', {'branch': 'release'} + Plug 'frazrepo/vim-rainbow' "{{ File management }} - Plugin 'vifm/vifm.vim' " Vifm - Plugin 'scrooloose/nerdtree' " Nerdtree - Plugin 'tiagofumo/vim-nerdtree-syntax-highlight' " Highlighting Nerdtree - Plugin 'ryanoasis/vim-devicons' " Icons for Nerdtree + Plug 'vifm/vifm.vim' " Vifm + Plug 'scrooloose/nerdtree' " Nerdtree + Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " Highlighting Nerdtree + Plug 'ryanoasis/vim-devicons' " Icons for Nerdtree "{{ Productivity }} - Plugin 'vimwiki/vimwiki' " VimWiki - Plugin 'jreybert/vimagit' " Magit-like plugin for vim + Plug 'vimwiki/vimwiki' " VimWiki + Plug 'jreybert/vimagit' " Magit-like plugin for vim "{{ Tim Pope Plugins }} - Plugin 'tpope/vim-surround' " Change surrounding marks + Plug 'tpope/vim-surround' " Change surrounding marks "{{ Syntax Highlighting and Colors }} - Plugin 'PotatoesMaster/i3-vim-syntax' " i3 config highlighting - Plugin 'kovetskiy/sxhkd-vim' " sxhkd highlighting - Plugin 'vim-python/python-syntax' " Python highlighting - Plugin 'ap/vim-css-color' " Color previews for CSS + Plug 'PotatoesMaster/i3-vim-syntax' " i3 config highlighting + Plug 'kovetskiy/sxhkd-vim' " sxhkd highlighting + Plug 'vim-python/python-syntax' " Python highlighting + Plug 'ap/vim-css-color' " Color previews for CSS "{{ Junegunn Choi Plugins }} - Plugin 'junegunn/goyo.vim' " Distraction-free viewing - Plugin 'junegunn/limelight.vim' " Hyperfocus on a range - Plugin 'junegunn/vim-emoji' " Vim needs emojis! + Plug 'junegunn/goyo.vim' " Distraction-free viewing + Plug 'junegunn/limelight.vim' " Hyperfocus on a range + Plug 'junegunn/vim-emoji' " Vim needs emojis! -call vundle#end() " required, all plugins must appear before this line. +call plug#end() filetype plugin indent on " required " To ignore plugin indent changes, instead use: diff --git a/.doom.d/config.el b/.doom.d/config.el index c79d4c9..977f67f 100644 --- a/.doom.d/config.el +++ b/.doom.d/config.el @@ -20,6 +20,9 @@ ;; Setting the neotree width to be adjustable. (setq neo-window-fixed-size nil) +;; Sets binding to toggle line wrap on/off. +(global-set-key "\C-x\ t" 'toggle-truncate-lines) + ;; Sets transparency for focuses and unfocused frames. ;; (set-frame-parameter (selected-frame) 'alpha '(95 . 80)) ;; (add-to-list 'default-frame-alist '(alpha . (95 . 80))) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index a1c8633..59a734a 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -8,7 +8,6 @@ ------------------------------------------------------------------------ -- Base import XMonad -import XMonad.Config.Desktop import System.IO (hPutStrLn) import System.Exit (exitSuccess) import qualified XMonad.StackSet as W @@ -38,8 +37,9 @@ import XMonad.Util.SpawnOnce -- Hooks import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..)) -import XMonad.Hooks.ManageDocks (avoidStruts, manageDocks, ToggleStruts(..)) +import XMonad.Hooks.ManageDocks (avoidStruts, docksEventHook, manageDocks, ToggleStruts(..)) import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat) +import XMonad.Hooks.ServerMode import XMonad.Hooks.SetWMName import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs. @@ -54,6 +54,7 @@ import XMonad.Actions.GridSelect import XMonad.Actions.MouseResize -- Layouts modifiers +import XMonad.Layout.Decoration import XMonad.Layout.LayoutModifier import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit) import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), Toggle(..), (??)) @@ -62,17 +63,17 @@ import XMonad.Layout.NoBorders import XMonad.Layout.Reflect (REFLECTX(..), REFLECTY(..)) import XMonad.Layout.Renamed (renamed, Rename(Replace)) import XMonad.Layout.Spacing +import XMonad.Layout.Tabbed import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..)) import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle)) -- Layouts import XMonad.Layout.GridVariants (Grid(Grid)) -import XMonad.Layout.OneBig import XMonad.Layout.SimplestFloat import XMonad.Layout.Spiral import XMonad.Layout.ResizableTile import XMonad.Layout.ThreeColumns -import XMonad.Layout.ZoomRow (zoomRow, zoomReset, ZoomMessage(ZoomFullToggle)) +import XMonad.Layout.ZoomRow (zoomReset, ZoomMessage(ZoomFullToggle)) ------------------------------------------------------------------------ -- VARIABLES @@ -136,6 +137,7 @@ mygridConfig colorizer = (buildDefaultGSConfig myColorizer) , gs_originFractY = 0.5 , gs_font = myFont } + spawnSelected' :: [(String, String)] -> X () spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn where conf = def @@ -201,17 +203,22 @@ dtXPConfig = def , historySize = 256 , historyFilter = id , defaultText = [] - , autoComplete = Just 100000 -- set Just 100000 for .1 sec + , autoComplete = Just 100000 -- set Just 100000 for .1 sec , showCompletionOnTab = False , searchPredicate = isPrefixOf , alwaysHighlight = True - , maxComplRows = Nothing -- set to Just 5 for 5 rows + , maxComplRows = Nothing -- set to Just 5 for 5 rows } +------------------------------------------------------------------------ +-- CALCPROMPT requires qalculate-gtk to be installed +------------------------------------------------------------------------ +-- You could use this as a template for other custom prompts that +-- use command line programs that return a single line of output. calcPrompt :: XPConfig -> String -> X () calcPrompt c ans = inputPrompt c (trim ans) ?+ \input -> - liftIO(runProcessWithInput "qalc" [input] "") >>= calcPrompt c + liftIO(runProcessWithInput "whereis" [input] "") >>= calcPrompt c where trim = f . f where f = reverse . dropWhile isSpace @@ -240,11 +247,12 @@ myKeys = -- Windows , ("M-S-c", kill1) -- Kill the currently focused client - , ("M-S-a", killAll) -- Kill all the windows on current workspace + , ("M-S-a", killAll) -- Kill all windows on current workspace -- Floating windows - , ("M-", withFocused $ windows . W.sink) -- Push floating window back to tile. - , ("M-S-", sinkAll) -- Push ALL floating windows back to tile. + , ("M-f", sendMessage (T.Toggle "floats")) -- Toggles my 'floats' layout + , ("M-", withFocused $ windows . W.sink) -- Push floating window back to tile + , ("M-S-", sinkAll) -- Push ALL floating windows to tile -- Grid Select , (("M-S-t"), spawnSelected' @@ -262,22 +270,22 @@ myKeys = , ("PCManFM", "pcmanfm") , ("Simple Terminal", "st") , ("Steam", "steam") - , ("Surf Browser", "surf suckless.org") + , ("Surf Browser", "surf suckless.org") , ("Xonotic", "xonotic-glx") ]) , ("M-S-g", goToSelected $ mygridConfig myColorizer) -- goto selected , ("M-S-b", bringSelected $ mygridConfig myColorizer) -- bring selected -- Windows navigation - , ("M-m", windows W.focusMaster) -- Move focus to the master window - , ("M-j", windows W.focusDown) -- Move focus to the next window - , ("M-k", windows W.focusUp) -- Move focus to the prev window - --, ("M-S-m", windows W.swapMaster) -- Swap the focused window and the master window - , ("M-S-j", windows W.swapDown) -- Swap the focused window with the next window - , ("M-S-k", windows W.swapUp) -- Swap the focused window with the prev window - , ("M-", promote) -- Moves focused window to master, all others maintain order - , ("M1-S-", rotSlavesDown) -- Rotate all windows except master and keep focus in place - , ("M1-C-", rotAllDown) -- Rotate all the windows in the current stack + , ("M-m", windows W.focusMaster) -- Move focus to the master window + , ("M-j", windows W.focusDown) -- Move focus to the next window + , ("M-k", windows W.focusUp) -- Move focus to the prev window + --, ("M-S-m", windows W.swapMaster) -- Swap the focused window and the master window + , ("M-S-j", windows W.swapDown) -- Swap focused window with next window + , ("M-S-k", windows W.swapUp) -- Swap focused window with prev window + , ("M-", promote) -- Moves focused window to master, others maintain order + , ("M1-S-", rotSlavesDown) -- Rotate all windows except master and keep focus in place + , ("M1-C-", rotAllDown) -- Rotate all the windows in the current stack --, ("M-S-s", windows copyToAll) , ("M-C-s", killAllOtherCopies) @@ -297,18 +305,17 @@ myKeys = , ("M-C-", sendMessage (DecreaseLeft 10)) -- Decrease size of focused window left -- Layouts - , ("M-", sendMessage NextLayout) -- Switch to next layout - , ("M-S-", sendMessage ToggleStruts) -- Toggles struts - , ("M-S-n", sendMessage $ Toggle NOBORDERS) -- Toggles noborder - , ("M-S-=", sendMessage (Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full - , ("M-S-f", sendMessage (T.Toggle "float")) + , ("M-", sendMessage NextLayout) -- Switch to next layout + , ("M-", sendMessage (Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full + , ("M-S-", sendMessage ToggleStruts) -- Toggles struts + , ("M-S-n", sendMessage $ Toggle NOBORDERS) -- Toggles noborder , ("M-S-x", sendMessage $ Toggle REFLECTX) , ("M-S-y", sendMessage $ Toggle REFLECTY) --, ("M-S-m", sendMessage $ Toggle MIRROR) - , ("M-", sendMessage (IncMasterN 1)) -- Increase number of clients in the master pane - , ("M-", sendMessage (IncMasterN (-1))) -- Decrease number of clients in the master pane - , ("M-S-", increaseLimit) -- Increase number of windows that can be shown - , ("M-S-", decreaseLimit) -- Decrease number of windows that can be shown + , ("M-", sendMessage (IncMasterN 1)) -- Increase number of clients in master pane + , ("M-", sendMessage (IncMasterN (-1))) -- Decrease number of clients in master pane + , ("M-S-", increaseLimit) -- Increase number of windows + , ("M-S-", decreaseLimit) -- Decrease number of windows , ("M-h", sendMessage Shrink) , ("M-l", sendMessage Expand) @@ -318,10 +325,10 @@ myKeys = , ("M-;", sendMessage ZoomFullToggle) -- Workspaces - , ("M-.", nextScreen) -- Switch focus to next monitor - , ("M-,", prevScreen) -- Switch focus to prev monitor - , ("M-S-", shiftTo Next nonNSP >> moveTo Next nonNSP) -- Shifts focused window to next workspace - , ("M-S-", shiftTo Prev nonNSP >> moveTo Prev nonNSP) -- Shifts focused window to previous workspace + , ("M-.", nextScreen) -- Switch focus to next monitor + , ("M-,", prevScreen) -- Switch focus to prev monitor + , ("M-S-", shiftTo Next nonNSP >> moveTo Next nonNSP) -- Shifts focused window to next ws + , ("M-S-", shiftTo Prev nonNSP >> moveTo Prev nonNSP) -- Shifts focused window to prev ws -- Scratchpads , ("M-C-", namedScratchpadAction myScratchPads "terminal") @@ -343,16 +350,16 @@ myKeys = --- My Applications (Super+Alt+Key) , ("M-M1-a", spawn (myTerminal ++ " -e ncpamixer")) , ("M-M1-b", spawn ("surf www.youtube.com/c/DistroTube/")) - , ("M-M1-c", spawn (myTerminal ++ " -e cmus")) , ("M-M1-e", spawn (myTerminal ++ " -e neomutt")) , ("M-M1-f", spawn (myTerminal ++ " -e sh ./.config/vifm/scripts/vifmrun")) , ("M-M1-i", spawn (myTerminal ++ " -e irssi")) , ("M-M1-j", spawn (myTerminal ++ " -e joplin")) , ("M-M1-l", spawn (myTerminal ++ " -e lynx -cfg=~/.lynx/lynx.cfg -lss=~/.lynx/lynx.lss gopher://distro.tube")) - , ("M-M1-m", spawn (myTerminal ++ " -e toot curses")) + , ("M-M1-m", spawn (myTerminal ++ " -e mocp")) , ("M-M1-n", spawn (myTerminal ++ " -e newsboat")) , ("M-M1-p", spawn (myTerminal ++ " -e pianobar")) , ("M-M1-r", spawn (myTerminal ++ " -e rtv")) + , ("M-M1-t", spawn (myTerminal ++ " -e toot curses")) , ("M-M1-w", spawn (myTerminal ++ " -e wopr report.xml")) , ("M-M1-y", spawn (myTerminal ++ " -e youtube-viewer")) @@ -426,38 +433,35 @@ myManageHook = composeAll -- module adds a configurable amount of space around windows. mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a mySpacing i = spacingRaw False (Border i i i i) True (Border i i i i) True --- This is a variation of the above except no borders are applied + +-- Below is a variation of the above except no borders are applied -- if fewer than two windows. So a single window has no gaps. +mySpacing' :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True +-- The layouts that I use tall = renamed [Replace "tall"] $ limitWindows 12 $ mySpacing 8 $ ResizableTall 1 (3/100) (1/2) [] - monocle = renamed [Replace "monocle"] $ limitWindows 20 $ Full - floats = renamed [Replace "floats"] $ limitWindows 20 $ simplestFloat - grid = renamed [Replace "grid"] $ limitWindows 12 $ mySpacing 8 $ mkToggle (single MIRROR) $ Grid (16/10) - spirals = renamed [Replace "spirals"] $ mySpacing' 8 $ spiral (6/7) - threeCol = renamed [Replace "threeCol"] $ limitWindows 7 $ mySpacing' 4 $ ThreeCol 1 (3/100) (1/2) - threeRow = renamed [Replace "threeRow"] $ limitWindows 7 $ mySpacing' 4 @@ -465,22 +469,35 @@ threeRow = renamed [Replace "threeRow"] -- So we are applying Mirror to the ThreeCol layout. $ Mirror $ ThreeCol 1 (3/100) (1/2) - - +tabs = renamed [Replace "tabs"] + -- I cannot add spacing to this layout because it will + -- add spacing between window and tabs which looks bad. + $ tabbed shrinkText myTabConfig + where + myTabConfig = def { fontName = "xft:Mononoki Nerd Font:regular:pixelsize=11" + , activeColor = "#292d3e" + , inactiveColor = "#3e445e" + , activeBorderColor = "#292d3e" + , inactiveBorderColor = "#292d3e" + , activeTextColor = "#ffffff" + , inactiveTextColor = "#d0d0d0" + } + +-- The layout hook myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) $ myDefaultLayout where - myDefaultLayout = tall ||| noBorders monocle ||| floats ||| grid ||| spirals ||| threeCol ||| threeRow + myDefaultLayout = tall ||| noBorders monocle ||| floats ||| grid ||| noBorders tabs ||| spirals ||| threeCol ||| threeRow ------------------------------------------------------------------------ -- SCRATCHPADS ------------------------------------------------------------------------ myScratchPads :: [NamedScratchpad] myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm - , NS "cmus" spawnCmus findCmus manageCmus + , NS "mocp" spawnCmus findCmus manageCmus ] where - spawnTerm = myTerminal ++ " -n scratchpad" + spawnTerm = myTerminal ++ " -n scratchpad" findTerm = resource =? "scratchpad" manageTerm = customFloating $ W.RationalRect l t w h where @@ -488,8 +505,8 @@ myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm w = 0.9 t = 0.95 -h l = 0.95 -w - spawnCmus = myTerminal ++ " -n cmus 'cmus'" - findCmus = resource =? "cmus" + spawnCmus = myTerminal ++ " -n mocp 'mocp'" + findCmus = resource =? "mocp" manageCmus = customFloating $ W.RationalRect l t w h where h = 0.9 @@ -507,8 +524,16 @@ main = do xmproc1 <- spawnPipe "xmobar -x 1 /home/dt/.config/xmobar/xmobarrc2" xmproc2 <- spawnPipe "xmobar -x 2 /home/dt/.config/xmobar/xmobarrc1" -- the xmonad, ya know...what the WM is named after! - xmonad $ ewmh desktopConfig - { manageHook = ( isFullscreen --> doFullFloat ) <+> myManageHook <+> manageHook desktopConfig <+> manageDocks + xmonad $ ewmh def + { manageHook = ( isFullscreen --> doFullFloat ) <+> myManageHook <+> manageDocks + -- Run xmonad commands from command line with "xmonadctl command". Commands include: + -- shrink, expand, next-layout, default-layout, restart-wm, xterm, kill, refresh, run, + -- focus-up, focus-down, swap-up, swap-down, swap-master, sink, quit-wm. You can run + -- "xmonadctl 0" to generate full list of commands written to ~/.xsession-errors. + , handleEventHook = serverModeEventHookCmd + <+> serverModeEventHook + <+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn) + <+> docksEventHook , modMask = myModMask , terminal = myTerminal , startupHook = myStartupHook