From 52c05feb581ad535aa790591c37093f3a8817494 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 30 Jul 2016 15:17:19 +0200 Subject: machines/profpatsch: clean up folder --- machines/profpatsch/notes.org | 32 ----------- machines/profpatsch/patches/sent-bg.patch | 18 ++++++ machines/profpatsch/patches/taffybar-color.patch | 40 +++++++++++++ machines/profpatsch/patches/taffybar.patch | 71 ++++++++++++++++++++++++ machines/profpatsch/pkgs.nix | 6 +- machines/profpatsch/sent-bg.patch | 18 ------ machines/profpatsch/taffybar-color.patch | 40 ------------- machines/profpatsch/taffybar.patch | 71 ------------------------ 8 files changed, 132 insertions(+), 164 deletions(-) delete mode 100644 machines/profpatsch/notes.org create mode 100644 machines/profpatsch/patches/sent-bg.patch create mode 100644 machines/profpatsch/patches/taffybar-color.patch create mode 100644 machines/profpatsch/patches/taffybar.patch delete mode 100644 machines/profpatsch/sent-bg.patch delete mode 100644 machines/profpatsch/taffybar-color.patch delete mode 100644 machines/profpatsch/taffybar.patch (limited to 'machines') diff --git a/machines/profpatsch/notes.org b/machines/profpatsch/notes.org deleted file mode 100644 index b5a82651..00000000 --- a/machines/profpatsch/notes.org +++ /dev/null @@ -1,32 +0,0 @@ -* GTK themes -this should work: - -#+BEGIN_SRC nix - # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/gnome3.nix - xserver.displayManager.session = [ - { - manage = "window"; - name = "awesome"; - start = '' - # Set GTK_DATA_PREFIX so that GTK+ can find the themes - export GTK_DATA_PREFIX=${config.system.path} - # Find theme engines - export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0 - # Find the mouse - export XCURSOR_PATH=~/.icons:${config.system.path}/share/icons - # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/ - ${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update - # Find the mouse - export XCURSOR_PATH=~/.icons:${config.system.path}/share/icons - ${pkgs.awesome}/bin/awesome& - waitPID=$! - ''; - } - ]; - - environment = { - - # Share needed for themes and backgrounds - pathsToLink = [ "/include" "/share"]; - }; -#+END_SRC diff --git a/machines/profpatsch/patches/sent-bg.patch b/machines/profpatsch/patches/sent-bg.patch new file mode 100644 index 00000000..acf92ebc --- /dev/null +++ b/machines/profpatsch/patches/sent-bg.patch @@ -0,0 +1,18 @@ +diff --git a/config.def.h b/config.def.h +index 92d577c..87baee5 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -8,8 +8,11 @@ static char *fontfallbacks[] = { + #define NUMFONTSCALES 42 + #define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */ + +-static const char *fgcol = "#000000"; +-static const char *bgcol = "#FFFFFF"; ++/* FUCK YOU */ ++/* static const char *fgcol = "#000000"; */ ++/* static const char *bgcol = "#FFFFFF"; */ ++static const char *bgcol = "#000000"; ++static const char *fgcol = "#FFFFFF"; + + static const float linespacing = 1.4; + diff --git a/machines/profpatsch/patches/taffybar-color.patch b/machines/profpatsch/patches/taffybar-color.patch new file mode 100644 index 00000000..cfa1cce8 --- /dev/null +++ b/machines/profpatsch/patches/taffybar-color.patch @@ -0,0 +1,40 @@ +From 45ff40992c8fe5593d5f3e03ef0765168c6325fb Mon Sep 17 00:00:00 2001 +From: Peder Stray +Date: Thu, 29 Oct 2015 17:37:56 +0100 +Subject: [PATCH] Load taffybar gtk configs after initGUI + +Since gtkrc files from themes seem to load anyway, load the default and +user gtkrc for taffybar after initGUI. please note that setting +gtk_color_scheme from any of these causes a lot of already loaded gtkrc +files to be reloaded. +--- + src/System/Taffybar.hs | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/src/System/Taffybar.hs b/src/System/Taffybar.hs +index f119852..f7afe5e 100644 +--- a/src/System/Taffybar.hs ++++ b/src/System/Taffybar.hs +@@ -261,16 +261,15 @@ setTaffybarSize cfg window = do + + taffybarMain :: TaffybarConfig -> IO () + taffybarMain cfg = do +- -- Override the default GTK theme path settings. This causes the +- -- bar (by design) to ignore the real GTK theme and just use the +- -- provided minimal theme to set the background and text colors. +- -- Users can override this default. +- defaultGtkConfig <- getDefaultConfigFile "taffybar.rc" +- userGtkConfig <- getUserConfigFile "taffybar" "taffybar.rc" +- rcSetDefaultFiles [ defaultGtkConfig, userGtkConfig ] + + _ <- initGUI + ++ -- Load default and user gtk resources ++ defaultGtkConfig <- getDefaultConfigFile "taffybar.rc" ++ userGtkConfig <- getUserConfigFile "taffybar" "taffybar.rc" ++ rcParse defaultGtkConfig ++ rcParse userGtkConfig ++ + Just disp <- displayGetDefault + nscreens <- displayGetNScreens disp + screen <- case screenNumber cfg < nscreens of diff --git a/machines/profpatsch/patches/taffybar.patch b/machines/profpatsch/patches/taffybar.patch new file mode 100644 index 00000000..a93fca1a --- /dev/null +++ b/machines/profpatsch/patches/taffybar.patch @@ -0,0 +1,71 @@ +diff --git a/src/System/Taffybar/Battery.hs b/src/System/Taffybar/Battery.hs +index 5335eff..32c7efa 100644 +--- a/src/System/Taffybar/Battery.hs ++++ b/src/System/Taffybar/Battery.hs +@@ -9,6 +9,7 @@ + -- more advanced features could be supported if there is interest. + module System.Taffybar.Battery ( + batteryBarNew, ++ batteryIconNew, + textBatteryNew, + defaultBatteryConfig + ) where +@@ -108,30 +109,22 @@ defaultBatteryConfig = + | pct < 0.9 = (0.5, 0.5, 0.5) + | otherwise = (0, 1, 0) + +--- | A fancy graphical battery widget that represents the current +--- charge as a colored vertical bar. There is also a textual +--- percentage readout next to the bar. ++-- | + batteryBarNew :: BarConfig -- ^ Configuration options for the bar display +- -> Double -- ^ Polling period in seconds + -> IO Widget +-batteryBarNew battCfg pollSeconds = do ++batteryBarNew battCfg = do + battCtxt <- batteryContextNew +- case battCtxt of +- Nothing -> do +- let lbl :: Maybe String +- lbl = Just "No battery" +- labelNew lbl >>= return . toWidget +- Just ctxt -> do +- -- This is currently pretty inefficient - each poll period it +- -- queries the battery twice (once for the label and once for +- -- the bar). +- -- +- -- Converting it to combine the two shouldn't be hard. +- b <- hBoxNew False 1 +- txt <- textBatteryNew "$percentage$%" pollSeconds +- r <- newIORef ctxt +- bar <- pollingBarNew battCfg pollSeconds (battPct r) +- boxPackStart b bar PackNatural 0 +- boxPackStart b txt PackNatural 0 +- widgetShowAll b +- return (toWidget b) ++ let noBat = toWidget <$> labelNew (Just "No battery" :: Maybe String) ++ maybe noBat (batteryIconNew battCfg) battCtxt ++ ++-- | A fancy graphical battery widget that represents the current ++-- charge as a colored vertical bar. ++batteryIconNew :: BarConfig ++ -> BatteryContext ++ -> IO Widget ++batteryIconNew cfg ctxt = do ++ icon <- pollingBarNew cfg pollSeconds . battPct =<< newIORef ctxt ++ widgetShowAll icon ++ return icon ++ where ++ pollSeconds = 5 +diff --git a/src/System/Taffybar/Widgets/PollingBar.hs b/src/System/Taffybar/Widgets/PollingBar.hs +index d30adaf..01f161c 100644 +--- a/src/System/Taffybar/Widgets/PollingBar.hs ++++ b/src/System/Taffybar/Widgets/PollingBar.hs +@@ -16,6 +16,7 @@ import Control.Monad ( forever ) + import Graphics.UI.Gtk + + import System.Taffybar.Widgets.VerticalBar ++import Debug.Trace + + pollingBarNew :: BarConfig -> Double -> IO Double -> IO Widget + pollingBarNew cfg pollSeconds action = do diff --git a/machines/profpatsch/pkgs.nix b/machines/profpatsch/pkgs.nix index 9a7e5a5a..c3c09297 100644 --- a/machines/profpatsch/pkgs.nix +++ b/machines/profpatsch/pkgs.nix @@ -30,16 +30,16 @@ let overrides = _: super: { taffybar = super.taffybar.overrideDerivation (old: { name = old.name + "foo"; - patches = (old.patches or []) ++ [ ./taffybar.patch ]; + patches = (old.patches or []) ++ [ ./patches/taffybar.patch ]; postPatch = old.postPathPhase or "" + '' - patch -R ${./taffybar-color.patch} + patch -R ${./patches/taffybar-color.patch} ''; }); }; }).ghcWithPackages; }; - sent = pkgs.sent.override { patches = [ ./sent-bg.patch ]; }; + sent = pkgs.sent.override { patches = [ ./patches/sent-bg.patch ]; }; mpv = pkgs.mpv.override { scripts = [ pkgs.mpvScripts.convert ]; }; diff --git a/machines/profpatsch/sent-bg.patch b/machines/profpatsch/sent-bg.patch deleted file mode 100644 index acf92ebc..00000000 --- a/machines/profpatsch/sent-bg.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 92d577c..87baee5 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -8,8 +8,11 @@ static char *fontfallbacks[] = { - #define NUMFONTSCALES 42 - #define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */ - --static const char *fgcol = "#000000"; --static const char *bgcol = "#FFFFFF"; -+/* FUCK YOU */ -+/* static const char *fgcol = "#000000"; */ -+/* static const char *bgcol = "#FFFFFF"; */ -+static const char *bgcol = "#000000"; -+static const char *fgcol = "#FFFFFF"; - - static const float linespacing = 1.4; - diff --git a/machines/profpatsch/taffybar-color.patch b/machines/profpatsch/taffybar-color.patch deleted file mode 100644 index cfa1cce8..00000000 --- a/machines/profpatsch/taffybar-color.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 45ff40992c8fe5593d5f3e03ef0765168c6325fb Mon Sep 17 00:00:00 2001 -From: Peder Stray -Date: Thu, 29 Oct 2015 17:37:56 +0100 -Subject: [PATCH] Load taffybar gtk configs after initGUI - -Since gtkrc files from themes seem to load anyway, load the default and -user gtkrc for taffybar after initGUI. please note that setting -gtk_color_scheme from any of these causes a lot of already loaded gtkrc -files to be reloaded. ---- - src/System/Taffybar.hs | 13 ++++++------- - 1 file changed, 6 insertions(+), 7 deletions(-) - -diff --git a/src/System/Taffybar.hs b/src/System/Taffybar.hs -index f119852..f7afe5e 100644 ---- a/src/System/Taffybar.hs -+++ b/src/System/Taffybar.hs -@@ -261,16 +261,15 @@ setTaffybarSize cfg window = do - - taffybarMain :: TaffybarConfig -> IO () - taffybarMain cfg = do -- -- Override the default GTK theme path settings. This causes the -- -- bar (by design) to ignore the real GTK theme and just use the -- -- provided minimal theme to set the background and text colors. -- -- Users can override this default. -- defaultGtkConfig <- getDefaultConfigFile "taffybar.rc" -- userGtkConfig <- getUserConfigFile "taffybar" "taffybar.rc" -- rcSetDefaultFiles [ defaultGtkConfig, userGtkConfig ] - - _ <- initGUI - -+ -- Load default and user gtk resources -+ defaultGtkConfig <- getDefaultConfigFile "taffybar.rc" -+ userGtkConfig <- getUserConfigFile "taffybar" "taffybar.rc" -+ rcParse defaultGtkConfig -+ rcParse userGtkConfig -+ - Just disp <- displayGetDefault - nscreens <- displayGetNScreens disp - screen <- case screenNumber cfg < nscreens of diff --git a/machines/profpatsch/taffybar.patch b/machines/profpatsch/taffybar.patch deleted file mode 100644 index a93fca1a..00000000 --- a/machines/profpatsch/taffybar.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/src/System/Taffybar/Battery.hs b/src/System/Taffybar/Battery.hs -index 5335eff..32c7efa 100644 ---- a/src/System/Taffybar/Battery.hs -+++ b/src/System/Taffybar/Battery.hs -@@ -9,6 +9,7 @@ - -- more advanced features could be supported if there is interest. - module System.Taffybar.Battery ( - batteryBarNew, -+ batteryIconNew, - textBatteryNew, - defaultBatteryConfig - ) where -@@ -108,30 +109,22 @@ defaultBatteryConfig = - | pct < 0.9 = (0.5, 0.5, 0.5) - | otherwise = (0, 1, 0) - ---- | A fancy graphical battery widget that represents the current ---- charge as a colored vertical bar. There is also a textual ---- percentage readout next to the bar. -+-- | - batteryBarNew :: BarConfig -- ^ Configuration options for the bar display -- -> Double -- ^ Polling period in seconds - -> IO Widget --batteryBarNew battCfg pollSeconds = do -+batteryBarNew battCfg = do - battCtxt <- batteryContextNew -- case battCtxt of -- Nothing -> do -- let lbl :: Maybe String -- lbl = Just "No battery" -- labelNew lbl >>= return . toWidget -- Just ctxt -> do -- -- This is currently pretty inefficient - each poll period it -- -- queries the battery twice (once for the label and once for -- -- the bar). -- -- -- -- Converting it to combine the two shouldn't be hard. -- b <- hBoxNew False 1 -- txt <- textBatteryNew "$percentage$%" pollSeconds -- r <- newIORef ctxt -- bar <- pollingBarNew battCfg pollSeconds (battPct r) -- boxPackStart b bar PackNatural 0 -- boxPackStart b txt PackNatural 0 -- widgetShowAll b -- return (toWidget b) -+ let noBat = toWidget <$> labelNew (Just "No battery" :: Maybe String) -+ maybe noBat (batteryIconNew battCfg) battCtxt -+ -+-- | A fancy graphical battery widget that represents the current -+-- charge as a colored vertical bar. -+batteryIconNew :: BarConfig -+ -> BatteryContext -+ -> IO Widget -+batteryIconNew cfg ctxt = do -+ icon <- pollingBarNew cfg pollSeconds . battPct =<< newIORef ctxt -+ widgetShowAll icon -+ return icon -+ where -+ pollSeconds = 5 -diff --git a/src/System/Taffybar/Widgets/PollingBar.hs b/src/System/Taffybar/Widgets/PollingBar.hs -index d30adaf..01f161c 100644 ---- a/src/System/Taffybar/Widgets/PollingBar.hs -+++ b/src/System/Taffybar/Widgets/PollingBar.hs -@@ -16,6 +16,7 @@ import Control.Monad ( forever ) - import Graphics.UI.Gtk - - import System.Taffybar.Widgets.VerticalBar -+import Debug.Trace - - pollingBarNew :: BarConfig -> Double -> IO Double -> IO Widget - pollingBarNew cfg pollSeconds action = do -- cgit 1.4.1