From becac06cfae77be449f1de21e9c23ff959ecd72f Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Tue, 14 Jul 2020 20:08:47 -0500 Subject: [PATCH] Adding a MyLayouts module for XMonad. --- .xmonad/lib/Custom/MyGridMenu.hs | 2 +- .xmonad/lib/Custom/MyLayouts.hs | 110 ++++++++++++++++++++++++++ .xmonad/lib/Custom/MyTreeMenu.hs | 84 ++++++++++---------- .xmonad/xmonad.hs | 129 +------------------------------ 4 files changed, 154 insertions(+), 171 deletions(-) create mode 100644 .xmonad/lib/Custom/MyLayouts.hs diff --git a/.xmonad/lib/Custom/MyGridMenu.hs b/.xmonad/lib/Custom/MyGridMenu.hs index c97a1ae..553b885 100644 --- a/.xmonad/lib/Custom/MyGridMenu.hs +++ b/.xmonad/lib/Custom/MyGridMenu.hs @@ -52,4 +52,4 @@ myAppGrid = [ ("Audacity", "audacity") , ("LibreOffice Writer", "lowriter") , ("OBS", "obs") , ("PCManFM", "pcmanfm") - ] \ No newline at end of file + ] diff --git a/.xmonad/lib/Custom/MyLayouts.hs b/.xmonad/lib/Custom/MyLayouts.hs new file mode 100644 index 0000000..87c4768 --- /dev/null +++ b/.xmonad/lib/Custom/MyLayouts.hs @@ -0,0 +1,110 @@ +module Custom.MyLayouts where + +import XMonad +import XMonad.Actions.MouseResize +import XMonad.Hooks.ManageDocks (avoidStruts) + + -- Layouts +import XMonad.Layout.GridVariants (Grid(Grid)) +import XMonad.Layout.SimplestFloat +import XMonad.Layout.Spiral +import XMonad.Layout.ResizableTile +import XMonad.Layout.Tabbed +import XMonad.Layout.ThreeColumns + + -- Layouts modifiers +import XMonad.Layout.LayoutModifier +import XMonad.Layout.LimitWindows (limitWindows) +import XMonad.Layout.Magnifier +import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??)) +import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS)) +import XMonad.Layout.NoBorders +import XMonad.Layout.Renamed (renamed, Rename(Replace)) +import XMonad.Layout.ShowWName +import XMonad.Layout.Spacing +import XMonad.Layout.WindowArranger (windowArrange) +import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts) + +------------------------------------------------------------------------ +-- LAYOUTS +------------------------------------------------------------------------ +-- Makes setting the spacingRaw simpler to write. The spacingRaw +-- 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 + +-- 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 + +-- Defining a bunch of layouts, many that I don't use. +tall = renamed [Replace "tall"] + $ limitWindows 12 + $ mySpacing 8 + $ ResizableTall 1 (3/100) (1/2) [] +magnify = renamed [Replace "magnify"] + $ magnifier + $ 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 + -- Mirror takes a layout and rotates it by 90 degrees. + -- 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" + } + +-- Theme for showWName which prints current workspace when you change workspaces. +myShowWNameTheme :: SWNConfig +myShowWNameTheme = def + { swn_font = "xft:Sans:bold:size=60" + , swn_fade = 1.0 + , swn_bgcolor = "#000000" + , swn_color = "#FFFFFF" + } + +-- The layout hook +myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $ + mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout + where + -- I've commented out the layouts I don't use. + myDefaultLayout = tall + ||| magnify + ||| noBorders monocle + ||| floats + -- ||| grid + ||| noBorders tabs + -- ||| spirals + -- ||| threeCol + -- ||| threeRow diff --git a/.xmonad/lib/Custom/MyTreeMenu.hs b/.xmonad/lib/Custom/MyTreeMenu.hs index f512cf9..f042025 100644 --- a/.xmonad/lib/Custom/MyTreeMenu.hs +++ b/.xmonad/lib/Custom/MyTreeMenu.hs @@ -18,30 +18,30 @@ import qualified Data.Map as M treeselectAction :: TS.TSConfig (X ()) -> X () treeselectAction a = TS.treeselectAction a - [ Node (TS.TSNode "Accessories" "Accessory applications" (return ())) + [ Node (TS.TSNode "+ Accessories" "Accessory applications" (return ())) [ Node (TS.TSNode "Archive Manager" "Tool for archived packages" (spawn "file-roller")) [] , Node (TS.TSNode "Calculator" "Gui version of qalc" (spawn "qalculate-gtk")) [] , Node (TS.TSNode "Calibre" "Manages books on my ereader" (spawn "calibre")) [] , Node (TS.TSNode "Castero" "Terminal podcast client" (spawn (myTerminal ++ " -e castero"))) [] - , Node (TS.TSNode "Compton" "Compositor for window managers" (spawn "killall compton && compton")) [] + , Node (TS.TSNode "Picom Toggle on/off" "Compositor for window managers" (spawn "killall picom; picom")) [] , Node (TS.TSNode "Virt-Manager" "Virtual machine manager" (spawn "virt-manager")) [] , Node (TS.TSNode "Virtualbox" "Oracle's virtualization program" (spawn "virtualbox")) [] ] - , Node (TS.TSNode "Games" "fun and games" (return ())) + , Node (TS.TSNode "+ Games" "fun and games" (return ())) [ Node (TS.TSNode "0 A.D" "Real-time strategy empire game" (spawn "0ad")) [] , Node (TS.TSNode "Battle For Wesnoth" "Turn-based stretegy game" (spawn "wesnoth")) [] , Node (TS.TSNode "Steam" "The Steam gaming platform" (spawn "steam")) [] , Node (TS.TSNode "SuperTuxKart" "Open source kart racing" (spawn "supertuxkart")) [] , Node (TS.TSNode "Xonotic" "Fast-paced first person shooter" (spawn "xonotic")) [] ] - , Node (TS.TSNode "Graphics" "graphics programs" (return ())) + , Node (TS.TSNode "+ Graphics" "graphics programs" (return ())) [ Node (TS.TSNode "Gimp" "GNU image manipulation program" (spawn "gimp")) [] , Node (TS.TSNode "Inkscape" "An SVG editing program" (spawn "inkscape")) [] , Node (TS.TSNode "LibreOffice Draw" "LibreOffice drawing program" (spawn "lodraw")) [] , Node (TS.TSNode "Shotwell" "Photo management program" (spawn "shotwell")) [] , Node (TS.TSNode "Simple Scan" "A simple scanning program" (spawn "simple-scan")) [] ] - , Node (TS.TSNode "Internet" "internet and web programs" (return ())) + , Node (TS.TSNode "+ Internet" "internet and web programs" (return ())) [ Node (TS.TSNode "Brave" "A privacy-oriented web browser" (spawn "brave")) [] , Node (TS.TSNode "Discord" "Chat and video chat platform" (spawn "discord")) [] , Node (TS.TSNode "Elfeed" "An Emacs RSS feed reader" (spawn "xxx")) [] @@ -57,7 +57,7 @@ treeselectAction a = TS.treeselectAction a , Node (TS.TSNode "Transmission" "Bittorrent client" (spawn "transmission-gtk")) [] , Node (TS.TSNode "Zoom" "Web conferencing" (spawn "zoom")) [] ] - , Node (TS.TSNode "Multimedia" "sound and video applications" (return ())) + , Node (TS.TSNode "+ Multimedia" "sound and video applications" (return ())) [ Node (TS.TSNode "Alsa Mixer" "Alsa volume control utility" (spawn (myTerminal ++ " -e alsamixer"))) [] , Node (TS.TSNode "Audacity" "Graphical audio editing program" (spawn "audacity")) [] , Node (TS.TSNode "Deadbeef" "Lightweight music player" (spawn "deadbeef")) [] @@ -67,7 +67,7 @@ treeselectAction a = TS.treeselectAction a , Node (TS.TSNode "Pianobar" "A terminal Pandora client" (spawn (myTerminal ++ " -e pianobar"))) [] , Node (TS.TSNode "VLC" "Multimedia player and server" (spawn "vlc")) [] ] - , Node (TS.TSNode "Office" "office applications" (return ())) + , Node (TS.TSNode "+ Office" "office applications" (return ())) [ Node (TS.TSNode "LibreOffice" "Open source office suite" (spawn "libreoffice")) [] , Node (TS.TSNode "LibreOffice Base" "Desktop database front end" (spawn "lobase")) [] , Node (TS.TSNode "LibreOffice Calc" "Spreadsheet program" (spawn "localc")) [] @@ -77,11 +77,11 @@ treeselectAction a = TS.treeselectAction a , Node (TS.TSNode "LibreOffice Writer" "Word processor" (spawn "lowriter")) [] , Node (TS.TSNode "Zathura" "PDF Viewer" (spawn "zathura")) [] ] - , Node (TS.TSNode "Programming" "programming and scripting tools" (return ())) + , Node (TS.TSNode "+ Programming" "programming and scripting tools" (return ())) [ Node (TS.TSNode "Emacs" "Doom Emacs launched as client" (spawn "emacsclient -c -a emacs")) [] , Node (TS.TSNode "Python" "Python interactive prompt" (spawn (myTerminal ++ " -e python"))) [] ] - , Node (TS.TSNode "System" "system tools and utilities" (return ())) + , Node (TS.TSNode "+ System" "system tools and utilities" (return ())) [ Node (TS.TSNode "Alacritty" "GPU accelerated terminal" (spawn "alacritty")) [] , Node (TS.TSNode "Dired" "Emacs file manager" (spawn "xxx")) [] , Node (TS.TSNode "Etcher" "USB stick writer" (spawn "xxx")) [] @@ -97,36 +97,36 @@ treeselectAction a = TS.treeselectAction a , Node (TS.TSNode "Vifm" "Vim-like file manager" (spawn (myTerminal ++ " -e vifm"))) [] ] , Node (TS.TSNode "------------------------" "" (spawn "xdotool key Escape")) [] - , Node (TS.TSNode "Bookmarks" "a list of web bookmarks" (return ())) - [ Node (TS.TSNode "Linux" "a list of web bookmarks" (return ())) - [ Node (TS.TSNode "Arch Linux" "btw, i use arch!" (return ())) + , Node (TS.TSNode "+ Bookmarks" "a list of web bookmarks" (return ())) + [ Node (TS.TSNode "+ Linux" "a list of web bookmarks" (return ())) + [ Node (TS.TSNode "+ Arch Linux" "btw, i use arch!" (return ())) [ Node (TS.TSNode "Arch Linux" "Arch Linux homepage" (spawn (myBrowser ++ "https://www.archlinux.org/"))) [] , Node (TS.TSNode "Arch Wiki" "The best Linux wiki" (spawn (myBrowser ++ "https://wiki.archlinux.org/"))) [] , Node (TS.TSNode "AUR" "Arch User Repository" (spawn (myBrowser ++ "https://aur.archlinux.org/"))) [] , Node (TS.TSNode "Arch Forums" "Arch Linux web forum" (spawn (myBrowser ++ "https://bbs.archlinux.org/"))) [] ] - , Node (TS.TSNode "Linux News" "linux news and blogs" (return ())) + , Node (TS.TSNode "+ Linux News" "linux news and blogs" (return ())) [ Node (TS.TSNode "DistroWatch" "Linux distro release announcments" (spawn (myBrowser ++ "https://distrowatch.com/"))) [] , Node (TS.TSNode "LXer" "LXer linux news aggregation" (spawn (myBrowser ++ "http://lxer.com"))) [] , Node (TS.TSNode "OMG Ubuntu" "Ubuntu news, apps and reviews" (spawn (myBrowser ++ "https://www.omgubuntu.co.uk"))) [] ] - , Node (TS.TSNode "Window Managers" "window manager documentation" (return ())) + , Node (TS.TSNode "+ Window Managers" "window manager documentation" (return ())) [ Node (TS.TSNode "Awesome" "awesomewm documentation" (return ())) [ Node (TS.TSNode "Awesome" "Homepage for awesome wm" (spawn (myBrowser ++ "https://awesomewm.org/"))) [] , Node (TS.TSNode "Awesome GitHub" "The GutHub page for awesome" (spawn (myBrowser ++ "https://github.com/awesomeWM/awesome"))) [] , Node (TS.TSNode "r/awesome" "Subreddit for awesome" (spawn (myBrowser ++ "https://www.reddit.com/r/awesomewm/"))) [] ] - , Node (TS.TSNode "Dwm" "dwm documentation" (return ())) + , Node (TS.TSNode "+ Dwm" "dwm documentation" (return ())) [ Node (TS.TSNode "Dwm" "Dynamic window manager" (spawn (myBrowser ++ "https://dwm.suckless.org/"))) [] , Node (TS.TSNode "Dwmblocks" "Modular status bar for dwm" (spawn (myBrowser ++ "https://github.com/torrinfail/dwmblocks"))) [] , Node (TS.TSNode "r/suckless" "Subreddit for suckless software" (spawn (myBrowser ++ "https://www.reddit.com/r/suckless//"))) [] ] - , Node (TS.TSNode "Qtile" "qtile documentation" (return ())) + , Node (TS.TSNode "+ Qtile" "qtile documentation" (return ())) [ Node (TS.TSNode "Qtile" "Tiling window manager in Python" (spawn (myBrowser ++ "http://www.qtile.org"))) [] , Node (TS.TSNode "Qtile GitHub" "The GitHub page for qtile" (spawn (myBrowser ++ "https://github.com/qtile/qtile"))) [] , Node (TS.TSNode "r/qtile" "Subreddit for qtile" (spawn (myBrowser ++ "https://www.reddit.com/r/qtile/"))) [] ] - , Node (TS.TSNode "XMonad" "xmonad documentation" (return ())) + , Node (TS.TSNode "+ XMonad" "xmonad documentation" (return ())) [ Node (TS.TSNode "XMonad" "Homepage for XMonad" (spawn (myBrowser ++ "http://xmonad.org"))) [] , Node (TS.TSNode "XMonad GitHub" "The GitHub page for XMonad" (spawn (myBrowser ++ "https://github.com/xmonad/xmonad"))) [] , Node (TS.TSNode "xmonad-contrib" "Third party extensions for XMonad" (spawn (myBrowser ++ "https://hackage.haskell.org/package/xmonad-contrib"))) [] @@ -135,51 +135,65 @@ treeselectAction a = TS.treeselectAction a ] ] ] - , Node (TS.TSNode "Emacs" "Emacs documentation" (return ())) + , Node (TS.TSNode "+ Emacs" "Emacs documentation" (return ())) [ Node (TS.TSNode "GNU Emacs" "Extensible free/libre text editor" (spawn (myBrowser ++ "https://www.gnu.org/software/emacs/"))) [] , Node (TS.TSNode "Doom Emacs" "Emacs distribution with sane defaults" (spawn (myBrowser ++ "https://github.com/hlissner/doom-emacs"))) [] , Node (TS.TSNode "r/emacs" "M-x emacs-reddit" (spawn (myBrowser ++ "https://www.reddit.com/r/emacs/"))) [] , Node (TS.TSNode "EmacsWiki" "EmacsWiki Site Map" (spawn (myBrowser ++ "https://www.emacswiki.org/emacs/SiteMap"))) [] , Node (TS.TSNode "Emacs StackExchange" "Q&A site for emacs" (spawn (myBrowser ++ "https://emacs.stackexchange.com/"))) [] ] - , Node (TS.TSNode "Search and Reference" "Search engines, indices and wikis" (return ())) + , Node (TS.TSNode "+ Search and Reference" "Search engines, indices and wikis" (return ())) [ Node (TS.TSNode "DuckDuckGo" "Privacy-oriented search engine" (spawn (myBrowser ++ "https://duckduckgo.com/"))) [] , Node (TS.TSNode "Google" "The evil search engine" (spawn (myBrowser ++ "http://www.google.com"))) [] , Node (TS.TSNode "Thesaurus" "Lookup synonyms and antonyms" (spawn (myBrowser ++ "https://www.thesaurus.com/"))) [] , Node (TS.TSNode "Wikipedia" "The free encyclopedia" (spawn (myBrowser ++ "https://www.wikipedia.org/"))) [] ] - , Node (TS.TSNode "Programming" "programming and scripting" (return ())) + , Node (TS.TSNode "+ Programming" "programming and scripting" (return ())) [ Node (TS.TSNode "Bash and Shell Scripting" "shell scripting documentation" (return ())) [ Node (TS.TSNode "GNU Bash" "Documentation for bash" (spawn (myBrowser ++ "https://www.gnu.org/software/bash/manual/"))) [] , Node (TS.TSNode "r/bash" "Subreddit for bash" (spawn (myBrowser ++ "https://www.reddit.com/r/bash/"))) [] , Node (TS.TSNode "r/commandline" "Subreddit for the command line" (spawn (myBrowser ++ "https://www.reddit.com/r/commandline/"))) [] , Node (TS.TSNode "Learn Shell" "Interactive shell tutorial" (spawn (myBrowser ++ "https://www.learnshell.org/"))) [] ] - , Node (TS.TSNode "Elisp" "emacs lisp documentation" (return ())) + , Node (TS.TSNode "+ Elisp" "emacs lisp documentation" (return ())) [ Node (TS.TSNode "Emacs Lisp" "Reference manual for elisp" (spawn (myBrowser ++ "https://www.gnu.org/software/emacs/manual/html_node/elisp/"))) [] , Node (TS.TSNode "Learn Elisp in Y Minutes" "Single webpage for elisp basics" (spawn (myBrowser ++ "https://learnxinyminutes.com/docs/elisp/"))) [] , Node (TS.TSNode "r/Lisp" "Subreddit for lisp languages" (spawn (myBrowser ++ "https://www.reddit.com/r/lisp/"))) [] ] - , Node (TS.TSNode "Haskell" "haskell documentation" (return ())) + , Node (TS.TSNode "+ Haskell" "haskell documentation" (return ())) [ Node (TS.TSNode "Haskell.org" "Homepage for haskell" (spawn (myBrowser ++ "http://www.haskell.org"))) [] , Node (TS.TSNode "Hoogle" "Haskell API search engine" (spawn "https://hoogle.haskell.org/")) [] , Node (TS.TSNode "r/haskell" "Subreddit for haskell" (spawn (myBrowser ++ "https://www.reddit.com/r/Python/"))) [] , Node (TS.TSNode "Haskell on StackExchange" "Newest haskell topics on StackExchange" (spawn (myBrowser ++ "https://stackoverflow.com/questions/tagged/haskell"))) [] ] - , Node (TS.TSNode "Python" "python documentation" (return ())) + , Node (TS.TSNode "+ Python" "python documentation" (return ())) [ Node (TS.TSNode "Python.org" "Homepage for python" (spawn (myBrowser ++ "https://www.python.org/"))) [] , Node (TS.TSNode "r/Python" "Subreddit for python" (spawn (myBrowser ++ "https://www.reddit.com/r/Python/"))) [] , Node (TS.TSNode "Python on StackExchange" "Newest python topics on StackExchange" (spawn (myBrowser ++ "https://stackoverflow.com/questions/tagged/python"))) [] ] ] - , Node (TS.TSNode "Vim" "vim and neovim documentation" (return ())) + , Node (TS.TSNode "+ Vim" "vim and neovim documentation" (return ())) [ Node (TS.TSNode "Vim.org" "Vim, the ubiquitous text editor" (spawn (myBrowser ++ "https://www.vim.org/"))) [] , Node (TS.TSNode "r/Vim" "Subreddit for vim" (spawn (myBrowser ++ "https://www.reddit.com/r/vim/"))) [] , Node (TS.TSNode "Vi/m StackExchange" "Vi/m related questions" (spawn (myBrowser ++ "https://vi.stackexchange.com/"))) [] ] ] - , Node (TS.TSNode "Config Files" "config files that edit often" (return ())) - [ Node (TS.TSNode "alacritty" "alacritty terminal emulator" (spawn (myEditor ++ "/home/dt/.config/alacritty/alacritty.yml"))) [] + , Node (TS.TSNode "+ Config Files" "config files that edit often" (return ())) + [ Node (TS.TSNode "+ xmobar configs" "My xmobar config files" (return ())) + [ Node (TS.TSNode "xmobar mon1" "status bar on monitor 1" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc0"))) [] + , Node (TS.TSNode "xmobar mon2" "status bar on monitor 2" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc2"))) [] + , Node (TS.TSNode "xmobar mon3" "status bar on monitor 3" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc1"))) [] + ] + , Node (TS.TSNode "+ xmonad configs" "My xmonad config files" (return ())) + [ Node (TS.TSNode "xmonad.hs" "My XMonad Main" (spawn (myEditor ++ "/home/dt/.xmonad/xmonad.hs"))) [] + , Node (TS.TSNode "MyGridMenu.hs" "My XMonad GridSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyGridMenu.hs"))) [] + , Node (TS.TSNode "MyKeys.hs" "My XMonad keybindings" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyKeys.hs"))) [] + , Node (TS.TSNode "MyPrompts.hs" "My XMonad prompts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyPrompts.hs"))) [] + , Node (TS.TSNode "MyScratchpads.hs" "My XMonad named scratchpads" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyScratchpads.hs"))) [] + , Node (TS.TSNode "MyTreeMenu.hs" "My XMonad TreeSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyTreeMenu.hs"))) [] + , Node (TS.TSNode "MyVariables.hs" "My XMonad variables" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyVariables.hs"))) [] + ] + , Node (TS.TSNode "alacritty" "alacritty terminal emulator" (spawn (myEditor ++ "/home/dt/.config/alacritty/alacritty.yml"))) [] , Node (TS.TSNode "awesome" "awesome window manager" (spawn (myEditor ++ "/home/dt/.config/awesome/rc.lua"))) [] , Node (TS.TSNode "bashrc" "the bourne again shell" (spawn (myEditor ++ "/home/dt/.bashrc"))) [] , Node (TS.TSNode "bspwmrc" "binary space partitioning window manager" (spawn (myEditor ++ "/home/dt/.config/bspwm/bspwmrc"))) [] @@ -198,30 +212,16 @@ treeselectAction a = TS.treeselectAction a , Node (TS.TSNode "sxhkdrc" "simple X hotkey daemon" (spawn (myEditor ++ "/home/dt/.config/sxhkd/sxhkdrc"))) [] , Node (TS.TSNode "surf config.h" "surf web browser" (spawn (myEditor ++ "/home/dt/surf-distrotube/config.h"))) [] , Node (TS.TSNode "tabbed config.h" "generic tabbed interface" (spawn (myEditor ++ "home/dt/tabbed-distrotube/config.h"))) [] - , Node (TS.TSNode "xmobar configs" "My xmobar config files" (return ())) - [ Node (TS.TSNode "xmobar mon1" "status bar on monitor 1" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc0"))) [] - , Node (TS.TSNode "xmobar mon2" "status bar on monitor 2" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc2"))) [] - , Node (TS.TSNode "xmobar mon3" "status bar on monitor 3" (spawn (myEditor ++ "/home/dt/.config/xmobar/xmobarrc1"))) [] - ] - , Node (TS.TSNode "XMonad configs" "My xmonad config files" (return ())) - [ Node (TS.TSNode "xmonad.hs" "My XMonad Main" (spawn (myEditor ++ "/home/dt/.xmonad/xmonad.hs"))) [] - , Node (TS.TSNode "MyGridMenu.hs" "My XMonad GridSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyGridMenu.hs"))) [] - , Node (TS.TSNode "MyKeys.hs" "My XMonad keybindings" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyKeys.hs"))) [] - , Node (TS.TSNode "MyPrompts.hs" "My XMonad prompts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyPrompts.hs"))) [] - , Node (TS.TSNode "MyScratchpads.hs" "My XMonad named scratchpads" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyScratchpads.hs"))) [] - , Node (TS.TSNode "MyTreeMenu.hs" "My XMonad TreeSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyTreeMenu.hs"))) [] - , Node (TS.TSNode "MyVariables.hs" "My XMonad variables" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyVariables.hs"))) [] - ] , Node (TS.TSNode "xresources" "xresources file" (spawn (myEditor ++ "/home/dt/.Xresources"))) [] , Node (TS.TSNode "zshrc" "Config for the z shell" (spawn (myEditor ++ "/home/dt/.zshrc"))) [] ] - , Node (TS.TSNode "Screenshots" "take a screenshot" (return ())) + , Node (TS.TSNode "+ Screenshots" "take a screenshot" (return ())) [ Node (TS.TSNode "Quick fullscreen" "take screenshot immediately" (spawn "scrot -d 1 ~/scrot/%Y-%m-%d-@%H-%M-%S-scrot.png")) [] , Node (TS.TSNode "Delayed fullscreen" "take screenshot in 5 secs" (spawn "scrot -d 5 ~/scrot/%Y-%m-%d-@%H-%M-%S-scrot.png")) [] , Node (TS.TSNode "Section screenshot" "take screenshot of section" (spawn "scrot -s ~/scrot/%Y-%m-%d-@%H-%M-%S-scrot.png")) [] ] , Node (TS.TSNode "------------------------" "" (spawn "xdotool key Escape")) [] - , Node (TS.TSNode "XMonad" "window manager commands" (return ())) + , Node (TS.TSNode "+ XMonad" "window manager commands" (return ())) [ Node (TS.TSNode "Recompile" "Recompile XMonad" (spawn "xmonad --recompile")) [] , Node (TS.TSNode "Restart" "Restart XMonad" (spawn "xmonad --restart")) [] , Node (TS.TSNode "Quit" "Restart XMonad" (io exitSuccess)) [] diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 0797add..04015ad 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -21,6 +21,7 @@ -- Custom (my personal configs) import Custom.MyGridMenu import Custom.MyKeys +import Custom.MyLayouts import Custom.MyPrompts import Custom.MyScratchpads import Custom.MyTreeMenu @@ -42,27 +43,6 @@ import XMonad.Hooks.ServerMode import XMonad.Hooks.SetWMName import XMonad.Hooks.WorkspaceHistory - -- Layouts -import XMonad.Layout.GridVariants (Grid(Grid)) -import XMonad.Layout.SimplestFloat -import XMonad.Layout.Spiral -import XMonad.Layout.ResizableTile -import XMonad.Layout.Tabbed -import XMonad.Layout.ThreeColumns - - -- Layouts modifiers -import XMonad.Layout.LayoutModifier -import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit) -import XMonad.Layout.Magnifier -import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??)) -import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS)) -import XMonad.Layout.NoBorders -import XMonad.Layout.Renamed (renamed, Rename(Replace)) -import XMonad.Layout.ShowWName -import XMonad.Layout.Spacing -import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..)) -import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle)) - -- Utilities import XMonad.Util.EZConfig (additionalKeysP) import XMonad.Util.NamedScratchpad @@ -83,29 +63,6 @@ myStartupHook = do -- spawnOnce "kak -d -s mysession &" setWMName "LG3D" ------------------------------------------------------------------------- --- MENUS FOR GRIDSELECT AND TREESELECT ------------------------------------------------------------------------- --- The lists below are actually 3-tuples for use with gridSelect and treeSelect. --- TreeSelect uses all three values in the 3-tuples but GridSelect only needs first --- two values in each list (see myAppGrid, myBookmarkGrid and myConfigGrid below). - - -myBookmarks :: [(String, String, String)] -myBookmarks = [ ("DistroTube.com", myBrowser ++ "https://www.distrotube.com", "Official website for DistroTube") - , ("DistroWatch", myBrowser ++ "https://www.distrowatch.com", "DistroWatch Release Announcements") - , ("Arch Linux", myBrowser ++ "https://www.archlinux.org/", "Official website for Arch Linux") - , ("Arch User Repository", myBrowser ++ "https://aur.archlinux.org/", "The Arch User Repository AUR") - , ("Arch Wiki", myBrowser ++ "https://wiki.archlinux.org/", "The Arch Wiki") - , ("LBRY", myBrowser ++ "https://lbry.tv/@DistroTube:2", "DistroTube on LBRY") - , ("GitLab", myBrowser ++ "https://gitlab.com/dwt1", "GitLab Page for DistroTube") - , ("Patreon", myBrowser ++ "https://www.patreon.com/distrotube", "DT on Patreon") - , ("Diaspora", myBrowser ++ "https://diasp.org/stream", "DT on Diaspora") - , ("Mastodon", myBrowser ++ "https://mastodon.technology/web/accounts/85897", "DT on Mastodon") - , ("Reddit", myBrowser ++ "https://www.reddit.com/r/distrotube/", "r/DistroTube") - , ("YouTube", myBrowser ++ "https://www.youtube.com/c/DistroTube?view_as=subscriber", "DT on YouTube") - ] - ------------------------------------------------------------------------ -- WORKSPACES ------------------------------------------------------------------------ @@ -165,90 +122,6 @@ myLogHook :: X () myLogHook = fadeInactiveLogHook fadeAmount where fadeAmount = 1.0 ------------------------------------------------------------------------- --- LAYOUTS ------------------------------------------------------------------------- --- Makes setting the spacingRaw simpler to write. The spacingRaw --- 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 - --- 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 - --- Defining a bunch of layouts, many that I don't use. -tall = renamed [Replace "tall"] - $ limitWindows 12 - $ mySpacing 8 - $ ResizableTall 1 (3/100) (1/2) [] -magnify = renamed [Replace "magnify"] - $ magnifier - $ 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 - -- Mirror takes a layout and rotates it by 90 degrees. - -- 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" - } - --- Theme for showWName which prints current workspace when you change workspaces. -myShowWNameTheme :: SWNConfig -myShowWNameTheme = def - { swn_font = "xft:Sans:bold:size=60" - , swn_fade = 1.0 - , swn_bgcolor = "#000000" - , swn_color = "#FFFFFF" - } - --- The layout hook -myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $ - mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout - where - -- I've commented out the layouts I don't use. - myDefaultLayout = tall - ||| magnify - ||| noBorders monocle - ||| floats - -- ||| grid - ||| noBorders tabs - -- ||| spirals - -- ||| threeCol - -- ||| threeRow - ------------------------------------------------------------------------ -- MAIN ------------------------------------------------------------------------