eww-start

This commit is contained in:
2025-04-30 13:35:31 +02:00
parent 61a35c611a
commit 7fb65ea258
6 changed files with 141 additions and 165 deletions

View File

@@ -1,97 +1,29 @@
(defwindow bar-primary (defwidget workspaces-and-windows []
:monitor 0 (let content (split " " (file "/tmp/xmonad-eww-log"))
:geometry (geometry :x "0px" (let ws-list (take 9 content)
:y "25px" (let win-list (drop 9 content)
:width "100%" (box :orientation "vertical" :class "bar"
:height "25px"
:anchor "top center")
:stacking "fg"
:reserve (struts :distance "50px" :side "top")
:windowtype "dock"
:wm-ignore false
(box
:orientation "horizontal"
:halign "right"
(eventbox :onclick "notify-send Left"
:onrightclick "notify-send Right"
"Click Me!")
(rightSideBar)))
;; The Wrapper of the rightside Information ;; Workspaces
(defwidget rightSideBar [] (box :orientation "horizontal"
(box (for ws in ws-list
:space-evenly "false" (let class (if (starts-with ws "[[")
:halign "end" "ws-current"
(audio) (if (starts-with ws "(")
(nw) "ws-visible"
(date) "ws-hidden")))
)) (let name (string-trim ws "[]()")
(button :onclick (format "wmctrl -s %s" name)
:class class
(label :text name))))))
;; The Internet Information box. ;; Open windows
(defwidget audio [] (box :orientation "horizontal" :class "window-list"
(box :class "container" (for win in win-list
:space-evenly "false" (let class (if (starts-with win "*") "win-focused" "win")
:halign "end" (label :class class :text (string-trim win "*")))))
(label :class "iconBat" :text "${volicon} ") )
(label :class "text" :text "${vol} % ") )
(label :class "text" :text "${micicon} "))) )
)
;; The Internet Information box. )
(defwidget nw []
(box :class "container"
:space-evenly "false"
:halign "end"
(label :class "iconNWDown" :text " ")
(label :class "text" :text " ${nwdown} ")
(label :class "iconNWUp" :text " ")
(label :class "text" :text "${nwup} ")))
;; The date Information box.
(defwidget date []
(box :class "container"
:space-evenly "false"
:halign "end"
(label :class "iconClock" :text " ")
(label :class "text" :text "${date-time} ")))
;; Variables
(defpoll volicon
:interval "1s"
:initial "-" ; optional, defaults to poll at startup
`if [[ $(cut -d ' ' -f 2 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo "󰝟"; else echo ""; fi`)
(defpoll vol
:interval "1s"
:initial "-" ; optional, defaults to poll at startup
`Volume=$(cut -d ' ' -f 1 <<<$(pulseaudio-ctl full-status)); echo "$(( Volume/2 ))"`)
(defpoll micicon
:interval "1s"
:initial "-" ; optional, defaults to poll at startup
`if [[ $(cut -d ' ' -f 3 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo ""; else echo ""; fi`)
(defpoll nwup ;; TODO
:interval "1s"
:initial "-" ; optional, defaults to poll at startup
`echo "up"`)
(defpoll nwdown ; TODO
:interval "1s"
:initial "-" ; optional, defaults to poll at startup
`echo "down"`)
(defpoll date-time
:interval "1s"
:initial "initial-value" ; optional, defaults to poll at startup
`date "+%a %d.%m.%y %H:%M:%S"`)
;; IDK
(defwidget greeter [?text name]
(box :orientation "horizontal"
:halign "center"
:geometry (geometry :x "0px"
:y "0px"
:height "20px"
:anchor "top center")
text))

View File

@@ -0,0 +1,4 @@
tail -F /tmp/xmonad-eww-log | while read -r line; do
clean_line=$(echo "$line" | sed -E 's/<[^>]+>//g')
eww update xmonad_log="$clean_line"
done

View File

@@ -5,6 +5,7 @@ return {
name = "catppuccin", name = "catppuccin",
priority = 1000, priority = 1000,
config = function() config = function()
require("catppuccin").setup()
vim.cmd.colorscheme("catppuccin-mocha") vim.cmd.colorscheme("catppuccin-mocha")
end, end,
opts = { opts = {

View File

@@ -19,5 +19,7 @@
xorg.xmessage xorg.xmessage
ghc ghc
cabal-install cabal-install
wmctrl
trayer
]; ];
} }

View File

