general update

This commit is contained in:
Luddifee 2021-07-27 16:07:29 +02:00
parent 4de626ffd0
commit 39a11abbeb
No known key found for this signature in database
GPG Key ID: 21AC8D2CC02D7CCC
4 changed files with 87 additions and 122 deletions

View File

@ -38,10 +38,7 @@ myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
myBorderWidth = 5 myBorderWidth = 5
myNormalBorderColor = "#dddddd" myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff8700"
myFocusedBorderColor1 = "#ff8700"
myFocusedBorderColor2 = "#00ffa1"
myFocusedBorderColor = myFocusedBorderColor1
-- screen spacing, then window spacing -- screen spacing, then window spacing
mySpacing x y = spacingRaw False (Border x x x x) True (Border y y y y) True mySpacing x y = spacingRaw False (Border x x x x) True (Border y y y y) True
@ -58,7 +55,7 @@ myKeys = [
-- killing, exiting and suspending keybindings -- killing, exiting and suspending keybindings
("M-q" , kill), ("M-q" , kill),
("M-S-q" , io (exitWith ExitSuccess)), ("M-S-q" , io (exitWith ExitSuccess)),
("M-S-b" , spawn "systemctl suspend"), ("M-S-s" , spawn "systemctl suspend"),
-- restarting and recompiling keybindings -- restarting and recompiling keybindings
("M-r" , spawn "xmonad --restart"), ("M-r" , spawn "xmonad --restart"),

View File

@ -1,22 +1,28 @@
import qualified Data.Map as M import qualified Data.Map as M
import Data.Monoid import Data.Monoid
import System.Exit import System.Exit
import XMonad import XMonad
import XMonad.Util.Run import XMonad.Util.Run
import XMonad.Util.SpawnOnce import XMonad.Util.SpawnOnce
import XMonad.Util.EZConfig
import XMonad.Layout.Spacing import XMonad.Layout.Spacing
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
myTerminal :: String myTerminal :: String
myTerminal = "kitty" myTerminal = "kitty"
myBrowser :: String myBrowser :: String
myBrowser = "brave" myBrowser = "firefox"
myAltBrowser :: String
myAltBrowser = "brave"
myAppMenu :: String myAppMenu :: String
myAppMenu = "rofi -show run" myAppMenu = "rofi -show run"
myAppMenuThemes :: String myAppMenuThemes :: String
myAppMenuThemes = "rofi-theme-selector" myAppMenuThemes = "rofi-theme-selector"
@ -26,88 +32,53 @@ myFocusFollowsMouse = True
myClickJustFocuses :: Bool myClickJustFocuses :: Bool
myClickJustFocuses = False myClickJustFocuses = False
myBorderWidth = 3
myModMask = mod4Mask myModMask = mod4Mask
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"] myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
myBorderWidth = 5
myNormalBorderColor = "#dddddd" myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff8700" myFocusedBorderColor = "#ff8700"
myKeys conf@(XConfig {XMonad.modMask = modm}) = -- screen spacing, then window spacing
M.fromList $ mySpacing x y = spacingRaw False (Border x x x x) True (Border y y y y) True
-- launch a terminal
[ ((modm, xK_Return), spawn $ XMonad.terminal conf),
-- launch dmenu
((modm, xK_p), spawn myAppMenu),
-- launch gmrun
((modm .|. shiftMask, xK_p), spawn myAppMenuThemes),
-- close focused window
((modm, xK_q), kill),
-- Rotate through the available layout algorithms
((modm, xK_space), sendMessage NextLayout),
-- Reset the layouts on the current workspace to default
((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf),
-- Resize viewed windows to the correct size
((modm, xK_n), refresh),
-- Move focus to the next window
((modm, xK_Tab), windows W.focusDown),
-- Move focus to the next window
((modm, xK_j), windows W.focusDown),
-- Move focus to the previous window
((modm, xK_k), windows W.focusUp),
-- Move focus to the master window
((modm, xK_m), windows W.focusMaster),
-- Swap the focused window and the master window
((modm, xK_s), windows W.swapMaster),
-- Swap the focused window with the next window
((modm .|. shiftMask, xK_j), windows W.swapDown),
-- Swap the focused window with the previous window
((modm .|. shiftMask, xK_k), windows W.swapUp),
-- Shrink the master area
((modm, xK_h), sendMessage Shrink),
-- Expand the master area
((modm, xK_l), sendMessage Expand),
-- Push window back into tiling
((modm, xK_t), withFocused $ windows . W.sink),
-- Increment the number of windows in the master area
((modm, xK_comma), sendMessage (IncMasterN 1)),
-- Deincrement the number of windows in the master area
((modm, xK_period), sendMessage (IncMasterN (-1))),
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ((modm , xK_b ), sendMessage ToggleStruts)
-- Launch Browser myKeys :: [(String, X ())]
((modm, xK_i), spawn myBrowser), myKeys = [
((modm .|. shiftMask, xK_s), spawn "systemctl suspend"), -- spawning keybindings
-- Quit xmonad ("M-<Return>" , spawn myTerminal),
((modm .|. shiftMask, xK_q), io (exitWith ExitSuccess)), ("M-d" , spawn myAppMenu),
-- Restart xmonad ("M-S-d" , spawn myAppMenuThemes),
((modm .|. shiftMask, xK_o), spawn "xmonad --recompile; xmonad --restart") ("M-i" , spawn myBrowser),
] ("M-S-i" , spawn myAltBrowser),
++
-- -- killing, exiting and suspending keybindings
-- mod-[1..9], Switch to workspace N ("M-q" , kill),
-- mod-shift-[1..9], Move client to workspace N ("M-S-q" , io (exitWith ExitSuccess)),
-- ("M-S-s" , spawn "systemctl suspend"),
[ ((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9], -- restarting and recompiling keybindings
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] ("M-r" , spawn "xmonad --restart"),
] ("M-S-r" , spawn "xmonad --recompile; xmonad --restart"),
++
-- -- window keybindings
-- ("M-<Tab>" , windows W.focusDown),
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 ("M-S-<Tab>" , windows W.focusMaster),
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
-- -- spacing keybindings
[ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) ("M4-S-<Up>" , incWindowSpacing 1),
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0 ..], ("M4-S-<Down>" , decWindowSpacing 1),
(f, m) <- [(W.view, 0), (W.shift, shiftMask)] ("M1-S-<Up>" , incScreenSpacing 1),
] ("M1-S-<Down>" , decScreenSpacing 1),
-- multimedia keybindings
("<XF86AudioRaiseVolume>" , spawn "amixer set Master 2%+"),
("<XF86AudioLowerVolume>" , spawn "amixer set Master 2%-"),
("<XF86AudioMute>" , spawn "amixer set Master toggle"),
("M-<Print>" , spawn clipBoardScreenshotCommand),
("M-<Page_Down>" , spawn clipBoardScreenshotCommand) ]
clipBoardScreenshotCommand = "bash -c \"gnome-screenshot -af /tmp/screenshot && cat /tmp/screenshot | xclip -i -selection clipboard -target image/png\""
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events -- Mouse bindings: default actions bound to mouse events
@ -133,41 +104,34 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) =
-- you may also bind events to the mouse scroll wheel (button4 and button5) -- you may also bind events to the mouse scroll wheel (button4 and button5)
] ]
myLayout = spacing 24 $ avoidStruts (tiled ||| Mirror tiled ||| Full)
myLayoutHook = avoidStruts (tiled ||| Mirror tiled ||| Full)
where where
tiled = Tall nmaster delta ratio tiled = mySpacing 32 8 $ Tall nmaster delta ratio
nmaster = 1 nmaster = 1
ratio = 1/2 ratio = 1/2
delta = 3/100 delta = 3/100
myManageHook = myManageHook = composeAll [
composeAll
[ className =? "MPlayer" --> doFloat,
className =? "Gimp" --> doFloat, className =? "Gimp" --> doFloat,
resource =? "desktop_window" --> doIgnore, resource =? "desktop_window" --> doIgnore ]
resource =? "kdesktop" --> doIgnore
]
myEventHook = mempty myEventHook = mempty
myLogHook = return () myLogHook = return ()
myStartupHook = do myStartupHook = do
spawnOnce "xrandr --output DP-0 --primary --left-of HDMI-0 --auto &" spawnOnce "xsetroot -cursor_name left_ptr"
spawnOnce "nitrogen --restore &" spawnOnce "xrandr --output DP-0 --primary --left-of HDMI-0 --auto"
spawnOnce "killall picom; picom --config ~/.config/picom/picom.conf --vsync &"
spawnOnce "killall jackd;"
main = do main = do
-- xmproc0 <- spawnPipe "" xmproc0 <- spawnPipe "nitrogen --restore"
xmproc0 <- spawnPipe "killall xmobar; xmobar ~/.config/xmobar/xmobar.config" xmproc1 <- spawnPipe "killall picom; picom &"
xmproc1 <- spawnPipe "jackd" xmproc2 <- spawnPipe "killall xmobar; xmobar ~/.config/xmobar/xmobar.config"
xmonad $ docks defaults xmonad $ docks defaults
defaults = def {
defaults =
def
{ -- simple stuff
terminal = myTerminal, terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse, focusFollowsMouse = myFocusFollowsMouse,
clickJustFocuses = myClickJustFocuses, clickJustFocuses = myClickJustFocuses,
@ -176,14 +140,15 @@ defaults =
workspaces = myWorkspaces, workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor, normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor, focusedBorderColor = myFocusedBorderColor,
-- key bindings
keys = myKeys, -- bindings
mouseBindings = myMouseBindings, mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout, -- hooks
layoutHook = myLayoutHook,
manageHook = myManageHook, manageHook = myManageHook,
handleEventHook = myEventHook, handleEventHook = myEventHook,
logHook = myLogHook, logHook = myLogHook,
startupHook = myStartupHook startupHook = myStartupHook
} } `additionalKeysP` myKeys

