diff --git a/bin/xmobar.hs b/bin/xmobar.hs index 6722a01..7cfbefa 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -1,14 +1,25 @@ import Xmobar +import XMonad (getXMonadDir) +fgColor0 :: String fgColor0 = "black" + +fgColor1 :: String fgColor1 = "#888888" + +bgColor0 :: String bgColor0 = "#eeeeee" + +bdColor :: String bdColor = "#cccccc" +wrapColor :: String -> String -> String wrapColor c s = "" ++ s ++ "" +sep :: String sep = wrapColor fgColor1 " : " +myTemplate :: String myTemplate = concat [ "%UnsafeStdinReader%" , " }{ " @@ -20,7 +31,8 @@ myTemplate = concat , sep, "%date% " ] -config = defaultConfig { +config :: String -> Config +config confDir = defaultConfig { font = "xft:DejaVu Sans Mono:size=11:bold:antialias=true" , additionalFonts = [ "xft:FontAwesome:pixelsize=13:antialias=true:hinting=true" @@ -44,7 +56,7 @@ config = defaultConfig { , overrideRedirect = True , pickBroadest = False , persistent = True - , iconRoot = "/home/ndwar/.local/share/xmobar/icons" + , iconRoot = confDir ++ "/icons" , commands = [ Run $ Alsa "default" "Master" @@ -97,4 +109,6 @@ config = defaultConfig { } main :: IO () -main = xmobar config +main = do + confDir <- getXMonadDir + xmobar $ config confDir diff --git a/icons/wifi_0.xpm b/icons/wifi_0.xpm new file mode 100644 index 0000000..04645f3 --- /dev/null +++ b/icons/wifi_0.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char * wifi_0_xpm[] = { +"16 16 2 1", +" c None", +". c #999999", +" ", +" ", +" .. ", +" .. ", +" .. .. ", +" .. .. ", +" .. .. .. ", +" .. .. .. ", +" .. .. .. .. ", +" .. .. .. .. ", +".. .. .. .. .. ", +".. .. .. .. .. ", +" ", +" ", +" ", +" "}; diff --git a/icons/wifi_1.xpm b/icons/wifi_1.xpm new file mode 100644 index 0000000..c34457c --- /dev/null +++ b/icons/wifi_1.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * wifi_1_xpm[] = { +"16 16 3 1", +" c None", +". c #999999", +"+ c #000000", +" ", +" ", +" .. ", +" .. ", +" .. .. ", +" .. .. ", +" .. .. .. ", +" .. .. .. ", +" .. .. .. .. ", +" .. .. .. .. ", +"++ .. .. .. .. ", +"++ .. .. .. .. ", +" ", +" ", +" ", +" "}; diff --git a/icons/wifi_2.xpm b/icons/wifi_2.xpm new file mode 120000 index 0000000..9c57b17 --- /dev/null +++ b/icons/wifi_2.xpm @@ -0,0 +1 @@ +wifi_3.xpm \ No newline at end of file diff --git a/icons/wifi_3.xpm b/icons/wifi_3.xpm new file mode 100644 index 0000000..fa2dd98 --- /dev/null +++ b/icons/wifi_3.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * wifi_3_xpm[] = { +"16 16 3 1", +" c None", +". c #999999", +"+ c #000000", +" ", +" ", +" .. ", +" .. ", +" .. .. ", +" .. .. ", +" .. .. .. ", +" .. .. .. ", +" ++ .. .. .. ", +" ++ .. .. .. ", +"++ ++ .. .. .. ", +"++ ++ .. .. .. ", +" ", +" ", +" ", +" "}; diff --git a/icons/wifi_4.xpm b/icons/wifi_4.xpm new file mode 120000 index 0000000..3701d4f --- /dev/null +++ b/icons/wifi_4.xpm @@ -0,0 +1 @@ +wifi_5.xpm \ No newline at end of file diff --git a/icons/wifi_5.xpm b/icons/wifi_5.xpm new file mode 100644 index 0000000..e8e6284 --- /dev/null +++ b/icons/wifi_5.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * wifi_5_xpm[] = { +"16 16 3 1", +" c None", +". c #999999", +"+ c #000000", +" ", +" ", +" .. ", +" .. ", +" .. .. ", +" .. .. ", +" ++ .. .. ", +" ++ .. .. ", +" ++ ++ .. .. ", +" ++ ++ .. .. ", +"++ ++ ++ .. .. ", +"++ ++ ++ .. .. ", +" ", +" ", +" ", +" "}; diff --git a/icons/wifi_6.xpm b/icons/wifi_6.xpm new file mode 120000 index 0000000..bcc41d1 --- /dev/null +++ b/icons/wifi_6.xpm @@ -0,0 +1 @@ +wifi_7.xpm \ No newline at end of file diff --git a/icons/wifi_7.xpm b/icons/wifi_7.xpm new file mode 100644 index 0000000..b29999b --- /dev/null +++ b/icons/wifi_7.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * wifi_7_xpm[] = { +"16 16 3 1", +" c None", +". c #999999", +"+ c #000000", +" ", +" ", +" .. ", +" .. ", +" ++ .. ", +" ++ .. ", +" ++ ++ .. ", +" ++ ++ .. ", +" ++ ++ ++ .. ", +" ++ ++ ++ .. ", +"++ ++ ++ ++ .. ", +"++ ++ ++ ++ .. ", +" ", +" ", +" ", +" "}; diff --git a/icons/wifi_8.xpm b/icons/wifi_8.xpm new file mode 100644 index 0000000..6092bee --- /dev/null +++ b/icons/wifi_8.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char * wifi_8_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" .. ", +" .. ", +" .. .. ", +" .. .. ", +" .. .. .. ", +" .. .. .. ", +" .. .. .. .. ", +" .. .. .. .. ", +".. .. .. .. .. ", +".. .. .. .. .. ", +" ", +" ", +" ", +" "}; diff --git a/my-xmonad.cabal b/my-xmonad.cabal index 238c64f..6f9c793 100644 --- a/my-xmonad.cabal +++ b/my-xmonad.cabal @@ -29,6 +29,7 @@ executable xmonad executable xmobar main-is: bin/xmobar.hs build-depends: base + , xmonad >= 0.13 , xmobar default-language: Haskell2010 ghc-options: -Wall -Werror -fno-warn-missing-signatures -threaded