This commit is contained in:
elkowar 2020-12-25 11:53:37 +01:00
parent 637af563bf
commit f9677f940e
19 changed files with 252 additions and 39 deletions

View file

@ -1,4 +1,4 @@
{ {
"optOut": false, "optOut": false,
"lastUpdateCheck": 1605901143177 "lastUpdateCheck": 1607799387166
} }

View file

@ -74,3 +74,14 @@ scale trough {
background-color: #8ec07c; background-color: #8ec07c;
} }
} }
.this {
border: 10px solid blue;
}
.shit {
border: 10px solid green;
}
.fuck {
border-radius: 100px;
}

View file

@ -2,7 +2,7 @@
<definitions> <definitions>
<def name="test"> <def name="test">
<box space-evenly="false" spacing="10"> <box class="{{some_var}}" space-evenly="false" spacing="10">
testing {{shit}} testing {{shit}}
<scale value="50" orientation="v" min="0" max="100" flipped="true" /> <scale value="50" orientation="v" min="0" max="100" flipped="true" />
@ -34,7 +34,7 @@
</def> </def>
<def name="music"> <def name="music">
<box orientation="h" valign="start" space-evenly="false" hexpand="true"> <box class="hi ho" orientation="h" valign="start" space-evenly="false" hexpand="true">
<image visible="{{song-image-visible}}" path="{{song-image}}" width="150" height="150" /> <image visible="{{song-image-visible}}" path="{{song-image}}" width="150" height="150" />
<box orientation="v" halign="fill" space-evenly="false" vexpand="true" hexpand="true"> <box orientation="v" halign="fill" space-evenly="false" vexpand="true" hexpand="true">
<box class="data" vexpand="true"> <box class="data" vexpand="true">
@ -73,6 +73,7 @@
<var name="shit"> <var name="shit">
shit shit
</var> </var>
<var name="some_var"></var>
<var name="song-image"></var> <var name="song-image"></var>
<var name="song-image-visible">true</var> <var name="song-image-visible">true</var>

View file

