diff --git a/user/wm/xmonad/base-xmobarrc b/user/wm/xmonad/base-xmobarrc new file mode 100644 index 0000000..0366688 --- /dev/null +++ b/user/wm/xmonad/base-xmobarrc @@ -0,0 +1,44 @@ +Config { font = "Inconsolata 18" + , additionalFonts = ["Symbols Nerd Font 14"] + , border = NoBorder + , bgColor = "colorBgNormal" + , alpha = 200 + , fgColor = "colorFgNormal" + , position = TopSize C 100 28 + , textOffset = -1 + , iconOffset = -1 + , lowerOnStart = True + , pickBroadest = False + , persistent = False + , hideOnStart = False + , iconRoot = "." + , allDesktops = True + , overrideRedirect = True + , commands = [ + Run XMonadLog + , Run Date " \xf073 %a %-m/%-d/%y %-I:%M:%S%P" "date" 10 + , Run BatteryP ["BAT0"] + ["-t", "", + "-L", "10", "-H", "80", "-p", "3", "--", + "-O"," \xf303 \xf17e3% ", + "-i"," \xf303 \xf17e7% ", + "-o"," \xf303 \xf17e4% ", + "-L", "-15", "-H", "-5", + "-l", "color02Normal", "-m", "color05Normal", "-h", "color03Normal"] 10 + , Run Brightness + [ "-t", "\xf0eb % ", "--", + "-D", "amdgpu_bl1" + ] 2 + , Run Volume "default" "Master" + [ "-t", "", "--" + , "--on", " \xf028 % " + , "--onc", "color07Normal" + , "--off", " \xf026Mute " + , "--offc", "color06Normal" + ] 1 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %battery% %bright%%default:Master%}%XMonadLog%{%date% " + } +} diff --git a/user/wm/xmonad/startup.sh b/user/wm/xmonad/startup.sh new file mode 100755 index 0000000..1590abc --- /dev/null +++ b/user/wm/xmonad/startup.sh @@ -0,0 +1,116 @@ +#!/bin/sh + +trayertint=$1 + +nbColor=$2 +nfColor=$3 +sbColor=$4 +sfColor=$5 + +themeGTKName=$6 +themeAlacrittyName=$7 +themeDoomEmacsName=$8 + +colorBgNormal=$2 +colorBgBright=${27} +colorFgNormal=$3 +color01Normal=$9 +color01Bright=${10} +color02Normal=${11} +color02Bright=${12} +color03Normal=${13} +color03Bright=${14} +color04Normal=${15} +color04Bright=${16} +color05Normal=${17} +color05Bright=${18} +color06Normal=${19} +color06Bright=${20} +color07Normal=${21} +color07Bright=${22} +color08Normal=${23} +color08Bright=${24} +colorFocus=${25} +colorSecondary=${26} + +# Startup shell script called by xmonad to start necessary programs +# +## Kill previous instances of applications (Prevents multiple instances of the following if XMonad is restarted durin the X session) +killall xmobar +killall twmnd +killall trayer +killall nm-applet +killall nextcloud +killall nitrogen +killall xautolock +killall caffeine +killall syncthing-gtk +killall discord +killall qjoypad + +# pre-launch configurations +# dbus-update-activation-environment --all & +# ~/.local/bin/setup-external-monitor.sh & +# picom --experimental-backends & +picom --animations --animation-window-mass 1 --animation-for-open-window zoom --animation-stiffness 200 --experimental-backends && # requires picom-pijulius +xset r rate 350 50 & +setxkbmap -option caps:escape & +# betterdiscordctl --d-install flatpak install & + +# setup necessary environment variables +# export QT_QPA_PLATFORMTHEME="qt5ct" & +# export GTK_THEME=$themeGTKName + +sed -i 's/background_color=.*/background_color='$nbcolor'/' ~/.config/twmn/twmn.conf & +sed -i 's/foreground_color=.*/foreground_color='$sbcolor'/' ~/.config/twmn/twmn.conf & + +sed -i 's/colors: .*/colors: *'$themeAlacrittyName'/' ~/.config/alacritty/alacritty.yml & +sed -i 's/colors: .*/colors: *'$themeAlacrittyName'/' ~/.config/alacritty/alacritty.org & + +sed -i "s/(setq doom-theme .*/(setq doom-theme '"$themeDoomEmacsName")/" ~/.doom.d/config.el & +sed -i "s/(setq doom-theme .*/(setq doom-theme '"$themeDoomEmacsName")/" ~/.doom.d/doom.org & +sed -i "s/(setq doom-theme .*/(setq doom-theme '"$themeDoomEmacsName")/" ~/.doom.d/doom-pub.org & + +cp -f ~/.config/xmobar/base-xmobarrc ~/.config/xmobar/xmobarrc && +sed -i "s/colorBgNormal/"$colorBgNormal"/g" ~/.config/xmobar/xmobarrc # normal background +sed -i "s/colorBgBright/"$colorBgBright"/g" ~/.config/xmobar/xmobarrc # bright background +sed -i "s/colorFgNormal/"$colorFgNormal"/g" ~/.config/xmobar/xmobarrc # normal foreground +sed -i "s/color01Normal/"$color01Normal"/g" ~/.config/xmobar/xmobarrc # normal black +sed -i "s/color01Bright/"$color01Bright"/g" ~/.config/xmobar/xmobarrc # bright black +sed -i "s/color02Normal/"$color02Normal"/g" ~/.config/xmobar/xmobarrc # normal red +sed -i "s/color02Bright/"$color02Bright"/g" ~/.config/xmobar/xmobarrc # bright red +sed -i "s/color03Normal/"$color03Normal"/g" ~/.config/xmobar/xmobarrc # normal green +sed -i "s/color03Bright/"$color03Bright"/g" ~/.config/xmobar/xmobarrc # bright green +sed -i "s/color04Normal/"$color04Normal"/g" ~/.config/xmobar/xmobarrc # normal yellow +sed -i "s/color04Bright/"$color04Bright"/g" ~/.config/xmobar/xmobarrc # bright yellow +sed -i "s/color05Normal/"$color05Normal"/g" ~/.config/xmobar/xmobarrc # normal blue +sed -i "s/color05Bright/"$color05Bright"/g" ~/.config/xmobar/xmobarrc # bright blue +sed -i "s/color06Normal/"$color06Normal"/g" ~/.config/xmobar/xmobarrc # normal magenta +sed -i "s/color06Bright/"$color06Bright"/g" ~/.config/xmobar/xmobarrc # bright magenta +sed -i "s/color07Normal/"$color07Normal"/g" ~/.config/xmobar/xmobarrc # normal cyan +sed -i "s/color07Bright/"$color07Bright"/g" ~/.config/xmobar/xmobarrc # bright cyan +sed -i "s/color08Normal/"$color08Normal"/g" ~/.config/xmobar/xmobarrc # normal white +sed -i "s/color08Bright/"$color08Bright"/g" ~/.config/xmobar/xmobarrc # bright white +sed -i "s/colorFocus/"$colorFocus"/g" ~/.config/xmobar/xmobarrc # wm focus color +sed -i "s/colorSecondary/"$colorSecondary"/g" ~/.config/xmobar/xmobarrc & # xmobar highlight color + +# Launch necessary desktop applications +# emacs --daemon & +# xautolock -time 10 -locker "dm-tool switch-to-greeter & systemctl suspend" & +twmnd & +alttab -w 1 -t 240x160 -i 64x64 -sc 1 -bg $colorBgNormal -fg $colorFgNormal -frame $colorSecondary -inact $colorFgNormal & +nitrogen --restore & +autokey-gtk & +##/usr/bin/trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --alpha 0 --height 28 --tint $trayertint --monitor "primary" & +nm-applet & +GOMAXPROCS=1 syncthing --no-browser & +rclone mount adantium-nextcloud:/ ~/Nextcloud & +syncthing-gtk -m & +# flatpak run com.discordapp.Discord --start-minimized & +protonmail-bridge --no-window +~/.local/bin/setup-external-monitor.sh & +rm -rf ~/org & +gnome-keyring-daemon --daemonize --login & +gnome-keyring-daemon --start --components=secrets & +#back4.sh 0.04 ~/Media/Backgrounds/steampunk-city.gif & +##sleep 2 && xwinwrap -b -s -fs -st -sp -nf -ov -fdt -- mpv -wid WID --really-quiet --framedrop=vo --no-audio --panscan="1.0" --loop-file=inf --osc=no ~/Downloads/gruvbox-town-mod.gif --scale="bilinear" diff --git a/user/wm/xmonad/xmonad.nix b/user/wm/xmonad/xmonad.nix index e04298a..f25fc3d 100644 --- a/user/wm/xmonad/xmonad.nix +++ b/user/wm/xmonad/xmonad.nix @@ -1,3 +1,7 @@ { config, pkgs, ... }: -{ home.file.".config/xmonad/xmonad.hs".source = ./xmonad.hs; } +{ + home.file.".config/xmonad/xmonad.hs".source = ./xmonad.hs; + home.file.".config/xmobar/base-xmobarrc".source = ./base-xmobarrc; + home.file.".config/xmonad/startup.sh".source = ./startup.sh; +}