Virtual desktop underlay for Wayland and X11
git clone https://github.com/m-col/xanadu
Files | Refs | Readme | License

Commit 7f9f1ec87d854c31330f1c6aea3f7dc6ddf5269c
Parent: e66e5b2a0445d99c718e1fcbda9e9cf266c9ccd5
Author: mcol <mcol@posteo.net>
Date: 2021-08-21 01:17:03 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2021-08-21 01:17:03 +0100

Trim initIcons block of unnecessary variables

src/Icons.hs Modified

@@ -18,18 +18,16 @@
 initIcons win = do
     pixbufGType <- glibType @Pixbuf.Pixbuf
     listStore <- Gtk.listStoreNew [GType.gtypeString, pixbufGType]
-    view <- new Gtk.IconView
+    iconTheme <- Gtk.iconThemeGetForScreen =<< Gtk.windowGetScreen win
+    homeDir <- getHomeDirectory
+    populate listStore iconTheme $ homeDir <> "/Desktop"
+    new Gtk.IconView
         [ #model := listStore
         , #selectionMode := Gtk.SelectionModeMultiple
         , #textColumn := 0
         , #tooltipColumn := 0
         , #pixbufColumn := 1
         ]
-    screen <- Gtk.windowGetScreen win
-    iconTheme <- Gtk.iconThemeGetForScreen screen
-    homeDir <- getHomeDirectory
-    populate listStore iconTheme $ homeDir <> "/Desktop"
-    return view
 
 populate :: Gtk.ListStore -> Gtk.IconTheme -> FilePath -> IO ()
 populate listStore iconTheme root = ls root >>= mconcat . map (addItem listStore iconTheme)