![]() |
|
Xmonad configuration - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Computers (https://sinister.ly/Forum-Computers) +--- Forum: Operating Systems (https://sinister.ly/Forum-Operating-Systems) +--- Thread: Xmonad configuration (/Thread-Xmonad-configuration) |
RE: Xmonad configuration - noize - 06-24-2013 (06-24-2013, 01:48 PM)Deque Wrote:(06-24-2013, 12:55 PM)noize Wrote: Thanks. Well, I'll try that soon and let you know, but for "my first problem" you mean the problem about the onWorkspace thing? I think so as it's the only part you changed, but maybe I should consider instead the second code you published? Thanks, this was a nice clarification. Yeah, I knew the "delta" variable was XMonad specific, I didn't know about the possibility to resize panes with mod + k / h (though, it looks to me like it is k / l instead) and so I got confused. I think that at least for now I won't learn Haskell. Would you mind remembering me what was the layout problem you're talking about :huh: ? lol, I can't remember about it. Edit: oh, you mean the problem in laying out workspaces in different ways, yeah. Edit: "xmonad.hi: openBinaryFile: permission denied" I just removed xmonad.hi and xmonad.o and it worked nice. RE: Xmonad configuration - noize - 06-24-2013 Deque Wrote:The second code in addition starts firefox in the web workspace. So try the second and see if it works. Tested. I also added a line to try and spawn Terminal on the main workspace, but it does not work. Firefox opens up in "main" instead (it did also before adding the line about Terminal). If I instead use MOD + Q to apply the new config file while I am in another workspace, Firefox opens up there, so I can tell it opens up in the current workspace, not in a fixed one. My current xmonad.hs: Code: import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Layout.PerWorkspace
import XMonad.Actions.SpawnOn
import System.IO
myNormalBorderColor = "#cccccc"
myFocusedBorderColor = "#0000ff"
myManageHook = composeAll
[ (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat
, manageDocks
]
myLayout = tiled ||| Mirror tiled ||| Full
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 = 2
-- Default proportion of screen occupied by master pane
ratio = 3/5
-- Ratio of screen to increment by when resizing panes
delta = 1/100
myLayoutWeb = Mirror tiled ||| tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 3/4
delta = 1/100
myLayoutCoding = tiled ||| Mirror tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 2
ratio = 7/12
delta = 1/100
main = do
xmonad $ gnomeConfig {
manageHook = myManageHook <+> manageHook gnomeConfig
, startupHook = do
spawnOn "main" "bash"
spawnOn "web" "firefox"
, layoutHook = onWorkspace "web" myLayoutWeb $
onWorkspace "coding" myLayoutCoding $
avoidStruts myLayout
, workspaces = ["main","web","coding","hacking","testing","6","7","8","9"]
, modMask = mod4Mask
, normalBorderColor = myNormalBorderColor
, focusedBorderColor = myFocusedBorderColor
}`additionalKeys`
[ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
]Also, I just logged in and new panes opened up fine, but after typing this, I tried opening up Terminal in another workspace and (also any other program does the same) it overlaps the top and bottom Gnome bars completely. RE: Xmonad configuration - Deque - 06-25-2013 (06-24-2013, 07:37 PM)noize Wrote: Tested. I also added a line to try and spawn Terminal on the main workspace, but it does not work. Firefox opens up in "main" instead (it did also before adding the line about Terminal). If I instead use MOD + Q to apply the new config file while I am in another workspace, Firefox opens up there, so I can tell it opens up in the current workspace, not in a fixed one. After a lot of trying and research I found the reason: http://www.haskell.org/haskellwiki/Xmonad/General_xmonad.hs_config_tips Quote:gnome-terminal by default starts a single back-end "factory" and spawns terminal windows from it; all of these windows will share the same resource name and class. Use the --disable-factory option with --name= or --class= to ensure that the created window is not shared with unrelated terminals. (06-24-2013, 07:37 PM)noize Wrote: Also, I just logged in and new panes opened up fine, but after typing this, I tried opening up Terminal in another workspace and (also any other program does the same) it overlaps the top and bottom Gnome bars completely. Use avoidStruts: Code: layoutHook = onWorkspace "web" (avoidStruts myLayoutWeb) $
onWorkspace "coding" (avoidStruts myLayoutCoding) $
avoidStruts myLayoutRE: Xmonad configuration - noize - 06-25-2013 (06-25-2013, 12:41 PM)Deque Wrote:(06-24-2013, 07:37 PM)noize Wrote: Tested. I also added a line to try and spawn Terminal on the main workspace, but it does not work. Firefox opens up in "main" instead (it did also before adding the line about Terminal). If I instead use MOD + Q to apply the new config file while I am in another workspace, Firefox opens up there, so I can tell it opens up in the current workspace, not in a fixed one. Where should I add the --disable-factory option exactly? RE: Xmonad configuration - Deque - 06-25-2013 How about this solution: Instead of using spawnOn, just spawn the program at the startupHook and set the workspace in the manageHook. Example (tested and works for me): Code: import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Actions.GridSelect
import XMonad.Layout.Fullscreen
myNormalBorderColor = "#cccccc"
myFocusedBorderColor = "#0000ff"
myManageHook = composeAll
[ (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat
, className =? "Thunderbird" --> doShift "mail"
, className =? "Firefox" --> doShift "web"
, manageDocks
]
main = do
xmonad $ gnomeConfig
{ manageHook = fullscreenManageHook <+> myManageHook <+> manageHook gnomeConfig
, handleEventHook = fullscreenEventHook
, startupHook = do
spawn "thunderbird"
spawn "firefox"
}RE: Xmonad configuration - noize - 06-25-2013 Thanks, it worked finestly. Now my XMonad is pretty much as I want it, fuck all dynamic WMs, it'll probably become my main working environment. My current config file: Code: import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Actions.GridSelect
import XMonad.Layout.Fullscreen
import XMonad.Layout.PerWorkspace
import System.IO
myNormalBorderColor = "#cccccc"
myFocusedBorderColor = "#0000ff"
myManageHook = composeAll
[
className =? "Firefox" --> doShift "web"
, manageDocks
]
myLayoutMain = Mirror tiled ||| tiled ||| Full
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 = 2
-- Default proportion of screen occupied by master pane
ratio = 3/5
-- Ratio of screen to increment by when resizing panes
delta = 1/100
myLayoutDefault = tiled ||| Mirror tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 2
ratio = 3/5
delta = 1/100
myLayoutWeb = Mirror tiled ||| tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 3/4
delta = 1/100
myLayoutCoding = tiled ||| Mirror tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 1/100
main = do
xmonad $ gnomeConfig
{ manageHook = fullscreenManageHook <+> myManageHook <+> manageHook gnomeConfig
, handleEventHook = fullscreenEventHook
, startupHook = do
spawn "gnome-terminal"
spawn "firefox"
, layoutHook = onWorkspace "main" (avoidStruts myLayoutMain) $
onWorkspace "web" (avoidStruts myLayoutWeb) $
onWorkspace "coding" (avoidStruts myLayoutCoding) $
avoidStruts myLayoutDefault
, workspaces = ["main","web","coding","hacking","testing","6","7","8","9"]
, modMask = mod4Mask
, normalBorderColor = myNormalBorderColor
, focusedBorderColor = myFocusedBorderColor
}`additionalKeys`
[ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
]This thread became pretty much overflowing with XMonad knowledge, lol. I'd have just a couple of questions more. 1. What does this do exactly? Code: (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat2. Where was I supposed to put that option about something-fabric? 3. Is there a way to shift a program to a workspace (for instance, spawning Firefox under the "web" workspace) just on startup (when I run Firefox, it always goes to "web" automatically)? Edit: while using XMonad with Gnome, since a couple of xmonad.hs edits ago or something like that, it seems like I can't anymore switch between workspaces by clicking on their respective bottom right squares. RE: Xmonad configuration - Deque - 06-26-2013 (06-25-2013, 09:46 PM)noize Wrote: 1. What does this do exactly? Every dialog box of firefox shall float instead of being a tiled window like the others. (06-25-2013, 09:46 PM)noize Wrote: 2. Where was I supposed to put that option about something-fabric? That's an option of gnome-terminal. You would have to put that option somewhere in the config files. Maybe you can use gconf-editor > apps > gnome-terminal to add the option. You will have to install gconf-editor for this, though. Quote:3. Is there a way to shift a program to a workspace (for instance, spawning Firefox under the "web" workspace) just on startup (when I run Firefox, it always goes to "web" automatically)? Using spawnOn would have been the way. Quote:Edit: while using XMonad with Gnome, since a couple of xmonad.hs edits ago or something like that, it seems like I can't anymore switch between workspaces by clicking on their respective bottom right squares. You are right. Now that you mention it, I realize it doesn't work for me too. I can't tell you why, though. I don't use the mouse much anyway. At least not in xmonad. RE: Xmonad configuration - noize - 06-26-2013 (06-26-2013, 09:03 AM)Deque Wrote:(06-25-2013, 09:46 PM)noize Wrote: 1. What does this do exactly? But, to me it looks just like the others. Quote:Quote:Edit: while using XMonad with Gnome, since a couple of xmonad.hs edits ago or something like that, it seems like I can't anymore switch between workspaces by clicking on their respective bottom right squares. Yeah, I don't use the mouse much either, but I can tell you why. Code: { manageHook = fullscreenManageHook <+> myManageHook <+> manageHook gnomeConfig
, handleEventHook = fullscreenEventHookJust change the above part with: Code: xmonad $ gnomeConfig
{ manageHook = myManageHook <+> manageHook gnomeConfigAs I've seen those "fullscreen" stuff, I just thought it had to be something set to widescreen overlapping the touch over there. It looks like working this way too: Code: xmonad $ gnomeConfig
{ manageHook = fullscreenManageHook <+> myManageHook <+> manageHook gnomeConfigYou just needed to remove "handleEventHook = fullscreenEventHook". Would you might explaining to me what all of this does exactly and what changes (apart from the fact this way I can switch between workspaces with a click too) ? I think something should differ as long as in the latest versions of the code you provided this was different from the earlier versions. Also a minor thing, if I switch gedit to widescreen with F11, it can't seem to be able to get back to normal, was just curious to know if you did know what causes this. RE: Xmonad configuration - Deque - 06-26-2013 (06-26-2013, 10:29 AM)noize Wrote:(06-26-2013, 09:03 AM)Deque Wrote: Every dialog box of firefox shall float instead of being a tiled window like the others. Works fine for me. See the dialog box here, it is not tiled: ![]() Quote:Yeah, I don't use the mouse much either, but I can tell you why. Interesting. Removing widescreen from Gedit works fine for me and I still have the xmonad.hs unchanged (with both, fullscreenEventHook and fullscreenManageHook). I suppose that removing the fullScreenEventHook causes this. I put these in, because I realized that I wasn't able to watch any youtube videos properly in fullscreen without them. I got the information from the Xmonad documentation: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Fullscreen.html What's written there is all I know. Maybe I have to add the fullscreenFull modifier to the layout too. Not sure, I will try later. RE: Xmonad configuration - noize - 06-26-2013 (06-26-2013, 07:15 PM)Deque Wrote:(06-26-2013, 10:29 AM)noize Wrote:(06-26-2013, 09:03 AM)Deque Wrote: Every dialog box of firefox shall float instead of being a tiled window like the others. Yeah, no, this works for me too, you're right. Quote:Quote:Yeah, I don't use the mouse much either, but I can tell you why. Are you able to still watch them properly by removing any of those two elements? Or do you need both of them to do so? |