feat: add x220 config
This commit is contained in:
parent
af0739e297
commit
ff7e0631e6
90
roles/xmonad/files/bashrc_x220
Normal file
90
roles/xmonad/files/bashrc_x220
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# ~/.bashrc
|
||||||
|
|
||||||
|
# colouring terminal
|
||||||
|
export PS1='\[\033[38;5;174m\]\u\[\033[38;5;187m\]@\h\[\033[00m\]:\[\033[38;5;174m\] \w \[\033[00m\]\$ '
|
||||||
|
|
||||||
|
# colouring ls
|
||||||
|
eval $( dircolors -b $HOME/.config/dircolours)
|
||||||
|
|
||||||
|
# set vi mode for bash
|
||||||
|
set -o vi
|
||||||
|
|
||||||
|
# aliases
|
||||||
|
alias ls='ls --color'
|
||||||
|
alias la='ls -lah'
|
||||||
|
|
||||||
|
alias gf='git fetch'
|
||||||
|
alias gd='git diff'
|
||||||
|
alias gl='git log'
|
||||||
|
alias gpl='git pull'
|
||||||
|
alias gps='git push'
|
||||||
|
alias ga='git add'
|
||||||
|
alias gst='git status'
|
||||||
|
alias gck='git checkout'
|
||||||
|
alias gcm='git commit'
|
||||||
|
alias gcl='git clone'
|
||||||
|
alias gb='git branch'
|
||||||
|
alias gr='git reset'
|
||||||
|
alias grm='git rm'
|
||||||
|
|
||||||
|
alias lg='lazygit'
|
||||||
|
|
||||||
|
# starting ssh-agent
|
||||||
|
if [ -z "$SSH_AUTH_SOCK" ] ; then
|
||||||
|
eval `ssh-agent -s` 2>&1 >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# nnn config
|
||||||
|
export NNN_OPTS="eEr"
|
||||||
|
export NNN_COLORS='#a744b322'
|
||||||
|
export NNN_FCOLORS='dfdfdf6c0000df42bbbaba5f'
|
||||||
|
export NNN_TRASH=1
|
||||||
|
export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"
|
||||||
|
export NNN_BMS='b:~/bilder;d:~/downloads;D:~/dokumente;v:~/videos;m:~/musik;c:~/.config;M:/mnt/'
|
||||||
|
export NNN_PLUG='t:opennewterm;i:imgview;m:nmount'
|
||||||
|
|
||||||
|
# nnn cd on quit
|
||||||
|
n ()
|
||||||
|
{
|
||||||
|
# Block nesting of nnn in subshells
|
||||||
|
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
|
||||||
|
echo "nnn is already running"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
|
# To cd on quit only on ^G, remove the "export" as in:
|
||||||
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
|
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
|
||||||
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||||
|
# stty start undef
|
||||||
|
# stty stop undef
|
||||||
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
|
nnn "$@"
|
||||||
|
|
||||||
|
if [ -f "$NNN_TMPFILE" ]; then
|
||||||
|
. "$NNN_TMPFILE"
|
||||||
|
rm -f "$NNN_TMPFILE" > /dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# vimwiki
|
||||||
|
vw () {
|
||||||
|
if [[ $# == 0 ]]
|
||||||
|
then
|
||||||
|
git -C ~/dokumente/wiki pull
|
||||||
|
nvim ~/dokumente/wiki/index.md
|
||||||
|
git -C ~/dokumente/wiki add -A
|
||||||
|
git -C ~/dokumente/wiki commit -m "autosync-$(date +%FT%T)"
|
||||||
|
git -C ~/dokumente/wiki push
|
||||||
|
elif [[ $1 == 'g' ]]
|
||||||
|
then
|
||||||
|
git -C ~/dokumente/wiki ${@:2}
|
||||||
|
else
|
||||||
|
echo 'Usage: vw [g] [args ...]'
|
||||||
|
fi
|
||||||
|
}
|
28
roles/xmonad/files/mimeapps_x220.list
Normal file
28
roles/xmonad/files/mimeapps_x220.list
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[Default Applications]
|
||||||
|
application/pdf=org.pwmt.zathura.desktop;
|
||||||
|
audio/flac=mpv.desktop;
|
||||||
|
audio/mpeg=mpv.desktop;
|
||||||
|
video/mp4=mpv.desktop;
|
||||||
|
video/mpeg=mpv.desktop;
|
||||||
|
video/x-matroska=mpv.desktop;
|
||||||
|
image/gif=feh.desktop;
|
||||||
|
image/jpeg=feh.desktop;
|
||||||
|
image/png=feh.desktop;
|
||||||
|
image/tiff=feh.desktop;
|
||||||
|
image/svg+xml=feh.desktop;
|
||||||
|
text/plain=nvim.desktop;
|
||||||
|
text/markdown=nvim.desktop;
|
||||||
|
text/html=librewolf.desktop
|
||||||
|
x-scheme-handler/http=librewolf.desktop
|
||||||
|
x-scheme-handler/https=librewolf.desktop
|
||||||
|
x-scheme-handler/about=librewolf.desktop
|
||||||
|
x-scheme-handler/unknown=librewolf.desktop
|
||||||
|
x-scheme-handler/nxm=vortex-downloads-handler.desktop
|
||||||
|
x-scheme-handler/nxm-protocol=vortex-downloads-handler.desktop
|
||||||
|
x-scheme-handler/chrome=librewolf.desktop
|
||||||
|
application/x-extension-htm=librewolf.desktop
|
||||||
|
application/x-extension-html=librewolf.desktop
|
||||||
|
application/x-extension-shtml=librewolf.desktop
|
||||||
|
application/xhtml+xml=librewolf.desktop
|
||||||
|
application/x-extension-xhtml=librewolf.desktop
|
||||||
|
application/x-extension-xht=librewolf.desktop
|
61
roles/xmonad/files/profile_x220
Normal file
61
roles/xmonad/files/profile_x220
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# first read by bash on login
|
||||||
|
|
||||||
|
# colour scheme for terminal
|
||||||
|
export TERM=xterm-256color
|
||||||
|
|
||||||
|
# colour scheme for gtk applications
|
||||||
|
export GTK_THEME=Adwaita:dark
|
||||||
|
|
||||||
|
# default programs
|
||||||
|
export EDITOR="nvim"
|
||||||
|
export VISUAL="open_editor_in_new_shell"
|
||||||
|
export TERMINAL="alacritty"
|
||||||
|
export READER="zathura"
|
||||||
|
export BROWSER="librewolf"
|
||||||
|
|
||||||
|
# environment variables
|
||||||
|
export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
|
export XDG_CACHE_HOME="$HOME/.cache"
|
||||||
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
|
export XDG_RUNTIME_DIR="/run/user/1000"
|
||||||
|
|
||||||
|
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||||
|
export WINEPREFIX="$XDG_DATA_HOME/wine"
|
||||||
|
export LESSHISTFILE=-
|
||||||
|
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
|
||||||
|
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
||||||
|
export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc"
|
||||||
|
export HISTFILE="$XDG_DATA_HOME/bash/history"
|
||||||
|
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
|
||||||
|
export KDEHOME="$XDG_CONFIG_HOME/kde4"
|
||||||
|
export ANDROID_SDK_ROOT="$XDG_CONFIG_HOME/android"
|
||||||
|
export ADB_VENDOR_KEY="$XDG_CONFIG_HOME/android"
|
||||||
|
export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"
|
||||||
|
export ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/de.pws; repl $XDG_CONFIG_HOME/aspell/de.prepl"
|
||||||
|
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
|
||||||
|
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
||||||
|
export TS3_CONFIG_DIR="$XDG_CONFIG_HOME/ts3client"
|
||||||
|
export XMONAD_CONFIG_HOME="$XDG_CONFIG_HOME/xmonad"
|
||||||
|
export XMONAD_DATA_HOME="$XDG_DATA_HOME/xmonad"
|
||||||
|
export XMONAD_CACHE_HOME="$XDG_CACHE_HOME/xmonad"
|
||||||
|
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||||
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
|
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
||||||
|
export DVDCSS_CACHE="$XDG_DATA_HOME/dvdcss"
|
||||||
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||||
|
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||||
|
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
||||||
|
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
||||||
|
export AZURE_CONFIG_DIR="$XDG_DATA_HOME/azure"
|
||||||
|
export NUGET_PACKAGES="$XDG_CACHE_HOME/NuGetPackages"
|
||||||
|
|
||||||
|
# if running bash
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# add private bin and its subdirectories to the $PATH
|
||||||
|
export PATH="$PATH:$XDG_DATA_HOME/cargo/bin:$(du "$HOME/.local/bin" | cut -f2 | grep -v git | paste -s -d ':')"
|
20
roles/xmonad/files/xmobarrc_x220
Normal file
20
roles/xmonad/files/xmobarrc_x220
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Config { font = "Iosevka Normal 11"
|
||||||
|
, bgColor = "#3f3f3f"
|
||||||
|
, fgColor = "#dcdccc"
|
||||||
|
, position = TopH 22
|
||||||
|
, border = FullB
|
||||||
|
, borderColor = "#dcdccc"
|
||||||
|
, lowerOnStart = True
|
||||||
|
, commands = [Run DynNetwork ["-t", "<fc=#dca3a3><dev>:</fc> ↓ <rx> | ↑ <tx> kbps"] 10
|
||||||
|
, Run BatteryP ["BAT0"] ["-t", "<fc=#8c8cbc>Bat:</fc> <left>% <acstatus>"] 600
|
||||||
|
, Run Date "<fc=#dca3a3>%a, %d.%m.%Y</fc> - <fc=#ffcfaf>%H:%M</fc>" "date" 10
|
||||||
|
, Run Kbd [("de", "de"), ("de(dsb_qwertz)", "dsb"), ("ru(phonetic)", "ru")]
|
||||||
|
, Run Memory ["-t", "<fc=#7f9f7f>RAM:</fc> <usedratio>%"] 10
|
||||||
|
, Run MultiCpu ["-t", "<fc=#ffcfaf>CPU:</fc> <total>%"] 10
|
||||||
|
, Run Com "pamixer" ["--get-volume-human"] "vol" 1
|
||||||
|
, Run StdinReader
|
||||||
|
]
|
||||||
|
, sepChar = "%"
|
||||||
|
, alignSep = "}{"
|
||||||
|
, template = " | %StdinReader% }{ %dynnetwork% | %multicpu% | %memory% | <fc=#efef8f>%kbd%</fc> | %battery% | <fc=#7f9f7f>Vol:</fc> %vol% | %date% | "
|
||||||
|
}
|
299
roles/xmonad/files/xmonad_x220.hs
Normal file
299
roles/xmonad/files/xmonad_x220.hs
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
{-# OPTIONS_GHC -Wno-missing-signatures #-}
|
||||||
|
{-# OPTIONS_GHC -Wno-orphans #-}
|
||||||
|
|
||||||
|
{-# LANGUAGE BlockArguments #-}
|
||||||
|
{-# LANGUAGE ImportQualifiedPost #-}
|
||||||
|
{-# LANGUAGE InstanceSigs #-}
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
|
{-# LANGUAGE MultiWayIf #-}
|
||||||
|
{-# LANGUAGE PostfixOperators #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE TypeApplications #-}
|
||||||
|
|
||||||
|
-- Imports
|
||||||
|
import XMonad
|
||||||
|
import Data.Monoid
|
||||||
|
import System.Exit
|
||||||
|
import XMonad.Util.Run
|
||||||
|
import XMonad.Util.SpawnOnce
|
||||||
|
import XMonad.Hooks.DynamicLog
|
||||||
|
import XMonad.Hooks.ManageDocks
|
||||||
|
import XMonad.Layout.Spacing
|
||||||
|
import XMonad.Layout.ThreeColumns
|
||||||
|
import XMonad.Layout.LayoutModifier
|
||||||
|
import XMonad.Layout.Renamed
|
||||||
|
import XMonad.Hooks.SetWMName
|
||||||
|
import XMonad.Util.Cursor
|
||||||
|
import XMonad.Layout.NoBorders
|
||||||
|
import XMonad.Layout.PerWorkspace
|
||||||
|
import XMonad.Hooks.EwmhDesktops
|
||||||
|
import XMonad.Util.EZConfig
|
||||||
|
import XMonad.Util.NamedScratchpad
|
||||||
|
import XMonad.Actions.TopicSpace
|
||||||
|
import XMonad.Prompt
|
||||||
|
import XMonad.Prompt.FuzzyMatch
|
||||||
|
import XMonad.Prompt.Shell
|
||||||
|
import XMonad.Prompt.Workspace
|
||||||
|
import XMonad.Hooks.WorkspaceHistory (workspaceHistoryHook)
|
||||||
|
import XMonad.Hooks.DynamicProperty
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
|
import qualified Data.Map as M
|
||||||
|
import Text.Regex.Posix
|
||||||
|
import XMonad.Util.WorkspaceCompare ( getSortByIndex, filterOutWs )
|
||||||
|
import Data.Maybe (fromMaybe)
|
||||||
|
|
||||||
|
import qualified XMonad.Actions.Search as S
|
||||||
|
import qualified XMonad.Prompt as P
|
||||||
|
|
||||||
|
-- colours
|
||||||
|
white :: String = "#dcdccc"
|
||||||
|
yellow :: String = "#efef8f"
|
||||||
|
orange :: String = "#ffcfaf"
|
||||||
|
red :: String = "#dca3a3"
|
||||||
|
blue :: String = "#8cd0d3"
|
||||||
|
darkBlue :: String = "#8c8cbc"
|
||||||
|
green :: String = "#7f9f7f"
|
||||||
|
grey :: String = "#3f3f3f"
|
||||||
|
darkGrey :: String = "#262626"
|
||||||
|
|
||||||
|
-- variables
|
||||||
|
myTerminal = "alacritty"
|
||||||
|
myBorderWidth = 1
|
||||||
|
myModMask = mod4Mask
|
||||||
|
|
||||||
|
-- scratchpads
|
||||||
|
myScratchpads :: [NamedScratchpad]
|
||||||
|
myScratchpads =
|
||||||
|
[ NS "keepassxc" "keepassxc ~/dokumente/Database.kdbx" (title =? "Database.kdbx - KeePassXC" <||> title =? "Database.kdbx [Gesperrt] - KeePassXC") defaultFloating
|
||||||
|
, NS "nnn" "alacritty -t nnn -e run_in_bash n" (title =? "nnn") (customFloating $ W.RationalRect (1/4) (1/6) (2/4) (4/6))
|
||||||
|
, NS "vimwiki" "alacritty -t vimwiki -e run_in_bash vw" (title =? "vimwiki") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
|
||||||
|
, NS "pavucontrol" "pavucontrol" (title =? "Lautstärkeregler") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
|
||||||
|
, NS "cmus" "alacritty -n cmus -e cmus" (resource =? "cmus") (customFloating $ W.RationalRect (1/6) (1/6) (4/6) (4/6))
|
||||||
|
, NS "qalculate" "qalculate-gtk" (title =? "Qalculate!") (customFloating $ W.RationalRect (3/6) (1/6) (1/6) (1/6))
|
||||||
|
]
|
||||||
|
|
||||||
|
-- Topic Space
|
||||||
|
topicItems :: [TopicItem]
|
||||||
|
topicItems =
|
||||||
|
[ noAction "1" "~/"
|
||||||
|
, noAction "2" "~/"
|
||||||
|
, noAction "3" "~/"
|
||||||
|
, noAction "4" "~/"
|
||||||
|
, noAction "5" "~/"
|
||||||
|
, TI "alkaa" "~/projekte/alkaa" (switchToLayout "Programming" *> spawnShell *> spawnEditor)
|
||||||
|
]
|
||||||
|
|
||||||
|
myTopicConfig :: TopicConfig
|
||||||
|
myTopicConfig = def
|
||||||
|
{ topicDirs = tiDirs topicItems
|
||||||
|
, topicActions = tiActions topicItems
|
||||||
|
, defaultTopicAction = const (pure ()) -- by default, do nothing
|
||||||
|
, defaultTopic = "1" -- fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnShell :: X ()
|
||||||
|
spawnShell = proc $ termInDir >-$ currentTopicDir myTopicConfig
|
||||||
|
|
||||||
|
spawnEditor :: X ()
|
||||||
|
spawnEditor = proc $ (termInDir >-$ currentTopicDir myTopicConfig) >-> execute "nvim"
|
||||||
|
|
||||||
|
switchToLayout :: String -> X ()
|
||||||
|
switchToLayout = sendMessage . JumpToLayout
|
||||||
|
|
||||||
|
spawnShellAndExecute :: String -> X ()
|
||||||
|
spawnShellAndExecute cmd = proc $ (termInDir >-$ currentTopicDir myTopicConfig) >-> execute cmd
|
||||||
|
|
||||||
|
toggleTopic :: X ()
|
||||||
|
toggleTopic = switchNthLastFocusedByScreen myTopicConfig 1
|
||||||
|
|
||||||
|
myWorkSpacePrompt :: XPConfig -> (String -> X ()) -> X ()
|
||||||
|
myWorkSpacePrompt c job = do ws <- gets (W.workspaces . windowset)
|
||||||
|
sort <- getSortByIndex
|
||||||
|
let filter = filterOutWs ["1", "2", "3", "4", "5", "NSP"]
|
||||||
|
let ts = map W.tag $ filter ws
|
||||||
|
mkXPrompt (Wor "") c (mkComplFunFromList' c ts) job
|
||||||
|
|
||||||
|
topicPrompt :: XPConfig
|
||||||
|
topicPrompt = def
|
||||||
|
{ historySize = 0 -- No history in the prompt.
|
||||||
|
, fgColor = white
|
||||||
|
, fgHLight = "#3f3f3f"
|
||||||
|
, bgHLight = red
|
||||||
|
, alwaysHighlight = True -- Current best match
|
||||||
|
, height = 25
|
||||||
|
, position = CenteredAt 0.45 0.3
|
||||||
|
, promptBorderWidth = myBorderWidth -- Fit in with rest of config
|
||||||
|
, borderColor = red
|
||||||
|
, maxComplRows = Just 10 -- Max rows to show in completion window
|
||||||
|
, maxComplColumns = Just 1
|
||||||
|
, searchPredicate = fuzzyMatch
|
||||||
|
, sorter = fuzzySort
|
||||||
|
}
|
||||||
|
|
||||||
|
searx :: S.SearchEngine
|
||||||
|
searx = S.searchEngine "searx" "https://search.tfld.de/search?q="
|
||||||
|
|
||||||
|
wiktionary :: S.SearchEngine
|
||||||
|
wiktionary = S.searchEngine "wiktionary" "https://wiktionary.org/w/index.php?search="
|
||||||
|
|
||||||
|
searchList :: [(String, S.SearchEngine)]
|
||||||
|
searchList = [ ("o", S.openstreetmap)
|
||||||
|
, ("h", S.hackage)
|
||||||
|
, ("w", S.wikipedia)
|
||||||
|
, ("y", S.youtube)
|
||||||
|
, ("s", searx)
|
||||||
|
, ("t", wiktionary)
|
||||||
|
]
|
||||||
|
|
||||||
|
-- custom keybinds
|
||||||
|
myAdditionalKeys :: [(String, X ())]
|
||||||
|
myAdditionalKeys =
|
||||||
|
-- xmonad specific
|
||||||
|
[ ("M-q", spawn "xmonad --recompile; xmonad --restart")
|
||||||
|
, ("M-S-c", kill)
|
||||||
|
, ("M-j", windows W.focusDown)
|
||||||
|
, ("M-k", windows W.focusUp)
|
||||||
|
, ("M-S-j", windows W.swapDown)
|
||||||
|
, ("M-S-k", windows W.swapUp)
|
||||||
|
, ("M-h", sendMessage Shrink)
|
||||||
|
, ("M-l", sendMessage Expand)
|
||||||
|
, ("M-,", sendMessage (IncMasterN 1))
|
||||||
|
, ("M-S-,", sendMessage (IncMasterN (-1)))
|
||||||
|
, ("M-.", sendMessage ToggleStruts)
|
||||||
|
|
||||||
|
-- dmenu prompts
|
||||||
|
, ("M-<Return>", spawn "dmenu_run")
|
||||||
|
, ("M-p s", spawn "dmenu_screenshot")
|
||||||
|
, ("M-p k", spawn "dmenu_kill")
|
||||||
|
|
||||||
|
-- scratchpads
|
||||||
|
, ("M-n", namedScratchpadAction myScratchpads "nnn")
|
||||||
|
, ("M-S-a", namedScratchpadAction myScratchpads "keepassxc")
|
||||||
|
, ("M-s v", namedScratchpadAction myScratchpads "vimwiki")
|
||||||
|
, ("M-s a", namedScratchpadAction myScratchpads "pavucontrol")
|
||||||
|
, ("M-s c", namedScratchpadAction myScratchpads "cmus")
|
||||||
|
, ("M-s q", namedScratchpadAction myScratchpads "qalculate")
|
||||||
|
, ("M-s g", spawnShellAndExecute "lazygit")
|
||||||
|
|
||||||
|
-- open terminal
|
||||||
|
, ("M-S-<Return>", spawnShell)
|
||||||
|
, ("M-b", spawn "firefox")
|
||||||
|
|
||||||
|
-- layout
|
||||||
|
, ("M-t t", switchToLayout "Tall")
|
||||||
|
, ("M-t p", switchToLayout "Programming")
|
||||||
|
, ("M-t f", switchToLayout "Full")
|
||||||
|
|
||||||
|
, ("M-S-f", withFocused $ windows . W.sink)
|
||||||
|
|
||||||
|
-- media keys
|
||||||
|
, ("<XF86AudioMute>", spawn "pamixer -t" *> spawn "brightnessctl -q -d platform::mute s $((1-$(brightnessctl -d platform::mute g)))")
|
||||||
|
, ("<XF86AudioLowerVolume>", spawn "pamixer -d 5")
|
||||||
|
, ("<XF86AudioRaiseVolume>", spawn "pamixer -i 5")
|
||||||
|
, ("<XF86AudioMicMute>", spawn "pamixer --default-source -t" *> spawn "brightnessctl -q -d platform::micmute s $((1-$(brightnessctl -d platform::micmute g)))")
|
||||||
|
, ("<XF86MonBrightnessDown>", spawn "brightnessctl -q -- s '-10%'")
|
||||||
|
, ("<XF86MonBrightnessUp>", spawn "brightnessctl -q -- s '+10%'")
|
||||||
|
|
||||||
|
-- lock screen
|
||||||
|
, ("M-S-l", spawn "slock")
|
||||||
|
|
||||||
|
-- workspace switching
|
||||||
|
, ("M-<Tab>", toggleTopic)
|
||||||
|
, ("M-<Space>", myWorkSpacePrompt topicPrompt (switchTopic myTopicConfig))
|
||||||
|
, ("M-S-<Space>", myWorkSpacePrompt topicPrompt (windows . W.shift))
|
||||||
|
]
|
||||||
|
++
|
||||||
|
[ ("M-" ++ m ++ k, f i)
|
||||||
|
| (i, k) <- zip (topicNames topicItems) (map show [1 .. 5 :: Int])
|
||||||
|
, (f, m) <- [(switchTopic myTopicConfig, ""), (windows . W.shift, "S-")]
|
||||||
|
]
|
||||||
|
-- Search commands
|
||||||
|
++ [("M-d " ++ k, S.promptSearch topicPrompt f) | (k,f) <- searchList ]
|
||||||
|
++ [("M-S-d " ++ k, S.selectSearch f) | (k,f) <- searchList ]
|
||||||
|
|
||||||
|
|
||||||
|
-- Layouts
|
||||||
|
mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||||
|
mySpacing i = spacingRaw True (Border i i i i) True (Border i i i i) True
|
||||||
|
|
||||||
|
myLayout = avoidStruts $ tiling ||| hacking ||| full
|
||||||
|
where
|
||||||
|
tiling = renamed [Replace "Tall"] $ smartBorders $ mySpacing 6 $ Tall 1 (3/100) (1/2)
|
||||||
|
hacking = renamed [Replace "Programming"] $ smartBorders $ mySpacing 6 $ Tall 1 (3/100) (5/8)
|
||||||
|
full = noBorders Full
|
||||||
|
-- Regex lifted up to use in manageHook
|
||||||
|
(*!?) :: Functor f => f String -> String -> f Bool
|
||||||
|
q *!? x = fmap (=~ x) q
|
||||||
|
|
||||||
|
-- window rules
|
||||||
|
myManageHook = composeAll . concat $
|
||||||
|
[ [ resource =? "desktop_window" --> doIgnore ]
|
||||||
|
, [ resource =? "kdesktop" --> doIgnore ]
|
||||||
|
, [ ( className =? "LibreWolf" <&&> role =? "Organizer" ) --> doFloat ]
|
||||||
|
|
||||||
|
-- float specific classes
|
||||||
|
, [ className =? c --> doFloat | c <- myFloatingClasses ]
|
||||||
|
|
||||||
|
-- scratchpads
|
||||||
|
, [ namedScratchpadManageHook myScratchpads ]
|
||||||
|
]
|
||||||
|
where
|
||||||
|
role = stringProperty "WM_WINDOW_ROLE"
|
||||||
|
myFloatingClasses = ["Gimp", "Origin"]
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
-- Event handling
|
||||||
|
|
||||||
|
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
|
||||||
|
--
|
||||||
|
-- Defines a custom handler function for X Events. The function should
|
||||||
|
-- return (All True) if the default handler is to be run afterwards. To
|
||||||
|
-- combine event hooks use mappend or mconcat from Data.Monoid.
|
||||||
|
--
|
||||||
|
myEventHook = dynamicPropertyChange "WM_NAME" (title =? "Database.kdbx - KeePassXC" <||> title =? "Database.kdbx [Gesperrt] - KeePassXC" --> floating)
|
||||||
|
where floating = customFloating $ W.RationalRect (1/8) (1/8) (3/4) (3/4)
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
-- Status bars and logging
|
||||||
|
|
||||||
|
-- Perform an arbitrary action on each internal state change or X event.
|
||||||
|
-- See the 'XMonad.Hooks.DynamicLog' extension for examples.
|
||||||
|
--
|
||||||
|
-- myLogHook = return ()
|
||||||
|
|
||||||
|
-- Startup hook
|
||||||
|
myStartupHook = do
|
||||||
|
setWMName "LG3D"
|
||||||
|
setDefaultCursor xC_left_ptr
|
||||||
|
spawnOnce "redshift -l 51.33:12.40"
|
||||||
|
spawnOnce "safeeyes -e"
|
||||||
|
spawnOnce "/usr/bin/dunst"
|
||||||
|
spawnOnce "feh --bg-fill ~/bilder/bg.jpg ~/bilder/bg.jpg"
|
||||||
|
|
||||||
|
-- Main
|
||||||
|
main = do
|
||||||
|
xmproc0 <- spawnPipe "xmobar -x 0 /home/max/.config/xmobar/xmobarrc"
|
||||||
|
xmproc1 <- spawnPipe "xmobar -x 1 /home/max/.config/xmobar/xmobarrc"
|
||||||
|
xmonad $ ewmh . spawnExternalProcess def $ docks def {
|
||||||
|
-- simple stuff
|
||||||
|
terminal = myTerminal,
|
||||||
|
borderWidth = myBorderWidth,
|
||||||
|
modMask = myModMask,
|
||||||
|
workspaces = topicNames topicItems,
|
||||||
|
normalBorderColor = white,
|
||||||
|
focusedBorderColor = red,
|
||||||
|
keys = mempty,
|
||||||
|
-- hooks, layouts
|
||||||
|
layoutHook = myLayout,
|
||||||
|
manageHook = myManageHook,
|
||||||
|
handleEventHook = myEventHook,
|
||||||
|
logHook = workspaceHistoryHook >> (dynamicLogWithPP $ filterOutWsPP ["NSP"] $ xmobarPP {
|
||||||
|
ppCurrent = xmobarColor "#dca3a3" "" . wrap "[ " " ]",
|
||||||
|
ppHidden = xmobarColor "#8cd0d3" "",
|
||||||
|
ppLayout = xmobarColor "#8c8cbc" "",
|
||||||
|
ppTitle = xmobarColor "#ffcfaf" "" . shorten 100,
|
||||||
|
ppSep = " | ",
|
||||||
|
ppOutput = \x -> hPutStrLn xmproc0 x >> hPutStrLn xmproc1 x
|
||||||
|
}),
|
||||||
|
startupHook = myStartupHook
|
||||||
|
} `additionalKeysP` myAdditionalKeys
|
@ -21,18 +21,19 @@
|
|||||||
- mpv
|
- mpv
|
||||||
- nsxiv
|
- nsxiv
|
||||||
- zathura
|
- zathura
|
||||||
|
- ttc-iosevka
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
tags: [pc, setup]
|
tags: [pc, setup]
|
||||||
|
|
||||||
- name: Install t460p specifig packages
|
- name: Install laptop specific packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- pavucontrol
|
- pavucontrol
|
||||||
- pamixer
|
- pamixer
|
||||||
- brightnessctl
|
- brightnessctl
|
||||||
state: present
|
state: present
|
||||||
tags: [t460p, setup]
|
tags: [t460p, x220, setup]
|
||||||
|
|
||||||
- name: Build and install dmenu
|
- name: Build and install dmenu
|
||||||
community.general.make:
|
community.general.make:
|
||||||
@ -153,6 +154,19 @@
|
|||||||
- { src: mimeapps_qwerty.list, dest: ~/.config/mimeapps.list }
|
- { src: mimeapps_qwerty.list, dest: ~/.config/mimeapps.list }
|
||||||
tags: qwerty
|
tags: qwerty
|
||||||
|
|
||||||
|
- name: Copy over x220 config files
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: '0644'
|
||||||
|
with_items:
|
||||||
|
- { src: xmonad_x220.hs, dest: ~/.config/xmonad/xmonad.hs }
|
||||||
|
- { src: xmobarrc_x220, dest: ~/.config/xmobar/xmobarrc }
|
||||||
|
- { src: bashrc_x220, dest: ~/.bashrc }
|
||||||
|
- { src: profile_x220, dest: ~/.profile }
|
||||||
|
- { src: mimeapps_x220.list, dest: ~/.config/mimeapps.list }
|
||||||
|
tags: x220
|
||||||
|
|
||||||
- name: Enable Lightdm
|
- name: Enable Lightdm
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: lightdm
|
name: lightdm
|
||||||
|
Loading…
Reference in New Issue
Block a user