diff --git a/.gitignore b/.gitignore index 3b9a594..1b49813 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,18 @@ -BAZECOR -chromium -dconf -discord -EOS-arch-news.conf -EOS-arch-news-for-you.conf -EOS-greeter.conf -EOS-initial-wallpaper.XFCE -pavucontrol.ini -ristretto -systemd -Thunar -user-dirs.dirs -user-dirs.locale -xfce4 -yay -.stack-work -.surf/cache +**/BAZECOR +**/chromium +**/dconf +**/discord +**/EOS-arch-news.conf +**/EOS-arch-news-for-you.conf +**/EOS-greeter.conf +**/EOS-initial-wallpaper.XFCE +**/pavucontrol.ini +**/ristretto +**/systemd +**/Thunar +**/user-dirs.dirs +**/user-dirs.locale +**/xfce4 +**/yay +**/.stack-work +**/.surf/cache diff --git a/files/.config/gtk-3.0/bookmarks b/files/.config/gtk-3.0/bookmarks new file mode 100644 index 0000000..bbbbefd --- /dev/null +++ b/files/.config/gtk-3.0/bookmarks @@ -0,0 +1 @@ +file:///home/leon/studium/Studium diff --git a/files/.config/polybar/config.ini b/files/.config/polybar/config.ini index 268c618..0e2774d 100644 --- a/files/.config/polybar/config.ini +++ b/files/.config/polybar/config.ini @@ -54,10 +54,12 @@ module-margin-right = 2 font-0 = fixed:pixelsize=10;1 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 +font-7 = NotoEmoji:size=7; + modules-left = xmonad test modules-center = mpd gitlab-pipeline player-mpv-tail -modules-right = info-pingrtt pulseaudio filesystem memory cpu date +modules-right = network-traffic info-pingrtt pulseaudio filesystem memory cpu date tray-position = right tray-padding = 2 @@ -161,7 +163,6 @@ margin-bottom = 5 [module/xmonad] type = custom/script exec = xmonad-log - tail = true @@ -186,3 +187,10 @@ click-middle = ~/.config/polybar/polybar-scripts/player-mpv-tail.py -p playlist- click-right = ~/.config/polybar/polybar-scripts/player-mpv-tail.py -p playlist-pos +1 scroll-up = ~/.config/polybar/polybar-scripts/player-mpv-tail.py -p time-pos -10 scroll-down = ~/.config/polybar/polybar-scripts/player-mpv-tail.py -p time-pos +10 + + +[module/network-traffic] +; configure interval, etc in script +type = custom/script +exec = ~/.config/polybar/polybar-scripts/network-traffic.sh +tail = true diff --git a/files/.config/polybar/polybar-scripts/network-traffic.sh b/files/.config/polybar/polybar-scripts/network-traffic.sh new file mode 100755 index 0000000..4a4d8d4 --- /dev/null +++ b/files/.config/polybar/polybar-scripts/network-traffic.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +print_bytes() { + if [ "$1" -eq 0 ] || [ "$1" -lt 1000 ]; then + bytes="0 kB/s" + elif [ "$1" -lt 1000000 ]; then + bytes="$(echo "scale=0;$1/1000" | bc -l ) kB/s" + else + bytes="$(echo "scale=1;$1/1000000" | bc -l ) MB/s" + fi + + echo "$bytes" +} + +print_bit() { + if [ "$1" -eq 0 ] || [ "$1" -lt 10 ]; then + bit="0 B" + elif [ "$1" -lt 100 ]; then + bit="$(echo "scale=0;$1*8" | bc -l ) B" + elif [ "$1" -lt 100000 ]; then + bit="$(echo "scale=0;$1*8/1000" | bc -l ) K" + else + bit="$(echo "scale=1;$1*8/1000000" | bc -l ) M" + fi + + echo "$bit" +} + +INTERVAL=5 +INTERFACES="enp0s31f6" + +declare -A bytes + +for interface in $INTERFACES; do + bytes[past_rx_$interface]="$(cat /sys/class/net/"$interface"/statistics/rx_bytes)" + bytes[past_tx_$interface]="$(cat /sys/class/net/"$interface"/statistics/tx_bytes)" +done + +while true; do + down=0 + up=0 + + for interface in $INTERFACES; do + bytes[now_rx_$interface]="$(cat /sys/class/net/"$interface"/statistics/rx_bytes)" + bytes[now_tx_$interface]="$(cat /sys/class/net/"$interface"/statistics/tx_bytes)" + + bytes_down=$((((${bytes[now_rx_$interface]} - ${bytes[past_rx_$interface]})) / INTERVAL)) + bytes_up=$((((${bytes[now_tx_$interface]} - ${bytes[past_tx_$interface]})) / INTERVAL)) + + down=$(((( "$down" + "$bytes_down" )))) + up=$(((( "$up" + "$bytes_up" )))) + + bytes[past_rx_$interface]=${bytes[now_rx_$interface]} + bytes[past_tx_$interface]=${bytes[now_tx_$interface]} + done + + echo "D: $(print_bytes $down) U: $(print_bytes $up)" + #echo "Download: $(print_bytes $down) / Upload: $(print_bytes $up)" + # echo "Download: $(print_bit $down) / Upload: $(print_bit $up)" + + sleep $INTERVAL +done diff --git a/files/.xmonad/.stack-work/stack.sqlite3 b/files/.xmonad/.stack-work/stack.sqlite3 index 6cf058c..3bf12f9 100644 Binary files a/files/.xmonad/.stack-work/stack.sqlite3 and b/files/.xmonad/.stack-work/stack.sqlite3 differ diff --git a/files/.xmonad/stack.yaml.lock b/files/.xmonad/stack.yaml.lock index 44832cc..14e6268 100644 --- a/files/.xmonad/stack.yaml.lock +++ b/files/.xmonad/stack.yaml.lock @@ -27,7 +27,7 @@ packages: hackage: netlink-1.1.1.0 snapshots: - completed: - size: 491163 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/4.yaml - sha256: bc60043a06b58902b533baa80fb566c0ec495c41e428bc0f8c1e8c15b2a4c468 - original: lts-15.4 + size: 491373 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/3.yaml + sha256: 29e9ff61b8bf4b4fcff55cde3ac106ebb971f0d21331dccac9eee63374fa6ca8 + original: lts-15.3 diff --git a/files/.xmonad/xmonad-x86_64-linux b/files/.xmonad/xmonad-x86_64-linux index 9f7a453..f0c7f17 100755 Binary files a/files/.xmonad/xmonad-x86_64-linux and b/files/.xmonad/xmonad-x86_64-linux differ diff --git a/files/.xmonad/xmonad.errors b/files/.xmonad/xmonad.errors index 194131c..c254311 100644 --- a/files/.xmonad/xmonad.errors +++ b/files/.xmonad/xmonad.errors @@ -1,10 +1,10 @@ Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail -xmonad.hs:205:109: warning: [-Wdeprecations] +xmonad.hs:207:109: warning: [-Wdeprecations] In the use of ‘defaultConfig’ (imported from XMonad, but defined in XMonad.Config): Deprecated: "Use def (from Data.Default, and re-exported by XMonad and XMonad.Config) instead." | -205 | , manageHook = manageDocks <+> myManageHook <+> (namedScratchpadManageHook scratchpads) <+> manageHook defaultConfig +207 | , manageHook = manageDocks <+> myManageHook <+> (namedScratchpadManageHook scratchpads) <+> manageHook defaultConfig <+> (isFullscreen --> doF W.focusDown <+> doFullFloat) | ^^^^^^^^^^^^^ diff --git a/files/.xmonad/xmonad.hi b/files/.xmonad/xmonad.hi index f0bd27f..4c9cad2 100644 Binary files a/files/.xmonad/xmonad.hi and b/files/.xmonad/xmonad.hi differ diff --git a/files/.xmonad/xmonad.hs b/files/.xmonad/xmonad.hs index f639500..5f2b9e0 100644 --- a/files/.xmonad/xmonad.hs +++ b/files/.xmonad/xmonad.hs @@ -1,7 +1,7 @@ {-# Language ScopedTypeVariables #-} -- Imports -------------------------------------------------------- {{{ import qualified Data.Map as M -import Data.List (isInfixOf) +import Data.List (isSuffixOf) import qualified Data.Maybe as Maybe import qualified System.IO as SysIO import Text.Read (readMaybe) @@ -21,6 +21,7 @@ import XMonad.Config.Desktop import XMonad.Hooks.EwmhDesktops (ewmh) import XMonad.Hooks.DynamicLog +import XMonad.Hooks.ManageHelpers import XMonad.Hooks.DynamicProperty import XMonad.Hooks.FadeInactive import XMonad.Hooks.ManageDocks @@ -62,7 +63,7 @@ scratchpads = (customFloating $ W.RationalRect 0 0.7 1 0.3) , NS "ghci" (myTerminal ++ " -e \"stack exec -- ghci\" --class scratchpad_ghci") (className =? "scratchpad_ghci") (customFloating $ W.RationalRect 0 0.7 1 0.3) - , NS "whatsapp" ("gtk-launch chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Default.desktop") (("WhatsApp" `isInfixOf`) <$> title) defaultFloating + , NS "whatsapp" ("gtk-launch chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Default.desktop") (("WhatsApp" `isSuffixOf`) <$> title) defaultFloating ] {-| adds the scripts-directory path to the filename of a script |-} @@ -115,10 +116,10 @@ myLogHook = do -- Startuphook ----------------------------- {{{ myStartupHook = do - setWMName "LG3D" -- Java stuff hack spawnOnce "picom --config ~/.config/picom.conf --no-fading-openclose" spawnOnce "pasystray" spawn "/home/leon/.config/polybar/launch.sh" + setWMName "LG3D" -- Java stuff hack -- }}} @@ -195,14 +196,15 @@ main = do D.requestName dbus (D.busName_ "org.xmonad.Log") [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue] - xmonad $ ewmh $ desktopConfig +-- $ ewmh (kills IntelliJ) + xmonad $ desktopConfig { terminal = myTerminal , modMask = myModMask , borderWidth = 1 , layoutHook = avoidStruts $ myLayout , logHook = myLogHook <+> logHook desktopConfig <+> dynamicLogWithPP (polybarPP dbus) , startupHook = myStartupHook <+> startupHook desktopConfig - , manageHook = manageDocks <+> myManageHook <+> (namedScratchpadManageHook scratchpads) <+> manageHook defaultConfig + , manageHook = manageDocks <+> myManageHook <+> (namedScratchpadManageHook scratchpads) <+> manageHook defaultConfig <+> (isFullscreen --> doF W.focusDown <+> doFullFloat) , focusedBorderColor = aqua , normalBorderColor = "#282828" } `removeKeysP` removedKeys `additionalKeysP` myKeys @@ -220,12 +222,12 @@ polybarPP dbus = namedScratchpadFilterOutWorkspacePP $ def , ppCurrent = withBG bg2 , ppVisible = withBG bg2 , ppUrgent = withFG red - , ppLayout = removeWord "Spacing" . withFG purple + , ppLayout = removeWord "Hinted" . removeWord "Spacing" . withFG purple , ppHidden = wrap " " " " . unwords . map wrapOpenWorkspaceCmd . words , ppWsSep = "" , ppSep = " | " , ppExtras = [] - , ppTitle = (shorten 40) . withFG aqua + , ppTitle = withFG aqua . (shorten 40) } where removeWord substr = unwords . filter (/= substr) . words diff --git a/files/.xmonad/xmonad.o b/files/.xmonad/xmonad.o index 99f75a2..75f34ef 100644 Binary files a/files/.xmonad/xmonad.o and b/files/.xmonad/xmonad.o differ