diff options
| -rw-r--r-- | extras/HOME/.xmobarrc | 4 | ||||
| -rwxr-xr-x | extras/HOME/.xmonad/xmobar-weather | 9 | ||||
| -rw-r--r-- | src/Internal/Layout.hs | 19 | ||||
| -rw-r--r-- | src/Main.hs | 2 | ||||
| -rw-r--r-- | stack.yaml | 2 |
5 files changed, 17 insertions, 19 deletions
diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc index e2a3e9f..916ba21 100644 --- a/extras/HOME/.xmobarrc +++ b/extras/HOME/.xmobarrc @@ -2,7 +2,7 @@ Config { font = "xft:Monofur Nerd Font:size=12" , additionalFonts = [ "xft:Monofur bold Nerd Font:style=bold:size=12", - "xft:Monofur Nerd Font:size=9", + "xft:Monofur Bold Nerd Font:size=9", "xft:Monofur Nerd Font:size=9", "xft:Monofur Nerd Font:size=6", "xft:Monofur bold Nerd Font:size=15", @@ -30,7 +30,7 @@ Config , template = " %logo% <fc=#a0a0a0><fn=3>%uname%</fn></fc><fc=#404040> │\ \</fc><fc=#a0a0a0> %date%</fc><fc=#404040> │ \ - \</fc>%StdinReader%}<fn=6><fc=#909090>%time%</fc></fn>\ + \</fc>%StdinReader%}<fn=2><fc=#606060>%time%</fc></fn>\ \{ %cpu% %memory% <fc=#404040>\ \│</fc> %weather% <fc=#404040>│\ \</fc> <fc=#a0a0a0>%mpris2%</fc> <fc=#404040>│ \ diff --git a/extras/HOME/.xmonad/xmobar-weather b/extras/HOME/.xmonad/xmobar-weather index d9dc88b..e8ce28e 100755 --- a/extras/HOME/.xmonad/xmobar-weather +++ b/extras/HOME/.xmonad/xmobar-weather @@ -1,18 +1,16 @@ #!/usr/bin/perl -use LWP::Simple; use Time::Local; use POSIX; -$content = get("https://ipinfo.io"); +$content = `curl https://ipinfo.io`; die "Unable to get IP info" unless defined $content; ($city, $lat, $lon) = ($content =~ m/.*"city":\s+"([^"]+)".*"loc":\s+"(-?[0-9.]+),(-?[0-9.]+).*"/ims); -$content = get( - "https://api.sunrise-sunset.org/json?lat=$lat&lng=$lon&formatted=0"); +$content = `curl "https://api.sunrise-sunset.org/json?lat=$lat&lng=$lon&formatted=0"`; die "Unable to get sunrise/sunset data" unless defined $content; @@ -22,8 +20,7 @@ $sunrise_str =~ s#.*"sunrise":"([^"]*)".*#\1#; $sunset_str =~ s#.*"sunset":"([^"]*)".*#\1#; $current_str=strftime "%Y-%m-%dT%H:%M:%S+00:00", gmtime(); -$content = get( - "https://tgftp.nws.noaa.gov/data/observations/metar/decoded/KLMO.TXT"); +$content = `curl "https://tgftp.nws.noaa.gov/data/observations/metar/decoded/KLMO.TXT"`; die "Unable to get weather data" unless defined $content; diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs index f28ae4d..8903fed 100644 --- a/src/Internal/Layout.hs +++ b/src/Internal/Layout.hs @@ -38,7 +38,7 @@ myLayout = Grid ||| Dishes 2 (1/6) ||| (MosaicAlt M.empty :: MosaicAlt Window) ||| - (D.Dwindle D.R D.CW 1.5 1.1) + D.Dwindle D.R D.CW 1.5 1.1 data ModifyDescription m l a = ModifyDescription m (l a) deriving (Show, Read) @@ -82,18 +82,19 @@ instance DescriptionModifier TallDescriptionModifier Tall where instance DescriptionModifier ThreeColDescMod ThreeCol where newDescription _ (ThreeCol mast _ _) _ = "ThreeCol(" ++ show mast ++ ")" + newDescription _ (ThreeColMid mast _ _) _ = "ThreeColMid(" ++ show mast ++ ")" data ResizeZoom = ShrinkZoom | ExpandZoom deriving (Typeable) instance Message ResizeZoom where -data Flippable a = Flippable Bool -- True if flipped +newtype Flippable a = Flippable Bool -- True if flipped deriving (Show, Read) -data HFlippable a = HFlippable Bool -- True if flipped +newtype HFlippable a = HFlippable Bool -- True if flipped deriving (Show, Read) -data Rotateable a = Rotateable Bool -- True if rotated +newtype Rotateable a = Rotateable Bool -- True if rotated deriving (Show, Read) data FlipLayout = FlipLayout deriving (Typeable) @@ -140,7 +141,7 @@ instance (Eq a) => LayoutModifier Rotateable a where pureMess (Rotateable rot) mess = - fmap (\(DoRotate) -> Rotateable (not rot)) (fromMessage mess) + fmap (\DoRotate -> Rotateable (not rot)) (fromMessage mess) modifyDescription (Rotateable rot) underlying = let descr = description underlying in @@ -197,17 +198,17 @@ instance (Eq a) => LayoutModifier Zoomable a where (zoomed, rest) = partition ((==focused) . Just . fst) returned in case zoomed of [] -> return (rest, Nothing) - ((fwin, _):_) -> return $ ((fwin, Rectangle (x + wp) (y + hp) (w - fromIntegral (wp * 2)) (h - fromIntegral (hp * 2))) : rest, Nothing) + ((fwin, _):_) -> return ((fwin, Rectangle (x + wp) (y + hp) (w - fromIntegral (wp * 2)) (h - fromIntegral (hp * 2))) : rest, Nothing) else return (returned, Nothing) where - wp = floor $ (fromIntegral w) * ws - hp = floor $ (fromIntegral h) * hs + wp = floor $ fromIntegral w * ws + hp = floor $ fromIntegral h * hs handleMessOrMaybeModifyIt self@(Zoomable showing sw sh) mess = return $ (handleResize <$> fromMessage mess) - <|> ((Left . handleZoom) <$> fromMessage mess) + <|> (Left . handleZoom <$> fromMessage mess) where handleResize r = if showing diff --git a/src/Main.hs b/src/Main.hs index 0d49e21..741e6dc 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -26,7 +26,7 @@ main = do { terminal = "alacritty" , modMask = mod3Mask , borderWidth = 2 - , keys = \config -> mempty + , keys = const mempty , focusedBorderColor = "#ff6c00" , normalBorderColor = "#404040" , layoutHook = myLayout @@ -17,7 +17,7 @@ # # resolver: ./custom-snapshot.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: lts-18.13 +resolver: lts-18.15 # User packages to be built. # Various formats can be used as shown in the example below. |