summaryrefslogtreecommitdiffstats
path: root/pkgs/haskell/xmonad-tv/src/main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/haskell/xmonad-tv/src/main.hs')
-rw-r--r--pkgs/haskell/xmonad-tv/src/main.hs29
1 files changed, 10 insertions, 19 deletions
diff --git a/pkgs/haskell/xmonad-tv/src/main.hs b/pkgs/haskell/xmonad-tv/src/main.hs
index 1878d8e..e3090a3 100644
--- a/pkgs/haskell/xmonad-tv/src/main.hs
+++ b/pkgs/haskell/xmonad-tv/src/main.hs
@@ -20,15 +20,13 @@ import XMonad.Extra (isFloatingX)
import System.IO (hPutStrLn, stderr)
import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv)
import System.Posix.Process (executeFile)
-import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
- , removeEmptyWorkspace)
+import XMonad.Actions.DynamicWorkspaces (removeEmptyWorkspace)
import XMonad.Actions.CycleWS (toggleWS)
import XMonad.Layout.Gaps (Direction2D(U,R,D,L), gaps)
import XMonad.Layout.NoBorders ( smartBorders )
import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall))
import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink))
import XMonad.Layout.StateFull (pattern StateFull)
-import qualified XMonad.Prompt
import qualified XMonad.StackSet as W
import Data.Map (Map)
import qualified Data.Map as Map
@@ -72,11 +70,10 @@ readEnv' defaultValue name =
mainNoArgs :: IO ()
mainNoArgs = do
+ myMasterDelta <- readEnv' (1 / 20) "XMONAD_MASTER_DELTA" :: IO Rational
+ myMasterWidth <- readEnv' (1 / 2) "XMONAD_MASTER_WIDTH" :: IO Rational
myScreenGaps <- readEnv' [] "XMONAD_SCREEN_GAPS" :: IO [Int]
myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension
- myTermFont <- getEnv "XMONAD_TERM_FONT"
- myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension
- myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension
handleShutdownEvent <- newShutdownEventHandler
config <-
ewmhExtra
@@ -93,15 +90,15 @@ mainNoArgs = do
{ terminal = {-pkg:alacritty-tv-}"alacritty"
, clientMask = clientMask def .|. focusChangeMask
, modMask = mod4Mask
- , keys = myKeys myTermFont
+ , keys = myKeys
, layoutHook =
refocusLastLayoutHook $
gaps (zip [U,R,D,L] myScreenGaps) $
smartBorders $
ResizableTall
1
- (fromIntegral (10 * myTermFontWidth) / fromIntegral myScreenWidth)
- (fromIntegral (80 * myTermFontWidth + 2 * (myTermPadding + borderWidth def)) / fromIntegral myScreenWidth)
+ myMasterDelta
+ (myMasterWidth + 2 * fromIntegral (borderWidth def) / fromIntegral myScreenWidth)
[]
|||
StateFull
@@ -148,8 +145,8 @@ spawnRootTerm =
Nothing
-myKeys :: String -> XConfig Layout -> Map (KeyMask, KeySym) (X ())
-myKeys font conf = Map.fromList $
+myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
+myKeys conf = Map.fromList $
[ ((_4 , xK_Escape ), forkFile {-pkg-}"slock" [] Nothing)
, ((_4S , xK_c ), kill)
@@ -185,8 +182,6 @@ myKeys font conf = Map.fromList $
, ((_4 , xK_comma ), sendMessage $ IncMasterN 1)
, ((_4 , xK_period ), sendMessage $ IncMasterN (-1))
- , ((_4 , xK_a ), addWorkspacePrompt promptXPConfig)
- , ((_4 , xK_r ), renameWorkspace promptXPConfig)
, ((_4 , xK_Delete ), removeEmptyWorkspace)
, ((_4 , xK_Return ), toggleWS)
@@ -215,7 +210,7 @@ myKeys font conf = Map.fromList $
_4CM = _4 .|. _C .|. _M
_4SM = _4 .|. _S .|. _M
- amixer args = forkFile {-pkg:alsaUtils-}"amixer" args Nothing
+ amixer args = forkFile {-pkg:alsa-utils-}"amixer" args Nothing
pavucontrol args = forkFile {-pkg-}"pavucontrol" args Nothing
audioLowerVolume = amixer ["-q", "sset", "Master", "5%-"]
@@ -225,14 +220,10 @@ myKeys font conf = Map.fromList $
resetLayout = setLayout $ XMonad.layoutHook conf
- promptXPConfig =
- def { XMonad.Prompt.font = font }
-
xdeny =
forkFile
{-pkg-}"xterm"
- [ "-fn", font
- , "-geometry", "300x100"
+ [ "-geometry", "300x100"
, "-name", "AlertFloat"
, "-bg", "#E4002B"
, "-e", "sleep", "0.05"