Xmonad en archlinux








xmonad es un administrador de ventanas dinámico para el sistema X Window, que se destaca por estar escrito en el lenguaje de programación funcional Haskell. 














Arch Linux ​ es una distribución Linux para computadoras x86-64​ orientada a usuarios avanzados. Se compone en su mayor parte de software libre y de código abierto ​ y apoya la participación comunitaria.​







paquetes a instalar:
trayer feh shutter xmonad

ahora xmonad nos crea 2 directorios .xmonad   dentro de este creamos e archivos xmonad,hs

ponemos el siguiente codigo:


xmonad.hs

import XMonad.Actions.SinkAll
import System.Posix.Env (getEnv)
import Data.Maybe (maybe)

import XMonad
import XMonad.Hooks.EwmhDesktops
---
import System.Exit

import qualified XMonad.StackSet as W
import qualified Data.Map        as M

-- GHC hierarchical libraries
import XMonad.Operations
import XMonad.Config
import XMonad.Util.Run
import System.IO
import Data.Ratio ((%))
--Contribs
import XMonad.Actions.CycleWS
import XMonad.Actions.NoBorders

import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.FadeInactive as FI
import XMonad.Layout.ToggleLayouts

-- import XMonad.Layout
import XMonad.Layout.Fullscreen
import XMonad.Layout.MultiToggle
import XMonad.Layout.MultiToggle.Instances

----
import XMonad.Layout.Accordion
import XMonad.Layout.Grid
import XMonad.Layout.IM
import XMonad.Layout.NoBorders
import XMonad.Layout.PerWorkspace
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.Layout.Tabbed
import XMonad.Layout.Circle
import XMonad.Layout.Dishes
import XMonad.Layout.FixedColumn
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Spiral
import XMonad.Layout.TwoPane
import XMonad.Layout.Combo
import XMonad.Layout.OneBig
import XMonad.Layout.ZoomRow
import XMonad.Layout.ResizableTile
---java
import XMonad.Hooks.SetWMName
myManageHook = composeAll . concat $
[
[ isFullscreen --> doFullFloat ],
[ className =? c --> doFloat | c <- floats ],
[ className =? c --> doIgnore | c <- ignore ]
] where
floats = ["yakuake"]
ignore = ["panel", "Trayer", "trayer", "gmrun"]

myLayout = avoidStruts $ noBorders Full ||| GridRatio (4/3)

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 = 1
-- Default proportion of screen occupied by master pane
ratio   = 1/2
-- Percent of screen to increment by when resizing panes
delta   = 2/100

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
[
((modm .|. shiftMask, xK_Return),spawn $ XMonad.terminal conf),
((modm , xK_F1),spawn "exe=`terminator` && eval \"exec $exe\""),
((modm , xK_F2),spawn "exe=`firefox` && eval \"exec $exe\""),
((modm , xK_F3),spawn "exe=`nemo` && eval \"exec $exe\""),

((modm, xK_Return), windows W.swapMaster),
((modm, xK_d ),spawn "exe=`dmenu_run` && eval \"exec $exe\""),
((modm , xK_q     ),kill),
((modm .|. shiftMask, xK_c     ),kill),
((modm, xK_space ),sendMessage NextLayout),
((modm, xK_comma ),sendMessage (IncMasterN 1)),
((modm , xK_period),sendMessage (IncMasterN (-1))),
((modm .|. shiftMask, xK_e     ), io (exitWith ExitSuccess)),
((modm              , xK_r     ), spawn "xmonad --recompile; xmonad --restart"),
((modm .|. shiftMask , xK_p), spawn "exe=`amixer -q sset Master 3%+` && eval \"exec $exe\""),
((modm ,               xK_h     ), sendMessage Shrink), -- %! Shrink the master area
    ((modm ,               xK_l     ), sendMessage Expand), -- %! Expand the master area
((mod4Mask .|. shiftMask, xK_f), sinkAll),
--resize
((modm, xK_a), sendMessage MirrorShrink),
((modm, xK_z), sendMessage MirrorExpand),
((modm .|. shiftMask , xK_o), spawn "exe=`amixer -q sset Master 3%-` && eval \"exec $exe\"")
]
++
[((m .|. modm, k), windows $ f i) | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]

myStartupHook = do
        -- No olvidar el permiso de ejecucion
setWMName "LG3D"
        spawn "~/.xmonad/init.sh"

defaults = defaultConfig {
        focusFollowsMouse = True,
borderWidth = 1,
focusedBorderColor = "#00FF00",
        layoutHook = myLayout, 
        manageHook = myManageHook,
        modMask = mod4Mask,
        keys    = myKeys,
        terminal = "terminator",
startupHook = myStartupHook
}


--main = do
-- xmproc <- spawnPipe "xmobar"       
-- session <- getEnv "DESKTOP_SESSION"
-- --Evitar que se trabe el libreoffice
-- xmonad $ defaults
main = xmonad =<< xmobar defaults




ahora en el .xmobarrc

Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
       , bgColor = "black"
       , fgColor = "grey"
       --, position = Top
       --, position = TopW L 95
       , position = Static { xpos = 0 , ypos = 0, width = 1166, height = 18 }
       , lowerOnStart = True
       , allDesktops = True
       , commands = [ Run Network "wlo1" ["-L","0","-H","32","--normal","green","--
high","red"] 10
, R
un Network "eno1" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"
] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
, R
un Swap [] 10
                    , Run Com "uname" ["-s","-r"] "" 36000
                    , Run Date "%a %b %_d %Y %H:%M:%S" "date" 11
, R
un StdinReader
                , Run BatteryP ["BAT0"]
                     ["-t", "<acstatus>"
                    , "-L", "10", "-H", "80"
                    , "-l", "red", "-h", "green"
                    , "--","-O", "Charging", "-o", "Battery: <left>%"
                    ] 1
                     ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = " %StdinReader% }{ %cpu% | %memory% * %swap%  | %wlo1%|%eno1%|
<fc=#ee9a00>%date%</fc> | %battery% |<fc=red> %uname%</fc>"
       }



como vemos en el xmonad.hs llamo un scrip llamado init.sh este es para cargar mi fondo de pantall ,el brillo de pantalla

el init.sh
#!/bin/bash
sudo bash tplink.sh
xmobar &
setxkbmap -layout us
xcompmgr -I1 -O1 -Ff &
echo  90 > /sys/class/backlight/amdgpu_bl0/brightness

feh --bg-fill ~/Downloads/wallpaper.jpg
trayer --edge top --align right --SetDockType true --SetPartialStrut true  --widtht
ype pixel --width 200 --transparent true --tint 0x000000 --heighttype pixel --heigh
t 18  &
synclient HorizTwoFingerScroll=0



con esto queda nuestro xmonad cualquier duda o sugerencia comentalo.
algunas capturas:






Comentarios