From 34f0e612d448f4fdfba83e93d524446e06e79dd5 Mon Sep 17 00:00:00 2001 From: Lucy McPhail Date: Mon, 22 Jul 2024 19:58:04 +0100 Subject: [PATCH] Add .xinitrc Add .xmobarrc Add .config/xmonad/xmonad.hs --- dot_xinitrc | 20 ++++++++++ dot_xmobarrc | 45 ++++++++++++++++++++++ private_dot_config/xmonad/xmonad.hs | 60 +++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 dot_xinitrc create mode 100644 dot_xmobarrc create mode 100644 private_dot_config/xmonad/xmonad.hs diff --git a/dot_xinitrc b/dot_xinitrc new file mode 100644 index 0000000..447eb90 --- /dev/null +++ b/dot_xinitrc @@ -0,0 +1,20 @@ +#!/bin/sh + +xrandr --output eDP-1 --dpi 204 + +trayer --edge top --align right --SetDockType true --SetPartialStrut true \ + --expand true --transparent true --alpha 0 --tint 0x000000 --width 10 --height 50 & + +feh --bg-fill --no-fehbg ~/.wallpaper.jpg + +xscreensaver -no-splash & + +xfce4-power-manager & + +dunst & + +if [ -x /usr/bin/nm-applet ] ; then + nm-applet --sm-disable & +fi + +exec xmonad diff --git a/dot_xmobarrc b/dot_xmobarrc new file mode 100644 index 0000000..fee50a2 --- /dev/null +++ b/dot_xmobarrc @@ -0,0 +1,45 @@ +Config { overrideRedirect = False + , font = "xft:Berkeley Mono-20" + , bgColor = "#000000" + , fgColor = "#ffffff" + , position = TopSize L 90 50 + , commands = [ Run Cpu + [ "--template", "c: %" + , "-L", "3" + , "-H", "50" + , "--high" , "#ff5f59" + , "--normal", "#44bc44" + ] 10 + , Run Alsa "default" "Master" + [ "--template", "v: " + , "--suffix" , "True" + , "--" + , "--on", "" + ] + , Run Battery + [ "--template" , "b: " + , "--Low" , "10" + , "--High" , "80" + , "--low" , "#ff5f59" + , "--normal" , "#fec43f" + , "--high" , "#44bc44" + + , "--" -- battery specific options + -- discharging status + , "-o" + , "% ()" + -- AC "on" status + , "-O" + , "Charging" + -- charged status + , "-i" + , "Charged" + ] 50 + , Run Mpris2 "mpd" ["-t", " - "] 10 + , Run Date "%a %d <fc=#feacd0>%H:%M</fc>" "date" 10 + , Run XMonadLog + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%XMonadLog% }{ %battery% | %alsa:default:Master% | %cpu% | %mpris2% | %date% " + } diff --git a/private_dot_config/xmonad/xmonad.hs b/private_dot_config/xmonad/xmonad.hs new file mode 100644 index 0000000..a48ed14 --- /dev/null +++ b/private_dot_config/xmonad/xmonad.hs @@ -0,0 +1,60 @@ +import XMonad + +import XMonad.Util.EZConfig +import XMonad.Util.Ungrab + +import XMonad.Layout.ThreeColumns +import XMonad.Layout.NoBorders +import XMonad.Layout.Spacing +import XMonad.Layout.Renamed + +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +main :: IO () +main = xmonad + . ewmhFullscreen + . ewmh + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + +myConfig = def + { modMask = mod4Mask -- rebind mod to super + , layoutHook = myLayout + , terminal = "alacritty" + , borderWidth = 4 + , normalBorderColor = "#000000" + , focusedBorderColor = "#feacd0" + } + `additionalKeysP` + [ ("M-S-z" , spawn "xscreensaver-command -lock") + , ("M-C-s" , unGrab *> spawn "scrot -s") + , ("M-f" , spawn "firefox") + -- volume keys + , ("<XF86AudioRaiseVolume>" , spawn "pactl set-sink-volume 0 +5%") + , ("<XF86AudioLowerVolume>" , spawn "pactl set-sink-volume 0 -5%") + , ("<XF86AudioMute>" , spawn "pactl set-sink-mute 0 toggle") + -- media keys + , ("<XF86AudioPlay>" , spawn "playerctl play-pause") + , ("<XF86AudioNext>" , spawn "playerctl next") + , ("<XF86AudioPrev>" , spawn "playerctl previous") + ] + +myLayout = tiled ||| full ||| threeCol + where + tiled = renamed [Replace "[]="] . smartSpacing 8 . smartBorders $ Tall nmaster delta ratio + threeCol = renamed [Replace "=|="] . smartSpacing 8 . smartBorders $ ThreeColMid nmaster delta ratio + full = renamed [Replace "[z]"] $ smartBorders Full + nmaster = 1 + ratio = 1/2 + delta = 3/100 + +myXmobarPP :: PP +myXmobarPP = def + { ppCurrent = xmobarColor "#feacd0" "" . wrap "[" "]" + , ppTitle = xmobarColor "#d0d0d0" "" . shorten 30 + , ppVisible = wrap "(" ")" + , ppUrgent = xmobarColor "#ff5f59" "#7a6100" + } -- 2.45.2