Browse Source

begin tweaking hidpi & xmonad settings for dell xps 13

- messes with DPI & fonts
- changes trayer height
- rewrites chunks of xmonad.hs to use EZConfig style bindings, rofi for
  launcher and i3lock for a lock screen (thanks @benlemasurier), and a
  slightly different set of layouts.  also handles some fancy laptop keys
  like volume adjustment.  still need to steal casey & tyler's stuffs for
  backlight handling, probably.

for now, i'm going to keep these changes in a separate branch rather than
attempt to make them work on all of my systems.  I'm running Debian Stretch
on here and the monitor is giant, so it would likely be a hassle, and it's
small enough that i can probably just manage as a separate branch as long
as needed.
escalation
Brennen Bearnes 4 years ago
parent
commit
829248b422
5 changed files with 122 additions and 85 deletions
  1. +3
    -1
      home/.Xresources
  2. +1
    -1
      home/.xinitrc
  3. +1
    -1
      home/.xmobarrc
  4. +114
    -81
      home/.xmonad/xmonad.hs
  5. +3
    -1
      home/bin/xmonad.start

+ 3
- 1
home/.Xresources View File

@ -20,7 +20,9 @@ XTerm*faceSize: 14
UXTerm*faceSize: 14
#endif
!
! terminal stuffs
!
urxvt*depth: 32
urxvt*borderless: 1
urxvt*scrollBar: false
@ -51,7 +53,7 @@ xcursor.size: 16
#endif
#ifdef HI_DPI
Xft.dpi: 163
Xft.dpi: 192
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull


+ 1
- 1
home/.xinitrc View File

@ -40,7 +40,7 @@ setxkbmap \
-option terminate:ctrl_alt_bksp \
-option ctrl:nocaps
xset -b # Stop beeping at me (A.K.A turn off PC speaker)
xset -b # Stop beeping at me (A.K.A turn off PC speaker)
# xset r rate 330 60 # Set keyboard repeat rate
# has? xcape && xcape -e 'Control_L=Escape' # https://github.com/alols/xcape


+ 1
- 1
home/.xmobarrc View File

