general update

This commit is contained in:
Luddifee 2021-07-26 17:09:53 +02:00
parent 4ad20f8351
commit ca518f26eb
No known key found for this signature in database
GPG Key ID: 21AC8D2CC02D7CCC
3 changed files with 77 additions and 118 deletions

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,7 +32,7 @@ myFocusFollowsMouse = True
myClickJustFocuses :: Bool myClickJustFocuses :: Bool
myClickJustFocuses = False myClickJustFocuses = False
myBorderWidth = 3 myBorderWidth = 5
myModMask = mod4Mask myModMask = mod4Mask
@ -35,79 +41,40 @@ myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
myNormalBorderColor = "#dddddd" myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff8700" myFocusedBorderColor = "#ff8700"
myKeys conf@(XConfig {XMonad.modMask = modm}) = myKeys :: [(String, X ())]
M.fromList $ myKeys = [
-- launch a terminal -- spawning keybindings
[ ((modm, xK_Return), spawn $ XMonad.terminal conf), ("M-<Return>" , spawn myTerminal),
-- launch dmenu ("M-d" , spawn myAppMenu),
((modm, xK_p), spawn myAppMenu), ("M-S-d" , spawn myAppMenuThemes),
-- launch gmrun ("M-i" , spawn myBrowser),
((modm .|. shiftMask, xK_p), spawn myAppMenuThemes), ("M-S-i" , spawn myAltBrowser),
-- close focused window
((modm, xK_q), kill), -- killing, exiting and suspending keybindings
-- Rotate through the available layout algorithms ("M-q" , kill),
((modm, xK_space), sendMessage NextLayout), ("M-S-q" , io (exitWith ExitSuccess)),
-- Reset the layouts on the current workspace to default ("M-S-b" , spawn "systemctl suspend"),
((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 -- restarting and recompiling keybindings
((modm, xK_i), spawn myBrowser), ("M-r" , spawn "xmonad --restart"),
((modm .|. shiftMask, xK_s), spawn "systemctl suspend"), ("M-S-r" , spawn "xmonad --recompile; xmonad --restart"),
-- Quit xmonad
((modm .|. shiftMask, xK_q), io (exitWith ExitSuccess)), -- window keybindings
-- Restart xmonad ("M-<Tab>" , windows W.focusDown),
((modm .|. shiftMask, xK_o), spawn "xmonad --recompile; xmonad --restart") ("M-S-<Tab>" , windows W.focusMaster),
]
++ -- brightness keybindings
-- ("<XF86MonBrightnessUp>" , spawn "light -A 2"),
-- mod-[1..9], Switch to workspace N ("<XF86MonBrightnessDown>" , spawn "light -U 2"),
-- mod-shift-[1..9], Move client to workspace N
-- -- touchpad keybinding(s)
[ ((m .|. modm, k), windows $ f i) ("<XF86TouchpadToggle>" , spawn "bash -c \"[ \"$(xinput list-props 11 | grep 'Device Enabled' | grep -o '[01]$')\" == \"1\" ] && xinput --disable 11 || xinput --enable 11\""),
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9],
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] -- multimedia keybindings
] ("<XF86AudioRaiseVolume>" , spawn "amixer set Master 2%+"),
++ ("<XF86AudioLowerVolume>" , spawn "amixer set Master 2%-"),
-- ("<XF86AudioMute>" , spawn "amixer set Master toggle"),
-- ("M-<Print>" , spawn "bash -c \"gnome-screenshot -af /tmp/screenshot && cat /tmp/screenshot | xclip -i -selection clipboard -target image/png\"") ]
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
--
[ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0 ..],
(f, m) <- [(W.view, 0), (W.shift, shiftMask)]
]
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events -- Mouse bindings: default actions bound to mouse events
@ -133,57 +100,47 @@ 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) myLayout = spacing 12 $ avoidStruts (tiled ||| Mirror tiled ||| Full)
where where
tiled = Tall nmaster delta ratio tiled = 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 =? "Gimp" --> doFloat,
[ className =? "MPlayer" --> doFloat, resource =? "desktop_window" --> doIgnore ]
className =? "Gimp" --> doFloat,
resource =? "desktop_window" --> doIgnore,
resource =? "kdesktop" --> doIgnore
]
myEventHook = mempty myEventHook = mempty
myLogHook = return () myLogHook = return ()
myStartupHook = do myStartupHook = return ()
spawnOnce "xrandr --output DP-0 --primary --left-of HDMI-0 --auto &"
spawnOnce "nitrogen --restore &"
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 --config ~/.config/picom/picom.conf --vsync &"
xmproc1 <- spawnPipe "jackd" xmproc2 <- spawnPipe "killall xmobar; xmobar ~/.config/xmobar/xmobar.config"
xmonad $ docks defaults xmonad $ docks defaults
defaults = def {
defaults = terminal = myTerminal,
def focusFollowsMouse = myFocusFollowsMouse,
{ -- simple stuff clickJustFocuses = myClickJustFocuses,
terminal = myTerminal, borderWidth = myBorderWidth,
focusFollowsMouse = myFocusFollowsMouse, modMask = myModMask,
clickJustFocuses = myClickJustFocuses, workspaces = myWorkspaces,
borderWidth = myBorderWidth, normalBorderColor = myNormalBorderColor,
modMask = myModMask, focusedBorderColor = myFocusedBorderColor,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor, -- bindings
focusedBorderColor = myFocusedBorderColor, mouseBindings = myMouseBindings,
-- key bindings
keys = myKeys, -- hooks
mouseBindings = myMouseBindings, layoutHook = myLayout,
-- hooks, layouts manageHook = myManageHook,
layoutHook = myLayout, handleEventHook = myEventHook,
manageHook = myManageHook, logHook = myLogHook,
handleEventHook = myEventHook, startupHook = myStartupHook
logHook = myLogHook, } `additionalKeysP` myKeys
startupHook = myStartupHook
}

View File

@ -89,6 +89,9 @@ ipkg picom
mkdir -p ~/.config/picom mkdir -p ~/.config/picom
cp $FILEDIR/.config/picom/picom.conf ~/.config/picom/ cp $FILEDIR/.config/picom/picom.conf ~/.config/picom/
# install gnome-screenshot
ipkg gnome-screenshot
# install xmonad and xmobar # install xmonad and xmobar
ipkg xmonad ipkg xmonad
ipkg xmonad-utils ipkg xmonad-utils
@ -101,6 +104,7 @@ ipkg rofi
# install keepassxc # install keepassxc
ipkg keepassxc ipkg keepassxc
# copy backgrounds # setup background stuff
ipkg nitrogen
mkdir -p ~/.local/share/backgrounds mkdir -p ~/.local/share/backgrounds
cp $FILEDIR/backgrounds/* ~/.local/share/backgrounds/ cp $FILEDIR/backgrounds/* ~/.local/share/backgrounds/

View File

@ -11,8 +11,6 @@ cp $FILEDIR/.config/xmobar/xmobar-laptop.config ~/.config/xmobar/xmobar.config
# setup backlight # setup backlight
ipkg_yay light ipkg_yay light
echo "#\!/bin/sh" > /etc/rc.local sudo sh -c "printf \"#\!/bin/sh\nchown $USER /sys/class/backlight/amdgpu_bl0/brightness\nexit 0\n\" > /etc/rc.local"
echo "chown $USER /sys/class/backlight/amdgpu_bl0/brightness" >> /etc/rc.local
echo "exit 0" >> /etc/rc.local
sudo reboot sudo reboot