View File

@ -85,7 +85,7 @@ sudo rm -f /etc/systemd/system/display-manager.service
sudo ln -s /usr/lib/systemd/system/gdm.service /etc/systemd/system/display-manager.service sudo ln -s /usr/lib/systemd/system/gdm.service /etc/systemd/system/display-manager.service
# setup picom # setup picom
ipkg picom ipkg_yay picom-jonaburg-git
mkdir -p ~/.config/picom mkdir -p ~/.config/picom
cp $FILEDIR/.config/picom/picom.conf ~/.config/picom/ cp $FILEDIR/.config/picom/picom.conf ~/.config/picom/

View File

@ -8,6 +8,9 @@ mkdir -p ~/.config/xmobar
cp $FILEDIR/.xmonad/xmonad-pc.hs ~/.xmonad/xmonad.hs cp $FILEDIR/.xmonad/xmonad-pc.hs ~/.xmonad/xmonad.hs
cp $FILEDIR/.config/xmobar/xmobar-pc.config ~/.config/xmobar/xmobar.config cp $FILEDIR/.config/xmobar/xmobar-pc.config ~/.config/xmobar/xmobar.config
# setup nvidia driver # download nvidia driver
# ipkg nvidia mkdir -p ~/Downloads
cd ~/Downloads
wget https://de.download.nvidia.com/XFree86/Linux-x86_64/470.57.02/NVIDIA-Linux-x86_64-470.57.02.run
sudo reboot sudo reboot