@ -17,7 +17,7 @@ corner-radius = 0;
# Shadows -------------------------------- {{{ # Shadows -------------------------------- {{{
shadow = false; shadow = true;
#shadow-radius = 20; #shadow-radius = 20;
#shadow-offset-x = -20; #shadow-offset-x = -20;
#shadow-offset-y = -20; #shadow-offset-y = -20;
@ -38,7 +38,7 @@ shadow-opacity = 0.5;
shadow-exclude = [ shadow-exclude = [
"name = 'GLava'", "name = 'GLava'",
"! name~=''", "! name~=''",
#"!focused && ! class_g ?='xfce4-notifyd'", "!focused && ! class_g ?='xfce4-notifyd'",
#"name *= 'polybar'", #"name *= 'polybar'",
"name = 'Notification'", "name = 'Notification'",
"name = 'Plank'", "name = 'Plank'",

View file

@ -28,7 +28,9 @@ SINK_BLACKLIST=(
# Maps PulseAudio sink names to human-readable names # Maps PulseAudio sink names to human-readable names
declare -A SINK_NICKNAMES declare -A SINK_NICKNAMES
SINK_NICKNAMES["alsa_output.usb-Native_Instruments_Komplete_Audio_6_77316682-00.analog-surround-21"]="📢" SINK_NICKNAMES["alsa_output.usb-Native_Instruments_Komplete_Audio_6_77316682-00.analog-surround-21"]="📢"
SINK_NICKNAMES["alsa_output.usb-Fujitsu_UC_C_USB_Value_Headset_Fujitsu_UC_C_USB_Value_Headset-00.analog-stereo"]="🎧" SINK_NICKNAMES["alsa_output.usb-Fujitsu_UC_C_USB_Value_Headset_Fujitsu_UC_C_USB_Value_Headset-00.analog-stereo"]="F🎧"
SINK_NICKNAMES["alsa_output.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.analog-stereo"]="🎧"
# Environment & global constants for the script # Environment & global constants for the script

View file

@ -21,9 +21,11 @@ format_workspaces() {
if [ "$MONITOR" = "HDMI-A-0" ]; then if [ "$MONITOR" = "HDMI-A-0" ]; then
tail -F /tmp/xmonad-state-bar1 | stdbuf -o0 cat | format_workspaces tail -F /tmp/xmonad-state-bar2 | stdbuf -o0 cat | format_workspaces
else elif [ "$MONITOR" = "DisplayPort-1" ]; then
tail -F /tmp/xmonad-state-bar0 | stdbuf -o0 cat | format_workspaces tail -F /tmp/xmonad-state-bar0 | stdbuf -o0 cat | format_workspaces
else
tail -F /tmp/xmonad-state-bar1 | stdbuf -o0 cat | format_workspaces
fi fi
#while true; do #while true; do

View file

@ -18,7 +18,6 @@ import Data.List ( isPrefixOf
) )
import qualified Data.List import qualified Data.List
import System.Exit (exitSuccess) import System.Exit (exitSuccess)
import qualified XMonad.Util.ExtensibleState as XS
import qualified Data.Char import qualified Data.Char
import qualified Rofi import qualified Rofi
import qualified DescribedSubmap import qualified DescribedSubmap
@ -73,6 +72,7 @@ import XMonad.Util.EZConfig ( additionalKeysP
, checkKeymap , checkKeymap
) )
import XMonad.Util.NamedScratchpad import XMonad.Util.NamedScratchpad
import XMonad.Util.Run import XMonad.Util.Run
import XMonad.Util.SpawnOnce (spawnOnce) import XMonad.Util.SpawnOnce (spawnOnce)
@ -110,12 +110,8 @@ import qualified Data.List.NonEmpty
myModMask = mod4Mask myModMask = mod4Mask
myLauncher = Rofi.asCommand def ["-show run"] myLauncher = Rofi.asCommand def ["-show run"]
--myTerminal = "termite --name törminell" myTerminal = "alacritty"
--myTerminal = "alacritty"
myTerminal = "st"
myBrowser = "qutebrowser"
useSharedWorkspaces = False useSharedWorkspaces = False
--myBrowser = "google-chrome-stable"
{-| adds the scripts-directory path to the filename of a script |-} {-| adds the scripts-directory path to the filename of a script |-}
scriptFile :: String -> String scriptFile :: String -> String
@ -139,20 +135,8 @@ scratchpads =
-- }}} -- }}}
-- Colors ------ {{{ -- Colors ------ {{{
fg = "#ebdbb2"
bg = "#282828"
gray = "#888974" gray = "#888974"
bg1 = "#3c3836"
bg2 = "#504945"
bg3 = "#665c54"
bg4 = "#7c6f64"
green = "#b8bb26"
darkgreen = "#98971a"
red = "#fb4934" red = "#fb4934"
darkred = "#cc241d"
yellow = "#fabd2f"
blue = "#83a598"
purple = "#d3869b" purple = "#d3869b"
aqua = "#8ec07c" aqua = "#8ec07c"
-- }}} -- }}}
@ -236,9 +220,10 @@ myStartupHook = do
--spawnOnce "nm-applet &" --spawnOnce "nm-applet &"
--spawnOnce "udiskie -s &" -- Mount USB sticks automatically. -s is smart systray mode: systray icon if something is mounted --spawnOnce "udiskie -s &" -- Mount USB sticks automatically. -s is smart systray mode: systray icon if something is mounted
spawnOnce "xfce4-clipman &" spawnOnce "xfce4-clipman &"
spawnOnce "redshift -P -O 5000 &" --spawnOnce "redshift -P -O 5000 &"
spawn "xset r rate 300 50 &" -- make key repeat quicker spawn "xset r rate 300 50 &" -- make key repeat quicker
spawn "/home/leon/.screenlayout/dualscreen-stacked.sh" --spawn "/home/leon/.screenlayout/dualscreen-stacked.sh"
spawn "/home/leon/.screenlayout/tripplescreen.sh"
spawnOnce "xsetroot -cursor_name left_ptr" spawnOnce "xsetroot -cursor_name left_ptr"
spawnOnce "xrdb -merge ~/.Xresources" spawnOnce "xrdb -merge ~/.Xresources"
io $ threadDelay $ 1000 * 100 io $ threadDelay $ 1000 * 100
@ -323,9 +308,11 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program
multiMonitorBindings :: [(String, X ())] multiMonitorBindings :: [(String, X ())]
multiMonitorBindings = multiMonitorBindings =
[ ("M-s", multiMonitorOperation W.view 1) [ ("M-s", multiMonitorOperation W.view 2)
, ("M-a", multiMonitorOperation W.view 1)
, ("M-d", multiMonitorOperation W.view 0) , ("M-d", multiMonitorOperation W.view 0)
, ("M-S-s", (multiMonitorOperation W.shift 1) >> multiMonitorOperation W.view 1) , ("M-S-s", (multiMonitorOperation W.shift 2) >> multiMonitorOperation W.view 2)
, ("M-S-a", (multiMonitorOperation W.shift 1) >> multiMonitorOperation W.view 1)
, ("M-S-d", (multiMonitorOperation W.shift 0) >> multiMonitorOperation W.view 0) , ("M-S-d", (multiMonitorOperation W.shift 0) >> multiMonitorOperation W.view 0)
, ("M-C-s", windows swapScreenContents) , ("M-C-s", windows swapScreenContents)
] ]
@ -363,6 +350,11 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program
, ("M-S-C-c", kill1) , ("M-S-C-c", kill1)
, ("M-S-C-q", io exitSuccess) , ("M-S-C-q", io exitSuccess)
-- useless binding simply to not accidentally quit firefox
, ("C-q", pure ())
-- Binary space partitioning -- Binary space partitioning
, ("M-<Delete>", sendMessage Swap) , ("M-<Delete>", sendMessage Swap)
, ("M-M1-<Delete>", sendMessage Rotate) , ("M-M1-<Delete>", sendMessage Rotate)
@ -610,12 +602,6 @@ fullscreenFixEventHook _ = return $ All True
foo :: X ()
foo = do
x <- ask
pure ()
-- POLYBAR Kram -------------------------------------- {{{ -- POLYBAR Kram -------------------------------------- {{{
-- | Loghook for polybar on a given monitor. -- | Loghook for polybar on a given monitor.

View file

@ -0,0 +1,112 @@
module WsContexts where
import Data.List (foldl', nub)
import qualified Data.List
import Data.List.NonEmpty ((<|), NonEmpty ((:|)))
import qualified Data.List.NonEmpty as NE
import XMonad
import qualified XMonad.StackSet as W
import qualified XMonad.Util.ExtensibleState as XS
createWorkspace :: Layout Window -> WorkspaceId -> W.Workspace WorkspaceId (Layout Window) a
createWorkspace layout name =
W.Workspace
{ W.tag = name,
W.layout = layout,
W.stack = Nothing
}
addWorkspaces :: [W.Workspace i l a] -> W.StackSet i l a s sid -> W.StackSet i l a s sid
addWorkspaces new ws = foldl' (flip addNewWorkspace) ws new
where
addNewWorkspace :: W.Workspace i l a -> W.StackSet i l a s sid -> W.StackSet i l a s sid
addNewWorkspace newWorkspace stackset =
stackset
{ W.current = (W.current stackset) {W.workspace = newWorkspace},
W.hidden = W.workspace (W.current stackset) : W.hidden stackset
}
wsContextView :: WorkspaceId -> X ()
wsContextView wspId = do
(WsContext currentCtx) <- XS.gets (NE.head . contexts)
windows (W.view $ annotateWspId currentCtx wspId)
pushContext :: WsContext -> X ()
pushContext ctx = updateContexts $ \ctxState -> ctxState { contexts = ctx <| contexts ctxState }
-- TODO: working dir
newtype WsContext = WsContext String
deriving (Show, Eq)
data WsContextsState = WsContextsState
{ contexts :: NonEmpty WsContext,
stickies :: [WorkspaceId]
}
deriving (Typeable, Show)
wsContexts :: XConfig l -> XConfig l
wsContexts conf = conf {workspaces = map (annotateWspId "default") (workspaces conf)}
instance ExtensionClass WsContextsState where
initialValue =
WsContextsState
{ contexts = WsContext "default" :| [],
stickies = []
}
updateContexts :: (WsContextsState -> WsContextsState) -> X ()
updateContexts update = do
oldState <- XS.get
let newState = update oldState
if NE.head (contexts oldState) /= NE.head (contexts newState)
then applyWorkspaceContext $ NE.head (contexts oldState)
else pure ()
annotateWspId :: String -> WorkspaceId -> WorkspaceId
annotateWspId contextName wspId = wspId ++ "<" ++ contextName ++ ">"
unannotateWspId :: WorkspaceId -> (WorkspaceId, String)
unannotateWspId wspId =
let (actualId, rest) = splitWhere (== '<') wspId
in (actualId, takeWhile (/= '>') rest)
applyWorkspaceContext :: WsContext -> X ()
applyWorkspaceContext context = do
contextAlreadyOpen <- withWindowSet $ pure . any (wspMatchesContext context) . W.workspaces
if contextAlreadyOpen
then windows (switchToWorkspacesOf context)
else initializeWorkspacesFor context
initializeWorkspacesFor :: WsContext -> X ()
initializeWorkspacesFor context = do
defaultLayout <- asks (layoutHook . config)
windows $ \ws -> addWorkspaces (map (createWorkspace defaultLayout) (baseWorkspaceNames ws)) ws
windows (switchToWorkspacesOf context)
baseWorkspaceNames :: W.StackSet WorkspaceId l a s sid -> [WorkspaceId]
baseWorkspaceNames = nub . fmap (fst . unannotateWspId . W.tag) . W.workspaces
switchToWorkspacesOf :: Eq s => WsContext -> W.StackSet WorkspaceId l a s sid -> W.StackSet WorkspaceId l a s sid
switchToWorkspacesOf (WsContext context) ws =
let (currentWspName, _) = unannotateWspId $ W.currentTag ws
in W.view (annotateWspId context currentWspName) ws
wspMatchesContext :: WsContext -> W.Workspace WorkspaceId l a -> Bool
wspMatchesContext (WsContext context) wsp = (snd . unannotateWspId $ W.tag wsp) == context
findWorkspaceByTag :: (i -> Bool) -> W.StackSet i l a s sid -> Maybe (W.Workspace i l a)
findWorkspaceByTag cond = Data.List.find (cond . W.tag) . W.workspaces
splitWhere :: (a -> Bool) -> [a] -> ([a], [a])
splitWhere cond list =
( takeWhile (not . cond) list,
goodTail $ dropWhile (not . cond) list
)
goodTail :: [a] -> [a]
goodTail [] = []
goodTail (_ : xs) = xs

View file

@ -13,13 +13,14 @@ executable my-xmonad
TiledDragging TiledDragging
WindowSwallowing WindowSwallowing
FancyBorders FancyBorders
WsContexts
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wall -threaded -fno-warn-missing-signatures ghc-options: -Wall -threaded -fno-warn-missing-signatures
build-depends: build-depends:
base -any, base -any,
xmonad >=0.13, xmonad >=0.15,
xmonad-contrib >=0.13, xmonad-contrib >=0.16,
dbus >=1.2.12, dbus >=1.2.12,
iwlib >=0.1.0, iwlib >=0.1.0,
netlink >=1.1.1.0, netlink >=1.1.1.0,

View file

@ -0,0 +1 @@
fromList [("Eval: ",["pure $ show \"Hi\"","pure $ show \"Hi\"","pure $ show \"Hi\""])]

1
files/.xmonad/result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/g0342b3m9b0c8znl1s7xyibadadw0y0w-glibc-locales-2.32

View file

@ -10,4 +10,3 @@ extra-deps:
- netlink-1.1.1.0 - netlink-1.1.1.0
- dbus-1.2.12 - dbus-1.2.12
- text-1.2.4.0 - text-1.2.4.0

View file

@ -84,12 +84,19 @@ in
gitAndTools.gitflow gitAndTools.gitflow
gitAndTools.tig gitAndTools.tig
gitAndTools.gitui gitAndTools.gitui
#pakcs
rlwrap
irssi
hexchat
swiPrologWithGui
kmonad
] ]
) )
( (
lib.mkIf cfg.includeHaskellDev [ lib.mkIf cfg.includeHaskellDev [
cabal2nix cabal2nix
cabal-install cabal-install
ormolu
] ]
) )
]; ];

View file

@ -82,6 +82,7 @@ in
enable = true; enable = true;
settings.global = dunst_settings; settings.global = dunst_settings;
settings.urgency_normal = dunst_settings; settings.urgency_normal = dunst_settings;
settings.urgency_low = dunst_settings; settings.urgency_low = dunst_settings;
}; };
}; };
@ -98,6 +99,7 @@ in
"Xft.lcdfilter" = "lcddefault"; "Xft.lcdfilter" = "lcddefault";
"st.font" = "Terminus (TTF):pixelsize=16"; "st.font" = "Terminus (TTF):pixelsize=16";
"*.background" = primary.background; "*.background" = primary.background;
"*.foreground" = primary.foreground; "*.foreground" = primary.foreground;
"*.color0" = normal.black; "*.color0" = normal.black;

