From e816e0b2d41edf203a646b8b9ec6ce5d6ccef289 Mon Sep 17 00:00:00 2001 From: Berkeley Date: Sun, 7 Apr 2024 14:39:56 +0000 Subject: [PATCH] Upload files to ".xmonad" --- .xmonad/xmonad.errors | 8 ++ .xmonad/xmonad.hs | 165 ++++++++++++++++++++++++++++++++++++++++++ .xmonad/xmonad.hs.old | 123 +++++++++++++++++++++++++++++++ .xmonad/xmonad.hs~ | 125 ++++++++++++++++++++++++++++++++ 4 files changed, 421 insertions(+) create mode 100644 .xmonad/xmonad.errors create mode 100644 .xmonad/xmonad.hs create mode 100644 .xmonad/xmonad.hs.old create mode 100644 .xmonad/xmonad.hs~ diff --git a/.xmonad/xmonad.errors b/.xmonad/xmonad.errors new file mode 100644 index 0000000..ef05b6f --- /dev/null +++ b/.xmonad/xmonad.errors @@ -0,0 +1,8 @@ +$ ghc --make xmonad.hs -dynamic -fPIC -i -ilib -fforce-recomp -main-is main -v0 -outputdir /home/berkeley/.xmonad/build-x86_64-linux -o /home/berkeley/.xmonad/xmonad-x86_64-linux + +xmonad.hs:69:1: warning: [-Wtabs] + Tab character found here, and in two further locations. + Please use spaces instead. + | +69 | spawnOnce "xrdb /home/berkeley/.Xresources" + | ^^^^^^^^ diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs new file mode 100644 index 0000000..8aeb42c --- /dev/null +++ b/.xmonad/xmonad.hs @@ -0,0 +1,165 @@ +import XMonad + +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +import XMonad.StackSet as W -- float purposes +import XMonad.Actions.MouseResize + + +import XMonad.Util.EZConfig +import XMonad.Util.Loggers +import XMonad.Util.Ungrab + +import XMonad.Layout.Magnifier +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Spacing + +import XMonad.Hooks.EwmhDesktops +import XMonad.Util.SpawnOnce (spawnOnce) + + +-- run or raise +import XMonad.Actions.WindowGo (raiseMaybe, runOrRaise) +import XMonad.ManageHook (className) +import XMonad.StackSet (RationalRect(..)) +-- + +import XMonad.Layout.Decoration +import XMonad.Layout.Simplest +import XMonad.Layout.SimplestFloat +import XMonad.Layout.Spacing +import XMonad.Actions.PerWindowKeys +import XMonad.Actions.FindEmptyWorkspace +import XMonad.Layout.Grid +import XMonad.Layout.PerScreen (ifWider) +import XMonad.StackSet +import XMonad.Layout +import XMonad.Layout.Reflect +import XMonad.Layout.WindowArranger + +-- Window Rearragement +import Data.List (find) +import XMonad.Actions.EasyMotion (selectWindow) +import XMonad.Actions.FocusNth (swapNth) +import qualified XMonad.StackSet as W + + + +main :: IO () +main = xmonad + . ewmhFullscreen + . ewmh + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + + +myConfig = def + { modMask = mod4Mask -- Rebind Mod to the Super key + , layoutHook = windowArrange myLayout -- Use custom layouts + , terminal = "alacritty" + , focusedBorderColor = "#000000" + , manageHook = myManageHook -- Match on certain windows + , startupHook = do + -- other startup commands + spawnOnce "xrandr --output HDMI-A-0 --primary --mode 1980x1080 --pos 0x0 --rotate normal --output DVI-D-0 --off" + spawnOnce "xrdb /home/berkeley/.Xresources" + spawnOnce "picom -b" + spawnOnce "tor" + spawnOnce "icecat" + spawnOnce "/home/berkeley/.local/bin/rotate_wallpapers.sh" + spawnOnce "polybar top-monitor-1" + spawnOnce "fcitx5 -d -r" + + } + + `additionalKeysP` + [ ("M-d", spawn "rofi -show run") + , ("M-0", runOrRaise "alacritty" (className =? "alacritty")) + , ("M-C-s", unGrab *> spawn "scrot -s") + , ("M-i", runOrRaise "chromium" (className =? "Chromium-browser")) + , ("M-e", runOrRaise "icecat" (className =? "GNU IceCat")) + , ("M-p", runOrRaise "openshot-qt" (className =? "openshot")) + , ("M-o", runOrRaise "obs" (className =? "obs")) + , ("M-t", withFocused $ windows . W.sink) -- Toggle float for the focused window + , ("M-ç", runOrRaise "torbrowser" (className =? "Tor Browser")) + , ("M-S-q", return ()) -- Unbind Mod + Shift + Q, to avoid quiting the wm. + , ("M-q", kill) -- Change the keybinding for closing windows to Mod + Q + , ("M-m", spawn "alacritty -e sh -c 'cd /files/music/ && cmus'") + , ("M-S-r", spawn "~/.local/bin/run_anki.sh") + , ("M-b", spawn "alacritty -e sh -c 'cd /home/berkeley/git/cleanall/clearner.sh'") + , ("M-a", runOrRaise "anki" (className =? "Anki")) + , ("M-l", sendToEmptyWorkspace) -- View an empty workspace + , ("M-f", viewEmptyWorkspace) -- View an empty workspace + , ("M-z", spawn "flameshot gui --path=/tmp/") + , ("M-w", spawn "~/.local/bin/copy_image.sh") + , ("M-v", easySwap) + ] + +easySwap :: X () +easySwap = do + win <- selectWindow def + stack <- gets $ W.index . windowset + let match = find ((win ==) . Just . fst) $ zip stack [0 ..] + whenJust match $ swapNth . snd + + + + +myManageHook :: ManageHook +myManageHook = composeAll + [ className =? "Gimp" --> doFloat + , isDialog --> doFloat + ] + + +myTheme :: Theme +myTheme = def + { decoHeight = 20 + + -- Add other theme properties as needed + } + +myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $ + tallLayout ||| Full + where + tallLayout = reflectHoriz $ Tall 2 (3/100) (1/2) + +toggleLayout :: X () +toggleLayout = do + currentLayout <- gets (W.layout . W.workspace . W.current . windowset) + case description currentLayout of + "Tall" -> sendMessage $ JumpToLayout "Mirror Tall" + _ -> sendMessage $ JumpToLayout "Tall" + + +myXmobarPP :: PP +myXmobarPP = def + { ppSep = cyan " • " + , ppTitleSanitize = xmobarStrip + , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 + , ppHidden = white . wrap " " "" + , ppHiddenNoWindows = lowWhite . wrap " " "" + , ppUrgent = red . wrap (yellow "!") (yellow "!") + , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] + , ppExtras = [logTitles formatFocused formatUnfocused] + } + where + formatFocused = wrap (white "[") (white "]") . cyan . ppWindow + formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . vividGreen . ppWindow + + -- | Windows should have *some* title, which should not exceed a + -- sane length. + ppWindow :: String -> String + ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 + + cyan, vividGreen, lowWhite, red, white, yellow :: String -> String + cyan = xmobarColor "#8be9fd" "" + vividGreen = xmobarColor "#50fa7b" "" + white = xmobarColor "#f8f8f2" "" + yellow = xmobarColor "#f1fa8c" "" + red = xmobarColor "#ff5555" "" + lowWhite = xmobarColor "#bbbbbb" "" diff --git a/.xmonad/xmonad.hs.old b/.xmonad/xmonad.hs.old new file mode 100644 index 0000000..bc6de05 --- /dev/null +++ b/.xmonad/xmonad.hs.old @@ -0,0 +1,123 @@ +import XMonad + +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +import XMonad.StackSet as W -- float purposes +import XMonad.Actions.MouseResize + + +import XMonad.Util.EZConfig +import XMonad.Util.Loggers +import XMonad.Util.Ungrab + +import XMonad.Layout.Magnifier +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Spacing + +import XMonad.Hooks.EwmhDesktops +import XMonad.Util.SpawnOnce (spawnOnce) + + +-- run or raise +import XMonad.Actions.WindowGo (runOrRaise) +import XMonad.ManageHook (className) +import XMonad.StackSet (RationalRect(..)) +-- + +import XMonad.Layout.Decoration +import XMonad.Layout.Simplest +import XMonad.Layout.SimplestFloat +import XMonad.Layout.Spacing + + + + + + + +main :: IO () +main = xmonad + . ewmhFullscreen + . ewmh + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + +myConfig = def + { modMask = mod4Mask -- Rebind Mod to the Super key + , layoutHook = myLayout -- Use custom layouts + , terminal = "alacritty" + , focusedBorderColor = "#000000" + , manageHook = myManageHook -- Match on certain windows + , startupHook = do + -- other startup commands + spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768" + spawnOnce "xrdb /home/berkeley/.Xresources" + spawnOnce "feh --bg-fill /home/berkeley/Downloads/Preto.jpg" + spawnOnce "picom -b" + spawnOnce "polybar top-monitor-1" + + } + `additionalKeysP` + [ ("M-d", spawn "rofi -show run") + , ("M-s", spawn "bash -c dictpopup") + , ("M-x", spawn "bash -c xkill") + , ("M-C-s", unGrab *> spawn "scrot -s" ) + , ("M-e", runOrRaise "icecat" (className =? "GNU IceCat")) + , ("M-p", runOrRaise "nyxt" (className =? "Nyxt")) + , ("M-t", withFocused $ windows . W.sink) -- Toggle float for the focused window + ] + + +myManageHook :: ManageHook +myManageHook = composeAll + [ className =? "Gimp" --> doFloat + , isDialog --> doFloat + ] + + +myTheme :: Theme +myTheme = def + { decoHeight = 20 + + -- Add other theme properties as needed + } + + +myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $ + Tall 1 (3/100) (1/2) ||| Full + + + + +myXmobarPP :: PP +myXmobarPP = def + { ppSep = cyan " • " + , ppTitleSanitize = xmobarStrip + , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 + , ppHidden = white . wrap " " "" + , ppHiddenNoWindows = lowWhite . wrap " " "" + , ppUrgent = red . wrap (yellow "!") (yellow "!") + , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] + , ppExtras = [logTitles formatFocused formatUnfocused] + } + where + formatFocused = wrap (white "[") (white "]") . cyan . ppWindow + formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . vividGreen . ppWindow + + -- | Windows should have *some* title, which should not exceed a + -- sane length. + ppWindow :: String -> String + ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 + + cyan, vividGreen, lowWhite, red, white, yellow :: String -> String + cyan = xmobarColor "#8be9fd" "" + vividGreen = xmobarColor "#50fa7b" "" + white = xmobarColor "#f8f8f2" "" + yellow = xmobarColor "#f1fa8c" "" + red = xmobarColor "#ff5555" "" + lowWhite = xmobarColor "#bbbbbb" "" + diff --git a/.xmonad/xmonad.hs~ b/.xmonad/xmonad.hs~ new file mode 100644 index 0000000..8957fbe --- /dev/null +++ b/.xmonad/xmonad.hs~ @@ -0,0 +1,125 @@ +import XMonad + +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +import XMonad.StackSet as W -- float purposes +import XMonad.Actions.MouseResize + + +import XMonad.Util.EZConfig +import XMonad.Util.Loggers +import XMonad.Util.Ungrab + +import XMonad.Layout.Magnifier +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Spacing + +import XMonad.Hooks.EwmhDesktops +import XMonad.Util.SpawnOnce (spawnOnce) + + +-- run or raise +import XMonad.Actions.WindowGo (runOrRaise) +import XMonad.ManageHook (className) +import XMonad.StackSet (RationalRect(..)) +-- + +import XMonad.Layout.Decoration +import XMonad.Layout.Simplest +import XMonad.Layout.SimplestFloat +import XMonad.Layout.Spacing + + + + + + + +main :: IO () +main = xmonad + . ewmhFullscreen + . ewmh + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + +myConfig = def + { modMask = mod4Mask -- Rebind Mod to the Super key + , layoutHook = myLayout -- Use custom layouts + , terminal = "alacritty" + , focusedBorderColor = myFocusedBorderColor, + , manageHook = myManageHook -- Match on certain windows + , startupHook = do + -- other startup commands + spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768" + spawnOnce "xrdb /home/hashirama/.Xresources" + spawnOnce "feh --bg-fill /home/hashirama/wallpaper.jpg" + spawnOnce "compton -b" + spawnOnce "polybar top-monitor-1" + + } + `additionalKeysP` + [ ("M-d", spawn "rofi -show run") + , ("M-s", spawn "bash -c dictpopup") + , ("M-C-s", unGrab *> spawn "scrot -s" ) + , ("M-e", runOrRaise "goldendict" (className =? "GoldenDict-ng")) + , ("M-p", runOrRaise "nyxt" (className =? "Nyxt")) + , ("M-t", withFocused $ windows . W.sink) -- Toggle float for the focused window + ] + + +myManageHook :: ManageHook +myManageHook = composeAll + [ className =? "Gimp" --> doFloat + , isDialog --> doFloat + ] + + + +myFocusedBorderColor = "#000000" + +myTheme :: Theme +myTheme = def + { decoHeight = 20 + + -- Add other theme properties as needed + } + + +myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $ + Tall 1 (3/100) (1/2) ||| Full + + + + +myXmobarPP :: PP +myXmobarPP = def + { ppSep = cyan " • " + , ppTitleSanitize = xmobarStrip + , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 + , ppHidden = white . wrap " " "" + , ppHiddenNoWindows = lowWhite . wrap " " "" + , ppUrgent = red . wrap (yellow "!") (yellow "!") + , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] + , ppExtras = [logTitles formatFocused formatUnfocused] + } + where + formatFocused = wrap (white "[") (white "]") . cyan . ppWindow + formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . vividGreen . ppWindow + + -- | Windows should have *some* title, which should not exceed a + -- sane length. + ppWindow :: String -> String + ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 + + cyan, vividGreen, lowWhite, red, white, yellow :: String -> String + cyan = xmobarColor "#8be9fd" "" + vividGreen = xmobarColor "#50fa7b" "" + white = xmobarColor "#f8f8f2" "" + yellow = xmobarColor "#f1fa8c" "" + red = xmobarColor "#ff5555" "" + lowWhite = xmobarColor "#bbbbbb" "" +