diff options
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/xmonad.hs | 93 |
1 files changed, 87 insertions, 6 deletions
diff --git a/XMonad/xmonad.hs b/XMonad/xmonad.hs index 3a8e6e1f..3092b7da 100644 --- a/XMonad/xmonad.hs +++ b/XMonad/xmonad.hs @@ -2,6 +2,10 @@ import XMonad import qualified XMonad.StackSet as W import XMonad.ManageHook +-- data +import Data.Tree +import qualified Data.Map as M + -- actions import XMonad.Actions.CycleWS (moveTo, shiftTo, WSType(..), nextScreen, prevScreen) import XMonad.Actions.CopyWindow @@ -10,6 +14,7 @@ import XMonad.Actions.GridSelect import XMonad.Actions.SwapWorkspaces import XMonad.Actions.WindowBringer import XMonad.Actions.MouseResize +import qualified XMonad.Actions.TreeSelect as TS -- layouts modifiers import XMonad.Layout.Spacing @@ -28,7 +33,7 @@ import XMonad.Layout.TwoPane import XMonad.Layout.Spiral import XMonad.Layout.ResizableTile import XMonad.Layout.Maximize --- import XMonad.Layout.Tabbed +import XMonad.Layout.Tabbed -- fix this it doesnt work -- hooks import XMonad.Hooks.SetWMName @@ -105,6 +110,11 @@ myVolDown = "pulseaudio-ctl down" myVolMute :: String myVolMute = "pulseaudio-ctl mute" + +myFont :: String +myFont = "xft:Roboto:pixelsize=16:antialias=true" + + -- wm variables nBorder = "#000000" -- "#3804f4" -- "#bf00ff" @@ -118,11 +128,59 @@ wGap = 1 -- window gap myExtraWorkspaces = [(xK_0, " 十 ")] -- , (xK_comma, " 十一 "), (xK_period, " 十二 "), (xK_slash, " 十三 ")] myWorkspaces = [" 一 "," 二 "," 三 "," 四 "," 五 "," 六 "," 七 "," 八 ", " 九 "] ++ (map snd myExtraWorkspaces) +-- treeselect config +defaultNavigation = M.fromList + [ ((0, xK_Escape), TS.cancel) + , ((0, xK_Return), TS.select) + , ((0, xK_space), TS.select) + , ((0, xK_Up), TS.movePrev) + , ((0, xK_Down), TS.moveNext) + , ((0, xK_Left), TS.moveParent) + , ((0, xK_Right), TS.moveChild) + , ((0, xK_k), TS.movePrev) + , ((0, xK_j), TS.moveNext) + , ((0, xK_h), TS.moveParent) + , ((0, xK_l), TS.moveChild) + , ((0, xK_o), TS.moveHistBack) + , ((0, xK_i), TS.moveHistForward) + ] + +myTSConfig = TS.TSConfig { TS.ts_hidechildren = False + , TS.ts_background = 0xdd282c34 + , TS.ts_font = myFont + , TS.ts_node = (0xffd0d0d0, 0xff1c1f24) + , TS.ts_nodealt = (0xffd0d0d0, 0xff282c34) + , TS.ts_highlight = (0xffffffff, 0xff755999) + , TS.ts_extra = 0xffd0d0d0 + , TS.ts_node_width = 200 + , TS.ts_node_height = 28 + , TS.ts_originX = 100 + , TS.ts_originY = 100 + , TS.ts_indent = 80 + , TS.ts_navigate = TS.defaultNavigation + } + +-- myTreeMenu :: TS.TSConfig (X ()) -> X () +-- myTreeMenu a = TS.treeselectAction a +-- [ Node (TS.TSNode "Hello" "displays hello" (spawn "xmessage hello!")) [] +-- , Node (TS.TSNode "Shutdown" "Poweroff the system" (spawn "shutdown")) [] +-- , Node (TS.TSNode "Brightness" "Sets screen brightness using xbacklight" (return ())) +-- [ Node (TS.TSNode "Bright" "FULL POWER!!" (spawn "xbacklight -set 100")) [] +-- , Node (TS.TSNode "Normal" "Normal Brightness (50%)" (spawn "xbacklight -set 50")) [] +-- , Node (TS.TSNode "Dim" "Quite dark" (spawn "xbacklight -set 10")) [] +-- ] +-- ] + +myPowerMenu :: TS.TSConfig (X ()) -> X () +myPowerMenu a = TS.treeselectAction a + [Node (TS.TSNode "SHUTDOWN" "It's not like I'm gonna miss you, b- baka!" (spawn "xmessage bye!")) [] + , Node (TS.TSNode "REBOOT" "Be quick, okay?" (spawn "st")) [] + , Node (TS.TSNode "CANCEL" "Do nothing" (return ())) [] + ] -- scratchpad config myScratchpads = [ --- NS "Vysor" "Vysor.AppImage" (title =? "Vysor") defaultFloating NS "Phone" "scrcpy" (title =? "Motorola One Power") defaultFloating, NS "Terminal" "st -t 'TerminalScratchpad'" (title =? "TerminalScratchpad") defaultFloating, NS "Nitrogen" "nitrogen" (title =? "Nitrogen") defaultFloating @@ -141,13 +199,21 @@ myKeys = [ , ((mod1Mask .|. shiftMask, xK_k), kill1) , ((myModMask, xK_a), withFocused $ windows . W.sink) -- unfloat windows + -- TreeSelect + , ((mod1Mask, xK_F4), myPowerMenu myTSConfig) + -- launch apps/execute scripts - , ((myModMask, xK_i), spawn (myBrowser)) + -- , ((myModMask, xK_i), spawn (myBrowser)) , ((myModMask, xK_o), spawn (myFileManager)) , ((myModMask, xK_y), spawn ("gimp")) , ((myModMask, xK_e), spawn (myEmailClient)) - , ((myModMask, xK_m), spawn ("vlc")) + -- , ((myModMask, xK_m), spawn ("vlc")) , ((myModMask, xK_b), spawn ("konqueror")) + + -- launch/copy apps + , ((myModMask .|. shiftMask, xK_o), runOrCopy "pcmanfm" (className =? "Pcmanfm")) + , ((myModMask, xK_i), runOrCopy "brave" (className =? "Brave-browser")) + , ((myModMask, xK_m), runOrCopy "vlc" (className =? "vlc")) -- volume , ((altMask, xK_0), spawn (myVolMute)) @@ -196,6 +262,11 @@ myKeys = [ -- grid select , ((myModMask, xK_g), goToSelected defaultGSConfig) + + -- kinda bad horizontal resizing of windows in non-bsp layouts + , ((myModMask, xK_Right), sendMessage Expand) + , ((myModMask, xK_Left), sendMessage Shrink) + -- windowbringer , ((myModMask, xK_b), bringMenu) @@ -244,11 +315,20 @@ myKeys = [ ] +-- tabs config +myTabTheme = def { fontName = "roboto" + , activeColor = "#46d9ff" + , inactiveColor = "#313846" + , activeBorderColor = "#46d9ff" + , inactiveBorderColor = "#282c34" + , activeTextColor = "#282c34" + , inactiveTextColor = "#d0d0d0" + } --- layouts -myGap = spacingRaw False (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True +-- layouts +myGap = spacingRaw False (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True @@ -260,6 +340,7 @@ myLayouts = avoidStruts ( ||| renamed [R.Replace "TwoPane"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ TwoPane (3/100) (1/2)) ||| renamed [R.Replace "ThreeCol (1)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 1 (3/100) (1/2)) ||| renamed [R.Replace "ThreeCol (2)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 2 (3/100) (1/2)) + ||| tabbedRight shrinkText def ) myLayoutHook = myLayouts |