From 7e19bd16b48bd009a3b4d0f029c445bb49d95615 Mon Sep 17 00:00:00 2001 From: azahi Date: Wed, 3 Oct 2018 14:30:31 +0300 Subject: Move to 0.15 Fix windows not showing with fullscreen hooks Add misc directory with stuff that should be moved to ~/.xmonad Switch indentation style Add submodules --- .gitmodules | 6 ++++ cabal.project | 3 ++ misc/bin/mpc-play-pause.sh | 8 ++++++ misc/bin/nsp-console.sh | 8 ++++++ misc/bin/screenlock.sh | 7 +++++ misc/bin/toggle-compton.sh | 8 ++++++ misc/bin/toggle-redshift.sh | 9 ++++++ misc/bin/toggle-touchpad.sh | 11 +++++++ misc/bin/toggle-trackpoint.sh | 11 +++++++ misc/bin/xmobar/fcitx.sh | 16 +++++++++++ misc/bin/xshot-select-upload.sh | 7 +++++ misc/bin/xshot-select.sh | 5 ++++ misc/bin/xshot-upload.sh | 7 +++++ misc/bin/xshot.sh | 5 ++++ misc/xmobarrcBot.hs | 64 +++++++++++++++++++++++++++++++++++++++++ misc/xmobarrcTop.hs | 40 ++++++++++++++++++++++++++ src/Main.hs | 45 +++++++++++++++-------------- src/XMonad/Custom/Bindings.hs | 27 +++++++++-------- src/XMonad/Custom/Layout.hs | 13 ++------- src/XMonad/Custom/Log.hs | 9 +++--- src/XMonad/Custom/Navigation.hs | 4 +-- src/XMonad/Custom/Startup.hs | 4 +-- src/XMonad/Custom/Workspaces.hs | 20 +++++++++++++ stack.yaml | 5 ++++ vendor/xmonad | 1 + vendor/xmonad-contrib | 1 + xmobarrcBot.hs | 64 ----------------------------------------- xmobarrcTop.hs | 40 -------------------------- xmonad-ng.cabal | 30 +++++++++---------- 29 files changed, 305 insertions(+), 173 deletions(-) create mode 100644 .gitmodules create mode 100644 cabal.project create mode 100755 misc/bin/mpc-play-pause.sh create mode 100755 misc/bin/nsp-console.sh create mode 100755 misc/bin/screenlock.sh create mode 100755 misc/bin/toggle-compton.sh create mode 100755 misc/bin/toggle-redshift.sh create mode 100755 misc/bin/toggle-touchpad.sh create mode 100755 misc/bin/toggle-trackpoint.sh create mode 100755 misc/bin/xmobar/fcitx.sh create mode 100755 misc/bin/xshot-select-upload.sh create mode 100755 misc/bin/xshot-select.sh create mode 100755 misc/bin/xshot-upload.sh create mode 100755 misc/bin/xshot.sh create mode 100644 misc/xmobarrcBot.hs create mode 100644 misc/xmobarrcTop.hs create mode 100644 stack.yaml create mode 160000 vendor/xmonad create mode 160000 vendor/xmonad-contrib delete mode 100644 xmobarrcBot.hs delete mode 100644 xmobarrcTop.hs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..781a58e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "vendor/xmonad"] + path = vendor/xmonad + url = https://github.com/azahi/xmonad +[submodule "vendor/xmonad-contrib"] + path = vendor/xmonad-contrib + url = https://github.com/azahi/xmonad-contrib diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..2f7a15c --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +packages: ./ + ./vendor/xmonad/ + ./vendor/xmonad-contrib/ diff --git a/misc/bin/mpc-play-pause.sh b/misc/bin/mpc-play-pause.sh new file mode 100755 index 0000000..3fb4f3b --- /dev/null +++ b/misc/bin/mpc-play-pause.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if mpc | grep -q "playing" +then + mpc --no-status pause +else + mpc --no-status play +fi diff --git a/misc/bin/nsp-console.sh b/misc/bin/nsp-console.sh new file mode 100755 index 0000000..5d19f46 --- /dev/null +++ b/misc/bin/nsp-console.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if tmux list-sessions | grep -q "scratchpad" +then + tmux attach-session -t "scratchpad" +else + tmux new-session -s "scratchpad" -n "scratchpad" -c "${HOME}" +fi diff --git a/misc/bin/screenlock.sh b/misc/bin/screenlock.sh new file mode 100755 index 0000000..28dbe0c --- /dev/null +++ b/misc/bin/screenlock.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +i3lock \ + --no-unlock-indicator \ + --image "${HOME}/pictures/wallpapers/mill-lock.png" \ + --pointer default \ + --ignore-empty-password diff --git a/misc/bin/toggle-compton.sh b/misc/bin/toggle-compton.sh new file mode 100755 index 0000000..91ebc4d --- /dev/null +++ b/misc/bin/toggle-compton.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ $(pgrep 'compton') ]] +then + pkill "compton" +else + compton -b --config "${XDG_CONFIG_HOME}/compton.conf" +fi diff --git a/misc/bin/toggle-redshift.sh b/misc/bin/toggle-redshift.sh new file mode 100755 index 0000000..8ba6b60 --- /dev/null +++ b/misc/bin/toggle-redshift.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [[ $(pgrep 'redshift') ]] +then + pkill "redshift" +else + redshift -c "${XDG_CONFIG_HOME}/redshift.conf" & + disown redshift +fi diff --git a/misc/bin/toggle-touchpad.sh b/misc/bin/toggle-touchpad.sh new file mode 100755 index 0000000..5a30528 --- /dev/null +++ b/misc/bin/toggle-touchpad.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +ID=$(xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}') +STATE=$(xinput list-props "$ID" | awk '/Device Enabled/ {print $4}') + +if [ "$STATE" -eq 1 ] +then + xinput disable "$ID" +else + xinput enable "$ID" +fi diff --git a/misc/bin/toggle-trackpoint.sh b/misc/bin/toggle-trackpoint.sh new file mode 100755 index 0000000..b0b3501 --- /dev/null +++ b/misc/bin/toggle-trackpoint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +ID=$(xinput list | grep -Eo 'TrackPoint\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}') +STATE=$(xinput list-props "$ID" | awk '/Device Enabled/ {print $4}') + +if [ "$STATE" -eq 1 ] +then + xinput disable "$ID" +else + xinput enable "$ID" +fi diff --git a/misc/bin/xmobar/fcitx.sh b/misc/bin/xmobar/fcitx.sh new file mode 100755 index 0000000..ddf1826 --- /dev/null +++ b/misc/bin/xmobar/fcitx.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +status="$(fcitx-remote)" +set out + +if [[ "$status" = 0 ]] +then + out="Off" +elif [[ "$status" = 1 ]] +then + out="Disabled" +else + out="Enabled" +fi + +echo -e "$out" diff --git a/misc/bin/xshot-select-upload.sh b/misc/bin/xshot-select-upload.sh new file mode 100755 index 0000000..e846800 --- /dev/null +++ b/misc/bin/xshot-select-upload.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png" + +maim --format=png --hidecursor --quality 8 --select "${PIC}" && \ + curl --form "file=@${PIC}" "https://0x0.st" | \ + xclip -quiet diff --git a/misc/bin/xshot-select.sh b/misc/bin/xshot-select.sh new file mode 100755 index 0000000..53ad782 --- /dev/null +++ b/misc/bin/xshot-select.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png" + +maim --format=png --hidecursor --quality 8 --select "${PIC}" diff --git a/misc/bin/xshot-upload.sh b/misc/bin/xshot-upload.sh new file mode 100755 index 0000000..91c23f4 --- /dev/null +++ b/misc/bin/xshot-upload.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png" + +maim --format=png --hidecursor --quality 8 "${PIC}" && \ + curl --form "file=@${PIC}" "https://0x0.st" | \ + xclip -quiet diff --git a/misc/bin/xshot.sh b/misc/bin/xshot.sh new file mode 100755 index 0000000..d7984e3 --- /dev/null +++ b/misc/bin/xshot.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png" + +maim --format=png --hidecursor --quality 8 "${PIC}" diff --git a/misc/xmobarrcBot.hs b/misc/xmobarrcBot.hs new file mode 100644 index 0000000..c70689b --- /dev/null +++ b/misc/xmobarrcBot.hs @@ -0,0 +1,64 @@ +Config { font = "xft:lucy tewi:style=Regular:pixelsize=11,Efont Biwidth:pixelsize=12,Misc Fixed Wide:size=8" + , additionalFonts = [ "xft:Wuncon Siji:style=Regular" + , "xft:lucy tewi:style=Bold:pixelsize=11" + ] + , bgColor = "#0b0806" + , fgColor = "#a19782" + , alpha = 255 + , position = Static { xpos = 0 + , ypos = 876 + , width = 1600 + , height = 24 + } + , textOffset = 16 + , iconOffset = -1 + , lowerOnStart = True + , hideOnStart = False + , allDesktops = True + , overrideRedirect = False + , pickBroadest = False + , persistent = False + , border = FullBM 0 + , borderColor = "#2f2b2a" + , borderWidth = 1 + , iconRoot = "." + , commands = [ Run StdinReader + , Run Battery [ "-t", "%" + , "--" + , "-i", "\57914", "-O", "\57913" , "-o", "\57911" + ] 10 + , Run Cpu [ "-t", "\57381%" ] 10 + , Run CoreTemp [ "-t", "°C / °C" ] 10 + , Run Memory [ "-t", "\57384%" ] 10 + , Run ThermalZone 0 ["-t","\57371°C"] 10 + , Run ThermalZone 1 ["-t","°C"] 10 + , Run Wireless "wlp3s0" [ "-t", "\57882 @ %" ] 10 + , Run DynNetwork [ "-t", "\57660 / \57659 kbps" ] 10 + , Run Kbd [ ("us", "\57967English / \57898") + , ("ru", "\57967Russian / \57898")] + , Run Com "/home/free/.xmonad/bin/xmobar/fcitx.sh" [] "fcitx" 3 + , Run Locks + , Run MPD [ "-t", " - " + , "--" + , "-P", "\57498", "-Z", "\57499", "-S", "\57497" + ] 10 + , Run Volume "default" "Master" [ "-t", "<fn=1><status></fn><volume>%" + , "--" + , "--on" , "\57427" + , "--off" , "\57426" + , "--onc" , "#a19782" + , "--offc" , "#a19782" + ] 10 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " \ + \%battery% %wlp3s0wi% %dynnetwork% %StdinReader%\ + \}\ + \%kbd%%fcitx%\ + \{\ + \%mpd% %default:Master%\ + \ " + } + +-- vim:filetype=haskell:expandtab:tabstop=4:shiftwidth=4 diff --git a/misc/xmobarrcTop.hs b/misc/xmobarrcTop.hs new file mode 100644 index 0000000..6764359 --- /dev/null +++ b/misc/xmobarrcTop.hs @@ -0,0 +1,40 @@ +Config { font = "xft:lucy tewi:style=Regular:pixelsize=11,Efont Biwidth:pixelsize=12,Misc Fixed Wide:size=8" + , additionalFonts = [ "xft:Wuncon Siji:style=Regular" + , "xft:lucy tewi:style=Bold:pixelsize=11" + ] + , bgColor = "#0b0806" + , fgColor = "#a19782" + , alpha = 255 + , position = Static { xpos = 0 + , ypos = 0 + , width = 1600 + , height = 24 + } + , textOffset = 16 + , iconOffset = -1 + , lowerOnStart = True + , hideOnStart = False + , allDesktops = True + , overrideRedirect = False + , pickBroadest = False + , persistent = False + , border = FullBM 0 + , borderColor = "#2f2b2a" + , borderWidth = 1 + , iconRoot = "." + , commands = [ Run StdinReader + , Run Date "<fn=1>\57893</fn>%d.%m.%y / %A / %H:%M" "date" 10 + , Run Weather "UUWW" [ "-t", "<fn=1>\57550</fn><tempC>°C / <rh>% / <pressure> Pa" ] 10000 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " \ + \%StdinReader%\ + \}\ + \\ + \{\ + \%UUWW% %date%\ + \ " + } + +-- vim:filetype=haskell:expandtab:tabstop=4:shiftwidth=4 diff --git a/src/Main.hs b/src/Main.hs index fadabec..27379ab 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -46,25 +46,26 @@ instance UrgencyHook NotifyUrgencyHook where safeSpawn (Custom.notify Custom.customApplications) [show n, "workspace " ++ wrap "[" "]" i] main :: IO () -main = xmonad $ ewmh - $ fullscreenSupport - $ docks - $ withUrgencyHook NotifyUrgencyHook - $ withNavigation2DConfig Custom.navigation2DConfig - $ dynamicProjects Custom.projects - $ addDescrKeys' ((Custom.modMask', xK_F1), Custom.showKeyBindings) Custom.keyBindings - $ def { borderWidth = Custom.border - , workspaces = Custom.workspaces' -- TODO save WS state - , layoutHook = Custom.layoutHook' -- TODO save layout state and floating W position - , terminal = Custom.term Custom.customApplications - , normalBorderColor = Custom.colorN - , focusedBorderColor = Custom.colorF - , modMask = Custom.modMask' - , logHook = Custom.logHook' - , startupHook = Custom.startupHook' - , mouseBindings = Custom.mouseBindings' - , manageHook = Custom.manageHook' - , handleEventHook = Custom.handleEventHook' - , focusFollowsMouse = False - , clickJustFocuses = False - } +main = xmonad + $ ewmh + $ fullscreenSupport + $ docks + $ withUrgencyHook NotifyUrgencyHook + $ withNavigation2DConfig Custom.navigation2DConfig + $ dynamicProjects Custom.projects + $ addDescrKeys' ((Custom.modMask', xK_F1), Custom.showKeyBindings) Custom.keyBindings + $ def { borderWidth = Custom.border + , workspaces = Custom.workspaces' -- TODO save WS state + , layoutHook = Custom.layoutHook' -- TODO save layout state and floating W position + , terminal = Custom.term Custom.customApplications + , normalBorderColor = Custom.colorN + , focusedBorderColor = Custom.colorF + , modMask = Custom.modMask' + , logHook = Custom.logHook' + , startupHook = Custom.startupHook' + , mouseBindings = Custom.mouseBindings' + , manageHook = Custom.manageHook' + , handleEventHook = Custom.handleEventHook' + , focusFollowsMouse = False + , clickJustFocuses = False + } diff --git a/src/XMonad/Custom/Bindings.hs b/src/XMonad/Custom/Bindings.hs index 19eaa2a..414e89a 100644 --- a/src/XMonad/Custom/Bindings.hs +++ b/src/XMonad/Custom/Bindings.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE LambdaCase #-} + ----------------------------------------------------------------------------- -- | -- Module : XMonad.Custom.Bindings @@ -34,7 +36,7 @@ import XMonad.Actions.MessageFeedback import XMonad.Actions.Navigation2D import XMonad.Actions.PerConditionKeys import XMonad.Actions.Promote -import XMonad.Actions.Volume +--import XMonad.Actions.Volume import XMonad.Actions.WithAll import XMonad.Custom.Layout import qualified XMonad.Custom.Misc as CM @@ -86,16 +88,15 @@ zipM' :: [a] -> String -> [[a]] -> [t] -> (t -> t1 -> X ()) -> t1 -> [([a], Name zipM' m nm ks as f b = zipWith (\k d -> (m ++ k, addName nm $ f d b)) ks as tryMessageR_ :: (Message a, Message b) => a -> b -> X () -tryMessageR_ x y = sequence_ [tryMessage_ x y, refresh] +tryMessageR_ x y = sequence_ [tryMessageWithNoRefreshToCurrent x y, refresh] xSelectionNotify :: MonadIO m => m () xSelectionNotify = join $ io - $ (unsafeSpawn . (\x -> CM.notify CM.customApplications ++ " Clipboard " ++ wrap "\"\\\"" "\"\\\"" x)) <$> getSelection + $ unsafeSpawn . (\x -> CM.notify CM.customApplications ++ " Clipboard " ++ wrap "\"\\\"" "\"\\\"" x) <$> getSelection toggleCopyToAll :: X () -toggleCopyToAll = wsContainingCopies >>= \x -> case x of - [] -> windows copyToAll - _ -> killAllOtherCopies +toggleCopyToAll = wsContainingCopies >>= \case [] -> windows copyToAll + _ -> killAllOtherCopies getSortByIndexNonSP :: X ([WindowSpace] -> [WindowSpace]) getSortByIndexNonSP = (. namedScratchpadFilterOutWorkspace) <$> getSortByIndex @@ -107,12 +108,10 @@ prevNonEmptyWS = findWorkspace getSortByIndexNonSP Prev HiddenNonEmptyWS 1 >>= \ toggleFloat :: Window -> X () toggleFloat w = windows (\s -> if M.member w (S.floating s) then S.sink w s - else S.float w (S.RationalRect (1/2 - 1/4) (1/2 - 1/4) (1/2) (1/2)) s) + else S.float w (S.RationalRect (1/2 - 1/4) (1/2 - 1/4) (1/2) (1/2)) s) keyBindings :: XConfig Layout -> [((KeyMask, KeySym), NamedAction)] -keyBindings c = - let subKeys s ks = subtitle s:mkNamedKeymap c ks - in +keyBindings c = let subKeys s ks = subtitle s:mkNamedKeymap c ks in subKeys "System" [ ("M-q" , addName "Restart XMonad" $ spawn "xmonad-ng --restart") , ("M-S-q" , addName "Quit XMonad" $ confirmPrompt hotPromptTheme "Quit XMonad?" $ io exitSuccess) @@ -148,10 +147,10 @@ keyBindings c = ] ^++^ subKeys "Volume & Music" - [ ("<XF86AudioMute>" , addName "ALSA: Mute" $ void toggleMute) - , ("<XF86AudioLowerVolume>" , addName "ALSA: Lower volume" $ void $ lowerVolume 5) - , ("<XF86AudioRaiseVolume>" , addName "ALSA: Raise volume" $ void $ raiseVolume 5) - , ("<XF86AudioPlay>" , addName "MPD: Play/pause" $ spawn "~/.xmonad/bin/mpc-play-pause.sh") + -- [ ("<XF86AudioMute>" , addName "ALSA: Mute" $ void toggleMute) + -- , ("<XF86AudioLowerVolume>" , addName "ALSA: Lower volume" $ void $ lowerVolume 5) + -- , ("<XF86AudioRaiseVolume>" , addName "ALSA: Raise volume" $ void $ raiseVolume 5) + [ ("<XF86AudioPlay>" , addName "MPD: Play/pause" $ spawn "~/.xmonad/bin/mpc-play-pause.sh") , ("<XF86AudioStop>" , addName "MPD: Stop" $ spawn "mpc --no-status stop") , ("<XF86AudioPrev>" , addName "MPD: Previos track" $ spawn "mpc --no-status prev") , ("<XF86AudioNext>" , addName "MPD: Next track" $ spawn "mpc --no-status next") diff --git a/src/XMonad/Custom/Layout.hs b/src/XMonad/Custom/Layout.hs index 3a0a107..9983b9c 100644 --- a/src/XMonad/Custom/Layout.hs +++ b/src/XMonad/Custom/Layout.hs @@ -40,23 +40,16 @@ import XMonad.Layout.Tabbed import XMonad.Layout.WindowNavigation applySpacing :: l a -> ModifiedLayout Spacing l a -applySpacing = spacing gapBase - -applyGaps :: l a -> ModifiedLayout Gaps l a -applyGaps = gaps [ (U, gapBase) - , (D, gapBase) - , (R, gapBase) - , (L, gapBase) - ] +applySpacing = spacingRaw True (Border 12 12 12 12) True (Border 12 12 12 12) True data CustomTransformers = GAPS deriving (Read, Show, Eq, Typeable) instance Transformer CustomTransformers Window where - transform GAPS x k = k (avoidStruts $ applyGaps $ applySpacing x) (const x) + transform GAPS x k = k (avoidStruts $ applySpacing x) (const x) layoutHook' = fullscreenFloat - $ lessBorders OnlyFloat + $ lessBorders OnlyLayoutFloat $ mkToggle (single NBFULL) $ avoidStruts $ mkToggle (single GAPS) diff --git a/src/XMonad/Custom/Log.hs b/src/XMonad/Custom/Log.hs index 1bf05f1..4102f6f 100644 --- a/src/XMonad/Custom/Log.hs +++ b/src/XMonad/Custom/Log.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE LambdaCase #-} + ----------------------------------------------------------------------------- -- | -- Module : XMonad.Custom.Log @@ -42,10 +44,9 @@ topBarPP = def , ppWsSep = " " , ppTitle = xmobarColor white1 "" . shorten 50 , ppTitleSanitize = xmobarStrip - , ppLayout = xmobarColor white1 "" . \x -> case x of -- TODO Generalize string conversion - "Spacing 12 Tabbed Hidden BSP" -> "Omni.Gaps" - "Tabbed Hidden BSP" -> "Omni" - _ -> "Misc" + , ppLayout = xmobarColor white1 "" . \case "Spacing 12 Tabbed Hidden BSP" -> "Omni.Gaps" + "Tabbed Hidden BSP" -> "Omni" + _ -> "Misc" , ppOrder = id , ppSort = (namedScratchpadFilterOutWorkspace .) <$> getSortByIndex , ppExtras = [] diff --git a/src/XMonad/Custom/Navigation.hs b/src/XMonad/Custom/Navigation.hs index 583d5ae..c301219 100644 --- a/src/XMonad/Custom/Navigation.hs +++ b/src/XMonad/Custom/Navigation.hs @@ -18,8 +18,8 @@ import XMonad.Actions.Navigation2D navigation2DConfig :: Navigation2DConfig navigation2DConfig = def - { defaultTiledNavigation = hybridNavigation - , floatNavigation = hybridNavigation + { defaultTiledNavigation = hybridOf sideNavigation centerNavigation + , floatNavigation = hybridOf lineNavigation centerNavigation , layoutNavigation = [("Full", centerNavigation)] , unmappedWindowRect = [("Full", singleWindowRect)] } diff --git a/src/XMonad/Custom/Startup.hs b/src/XMonad/Custom/Startup.hs index 592f9b8..68b8fd3 100644 --- a/src/XMonad/Custom/Startup.hs +++ b/src/XMonad/Custom/Startup.hs @@ -51,8 +51,8 @@ addEWMHFullscreen = do startupHook' :: X () startupHook' = do - spawnNamedPipe "xmobar ~/work/xmonad-ng/xmobarrcTop.hs" "xmobarTop" - spawnNamedPipe "xmobar ~/work/xmonad-ng/xmobarrcBot.hs" "xmobarBot" + spawnNamedPipe "xmobar ~/.xmonad/xmobarrcTop.hs" "xmobarTop" + spawnNamedPipe "xmobar ~/.xmonad/xmobarrcBot.hs" "xmobarBot" docksStartupHook addEWMHFullscreen setDefaultCursor xC_left_ptr diff --git a/src/XMonad/Custom/Workspaces.hs b/src/XMonad/Custom/Workspaces.hs index 881861c..3c15671 100644 --- a/src/XMonad/Custom/Workspaces.hs +++ b/src/XMonad/Custom/Workspaces.hs @@ -14,7 +14,27 @@ module XMonad.Custom.Workspaces ( workspaces' ) where +import XMonad.Actions.DynamicProjects import XMonad.Core +import XMonad.Custom.Misc workspaces' :: [WorkspaceId] workspaces' = map show [1..9 :: Int] + +projects :: [Project] +projects = + [ Project { projectName = "scratch" + , projectDirectory = "~/" + , projectStartHook = Nothing + } + + , Project { projectName = "www" + , projectDirectory = "~/" + , projectStartHook = Nothing + } + + , Project { projectName = "mail" + , projectDirectory = "~/" + , projectStartHook = Nothing + } + ] diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..98ff64a --- /dev/null +++ b/stack.yaml @@ -0,0 +1,5 @@ +resolver: lts-12.11 +packages: + - . + - ./vendor/xmonad + - ./vendor/xmonad-contrib diff --git a/vendor/xmonad b/vendor/xmonad new file mode 160000 index 0000000..bb13853 --- /dev/null +++ b/vendor/xmonad @@ -0,0 +1 @@ +Subproject commit bb13853929f8f6fc59b526bcc10631e1bac309ad diff --git a/vendor/xmonad-contrib b/vendor/xmonad-contrib new file mode 160000 index 0000000..81a9808 --- /dev/null +++ b/vendor/xmonad-contrib @@ -0,0 +1 @@ +Subproject commit 81a980823e441713217336040656495850f7e756 diff --git a/xmobarrcBot.hs b/xmobarrcBot.hs deleted file mode 100644 index c70689b..0000000 --- a/xmobarrcBot.hs +++ /dev/null @@ -1,64 +0,0 @@ -Config { font = "xft:lucy tewi:style=Regular:pixelsize=11,Efont Biwidth:pixelsize=12,Misc Fixed Wide:size=8" - , additionalFonts = [ "xft:Wuncon Siji:style=Regular" - , "xft:lucy tewi:style=Bold:pixelsize=11" - ] - , bgColor = "#0b0806" - , fgColor = "#a19782" - , alpha = 255 - , position = Static { xpos = 0 - , ypos = 876 - , width = 1600 - , height = 24 - } - , textOffset = 16 - , iconOffset = -1 - , lowerOnStart = True - , hideOnStart = False - , allDesktops = True - , overrideRedirect = False - , pickBroadest = False - , persistent = False - , border = FullBM 0 - , borderColor = "#2f2b2a" - , borderWidth = 1 - , iconRoot = "." - , commands = [ Run StdinReader - , Run Battery [ "-t", "<fn=1><acstatus></fn><left>%" - , "--" - , "-i", "\57914", "-O", "\57913" , "-o", "\57911" - ] 10 - , Run Cpu [ "-t", "<fn=1>\57381</fn><total>%" ] 10 - , Run CoreTemp [ "-t", "<core0>°C / <core1>°C" ] 10 - , Run Memory [ "-t", "<fn=1>\57384</fn><usedratio>%" ] 10 - , Run ThermalZone 0 ["-t","<fn=1>\57371</fn><temp>°C"] 10 - , Run ThermalZone 1 ["-t","<temp>°C"] 10 - , Run Wireless "wlp3s0" [ "-t", "<fn=1>\57882</fn><essid> @ <quality>%" ] 10 - , Run DynNetwork [ "-t", "<fn=1>\57660</fn><rx> / <fn=1>\57659</fn><tx> kbps" ] 10 - , Run Kbd [ ("us", "<fn=1>\57967</fn>English / <fn=1>\57898</fn>") - , ("ru", "<fn=1>\57967</fn>Russian / <fn=1>\57898</fn>")] - , Run Com "/home/free/.xmonad/bin/xmobar/fcitx.sh" [] "fcitx" 3 - , Run Locks - , Run MPD [ "-t", "<fn=1><statei></fn><artist> - <title>" - , "--" - , "-P", "\57498", "-Z", "\57499", "-S", "\57497" - ] 10 - , Run Volume "default" "Master" [ "-t", "<fn=1><status></fn><volume>%" - , "--" - , "--on" , "\57427" - , "--off" , "\57426" - , "--onc" , "#a19782" - , "--offc" , "#a19782" - ] 10 - ] - , sepChar = "%" - , alignSep = "}{" - , template = " \ - \%battery% %wlp3s0wi% %dynnetwork% %StdinReader%\ - \}\ - \%kbd%%fcitx%\ - \{\ - \%mpd% %default:Master%\ - \ " - } - --- vim:filetype=haskell:expandtab:tabstop=4:shiftwidth=4 diff --git a/xmobarrcTop.hs b/xmobarrcTop.hs deleted file mode 100644 index 6764359..0000000 --- a/xmobarrcTop.hs +++ /dev/null @@ -1,40 +0,0 @@ -Config { font = "xft:lucy tewi:style=Regular:pixelsize=11,Efont Biwidth:pixelsize=12,Misc Fixed Wide:size=8" - , additionalFonts = [ "xft:Wuncon Siji:style=Regular" - , "xft:lucy tewi:style=Bold:pixelsize=11" - ] - , bgColor = "#0b0806" - , fgColor = "#a19782" - , alpha = 255 - , position = Static { xpos = 0 - , ypos = 0 - , width = 1600 - , height = 24 - } - , textOffset = 16 - , iconOffset = -1 - , lowerOnStart = True - , hideOnStart = False - , allDesktops = True - , overrideRedirect = False - , pickBroadest = False - , persistent = False - , border = FullBM 0 - , borderColor = "#2f2b2a" - , borderWidth = 1 - , iconRoot = "." - , commands = [ Run StdinReader - , Run Date "<fn=1>\57893</fn>%d.%m.%y / %A / %H:%M" "date" 10 - , Run Weather "UUWW" [ "-t", "<fn=1>\57550</fn><tempC>°C / <rh>% / <pressure> Pa" ] 10000 - ] - , sepChar = "%" - , alignSep = "}{" - , template = " \ - \%StdinReader%\ - \}\ - \\ - \{\ - \%UUWW% %date%\ - \ " - } - --- vim:filetype=haskell:expandtab:tabstop=4:shiftwidth=4 diff --git a/xmonad-ng.cabal b/xmonad-ng.cabal index 7216550..87374fb 100644 --- a/xmonad-ng.cabal +++ b/xmonad-ng.cabal @@ -1,5 +1,5 @@ name: xmonad-ng -version: 0.2.1.1 +version: 0.15 synopsis: azahi's XMonad configuration description: azahi's XMonad configuration based on stolen code and bad Haskell knowledge homepage: https://github.com/azahi/xmonad-ng @@ -25,10 +25,10 @@ library exposed-modules: XMonad.Actions.FloatSnapSpaced , XMonad.Actions.PerConditionKeys - build-depends: base >= 4.9.1 && < 4.10 - , containers >= 0.5.7 && < 0.6 - , xmonad >= 0.13 && < 0.14 - , xmonad-contrib >= 0.13 && < 0.14 + build-depends: base >= 4.11 && < 4.12 + , containers >= 0.5 && < 0.6 + , xmonad >= 0.15 && < 0.16 + , xmonad-contrib >= 0.15 && < 0.16 executable xmonad-ng main-is: Main.hs @@ -37,6 +37,7 @@ executable xmonad-ng default-language: Haskell2010 other-extensions: DeriveDataTypeable + , LambdaCase , MultiParamTypeClasses , TypeSynonymInstances @@ -55,13 +56,12 @@ executable xmonad-ng , XMonad.Custom.Theme , XMonad.Custom.Workspaces - build-depends: X11 >= 1.8 && < 1.9 - , base >= 4.9.1 && < 4.10 - , containers >= 0.5.7 && < 0.6 - , directory >= 1.3 && < 1.4 - , filepath >= 1.4.1 && < 1.5 - , text >= 1.2.3 && < 1.3 - , time >= 1.6 && < 1.7 - , xmonad >= 0.13 && < 0.14 - , xmonad-contrib >= 0.13 && < 0.14 - , xmonad-extras >= 0.13 && < 0.14 + build-depends: X11 >= 1.9 && < 1.10 + , base >= 4.11 && < 4.12 + , containers >= 0.5 && < 0.6 + , directory >= 1.3 && < 1.4 + , filepath >= 1.4 && < 1.5 + , text >= 1.2 && < 1.3 + , time >= 1.8 && < 1.9 + , xmonad >= 0.15 && < 0.16 + , xmonad-contrib >= 0.15 && < 0.16 -- cgit 1.4.1