From c8ffbad343cb9e58ed359cf74a6d231528b6aa5e Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 19 May 2024 19:22:52 +0200 Subject: more familiar multiscreen, no more firefox control, set TERM --- home.nix | 66 +++------------------------------------------------------------ xmonad.hs | 41 ++++++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 76 deletions(-) diff --git a/home.nix b/home.nix index f1b3eb4..36a08b2 100644 --- a/home.nix +++ b/home.nix @@ -23,6 +23,7 @@ in { binutils feh file + firefox ghc gimp haskellPackages.fourmolu @@ -40,6 +41,7 @@ in { // { LESS = "-R -F"; EDITOR = "vim"; + TERM = "xterm-256color"; }; file.".xinitrc".text = '' @@ -80,68 +82,6 @@ in { ]; }; }; - firefox = { - enable = true; - profiles.tom = { - search = { - default = "DuckDuckGo"; - force = true; - }; - bookmarks = [ - { - toolbar = true; - bookmarks = [ - { - name = "home-manager"; - url = "https://nix-community.github.io/home-manager/options.xhtml"; - } - { - name = "nixpkgs"; - url = "https://search.nixos.org/packages"; - } - ]; - } - ]; - settings = { - "browser.startup.homepage" = "https://duckduckgo.com"; - "browser.newtabpage.enabled" = false; - "browser.toolbars.bookmarks.visibility" = "always"; - "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; - "general.autoScroll" = true; - "browser.bookmarks.addedImportButton" = true; - "browser.uiCustomization.state" = { - "placements" = { - "widget-overflow-fixed-list" = []; - "unified-extensions-area" = []; - "nav-bar" = [ - "back-button" - "forward-button" - "stop-reload-button" - "urlbar-container" - "downloads-button" - "unified-extensions-button" - ]; - "toolbar-menubar" = ["menubar-items"]; - "TabsToolbar" = ["tabbrowser-tabs" "new-tab-button" "alltabs-button"]; - "PersonalToolbar" = ["personal-bookmarks"]; - }; - "seen" = ["save-to-pocket-button" "developer-button"]; - "dirtyAreaCache" = ["nav-bar" "PersonalToolbar" "toolbar-menubar" "TabsToolbar"]; - "currentVersion" = 20; - "newElementCount" = 3; - }; - "privacy.sanitize.sanitizeOnShutdown" = true; - "privacy.clearOnShutdown.cookies" = true; - "privacy.clearOnShutdown.cache" = true; - "privacy.clearOnShutdown.downloads" = true; - "privacy.clearOnShutdown.history" = true; - "privacy.clearOnShutdown.formData" = true; - "privacy.clearOnShutdown.offlineApps" = true; - "privacy.clearOnShutdown.sessions" = true; - "privacy.clearOnShutdown.siteSettings" = true; - }; - }; - }; git = { enable = true; userName = "tom barrett"; @@ -174,7 +114,7 @@ in { enableSshSupport = true; pinentryPackage = pkgs.pinentry-bemenu; # from gpg --list-secret-keys --with-keygrip ([A] keygrip) - sshKeys = []; + sshKeys = [""]; }; }; xdg.userDirs = { diff --git a/xmonad.hs b/xmonad.hs index 483744b..e566f37 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -4,6 +4,7 @@ import XMonad.Actions.CycleWS import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar.PP +import XMonad.Layout.IndependentScreens import XMonad.Layout.Renamed import XMonad.Layout.Spacing import XMonad.Prompt @@ -20,7 +21,8 @@ grey2 = "#b8b8b8" grey3 = "#f8f8f8" main :: IO () -main = +main = do + nScreens <- countScreens xmonad . ewmhFullscreen . ewmh @@ -28,15 +30,18 @@ main = ( statusBarProp "xmobar" ( pure - def - { ppSep = "" - , ppWsSep = "" - , ppHiddenNoWindows = xmobarColor grey2 grey0 . pad - , ppCurrent = xmobarColor grey3 primary . pad - , ppHidden = xmobarBorder "Top" primary 2 . xmobarColor grey2 grey0 . pad - , ppTitle = const "" - , ppLayout = xmobarColor grey2 grey0 . pad - } + ( marshallPP + (S 0) + def + { ppSep = "" + , ppWsSep = "" + , ppHiddenNoWindows = xmobarColor grey2 grey0 . pad + , ppCurrent = xmobarColor grey3 primary . pad + , ppHidden = xmobarBorder "Top" primary 2 . xmobarColor grey2 grey0 . pad + , ppTitle = const "" + , ppLayout = xmobarColor grey2 grey0 . pad + } + ) ) ) defToggleStrutsKey @@ -55,6 +60,7 @@ main = } in def { borderWidth = 2 + , workspaces = [marshall s vw | vw <- (map show [1 .. 9]), s <- [0 .. nScreens]] , layoutHook = renamed [Replace "[]="] @@ -80,14 +86,23 @@ main = , ("M-l", sendMessage Expand) , ("M-m", sendMessage $ JumpToLayout "[M]") , ("M-t", sendMessage $ JumpToLayout "[]=") - , ("M-", toggleWS) + , + ( "M-" + , gets (W.screen . W.current . windowset) + >>= \currentScreen -> + toggleWS' + [ marshall s vw + | vw <- (map show [1 .. 9]) + , s <- [x | x <- [0 .. nScreens], x /= currentScreen] + ] + ) , ("M-S-", windows W.swapMaster) , ("M-S-", withFocused $ windows . W.sink) ] ++ concatMap ( \n -> - [ ("M-" ++ n, windows $ W.greedyView n) - , ("M-S-" ++ n, windows $ W.shift n) + [ ("M-" ++ n, windows $ onCurrentScreen W.greedyView n) + , ("M-S-" ++ n, windows $ onCurrentScreen W.shift n) ] ) (map show [1 .. 9]) -- cgit v1.2.3