View file

@ -0,0 +1,70 @@
rec {
#accent = bright.cyan;
#accentDark = normal.cyan;
! black
*.color0: #0f1010
*.color8: #73665a
! red
*.color1: #cc241d
*.color9: #fb4934
! green
*.color2: #98971a
*.color10: #a7aa2e
! yellow
*.color3: #ce8b3a
*.color11: #fabd2f
! blue
*.color4: #458588
*.color12: #9f83a5
! magenta
*.color5: #b16286
*.color13: #d3869b
! cyan
*.color6: #689d6a
*.color14: #8ec07c
! white
*.color7: #a89984
*.color15: #cdbe96
#*.cursorColor: #d8c9a3
primary = {
foreground= "#d8c9a3";
background= "#0f1010";
#background= "#0f1010";
bg_darker = "#1d2021";
bg_lighter = "#3c3836";
};
normal = {
black = "#282828";
red = "#cc241d";
green = "#98971a";
yellow = "#d79921";
blue = "#458588";
magenta = "#b16286";
cyan = "#689d6a";
white = "#a89984";
};
bright = {
black = "#928374";
red = "#fb4934";
green = "#b8bb26";
yellow = "#fabd2f";
blue = "#83a598";
magenta = "#d3869b";
cyan = "#8ec07c";
white = "#ebdbb2";
};
}