@@ -1,102 +1,101 @@
import XMonad
import XMonad.Util.SpawnOnce (spawnOnce)
import XMonad.Hooks.EwmhDesktops
import XMonad.Util.EZConfig
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Magnifier
import XMonad.Util.ClickableWorkspaces
import XMonad.Util.Loggers
import Data.ByteString (maximum) import Data.ByteString (maximum)
import Distribution.Compat.Prelude (print) import Distribution.Compat.Prelude (print)
--import Control.Monad.RWS (All(All)) import System.IO
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Layout.Magnifier
import XMonad.Layout.ThreeColumns
import XMonad.Util.ClickableWorkspaces
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.Run (spawnPipe)
import XMonad.Util.SpawnOnce (spawnOnce)
-- import Control.Monad.RWS (All(All))
import XMonad.Hooks.ManageHelpers import XMonad.Hooks.ManageHelpers
main = do
xmonad . ewmhFullscreen . ewmh $ myConfig
main = xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey $ myconfig myConfig =
def
myconfig = def { modMask = mod4Mask
{
modMask = mod4Mask
, layoutHook = myLayout
, terminal = "alacritty" , terminal = "alacritty"
, layoutHook = avoidStruts myLayout
, normalBorderColor = "#f5c2e7" , normalBorderColor = "#f5c2e7"
, focusedBorderColor = "#cdd6f4" , focusedBorderColor = "#cdd6f4"
, manageHook = myManageHooks , manageHook = manageDocks <+> myManageHooks
, startupHook = myStartupHook , startupHook = myStartupHook
, logHook = dynamicLogWithPP myXmobarPP
} }
`additionalKeysP` `additionalKeysP` myKeys
[
-- Messages myKeys =
[ -- Messages
("M-m w", spawn "xmessage 'Test Message :)'") -- type mod+x then w to pop up 'woohoo!') ("M-m w", spawn "xmessage 'Test Message :)'") -- type mod+x then w to pop up 'woohoo!')
-- System -- System
, ("M-p", spawn "rofi -show \"drun\"") , ("M-p", spawn "rofi -show \"drun\"")
-- Screenshots , -- Screenshots
, ("<Print>", spawn "maim --format=png \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Whole Screen to File ("<Print>", spawn "maim --format=png \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Whole Screen to File
, ("M-<Print>", spawn "maim --format=png --window $(xdotool getactivewindow) \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Focused Window to File , ("M-<Print>", spawn "maim --format=png --window $(xdotool getactivewindow) \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Focused Window to File
, ("S-<Print>", spawn "maim --format=png --select \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Selection to File , ("S-<Print>", spawn "maim --format=png --select \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Selection to File
, ("C-<Print>", spawn "maim --format=png | xclip -selection clipboard -t image/png") -- Whole Screen to Clipboard , ("C-<Print>", spawn "maim --format=png | xclip -selection clipboard -t image/png") -- Whole Screen to Clipboard
, ("M-C-<Print>", spawn "maim --format=png --window $(xdotool getactivewindow) | xclip -section clipboard -t image/png") -- Focused Window to Clipboard , ("M-C-<Print>", spawn "maim --format=png --window $(xdotool getactivewindow) | xclip -section clipboard -t image/png") -- Focused Window to Clipboard
, ("C-S-<Print>", spawn "maim --format=png --select | xclip -selection clipboard -t image/png") -- Selection to Clipboard , ("C-S-<Print>", spawn "maim --format=png --select | xclip -selection clipboard -t image/png") -- Selection to Clipboard
--Program -- Program
, ("M-c", spawn "firefox") , ("M-c", spawn "firefox")
, ("M-y", spawn "signal-desktop") , ("M-y", spawn "signal-desktop")
, ("M-x", spawn "telegram-desktop") , ("M-x", spawn "telegram-desktop")
, ("M-c", spawn "firefox") , ("M-c", spawn "firefox")
, ("M-v", spawn "thunderbird") , ("M-v", spawn "thunderbird")
-- Brightness , -- Brightness
, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10") ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10")
, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10") , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10")
-- Audio , -- Audio
, ("<XF86AudioMute>", spawn "pulseaudio-ctl mute") ("<XF86AudioMute>", spawn "pulseaudio-ctl mute")
, ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up 5") , ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up 5")
, ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down 5") , ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down 5")
, ("<XF86AudioMicMute>", spawn "pulseaudio-ctl mute-input") , ("<XF86AudioMicMute>", spawn "pulseaudio-ctl mute-input")
] ]
--`removeKeysP` [ "M-S-q" ]
-- `removeKeysP` [ "M-S-q" ]
myXmobarPP :: PP myXmobarPP :: PP
myXmobarPP = def myXmobarPP =
{ def
ppSep = pink "" { ppOutput = \str -> do
, ppWsSep = "" writeFile "/tmp/xmonad-eww-log" str
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#f38ba8" 2 , ppCurrent = wrap "[[" "]]"
, ppVisible = wrap " " "" . xmobarBorder "Top" "#a6e3a1" 2 , ppVisible = wrap "(" ")"
, ppHidden = green . wrap " " "" , ppHidden = wrap " " " "
, ppHiddenNoWindows = gray . wrap " " "" , ppHiddenNoWindows = id
, ppUrgent = red . wrap (yellow "!") (yellow "!") , ppUrgent = wrap "!" "!"
, ppTitleSanitize = xmobarStrip , ppSep = " "
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins] , ppOrder = \(ws : _ : _ : wins : _) -> [ws, wins]
, ppExtras = [logTitles formatFocused formatUnfocused] , ppExtras = [logTitles formatFocused formatUnfocused]
} }
where where
formatFocused = wrap "[" "]" . pink . ppWindow formatFocused = wrap "*" "*" . ppWindow
formatUnfocused = wrap "[" "]" . gray . ppWindow formatUnfocused = id . ppWindow
ppWindow :: String -> String ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "???" else w) . shorten 15 -- set maximum length of windowtitle to 15 ppWindow w = if null w then "???" else take 30 w
pink, gray, red, yellow, green :: String -> String myLayout = Tall 1 (3 / 100) (1 / 2) ||| Mirror (Tall 1 (3 / 100) (1 / 2)) ||| Full ||| ThreeColMid 1 (3 / 100) (1 / 2) -- wenn wieder zoom von fokusierten Seitenfenstern gewünscht, dann Fireox fixn und: magnifiercz' 1.3 (ThreeColMid 1 (3/100) (1/2))
pink = xmobarColor "#f5c2e7" ""
green = xmobarColor "#a6e3a1" ""
gray = xmobarColor "#cdd6f4" ""
red = xmobarColor "#f38ba8" ""
yellow = xmobarColor "#f9e2af" ""
myLayout = Tall 1 (3/100) (1/2) ||| Mirror (Tall 1 (3/100) (1/2)) ||| Full ||| ThreeColMid 1 (3/100) (1/2) -- wenn wieder zoom von fokusierten Seitenfenstern gewünscht, dann Fireox fixn und: magnifiercz' 1.3 (ThreeColMid 1 (3/100) (1/2))
myManageHooks :: ManageHook myManageHooks :: ManageHook
myManageHooks = composeAll myManageHooks =
[ composeAll
isDialog --> doFloat [ isDialog --> doFloat
, className =? "Xmessage" --> doCenterFloat , className =? "Xmessage" --> doCenterFloat
] ]
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
mapM_ spawnOnce ["xmobar -x " ++ show sid | sid <- [0..9]]
spawnOnce "dropbox"
spawnOnce "nextcloud --background" spawnOnce "nextcloud --background"
spawnOnce "trayer --edge top --align left --widthtype request --height 25 --transparent true --alpha 0 --expand false --SetDockType true --SetPartialStrut true --monitor primary &"
spawnOnce "eww open bar"