@ -1,4 +1,4 @@
Config { font = "-*-Fixed-Bold-R-Normal-*-18*-*-*-*-*-*-*"
Config { font = "xft:Bitstream Vera Sans Mono:size=9:antialias=true"
, bgColor = "darkgreen"
, fgColor = "grey"
, position = BottomW L 90


+ 114
- 81
home/.xmonad/xmonad.hs View File

@ -2,21 +2,17 @@
-- am doing in this file. It is pure magpie behavior with little underlying
-- logic. I do not know Haskell.
-- Sources:
-- Some sources:
-- Things I have bookmarked: https://pinboard.in/search/u:brennen?query=xmonad
-- Tyler Cipriani's setup: https://github.com/thcipriani/dotfiles/blob/master/xmonad/xmonad.hs
-- Ben LeMasurier's setup: https://github.com/benlemasurier/ben/blob/master/.xmonad/xmonad.hs
-- http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration
-- http://www.xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Doc-Configuring.html
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8.1/doc/html/XMonad-Doc-Extending.html
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8.1/doc/html/XMonad-Actions-CycleWS.html
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html
-- I think we do this because otherwise Data.Map.keys would overlap
-- with XMonad.keys:
import qualified Data.Map as M
import System.IO
import qualified XMonad.StackSet as W -- used by the scratchpad stuff below
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Actions.GridSelect
@ -25,88 +21,55 @@ import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers(isFullscreen, isDialog, doFullFloat, doCenterFloat)
import XMonad.Layout.Accordion
import XMonad.Layout.Fullscreen
import XMonad.Layout.Grid
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.Spacing
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Layout.ToggleLayouts
import XMonad.Util.EZConfig(additionalKeys) -- Easier keybindings, not in use here yet
import XMonad.Util.EZConfig(additionalKeysP) -- Easier keybindings
import XMonad.Util.NamedScratchpad
import XMonad.Util.NamedWindows
import XMonad.Util.Run(hPutStrLn)
import XMonad.Util.Run(runInTerm) -- Need this guy for keybindings to external commands
import XMonad.Util.Run(spawnPipe) -- Need this guy for talking to xmobar
import XMonad.Util.Run(unsafeSpawn) -- Need this guy for keybindings to external commands
import XMonad.Util.Scratchpad
import qualified XMonad.StackSet as W -- used by the scratchpad stuff below
-- Tomorrow Night Colors:
colorBackground = "#1d1f21"
colorCurrent = "#282a2e"
colorSelection = "#373b41"
colorForeground = "#c5c8c6"
colorComment = "#969896"
colorRed = "#cc6666"
colorOrange = "#de935f"
colorYellow = "#f0c674"
colorGreen = "#b5bd68"
colorAqua = "#8abeb7"
colorBlue = "#81a2be"
colorPurple = "#b294bb"
-- A breakdown of desired workspaces:
-- [NSP] - named scratchpads; created implicitly by namedScratchpad stuff
-- - one gnome-terminal
-- - one gnome-terminal with a tmux containing a vim with notes
-- top - for monitoring, logs, and remote shells
-- mail - originally for thunderbird, now a rarely-used spare
-- irc - chat clients (weechat, hipchat, slack, signal, etc.)
-- code - development and writing
-- browse - web browser(s)
-- org - a vim with notes file and such
-- media - photos, graphics work, video, file managers, etc.
-- This is some crazy shit, man:
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ ewmh defaultConfig
{ borderWidth = 1
, normalBorderColor = "#281DF2"
, focusedBorderColor = "#24AD09"
, workspaces = ["top", "mail", "irc", "code", "browse", "org", "media"]
-- , terminal = "uxterm"
, terminal = "konsole"
, keys = newKeys
, manageHook = manageDocks <+> myManageHook
<+> manageHook defaultConfig
, layoutHook = myLayout
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
-- Rebind Mod to the Windows key:
, modMask = mod4Mask
}
newKeys x = M.union (keys defaultConfig x) (M.fromList (myKeys x))
myKeys x =
[ ((modMask x, xK_Right), nextWS)
, ((modMask x, xK_Left), prevWS)
, ((modMask x .|. shiftMask, xK_Down), shiftToNext)
, ((modMask x .|. shiftMask, xK_Up), shiftToPrev)
, ((modMask x .|. shiftMask, xK_Right), shiftNextScreen)
, ((modMask x .|. shiftMask, xK_Left), shiftPrevScreen)
, ((modMask x, xK_z), toggleWS)
, ((modMask x, xK_g), goToSelected defaultGSConfig)
, ((modMask x .|. shiftMask, xK_g), spawn "jump-to-window")
, ((modMask x, xK_grave), namedScratchpadAction scratchpads "scratch")
-- I am not sure why I can't use mod-n here, but it works with mod-shift-n:
, ((modMask x .|. shiftMask, xK_n), namedScratchpadAction scratchpads "notes")
]
colorBackground = "#1d1f21"
colorCurrent = "#282a2e"
colorSelection = "#373b41"
colorForeground = "#c5c8c6"
colorComment = "#969896"
colorRed = "#cc6666"
colorOrange = "#de935f"
colorYellow = "#f0c674"
colorGreen = "#b5bd68"
colorAqua = "#8abeb7"
colorBlue = "#81a2be"
colorPurple = "#b294bb"
myTerminal = "xterm"
-- i3lock is a locking mechanism presumably designed originally for i3.
-- It has a nice little input indicator thingy, and with -i can show an
-- image:
myLockScreen = "i3lock"
-- rofi is a launcher similar to dmenu, with some neat extra features.
-- It's in Debian - apt-get install rofi
myLauncher = "rofi -show run -font 'mono 28'"
manageScratchPad :: ManageHook
manageScratchPad = scratchpadManageHookDefault
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
[ resource =? "desktop_window" --> doIgnore
, className =? "Gimp" --> doFloat
, className =? "Vncviewer" --> doFloat
, className =? "Nautilus" --> doFloat
, className =? "Svkbd" --> doFloat
@ -135,20 +98,21 @@ myTabConfig = defaultTheme
, inactiveColor = colorBackground
, inactiveTextColor = colorComment
, activeTextColor = colorForeground
, fontName = "xft: Droid Sans 34"
}
-- Originally this was just:
-- myLayout = avoidStruts $ layoutHook defaultConfig
-- ...stole thcipriani's version whole cloth to try out tabs.
myLayout = avoidStruts
$ toggleLayouts tiledSpace
$ smartBorders
$ basicRotate
where
basicRotate = Full ||| tabbed shrinkText myTabConfig ||| fullTiled ||| Mirror fullTiled
basicRotate = Full |||
tabbed shrinkText myTabConfig |||
fullTiled |||
-- Mirror fullTiled |||
Grid |||
ThreeColMid 1 (3/100) (1/2)
-- tiled = spacing 5 $ ResizableTall nmaster delta ratio []
tiledSpace = spacing 60 $ ResizableTall nmaster delta ratio []
fullTiled = ResizableTall nmaster delta ratio []
@ -160,3 +124,72 @@ myLayout = avoidStruts
-- Percent of screen to increment by when resizing panes
delta = 5/100
-- A breakdown of desired workspaces:
-- [NSP] - named scratchpads; created implicitly by namedScratchpad stuff
-- - one gnome-terminal
-- - one gnome-terminal with a tmux containing a vim with notes
-- ...plus:
myWorkspaces =
[ "top" -- monitoring, logs, and remote shells
, "mail" -- originally for thunderbird, now a rarely-used spare
, "irc" -- chat clients (weechat, hipchat, slack, signal, etc.)
, "code" -- development and writing
, "browse" -- web browser(s)
, "org" -- a vim with notes file and such
, "media" -- photos, graphics work, video, file managers, etc.
]
-- ewmh is Extended Window Manager Hints, useful for wmctrl(1):
-- https://en.wikipedia.org/wiki/Extended_Window_Manager_Hints
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ ewmh defaults {
manageHook = manageDocks <+> myManageHook,
-- This seems to need to happen here so that xmproc is available:
logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
},
modMask = mod4Mask
}
defaults = def {
terminal = myTerminal
, borderWidth = 3
, normalBorderColor = colorGreen
, focusedBorderColor = colorBlue
, layoutHook = smartBorders $ myLayout
, manageHook = manageScratchPad <+> myManageHook
, workspaces = myWorkspaces
, handleEventHook = XMonad.Hooks.EwmhDesktops.fullscreenEventHook
} `additionalKeysP`
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Util-EZConfig.html
[ ("M-<Right>", nextWS)
-- , ("M-s", scratchpadSpawnActionTerminal $ myTerminal)
, ("M-p", spawn myLauncher)
, ("M-S-l", spawn myLockScreen)
, ("M-<Left>", prevWS)
, ("M-S-<Down>", shiftToNext)
, ("M-S-<Up>", shiftToPrev)
, ("M-S-<Right>", shiftNextScreen)
, ("M-S-<Left>", shiftPrevScreen)
, ("M-z", toggleWS)
, ("M-g", goToSelected defaultGSConfig)
, ("M-S-g", spawn "jump-to-window")
-- A basic scratchpad, by analogy to the ~ console in Quake:
, ("M-`", namedScratchpadAction scratchpads "scratch")
-- Notes - I am not sure why I can't use mod-n here, but works with mod-shift-n:
, ("M-S-n", namedScratchpadAction scratchpads "notes")
-- Special laptopish media keys
, ("<XF86AudioMute>", spawn "amixer set Master toggle")
, ("<XF86AudioLowerVolume>", spawn "amixer set Master 1- unmute")
, ("<XF86AudioRaiseVolume>", spawn "amixer set Master 1+ unmute")
, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5")
]

+ 3
- 1
home/bin/xmonad.start View File

@ -15,7 +15,7 @@ xrdb -merge .Xresources
xmodmap ~/.xmodmap
# Set up an icon tray
trayer --SetDockType true --SetPartialStrut true --edge bottom --align right --widthtype percent --width 10 --height 18 --alpha 10 --tint "0x00ff00" &
trayer --SetDockType true --SetPartialStrut true --edge bottom --align right --widthtype percent --width 10 --height 40 --alpha 10 --tint "0x00ff00" &
# Set the background color
xsetroot -solid midnightblue
@ -39,4 +39,6 @@ if [ -x /usr/bin/gnome-power-manager ] ; then
gnome-power-manager &
fi
# compton -b
exec xmonad-session

Loading…
Cancel
Save