Reputation: 105
Xmonad hides xmobar and tabs on tabbed layouts. What is wrong with config?
I am using xmonad with xmobar for long time. But last time when I migrated back to Arch linux all layouts from XMonad.Layout.Tabbed
show windows on full screen. No xmobar or any tab on the screen. Windows switching and anything else works as well.
Here is three screenshots from my three layouts:
Grid:
Spiral:
Tabbed:
xmonad.hs:
import XMonad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.Exit
import System.Directory (getHomeDirectory)
import System.FilePath.Posix (joinPath)
import Graphics.X11.Xlib
import Graphics.X11.ExtraTypes.XF86
--import IO (Handle, hPutStrLn)
import qualified System.IO
import XMonad.Actions.CycleWS (nextScreen,prevScreen)
import Data.List
-- Prompts
import XMonad.Prompt
import XMonad.Prompt.Shell
-- Actions
import XMonad.Actions.MouseGestures
import XMonad.Actions.UpdatePointer
import XMonad.Actions.GridSelect
import XMonad.Actions.CycleWS
-- Utils
import XMonad.Util.Run (spawnPipe, safeSpawn)
import XMonad.Util.Loggers
import XMonad.Util.EZConfig
import XMonad.Util.Scratchpad
import XMonad.Util.NamedWindows
import qualified XMonad.StackSet as W
-- Hooks
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.Place
import XMonad.Hooks.EwmhDesktops
-- Layouts
import XMonad.Layout.NoBorders
import XMonad.Layout.Fullscreen
import XMonad.Layout.LayoutCombinators hiding ((|||))
import XMonad.Layout.Grid
import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import Data.Ratio ((%))
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.Spacing
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.Gaps
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
defaults = defaultConfig {
terminal = "xterm"
, workspaces = myWorkSpaces
, modMask = mod4Mask
, layoutHook = myLayoutHook
-- , manageHook = myManageHook
, startupHook = myStartupHook
, borderWidth = 2
, normalBorderColor = "#303030"
, focusedBorderColor = "#A0A0A0"
} `additionalKeys` myKeys
myKeys = [
((mod4Mask, xK_g), goToSelected defaultGSConfig)
, ((mod4Mask, xK_s), spawnSelected defaultGSConfig ["vivaldi","idea","robo3t","thunderbird","postman","easyhg","renoise","telegram-desktop"])
, ((mod4Mask, xK_c), spawn "ps -eo pcpu,pid,user,args | sort -r | head -5 >> ~/cpu-report")
, ((mod4Mask, xK_grave), nextWS)
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer -D pulse sset Master 3%+ && ~/.xmonad/getvolume.sh >> /tmp/.volume-pipe")
, ((0, xF86XK_AudioLowerVolume), spawn "amixer -D pulse sset Master 3%- && ~/.xmonad/getvolume.sh >> /tmp/.volume-pipe")
, ((0, xF86XK_AudioMute), spawn "amixer -D pulse sset Master toggle && ~/.xmonad/getvolume.sh >> /tmp/.volume-pipe")
, ((0, xK_Print), spawn "scrot")
]
myWorkSpaces :: [String]
myWorkSpaces = [
"<action=`xdotool key Super_L+1`> |1| </action>"
, "<action=`xdotool key Super_L+2`> |2| </action>"
, "<action=`xdotool key Super_L+3`> |3| </action>"
, "<action=`xdotool key Super_L+4`> |4| </action>"
, "<action=`xdotool key Super_L+5`> |5| </action>"
, "<action=`xdotool key Super_L+6`> |6| </action>"
, "<action=`xdotool key Super_L+7`> |7| </action>"
, "<action=`xdotool key Super_L+8`> |8| </action>"
, "<action=`xdotool key Super_L+9`> |9| </action>"
]
-- tab theme default
myTabConfig = defaultTheme {
activeColor = "#666666"
, activeBorderColor = "#000000"
, inactiveColor = "#666666"
, inactiveBorderColor = "#000000"
, decoHeight = 10
}
xmobarTitleColor = "#FFB6B0"
xmobarCurrentWorkspaceColor = "#FFB6B0"
xmobarUrgentWorkspaceColor = "#45A5F5"
xmobarHiddenNoWindowsColor = "#A4A19F"
myStartupHook = do
startupHook defaultConfig
setWMName "LG3D"
spawn "~/.xmonad/getvolume.sh >> /tmp/.volume-pipe"
myLayoutHook =
avoidStruts $
spacing 6 $
gaps [(U,15)] $
toggleLayouts (noBorders Full) $
smartBorders $ Grid ||| spiral (6/7) ||| tabbedAlways shrinkText defaultTheme
myManageHook = manageDocks <+> manageHook defaultConfig
data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show)
instance UrgencyHook LibNotifyUrgencyHook where
urgencyHook LibNotifyUrgencyHook w = do
name <- getName w
safeSpawn "notify-send" [show name]
main = do
xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobar.hs"
xmonad $ withUrgencyHook LibNotifyUrgencyHook $ fullscreenSupport $ defaults {
logHook = dynamicLogWithPP $ defaultPP {
ppOutput = System.IO.hPutStrLn xmproc
, ppTitle = xmobarColor xmobarTitleColor "" . shorten 65
, ppCurrent = xmobarColor xmobarCurrentWorkspaceColor "" . wrap "" ""
, ppUrgent = xmobarColor xmobarUrgentWorkspaceColor "" . wrap "" ""
, ppHiddenNoWindows = xmobarColor xmobarHiddenNoWindowsColor {-"#7e7c7a"-} "" . wrap "" ""
, ppSep = " "
, ppWsSep = ""
, ppLayout = (\ x -> case x of
"Spacing Grid" -> "[ Grid ]"
"Spacing Spiral" -> "[Spiral]"
_ -> x )
}
}
xmobar.hs:
Config {
font = "xft:DejaVu Sans Mono:size=9:bold:antialias=true",
bgColor = "#000000",
fgColor = "#fcf9f4",
alpha = 125,
position = Static { xpos = 0, ypos = 0, width = 1920, height = 18 },
lowerOnStart = True,
commands = [
Run Memory ["-t","mem: <usedbar>", "-n", "#45a5f5", "-L", "0", "-H", "100"] 10
,Run Date "%d.%m.%Y %a %H:%M:%S" "date" 10
,Run MultiCpu [ "--template" , "cpu: <autovbar>"
, "--Low" , "50" -- units: %
, "--High" , "85" -- units: %
, "--low" , "gray"
, "--normal" , "darkorange"
, "--high" , "darkred"
, "-c" , ""
, "-w" , "1"
] 3
,Run Com "/home/laniakea/.xmonad/getinet.sh" [] "inet" 10
,Run UnsafeStdinReader
,Run PipeReader "/tmp/.volume-pipe" "vol"
,Run Kbd [("us", "US"),("ru", "RU")]
,Run Battery ["-t", "<acstatus> <left>%", "--", "-o", "<fc=#f7c2ba>Off</fc>", "-O", "<fc=#45a5f5>On</fc>", "-i", "<fc=#fcf9f4>Idle</fc>"] 10
],
sepChar = "%",
alignSep = "}{",
template = " %UnsafeStdinReader% }{%vol% | %multicpu% | %memory% | %battery% | %inet% | %kbd% | <fc=#f7c2ba>%date%</fc> "
}
I expect on tabbed layout I still can see xmobar with all info and tabs if I have several windows opened on workspace. Thank you.
Upvotes: 2
Views: 1309
Reputation: 55
I might be answering this question late but this happened for me too. For me I tested the same thing using Xephyr
this gave me a clue as to what caused the issue. The issue for me was all about the fonts. So I fixed it in this manner.
myLayout = tabs ||| ...
where
tabs = tabbed shrinkText myTabConf
myTabConf :: Theme
myTabConf = def {
fontName = "xft:Source Code Pro:size=8:antialias=true"
}
If you notice the error generated while using xephyr(user error (createFontSet)
), and research a bit on it you will find this.
Upvotes: 1