38
indent.log Normal file
View File

@@ -0,0 +1,38 @@
INFO: latexindent.pl version 3.24.4, 2024-07-18, a script to indent .tex files
latexindent.pl lives here: /nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/
Sun Apr 20 15:34:29 2025
Reading input from STDIN
INFO: Processing switches:
-y|--yaml: YAML settings specified via command line
INFO: Directory for backup files and log file indent.log:
.
INFO: Perl modules are being loaded from the following directories:
/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/FindBin.pm
/nix/store/zi73jrv7iqlrwg6sk8fjbfafqs7jjj1z-perl-5.40.0-env/lib/perl5/site_perl/5.40.0/YAML/Tiny.pm
/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/File/Copy.pm
/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/File/Basename.pm
/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/Getopt/Long.pm
/nix/store/zi73jrv7iqlrwg6sk8fjbfafqs7jjj1z-perl-5.40.0-env/lib/perl5/site_perl/5.40.0/File/HomeDir.pm
INFO: LatexIndent perl modules are being loaded from, for example:
/nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/LatexIndent/Document.pm
INFO: YAML settings read: defaultSettings.yaml
Reading defaultSettings.yaml from /nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/defaultSettings.yaml
INFO: YAML reading settings
Home directory is /home/elias
latexindent.pl didn't find indentconfig.yaml or .indentconfig.yaml
see all possible locations: https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#indentconfig-options)
INFO: YAML settings read: -y switch
YAML setting: "defaultIndent:' '"
quote found in -y switch
key:
value: defaultIndent:' '
double-quoted string found in -y switch: "defaultIndent:' '", substitute to defaultIndent:' '
INFO: Phase 1: searching for objects
INFO: Phase 2: finding surrounding indentation
INFO: Phase 3: indenting objects
INFO: Phase 4: final indentation check
INFO: Output routine:
Not outputting to file; see -w and -o switches for more options.
--------------
INFO: Please direct all communication/issues to:
https://github.com/cmhughes/latexindent.pl