View file

@ -167,6 +167,8 @@ in
#zle -N deer #zle -N deer
#bindkey '\ek' deer #bindkey '\ek' deer
source ~/.profile
${fzf-tab-stuff} ${fzf-tab-stuff}
${fixedKeybinds} ${fixedKeybinds}
${makeAbbrs cfg.abbrs} ${makeAbbrs cfg.abbrs}

View file

@ -35,6 +35,18 @@
"url": "https://github.com/Jomik/fish-gruvbox/archive/d8c0463518fb95bed8818a1e7fe5da20cffe6fbd.tar.gz", "url": "https://github.com/Jomik/fish-gruvbox/archive/d8c0463518fb95bed8818a1e7fe5da20cffe6fbd.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"kmonad": {
"branch": "master",
"description": "An advanced keyboard manager",
"homepage": null,
"owner": "david-janssen",
"repo": "kmonad",
"rev": "9ea39845c722a0b7408abdbdc6d1d829c6af1e9d",
"sha256": "1paxk2jslyx4hcyrawh6vj1bz5vq3z2bd7ag8jn2r6g6mh1bfb30",
"type": "tarball",
"url": "https://github.com/david-janssen/kmonad/archive/9ea39845c722a0b7408abdbdc6d1d829c6af1e9d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"manix": { "manix": {
"branch": "master", "branch": "master",
"description": "A fast CLI documentation searcher for Nix.", "description": "A fast CLI documentation searcher for Nix.",

View file

@ -11,4 +11,5 @@ self: super: {
nixGL = import sources.nixGL { }; nixGL = import sources.nixGL { };
scr = super.callPackage ../packages/scr.nix { }; scr = super.callPackage ../packages/scr.nix { };
my-st = super.callPackage ../packages/st/st-tanish2002 { }; my-st = super.callPackage ../packages/st/st-tanish2002 { };
kmonad = import "${sources.kmonad}/nix";
} }

View file

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
case "$1" in
-*) exit 0;;
esac
case "$(file --mime-type "$1")" in case "$(file --mime-type "$1")" in
*text*) *text*)