mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
Compare commits
10 commits
09d5f8e0c8
...
b8f78260b3
| Author | SHA1 | Date | |
|---|---|---|---|
| b8f78260b3 | |||
| 60bfd4f5c9 | |||
| d3489e5730 | |||
| 112439418c | |||
| 58e39ea0a6 | |||
| e7c50da45f | |||
| 3e603eb1e0 | |||
| 33aa3065c3 | |||
| 9b1399e0e6 | |||
| 587b4a4e20 |
5 changed files with 72 additions and 71 deletions
|
|
@ -125,7 +125,7 @@ in
|
||||||
|
|
||||||
(sources.agenix + "/modules/age.nix")
|
(sources.agenix + "/modules/age.nix")
|
||||||
|
|
||||||
(import sources.url-eater).nixosModules.default
|
sources.url-eater.asFlake.nixosModules.default
|
||||||
|
|
||||||
(sources.nixos-hardware + "/framework/13-inch/7040-amd")
|
(sources.nixos-hardware + "/framework/13-inch/7040-amd")
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ in
|
||||||
# Extern modules
|
# Extern modules
|
||||||
#
|
#
|
||||||
(sources.agenix + "/modules/age-home.nix")
|
(sources.agenix + "/modules/age-home.nix")
|
||||||
(import sources.wired-notify).homeManagerModules.default
|
sources.wired-notify.asFlake.homeManagerModules.default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,8 @@ config =
|
||||||
|
|
||||||
, commands =
|
, commands =
|
||||||
[ Run $ DateZone "%a %d %H:%M:%S" "" "" "hereClock" (1 &second)
|
[ Run $ DateZone "%a %d %H:%M:%S" "" "" "hereClock" (1 &second)
|
||||||
, Run $ DateZone "%H:%M" "" "America/Aruba" "arubaClock" (10 &second)
|
|
||||||
, Run $ DateZone "%H:%M" "" "Europe/Dublin" "dublinClock" (10 &second)
|
, Run $ DateZone "%H:%M" "" "Europe/Dublin" "dublinClock" (10 &second)
|
||||||
, Run $ DateZone "%H:%M" "" "America/New_York" "newYorkClock" (10 &second)
|
, Run $ DateZone "%H:%M" "" "Europe/Paris" "parisClock" (10 &second)
|
||||||
, Run $ DateZone "%H:%M" "" "Europe/Paris" "cetClock" (10 &second)
|
|
||||||
, Run $ DateZone "%H:%M" "" "Asia/Taipei" "tstClock" (10 &second)
|
, Run $ DateZone "%H:%M" "" "Asia/Taipei" "tstClock" (10 &second)
|
||||||
, Run $
|
, Run $
|
||||||
Com
|
Com
|
||||||
|
|
@ -76,8 +74,7 @@ config =
|
||||||
, "--target", "2025-09-16=snip snip"
|
, "--target", "2025-09-16=snip snip"
|
||||||
, "--target", "2025-10-13=no teef"
|
, "--target", "2025-10-13=no teef"
|
||||||
, "--target", "2025-10-31=dragon book"
|
, "--target", "2025-10-31=dragon book"
|
||||||
, "--target", "2025-11-21=scalpel"
|
, "--target", "2025-11-19=scalpel"
|
||||||
, "--target", "2025-11-21=baguette"
|
|
||||||
, "--target", "2025-11-29=à deux"
|
, "--target", "2025-11-29=à deux"
|
||||||
, "--target", "2025-12-16=dragon book"
|
, "--target", "2025-12-16=dragon book"
|
||||||
, "--target", "2025-12-30=seule"
|
, "--target", "2025-12-30=seule"
|
||||||
|
|
@ -125,10 +122,8 @@ config =
|
||||||
<> alignSep config
|
<> alignSep config
|
||||||
<> intercalate "|"
|
<> intercalate "|"
|
||||||
[ (unwords . map greyFg)
|
[ (unwords . map greyFg)
|
||||||
[ "[AUA: %arubaClock%]"
|
[ "[DUB: %dublinClock%]"
|
||||||
, "[DUB: %dublinClock%]"
|
, "[CDG: %parisClock%]"
|
||||||
, "[JFK: %newYorkClock%]"
|
|
||||||
, "[CDG: %cetClock%]"
|
|
||||||
, "[TPE: %tstClock%]"
|
, "[TPE: %tstClock%]"
|
||||||
]
|
]
|
||||||
<> " "
|
<> " "
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ library
|
||||||
hs-source-dirs: lib
|
hs-source-dirs: lib
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
XMonad.Layout.Reflect.Message
|
XMonad.Layout.Reflect.Message
|
||||||
XMonad.Layout.ResizableTile.FixDescription
|
|
||||||
Data.Char.Greek
|
Data.Char.Greek
|
||||||
|
|
||||||
executable leanamonad
|
executable leanamonad
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
|
|
||||||
|
|
||||||
module XMonad.Layout.ResizableTile.FixDescription
|
|
||||||
( RTFixDescription(..)
|
|
||||||
) where
|
|
||||||
|
|
||||||
import XMonad
|
|
||||||
import qualified XMonad.StackSet as W
|
|
||||||
import XMonad.Layout.ResizableTile
|
|
||||||
|
|
||||||
newtype RTFixDescription a = RTFixDescription { unwrapRT :: ResizableTall a }
|
|
||||||
deriving (Read, Show)
|
|
||||||
|
|
||||||
instance LayoutClass RTFixDescription a where
|
|
||||||
runLayout (W.Workspace t l s) =
|
|
||||||
let ws' = W.Workspace t (unwrapRT l) s
|
|
||||||
in (fmap . fmap . fmap) RTFixDescription . runLayout ws'
|
|
||||||
|
|
||||||
handleMessage (RTFixDescription l) =
|
|
||||||
(fmap . fmap) RTFixDescription . handleMessage l
|
|
||||||
|
|
||||||
description (RTFixDescription l) =
|
|
||||||
description l <> " " <> show (_nmaster l)
|
|
||||||
|
|
@ -13,12 +13,12 @@ import XMonad.Hooks.ManageHelpers
|
||||||
import XMonad.Hooks.OnPropertyChange
|
import XMonad.Hooks.OnPropertyChange
|
||||||
import XMonad.Hooks.RefocusLast
|
import XMonad.Hooks.RefocusLast
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
|
import XMonad.Layout.FocusTracking
|
||||||
import XMonad.Layout.NoBorders
|
import XMonad.Layout.NoBorders
|
||||||
import XMonad.Layout.Reflect
|
import XMonad.Layout.Reflect
|
||||||
import XMonad.Layout.Reflect.Message
|
import XMonad.Layout.Reflect.Message
|
||||||
import XMonad.Layout.Renamed
|
import XMonad.Layout.Renamed
|
||||||
import XMonad.Layout.ResizableTile
|
import XMonad.Layout.ResizableTile
|
||||||
import XMonad.Layout.ResizableTile.FixDescription
|
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
|
|
@ -27,7 +27,9 @@ import XMonad.Util.NamedScratchpad
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.SpawnOnce
|
||||||
import XMonad.Layout.Magnifier
|
import XMonad.Layout.Magnifier
|
||||||
|
|
||||||
|
import Data.Function
|
||||||
import Data.Char.Greek
|
import Data.Char.Greek
|
||||||
|
import Data.Ratio
|
||||||
import Data.Semigroup
|
import Data.Semigroup
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import System.Posix
|
import System.Posix
|
||||||
|
|
@ -38,10 +40,10 @@ main =
|
||||||
xmonad
|
xmonad
|
||||||
-- Fix all java things that don't scale with XMonad
|
-- Fix all java things that don't scale with XMonad
|
||||||
-- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing
|
-- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing
|
||||||
. javaHack
|
$ javaHack
|
||||||
. withSB xmobarConfig . docks
|
$ withSB xmobarConfig . docks
|
||||||
. setEwmhActivateHook myActivateHook
|
$ setEwmhActivateHook myActivateHook
|
||||||
. ewmhFullscreen . ewmh
|
$ ewmhFullscreen . ewmh
|
||||||
$ def
|
$ def
|
||||||
{ modMask = superMask
|
{ modMask = superMask
|
||||||
, borderWidth = 5
|
, borderWidth = 5
|
||||||
|
|
@ -62,14 +64,14 @@ main =
|
||||||
`additionalKeys` keybinds
|
`additionalKeys` keybinds
|
||||||
|
|
||||||
myLayout =
|
myLayout =
|
||||||
let tallr = renamed [ KeepWordsRight 2 ] {- keep "ResizableTall n" -}
|
let tallr = renamed [ Replace "Tall" ]
|
||||||
$ smartSpacingWithEdge 5
|
$ smartSpacingWithEdge 5
|
||||||
$ reflectMsg . reflectHoriz
|
$ reflectMsg . reflectHoriz
|
||||||
$ RTFixDescription
|
|
||||||
$ ResizableTall 1 (1/10) (3/7) []
|
$ ResizableTall 1 (1/10) (3/7) []
|
||||||
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
||||||
in avoidStruts . smartBorders $
|
in avoidStruts
|
||||||
mag tallr ||| Full
|
$ smartBorders
|
||||||
|
$ mag tallr ||| focusTracking Full
|
||||||
|
|
||||||
isSioyek :: Query Bool
|
isSioyek :: Query Bool
|
||||||
isSioyek = className =? "sioyek"
|
isSioyek = className =? "sioyek"
|
||||||
|
|
@ -148,27 +150,35 @@ myManageHook =
|
||||||
]
|
]
|
||||||
<> namedScratchpadManageHook myScratchpads
|
<> namedScratchpadManageHook myScratchpads
|
||||||
|
|
||||||
|
-- TODO: is there a way to always open certain sites in new windows in firefox?
|
||||||
|
-- TODO: stop full screen when move happens
|
||||||
myEventHandleHook :: Event -> X All
|
myEventHandleHook :: Event -> X All
|
||||||
myEventHandleHook =
|
myEventHandleHook =
|
||||||
-- TODO: is there a way to always open certain sites in new windows in firefox?
|
-- If the title changes in the background, we don't want to greedy view that workspace.
|
||||||
onTitleChange $ composeAll
|
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
||||||
[ isSpotify --> doShiftAndViewIfMoved multimediaWS
|
-- We prevent this by checking if the window is in the current workspace
|
||||||
, isYouTube --> doShiftAndViewIfMoved multimediaWS
|
onTitleChange
|
||||||
, isDiscord --> doShiftAndViewIfMoved chatWS
|
$ (windowIsInCurrentWorkspace -->)
|
||||||
, isWhatsApp --> doShiftAndViewIfMoved chatWS
|
$ composeAll
|
||||||
, isElement --> doShiftAndViewIfMoved chatWS
|
[ isSpotify --> doShiftAndGreedyView multimediaWS
|
||||||
|
, isYouTube --> doShiftAndGreedyView multimediaWS
|
||||||
|
, isDiscord --> doShiftAndGreedyView chatWS
|
||||||
|
, isWhatsApp --> doShiftAndGreedyView chatWS
|
||||||
|
, isElement --> doShiftAndGreedyView chatWS
|
||||||
]
|
]
|
||||||
|
|
||||||
-- If the title changes in the background, we don't want to greedy view that workspace.
|
doShiftAndGreedyView :: WorkspaceId -> Query (Endo WindowSet)
|
||||||
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
doShiftAndGreedyView n = doF . go =<< ask
|
||||||
-- We prevent this by checking if the window is already there.
|
where go :: Window -> WindowSet -> WindowSet
|
||||||
doShiftAndViewIfMoved :: WorkspaceId -> Query (Endo WindowSet)
|
go w s = W.greedyView n $ W.shiftWin n w s
|
||||||
doShiftAndViewIfMoved n = doF . shiftAndViewIfMoved n =<< ask
|
|
||||||
|
|
||||||
shiftAndViewIfMoved :: WorkspaceId -> Window -> WindowSet -> WindowSet
|
hasProp :: (Window -> WindowSet -> Bool) -> Query Bool
|
||||||
shiftAndViewIfMoved n w s = case W.findTag w s of
|
hasProp f = f <$> ask <*> (liftX $ gets windowset)
|
||||||
Just from | n `W.tagMember` s && n /= from -> W.greedyView n $ W.shiftWin n w s
|
|
||||||
_ -> s
|
windowIsInCurrentWorkspace :: Query Bool
|
||||||
|
windowIsInCurrentWorkspace = hasProp $ \w s -> case W.findTag w s of
|
||||||
|
Just from | from == W.currentTag s -> True
|
||||||
|
_ -> False
|
||||||
|
|
||||||
myStartupHook :: X ()
|
myStartupHook :: X ()
|
||||||
myStartupHook = do
|
myStartupHook = do
|
||||||
|
|
@ -315,21 +325,41 @@ chatWS :: WorkspaceId
|
||||||
chatWS = myWorkspaces !! 3
|
chatWS = myWorkspaces !! 3
|
||||||
|
|
||||||
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
|
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
|
||||||
centeredFloat = W.RationalRect (1/9) (1/9) (7/9) (7/9)
|
centeredFloat = W.RationalRect (1%9) (1%9) (7%9) (7%9)
|
||||||
smallFloat = W.RationalRect (3/5) (3/5) (2/7) (2/7)
|
smallFloat = W.RationalRect (3%5) (3%5) (2%7) (2%7)
|
||||||
fullFloat = W.RationalRect 0 0 1 1
|
fullFloat = W.RationalRect 0 0 1 1
|
||||||
buttomRightFloat = W.RationalRect (1/2) (1/2) (1/2) (1/2)
|
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
||||||
|
|
||||||
xmobarConfig :: StatusBarConfig
|
xmobarConfig :: StatusBarConfig
|
||||||
xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
|
xmobarConfig = statusBarProp "xmobar -x 0" myPrettyPrinter
|
||||||
where
|
where
|
||||||
myPrettyPrinter =
|
mkPpCurrent :: X (String -> String)
|
||||||
filterOutWsPP [scratchpadWorkspaceTag]
|
mkPpCurrent = do
|
||||||
$ def
|
windowCount <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper
|
pure $ \wid ->
|
||||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
wid <> (if windowCount > 1 then ":" <> show windowCount else mempty)
|
||||||
, ppSep = " | "
|
& xmobarColor "#000000" "#ffffff" . wrap " " " "
|
||||||
}
|
|
||||||
|
mkPpHidden :: X (String -> String)
|
||||||
|
mkPpHidden = do
|
||||||
|
m <- gets $ M.fromList . map (\x -> (W.tag x, length . W.integrate' . W.stack $ x)) . W.hidden . windowset
|
||||||
|
pure $ \wid ->
|
||||||
|
let windowCount = m M.! wid
|
||||||
|
in wid <> (if windowCount > 1 then ":" <> show windowCount else mempty)
|
||||||
|
& xmobarColor "#ffffff" ""
|
||||||
|
|
||||||
|
myPrettyPrinter :: X PP
|
||||||
|
myPrettyPrinter = do
|
||||||
|
myPpCurrent <- mkPpCurrent
|
||||||
|
myPpHidden <- mkPpHidden
|
||||||
|
pure
|
||||||
|
$ filterOutWsPP [scratchpadWorkspaceTag]
|
||||||
|
$ def
|
||||||
|
{ ppCurrent = myPpCurrent
|
||||||
|
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||||
|
, ppHidden = myPpHidden
|
||||||
|
, ppSep = " | "
|
||||||
|
}
|
||||||
|
|
||||||
myScratchpads :: [NamedScratchpad]
|
myScratchpads :: [NamedScratchpad]
|
||||||
myScratchpads =
|
myScratchpads =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue