statusbar & tray set up

This commit is contained in:
Jade 2023-04-22 14:57:32 +02:00
parent 5bc1b7fc2b
commit dc1d2b7c2b
4 changed files with 39 additions and 37 deletions

View file

@ -11,6 +11,9 @@ import XMonad
import Data.Monoid import Data.Monoid
import System.Exit import System.Exit
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
import qualified Data.Map as M import qualified Data.Map as M
@ -61,18 +64,24 @@ myFocusedBorderColor = "#504945"
-- --
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal
[ ((modm, xK_Return), spawn $ XMonad.terminal conf) [ ((modm, xK_Return), spawn $ XMonad.terminal conf)
-- launch gmrun
, ((modm, xK_d ), spawn "rofi -show drun")
-- close focused window
, ((modm .|. shiftMask, xK_q), kill) , ((modm .|. shiftMask, xK_q), kill)
-- Rotate through the available layout algorithms -- Rotate through the available layout algorithms
, ((modm, xK_space ), sendMessage NextLayout) , ((modm, xK_space ), sendMessage NextLayout)
-- rofiing
, ((modm, xK_d), spawn "rofi -show drun")
, ((modm .|. shiftMask, xK_e), spawn "rofi -show \"desktopctl\" -modes \"desktopctl:$(which desktopctl)\"")
, ((modm, xK_m), spawn "menu-qalc")
, ((modm, xK_i), spawn "rofimoji -f alchemical_symbols anatolian_hieroglyphs emojis braille_patterns box_drawing chess_symbols emoticons geometric_shapes gothic greek_extended math mathematical_alphanumeric_symbols mathematical_operators miscellaneous_symbols miscellaneous_mathematical_symbols-a miscellaneous_mathematical_symbols-b miscellaneous_symbols_and_arrows miscellaneous_symbols_and_pictographs miscellaneous_technical modi modifier_tone_letters musical_symbols nerd_font number_forms shorthand_format_controls specials variation_selectors vertical_forms -a copy")
-- screenshotting
-- TODO: Fix/rewrite window-screenshot.sh
, ((modm, xK_w), spawn "window-screenshot.sh")
, ((modm, xK_s), spawn "flameshot gui -c -p $HOME/Pictures/screenshots")
, ((modm, xK_a), spawn "flameshot screen -c -p $HOME/Pictures/screenshots")
, ((modm, xK_t), spawn "ocr-screenshot.sh")
-- Reset the layouts on the current workspace to default -- Reset the layouts on the current workspace to default
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
@ -82,37 +91,23 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- Move focus to the next window -- Move focus to the next window
, ((modm, xK_Tab ), windows W.focusDown) , ((modm, xK_Tab ), windows W.focusDown)
-- Move focus to the next window -- Move focus
, ((modm, xK_j ), windows W.focusDown) , ((modm, xK_j ), windows W.focusDown)
-- Move focus to the previous window
, ((modm, xK_k ), windows W.focusUp ) , ((modm, xK_k ), windows W.focusUp )
-- Move focus to the master window
, ((modm, xK_m ), windows W.focusMaster )
-- Swap the focused window and the master window
, ((modm, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window -- Swap the focused window with the next window
, ((modm .|. shiftMask, xK_j ), windows W.swapDown ) , ((modm .|. shiftMask, xK_j ), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modm .|. shiftMask, xK_k ), windows W.swapUp ) , ((modm .|. shiftMask, xK_k ), windows W.swapUp )
-- Shrink the master area -- Shrink the master area
, ((modm, xK_h ), sendMessage Shrink) , ((modm, xK_h ), sendMessage Shrink)
-- Expand the master area
, ((modm, xK_l ), sendMessage Expand) , ((modm, xK_l ), sendMessage Expand)
-- Push window back into tiling -- Push window back into tiling
, ((modm, xK_t ), withFocused $ windows . W.sink) --, ((modm, xK_t ), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area -- Increment the number of windows in the master area
, ((modm , xK_comma ), sendMessage (IncMasterN 1)) , ((modm , xK_comma ), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
, ((modm , xK_period), sendMessage (IncMasterN (-1))) , ((modm , xK_period), sendMessage (IncMasterN (-1)))
-- Toggle the status bar gap -- Toggle the status bar gap
@ -121,7 +116,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- --
-- , ((modm , xK_b ), sendMessage ToggleStruts) -- , ((modm , xK_b ), sendMessage ToggleStruts)
, ((modm .|. shiftMask, xK_e ), io (exitWith ExitSuccess)) --, ((modm .|. shiftMask, xK_e ), io (exitWith ExitSuccess))
-- Restart xmonad -- Restart xmonad
--, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") --, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
@ -241,14 +236,20 @@ myLogHook = return ()
-- per-workspace layout choices. -- per-workspace layout choices.
-- --
-- By default, do nothing. -- By default, do nothing.
myStartupHook = return () myStartupHook = do
spawn "pkill oneko; oneko -tofocus -tora -position +-1+5 -fg palevioletred3 -bg pink -name 'Rose the desktop kitty'"
--spawn "pkill polybar; polybar"
spawn "pkill volumeicon; volumeicon"
spawn "pkill nm-applet; nm-applet"
spawn "mullvad-vpn --background"
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up. -- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this. -- Run xmonad with the settings you specify. No need to modify this.
-- --
main = xmonad defaults mySB = statusBarProp "polybar" (pure xmobarPP)
main = xmonad $ withEasySB mySB defToggleStrutsKey defaults
-- A structure containing your configuration settings, overriding -- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will -- fields in the default config. Any you don't override, will
@ -271,7 +272,7 @@ defaults = def
, keys = myKeys , keys = myKeys
, mouseBindings = myMouseBindings , mouseBindings = myMouseBindings
-- hooks, layouts -- hooks, layouts
, layoutHook = spacingRaw True (Border 0 10 10 10) True (Border 10 10 10 10) True $ myLayout , layoutHook = spacingRaw True (Border 0 0 0 0) True (Border 7 7 7 7) True $ myLayout
, manageHook = myManageHook , manageHook = myManageHook
, handleEventHook = myEventHook , handleEventHook = myEventHook
, logHook = myLogHook , logHook = myLogHook

View file

@ -155,7 +155,7 @@ in with lib; {
# external # external
libnotify i3lock-fancy rofi rofimoji feh xorg.xinput dunst arandr libnotify i3lock-fancy rofi rofimoji feh xorg.xinput dunst arandr
flameshot tesseract5 imagemagick xclip polybar kitty xmacro flameshot tesseract5 imagemagick xclip kitty xmacro
brightnessctl drawing libqalculate ddgr jq brillo brightnessctl drawing libqalculate ddgr jq brillo
# custom scripts # custom scripts

View file

@ -3,14 +3,15 @@
{ {
config = { config = {
home-manager.users.jade = { pkgs, ... }: { home-manager.users.jade = { pkgs, ... }: {
xsession.windowManager.i3.config.startup = [ #xsession.windowManager.i3.config.startup = [
{ #{
command = "pkill polybar; polybar"; #command = "pkill polybar; polybar";
always = true; #always = true;
} #}
]; #];
services.polybar = { services.polybar = {
enable = true; enable = true;
package = pkgs.polybarFull;
script = ""; script = "";
settings = { settings = {
@ -44,7 +45,7 @@
cursor-click = "pointer"; cursor-click = "pointer";
cursor-scroll = "ns-resize"; cursor-scroll = "ns-resize";
enable-ipc = true; enable-ipc = true;
wm-restack = "i3"; wm-restack = "generic";
override-redirect = false; override-redirect = false;
}; };

View file

@ -6,7 +6,7 @@ pkgs.writeShellScriptBin "desktopctl" ''
exit 0 exit 0
;; ;;
"Log Out") "Log Out")
pkill i3 pkill xmonad
exit 0 exit 0
;; ;;
"Shut Down") "Shut Down")