From 742cda0e2261acad6b3d17dc42331ecc5e833854 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 3 Mar 2018 15:07:00 +0100 Subject: l: turn pkgs into overlay --- lass/5pkgs/custom/xmonad-lass/default.nix | 192 ++++++++++++++++++++++++++++++ lass/5pkgs/default.nix | 63 +++++----- lass/5pkgs/xmonad-lass.nix | 183 ---------------------------- 3 files changed, 223 insertions(+), 215 deletions(-) create mode 100644 lass/5pkgs/custom/xmonad-lass/default.nix delete mode 100644 lass/5pkgs/xmonad-lass.nix (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/custom/xmonad-lass/default.nix b/lass/5pkgs/custom/xmonad-lass/default.nix new file mode 100644 index 000000000..e658897da --- /dev/null +++ b/lass/5pkgs/custom/xmonad-lass/default.nix @@ -0,0 +1,192 @@ +{ config, pkgs, ... }: +pkgs.writeHaskell "xmonad-lass" { + executables.xmonad = { + extra-depends = [ + "containers" + "extra" + "unix" + "X11" + "xmonad" + "xmonad-contrib" + "xmonad-stockholm" + ]; + text = /* haskell */ '' +{-# LANGUAGE DeriveDataTypeable #-} -- for XS +{-# LANGUAGE FlexibleContexts #-} -- for xmonad' +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE ScopedTypeVariables #-} + + +module Main where +import XMonad + +import qualified XMonad.StackSet as W +import Control.Monad.Extra (whenJustM) +import Data.List (isInfixOf) +import Data.Monoid (Endo) +import System.Environment (getArgs, lookupEnv) +import System.Posix.Process (executeFile) +import XMonad.Actions.CopyWindow (copy, kill1) +import XMonad.Actions.CycleWS (toggleWS) +import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace, removeEmptyWorkspace) +import XMonad.Actions.DynamicWorkspaces (withWorkspace) +import XMonad.Actions.GridSelect (GSConfig(..), gridselectWorkspace, navNSearch) +import XMonad.Hooks.EwmhDesktops (ewmh) +import XMonad.Hooks.FloatNext (floatNext) +import XMonad.Hooks.FloatNext (floatNextHook) +import XMonad.Hooks.ManageDocks (avoidStruts, ToggleStruts(ToggleStruts)) +import XMonad.Hooks.Place (placeHook, smart) +import XMonad.Hooks.UrgencyHook (focusUrgent) +import XMonad.Hooks.UrgencyHook (withUrgencyHook, UrgencyHook(..)) +import XMonad.Layout.FixedColumn (FixedColumn(..)) +import XMonad.Layout.Minimize (minimize, minimizeWindow, MinimizeMsg(RestoreNextMinimizedWin)) +import XMonad.Layout.NoBorders (smartBorders) +import XMonad.Layout.SimplestFloat (simplestFloat) +import XMonad.Prompt (autoComplete, font, searchPredicate, XPConfig) +import XMonad.Prompt.Window (windowPromptGoto, windowPromptBringCopy) +import XMonad.Util.EZConfig (additionalKeysP) +import XMonad.Util.NamedWindows (getName) +import XMonad.Util.Run (safeSpawn) + +import XMonad.Stockholm.Shutdown + +data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show) + +instance UrgencyHook LibNotifyUrgencyHook where + urgencyHook LibNotifyUrgencyHook w = do + name <- getName w + Just idx <- fmap (W.findTag w) $ gets windowset + + safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx] + +myTerm :: FilePath +myTerm = "${pkgs.rxvt_unicode_with-plugins}/bin/urxvtc" + +myFont :: String +myFont = "${config.lass.fonts.regular}" + +main :: IO () +main = getArgs >>= \case + ["--shutdown"] -> sendShutdownEvent + _ -> main' + +main' :: IO () +main' = do + xmonad $ ewmh + $ withUrgencyHook LibNotifyUrgencyHook + $ def + { terminal = myTerm + , modMask = mod4Mask + , layoutHook = smartBorders $ myLayoutHook + , manageHook = placeHook (smart (1,0)) <+> floatNextHook <+> floatHooks + , startupHook = + whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK")) + (\path -> forkFile path [] Nothing) + , normalBorderColor = "#1c1c1c" + , focusedBorderColor = "#ff0000" + , handleEventHook = handleShutdownEvent + , workspaces = [ "dashboard", "sys", "wp" ] + } `additionalKeysP` myKeyMap + +myLayoutHook = defLayout + where + defLayout = minimize $ ((avoidStruts $ Tall 1 (3/100) (1/2) ||| Full ||| Mirror (Tall 1 (3/100) (1/2))) ||| FixedColumn 2 80 80 1 ||| simplestFloat) + +floatHooks :: Query (Endo WindowSet) +floatHooks = composeAll . concat $ + [ [ title =? t --> doFloat | t <- myTitleFloats] + , [ className =? c --> doFloat | c <- myClassFloats ] ] + where + myTitleFloats = [] + myClassFloats = ["Pinentry"] -- for gpg passphrase entry + + +myKeyMap :: [([Char], X ())] +myKeyMap = + [ ("M4-", spawn "${config.lass.screenlock.command}") + , ("M4-C-p", spawn "${pkgs.scrot}/bin/scrot ~/public_html/scrot.png") + , ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type") + , ("M4-o", spawn "${pkgs.brain}/bin/brainmenu --type") + , ("M4-i", spawn "${pkgs.dpass}/bin/dpassmenu --type") + + , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle") + , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%") + , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%") + , ("", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -time 0 -dec 1%") + , ("", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -time 0 -inc 1") + , ("", gridselectWorkspace gridConfig W.view) + , ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill") + + , ("M4-a", focusUrgent) + , ("M4-S-r", renameWorkspace myXPConfig) + , ("M4-S-a", addWorkspacePrompt myXPConfig) + , ("M4-S-", removeEmptyWorkspace) + , ("M4-S-c", kill1) + , ("M4-", toggleWS) + , ("M4-S-", spawn myTerm) + , ("M4-x", floatNext True >> spawn myTerm) + , ("M4-c", floatNext True >> spawn "${pkgs.termite}/bin/termite") + , ("M4-f", floatNext True) + , ("M4-b", sendMessage ToggleStruts) + + , ("M4-v", withWorkspace autoXPConfig (windows . W.greedyView)) + , ("M4-S-v", withWorkspace autoXPConfig (windows . W.shift)) + , ("M4-C-v", withWorkspace autoXPConfig (windows . copy)) + + , ("M4-m", withFocused minimizeWindow) + , ("M4-S-m", sendMessage RestoreNextMinimizedWin) + + , ("M4-q", windowPromptGoto infixAutoXPConfig) + , ("M4-C-q", windowPromptBringCopy infixAutoXPConfig) + + , ("M4-S-q", return ()) + + , ("M4-d", floatNext True >> spawn "${pkgs.copyq}/bin/copyq show") + + , ("M4-", spawn "${pkgs.writeDash "nm-dmenu" '' + export PATH=$PATH:${pkgs.dmenu}/bin:${pkgs.networkmanagerapplet}/bin + exec ${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu "$@" + ''}") + + , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 1") + , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 10") + , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 33") + , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 100") + + , ("", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter") + + --, ("M4-w", screenWorkspace 0 >>= (windows . W.greedyView)) + --, ("M4-e", screenWorkspace 1 >>= (windows . W.greedyView)) + --, ("M4-r", screenWorkspace 2 >>= (windows . W.greedyView)) + ] + +forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () +forkFile path args env = + xfork (executeFile path False args env) >> return () + +myXPConfig :: XPConfig +myXPConfig = def + { font = myFont + } + +autoXPConfig :: XPConfig +autoXPConfig = myXPConfig + { autoComplete = Just 5000 + } + +infixAutoXPConfig :: XPConfig +infixAutoXPConfig = autoXPConfig + { searchPredicate = isInfixOf + } + +gridConfig :: GSConfig WorkspaceId +gridConfig = def + { gs_cellwidth = 100 + , gs_cellheight = 30 + , gs_cellpadding = 2 + , gs_navigate = navNSearch + , gs_font = myFont + } + ''; + }; +} diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix index a158cd3c6..28482eb91 100644 --- a/lass/5pkgs/default.nix +++ b/lass/5pkgs/default.nix @@ -1,40 +1,39 @@ -{ config, pkgs, ... }@args: +with import ; +self: super: let -{ - nixpkgs.config.packageOverrides = rec { - acronym = pkgs.callPackage ./acronym/default.nix {}; - dpass = pkgs.callPackage ./dpass {}; - firefoxPlugins = { - noscript = pkgs.callPackage ./firefoxPlugins/noscript.nix {}; - ublock = pkgs.callPackage ./firefoxPlugins/ublock.nix {}; - vimperator = pkgs.callPackage ./firefoxPlugins/vimperator.nix {}; - }; - init = pkgs.callPackage ./init/default.nix args; - logify = pkgs.callPackage ./logify/default.nix {}; - mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {}; - mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {}; - pop = pkgs.callPackage ./pop/default.nix {}; - q = pkgs.callPackage ./q {}; - rs = pkgs.callPackage ./rs/default.nix {}; - urban = pkgs.callPackage ./urban/default.nix {}; - xml2json = pkgs.callPackage ./xml2json/default.nix {}; - xmonad-lass = import ./xmonad-lass.nix { inherit config pkgs; }; - yt-next = pkgs.callPackage ./yt-next/default.nix {}; + # This callPackage will try to detect obsolete overrides. + callPackage = path: args: let + override = super.callPackage path args; + upstream = optionalAttrs (override ? "name") + (super.${(parseDrvName override.name).name} or {}); + in if upstream ? "name" && + override ? "name" && + compareVersions upstream.name override.name != -1 + then + trace + "Upstream `${upstream.name}' gets overridden by `${override.name}'." + override + else override; - bank = pkgs.writeDashBin "bank" '' + subdirsOf = path: + mapAttrs (name: _: path + "/${name}") + (filterAttrs (_: eq "directory") (readDir path)); + +in { + bank = self.writeDashBin "bank" '' tmp=$(mktemp) - ${pkgs.pass}/bin/pass show hledger > $tmp - ${pkgs.hledger}/bin/hledger --file=$tmp "$@" - ${pkgs.pass}/bin/pass show hledger | if ${pkgs.diffutils}/bin/diff $tmp -; then + ${self.pass}/bin/pass show hledger > $tmp + ${self.hledger}/bin/hledger --file=$tmp "$@" + ${self.pass}/bin/pass show hledger | if ${self.diffutils}/bin/diff $tmp -; then exit 0 else - ${pkgs.coreutils}/bin/cat $tmp | ${pkgs.pass}/bin/pass insert -m hledger + ${self.coreutils}/bin/cat $tmp | ${self.pass}/bin/pass insert -m hledger fi - ${pkgs.coreutils}/bin/rm $tmp - ''; - screengrab = pkgs.writeDashBin "screengrab" '' - resolution="$(${pkgs.xorg.xrandr}/bin/xrandr | ${pkgs.gnugrep}/bin/grep '*' | ${pkgs.gawk}/bin/awk '{print $1}')" - ${pkgs.ffmpeg}/bin/ffmpeg -f x11grab -r 25 -i :${toString config.services.xserver.display} -s $resolution -c:v huffyuv $1 + ${self.coreutils}/bin/rm $tmp ''; - }; + rtl8814au = callPackage ./custom/rtl8814au { kernel = self.linux; }; } + +// mapAttrs (_: flip callPackage {}) + (filterAttrs (_: dir: pathExists (dir + "/default.nix")) + (subdirsOf ./.)) diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix deleted file mode 100644 index 59c95cff7..000000000 --- a/lass/5pkgs/xmonad-lass.nix +++ /dev/null @@ -1,183 +0,0 @@ -{ config, pkgs, ... }: -pkgs.writeHaskell "xmonad-lass" { - executables.xmonad = { - extra-depends = [ - "containers" - "extra" - "unix" - "X11" - "xmonad" - "xmonad-contrib" - "xmonad-stockholm" - ]; - text = /* haskell */ '' -{-# LANGUAGE DeriveDataTypeable #-} -- for XS -{-# LANGUAGE FlexibleContexts #-} -- for xmonad' -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE ScopedTypeVariables #-} - - -module Main where -import XMonad - -import qualified XMonad.StackSet as W -import Control.Monad.Extra (whenJustM) -import Data.List (isInfixOf) -import Data.Monoid (Endo) -import System.Environment (getArgs, lookupEnv) -import System.Posix.Process (executeFile) -import XMonad.Actions.CopyWindow (copy, kill1) -import XMonad.Actions.CycleWS (toggleWS) -import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace, removeEmptyWorkspace) -import XMonad.Actions.DynamicWorkspaces (withWorkspace) -import XMonad.Actions.GridSelect (GSConfig(..), gridselectWorkspace, navNSearch) -import XMonad.Hooks.EwmhDesktops (ewmh) -import XMonad.Hooks.FloatNext (floatNext) -import XMonad.Hooks.FloatNext (floatNextHook) -import XMonad.Hooks.ManageDocks (avoidStruts, ToggleStruts(ToggleStruts)) -import XMonad.Hooks.Place (placeHook, smart) -import XMonad.Hooks.UrgencyHook (focusUrgent) -import XMonad.Hooks.UrgencyHook (withUrgencyHook, UrgencyHook(..)) -import XMonad.Layout.FixedColumn (FixedColumn(..)) -import XMonad.Layout.Minimize (minimize, minimizeWindow, MinimizeMsg(RestoreNextMinimizedWin)) -import XMonad.Layout.NoBorders (smartBorders) -import XMonad.Layout.SimplestFloat (simplestFloat) -import XMonad.Prompt (autoComplete, font, searchPredicate, XPConfig) -import XMonad.Prompt.Window (windowPromptGoto, windowPromptBringCopy) -import XMonad.Util.EZConfig (additionalKeysP) -import XMonad.Util.NamedWindows (getName) -import XMonad.Util.Run (safeSpawn) - -import XMonad.Stockholm.Shutdown - -data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show) - -instance UrgencyHook LibNotifyUrgencyHook where - urgencyHook LibNotifyUrgencyHook w = do - name <- getName w - Just idx <- fmap (W.findTag w) $ gets windowset - - safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx] - -myTerm :: FilePath -myTerm = "${pkgs.rxvt_unicode_with-plugins}/bin/urxvtc" - -myFont :: String -myFont = "${config.lass.fonts.regular}" - -main :: IO () -main = getArgs >>= \case - ["--shutdown"] -> sendShutdownEvent - _ -> main' - -main' :: IO () -main' = do - xmonad $ ewmh - $ withUrgencyHook LibNotifyUrgencyHook - $ def - { terminal = myTerm - , modMask = mod4Mask - , layoutHook = smartBorders $ myLayoutHook - , manageHook = placeHook (smart (1,0)) <+> floatNextHook <+> floatHooks - , startupHook = - whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK")) - (\path -> forkFile path [] Nothing) - , normalBorderColor = "#1c1c1c" - , focusedBorderColor = "#ff0000" - , handleEventHook = handleShutdownEvent - , workspaces = [ "dashboard", "sys", "wp" ] - } `additionalKeysP` myKeyMap - -myLayoutHook = defLayout - where - defLayout = minimize $ ((avoidStruts $ Tall 1 (3/100) (1/2) ||| Full ||| Mirror (Tall 1 (3/100) (1/2))) ||| FixedColumn 2 80 80 1 ||| simplestFloat) - -floatHooks :: Query (Endo WindowSet) -floatHooks = composeAll . concat $ - [ [ title =? t --> doFloat | t <- myTitleFloats] - , [ className =? c --> doFloat | c <- myClassFloats ] ] - where - myTitleFloats = [] - myClassFloats = ["Pinentry"] -- for gpg passphrase entry - - -myKeyMap :: [([Char], X ())] -myKeyMap = - [ ("M4-", spawn "${config.lass.screenlock.command}") - , ("M4-C-p", spawn "${pkgs.scrot}/bin/scrot ~/public_html/scrot.png") - , ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type") - , ("M4-o", spawn "${pkgs.brain}/bin/brainmenu --type") - , ("M4-i", spawn "${pkgs.dpass}/bin/dpassmenu --type") - - , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle") - , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%") - , ("", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%") - , ("", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -time 0 -dec 1%") - , ("", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -time 0 -inc 1") - , ("", gridselectWorkspace gridConfig W.view) - , ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill") - - , ("M4-a", focusUrgent) - , ("M4-S-r", renameWorkspace myXPConfig) - , ("M4-S-a", addWorkspacePrompt myXPConfig) - , ("M4-S-", removeEmptyWorkspace) - , ("M4-S-c", kill1) - , ("M4-", toggleWS) - , ("M4-S-", spawn myTerm) - , ("M4-x", floatNext True >> spawn myTerm) - , ("M4-c", floatNext True >> spawn "${pkgs.termite}/bin/termite") - , ("M4-f", floatNext True) - , ("M4-b", sendMessage ToggleStruts) - - , ("M4-v", withWorkspace autoXPConfig (windows . W.greedyView)) - , ("M4-S-v", withWorkspace autoXPConfig (windows . W.shift)) - , ("M4-C-v", withWorkspace autoXPConfig (windows . copy)) - - , ("M4-m", withFocused minimizeWindow) - , ("M4-S-m", sendMessage RestoreNextMinimizedWin) - - , ("M4-q", windowPromptGoto infixAutoXPConfig) - , ("M4-C-q", windowPromptBringCopy infixAutoXPConfig) - - , ("M4-S-q", return ()) - - , ("M4-d", floatNext True >> spawn "${pkgs.copyq}/bin/copyq show") - - , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 1") - , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 10") - , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 33") - , ("M4-", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 100") - - , ("", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter") - ] - -forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () -forkFile path args env = - xfork (executeFile path False args env) >> return () - -myXPConfig :: XPConfig -myXPConfig = def - { font = myFont - } - -autoXPConfig :: XPConfig -autoXPConfig = myXPConfig - { autoComplete = Just 5000 - } - -infixAutoXPConfig :: XPConfig -infixAutoXPConfig = autoXPConfig - { searchPredicate = isInfixOf - } - -gridConfig :: GSConfig WorkspaceId -gridConfig = def - { gs_cellwidth = 100 - , gs_cellheight = 30 - , gs_cellpadding = 2 - , gs_navigate = navNSearch - , gs_font = myFont - } - ''; - }; -} -- cgit v1.2.3 From 7eb71976f102eb616dc1ab07283acdbdf519ea90 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 3 Mar 2018 18:28:05 +0100 Subject: l: add xephyrify --- lass/5pkgs/xephyrify/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lass/5pkgs/xephyrify/default.nix (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix new file mode 100644 index 000000000..cd918af37 --- /dev/null +++ b/lass/5pkgs/xephyrify/default.nix @@ -0,0 +1,9 @@ +{ writeDashBin, coreutils, xorg, virtualgl, ... }: + +writeDashBin "xephyrify" '' + NDISPLAY=:$(${coreutils}/bin/shuf -i 100-65536 -n 1) + ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable $NDISPLAY & + XEPHYR_PID=$! + DISPLAY=$NDISPLAY ${virtualgl}/bin/vglrun "$@" + kill $XEPHYR_PID +'' -- cgit v1.2.3 From 02f67eed443ba552d775d1a0ab7860d439f7552b Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 6 Mar 2018 21:30:05 +0100 Subject: l xephyrify: add minimal xmonad --- lass/5pkgs/xephyrify/default.nix | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix index cd918af37..8b18ea949 100644 --- a/lass/5pkgs/xephyrify/default.nix +++ b/lass/5pkgs/xephyrify/default.nix @@ -1,9 +1,42 @@ -{ writeDashBin, coreutils, xorg, virtualgl, ... }: +{ writeDashBin, writeHaskell, coreutils, xorg, virtualgl, ... }: -writeDashBin "xephyrify" '' +let + + minimalXmonad = writeHaskell "minimalXmonad" { + executables.xmonad = { + extra-depends = [ + "containers" + "xmonad" + ]; + text = /* haskell */ '' + module Main where + import XMonad + import qualified Data.Map as Map + + main :: IO () + main = do + xmonad def + { workspaces = [ "1" ] + , layoutHook = myLayoutHook + , keys = myKeys + , normalBorderColor = "#000000" + , focusedBorderColor = "#000000" + } + + myLayoutHook = Full + myKeys _ = Map.fromList [] + ''; + }; + }; + +in writeDashBin "xephyrify" '' NDISPLAY=:$(${coreutils}/bin/shuf -i 100-65536 -n 1) + echo "using DISPLAY $NDISPLAY" ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable $NDISPLAY & XEPHYR_PID=$! + DISPLAY=$NDISPLAY ${minimalXmonad}/bin/xmonad & + XMONAD_PID=$! DISPLAY=$NDISPLAY ${virtualgl}/bin/vglrun "$@" + kill $XMONAD_PID kill $XEPHYR_PID '' -- cgit v1.2.3 From 9c1e215dd500458d37832f234ecb33f455ed4c64 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 28 Mar 2018 21:08:35 +0200 Subject: l xephyrify: handle resize --- lass/5pkgs/xephyrify/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix index 8b18ea949..f1711891c 100644 --- a/lass/5pkgs/xephyrify/default.nix +++ b/lass/5pkgs/xephyrify/default.nix @@ -2,15 +2,18 @@ let - minimalXmonad = writeHaskell "minimalXmonad" { + xephyrify-xmonad = writeHaskell "xephyrify-xmonad" { executables.xmonad = { extra-depends = [ "containers" + "unix" "xmonad" ]; text = /* haskell */ '' module Main where import XMonad + import Data.Monoid + import System.Posix.Process (executeFile) import qualified Data.Map as Map main :: IO () @@ -21,8 +24,18 @@ let , keys = myKeys , normalBorderColor = "#000000" , focusedBorderColor = "#000000" + , handleEventHook = myEventHook } + myEventHook :: Event -> X All + + myEventHook (ConfigureEvent { ev_event_type = 22 }) = do + spawn "${xorg.xrandr}/bin/xrandr >/dev/null 2>&1" + return (All True) + + myEventHook _ = do + return (All True) + myLayoutHook = Full myKeys _ = Map.fromList [] ''; -- cgit v1.2.3 From 28e1b8d3a51e2405ecc60b04e321f1f7dba364ad Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 28 Mar 2018 21:11:51 +0200 Subject: l xephyrify: change ownership of socket if wanted --- lass/5pkgs/xephyrify/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix index f1711891c..8d6036843 100644 --- a/lass/5pkgs/xephyrify/default.nix +++ b/lass/5pkgs/xephyrify/default.nix @@ -43,13 +43,20 @@ let }; in writeDashBin "xephyrify" '' - NDISPLAY=:$(${coreutils}/bin/shuf -i 100-65536 -n 1) + NDISPLAY=''${NDISPLAY:-$(${coreutils}/bin/shuf -i 100-65536 -n 1)} echo "using DISPLAY $NDISPLAY" - ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable $NDISPLAY & + ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable -dpi 60 -nolisten local :$NDISPLAY & + if test -n $DROP_TO_USER; then + sleep 1 + ls /tmp/.X11-unix/ + id + ${coreutils}/bin/chgrp "$DROP_TO_USER" "/tmp/.X11-unix/X$NDISPLAY" + ${coreutils}/bin/chmod 770 "/tmp/.X11-unix/X$NDISPLAY" + fi XEPHYR_PID=$! - DISPLAY=$NDISPLAY ${minimalXmonad}/bin/xmonad & + DISPLAY=:$NDISPLAY ${xephyrify-xmonad}/bin/xmonad & XMONAD_PID=$! - DISPLAY=$NDISPLAY ${virtualgl}/bin/vglrun "$@" + DISPLAY=:$NDISPLAY ${virtualgl}/bin/vglrun "$@" kill $XMONAD_PID kill $XEPHYR_PID '' -- cgit v1.2.3