From dd204af083198e7405e10c97c3790758cf0dc7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 May 2023 17:10:54 +0200 Subject: [PATCH] Continue i3 config --- i3/config | 39 +-- picom/picom.conf | 2 +- polybar/colors.config | 13 + polybar/config.ini | 120 +++++++ polybar/powerline-for-polybar.config | 448 +++++++++++++++++++++++++++ 5 files changed, 591 insertions(+), 31 deletions(-) create mode 100644 polybar/colors.config create mode 100644 polybar/config.ini create mode 100644 polybar/powerline-for-polybar.config diff --git a/i3/config b/i3/config index 5e793de..a932d6a 100644 --- a/i3/config +++ b/i3/config @@ -1,25 +1,15 @@ set $mod Mod4 font pango:monospace 8 -# exec --no-startup-id dex --autostart --environment i3 -# -# # The combination of xss-lock, nm-applet and pactl is a popular choice, so -# # they are included here as an example. Modify as you see fit. -# -# # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the -# # screen before suspend. Use loginctl lock-session to lock your screen. -# exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork -# exec --no-startup-id "feh --no-fehbg --bg-fill /home/user/.config/awesome/wallpaper/wallpaper.png" exec --no-startup-id "picom -b" +exec --no-startup-id "polybar &" -# Use pactl to adjust volume in PulseAudio. -set $refresh_i3status killall -SIGUSR1 i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status -bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -31,6 +21,9 @@ tiling_drag modifier titlebar # start a terminal bindsym $mod+Return exec alacritty +bindsym $mod+minus split v; exec alacritty +bindsym $mod+bar split h; exec alacritty + # kill focused window bindsym $mod+q kill @@ -69,13 +62,8 @@ bindsym $mod+ctrl+h split h # split in vertical orientation bindsym $mod+ctrl+v split v -# enter fullscreen mode for the focused container -bindsym $mod+m fullscreen toggle - # change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split +bindsym $mod+m layout toggle stacked split # toggle tiling / floating bindsym $mod+f floating toggle @@ -130,8 +118,6 @@ bindsym $mod+Shift+0 move container to workspace number $ws10 bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" # resize window (you can also use the mouse for that) mode "resize" { @@ -160,7 +146,6 @@ mode "resize" { bindsym $mod+r mode "resize" - # Hide the title bar default_border pixel 2 default_floating_border pixel 2 @@ -168,9 +153,3 @@ default_floating_border pixel 2 # Useless gapps gaps inner 5 smart_gaps on - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - status_command i3status -} diff --git a/picom/picom.conf b/picom/picom.conf index eabf64e..1fe6593 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -132,7 +132,7 @@ focus-exclude = [ "class_g = 'Cairo-clock'" ]; # example: # opacity-rule = [ "80:class_g = 'URxvt'" ]; # -# opacity-rule = [] +opacity-rule = ["0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'",] ################################# diff --git a/polybar/colors.config b/polybar/colors.config new file mode 100644 index 0000000..6871237 --- /dev/null +++ b/polybar/colors.config @@ -0,0 +1,13 @@ +;========================================================== +; Color theme +;========================================================== + +[colors] +background = #1f2430 +blue = #002F5F +red = #802929 +green = #427241 +yellow = #dbd759 +black = #000000 +white = #ffffff +gray = #808080 diff --git a/polybar/config.ini b/polybar/config.ini new file mode 100644 index 0000000..81490f4 --- /dev/null +++ b/polybar/config.ini @@ -0,0 +1,120 @@ +;========================================================== +; +;========================================================== + +; Include powerline utility +include-file = ~/.config/polybar/powerline-for-polybar.config + +; Include color scheme +include-file = ~/.config/polybar/colors.config + +;======================================= +; Bar +;======================================= + +[bar/example] +; Generic options +width = 100% +height = 26 +dpi-x = 96 +dpi-y = 96 + +; Set bar's default background/foreground color +background = #12151cbb +foreground = ${colors.white} + +; Set bar's fonts list +font-0 = "Noto Sans:size=11:antialias=true;3" +font-1 = "Source Code Pro:pixelsize=20:antialias=true;6" +font-2 = "Source Code Pro:size=12:weight=bold:antialias=true;3" + +; Set modules list +modules-left = xwindow +modules-center = i3 +modules-right = pulseaudio temperature memory cpu date +fixed-center = true + +;======================================= +; Modules +;======================================= + +[module/pulseaudio] +type = internal/pulseaudio +inherit = powerline-templates/right-to-left-item +background = ${colors.blue} +background-next = ${root.background} +label-muted-foreground = ${colors.gray} +format-foreground = ${colors.white} +format-volume-background = ${colors.blue} +format-muted-background = ${colors.blue} + +[module/date] +; Powerline settings +inherit = powerline-templates/right-to-left-item +background = ${colors.blue} +background-next = ${colors.background} +; Other settings +type = internal/date +format-background = ${self.background} +format-foreground = ${colors.white} +date = " %a %b %d, %H:%M:%S " + +[module/cpu] +; Powerline settings +inherit = powerline-templates/right-to-left-item +background = ${colors.background} +background-next = ${colors.blue} +; Other settings +type = internal/cpu +format-background = ${self.background} +format-foreground = ${colors.white} +label = " CPU: %percentage%% " + +[module/memory] +; Powerline settings +inherit = powerline-templates/right-to-left-item +background = ${colors.blue} +background-next = ${colors.background} +; Other settings +type = internal/memory +format-background = ${self.background} +format-foreground = ${colors.white} +label = " %gb_used% " + +[module/temperature] +; Powerline settings +inherit = powerline-templates/right-to-left-item +background = ${colors.background} +background-next = ${colors.blue} +; Other settings +type = internal/temperature +format-background = ${self.background} +format-foreground = ${colors.white} +thermal-zone = 6 +label = " %temperature-c% " + +[module/xwindow] +; Other settings +type = internal/xwindow +inherit = powerline-templates/left-to-right-item +background = ${colors.blue} +background-next = ${root.background} +format-background = ${self.background} +format-foreground = ${colors.white} +label = " %title% " + + +[module/i3] +type = internal/i3 +pin-workspaces = true +show-urgent = true +index-sort = true +enable-click = true +label-unfocused-padding = 3 +label-focused-background = ${colors.blue} +label-focused-padding = 3 +label-focused-font=3 +label-unfocused-font=3 +label-separator-padding = 2 +label-focused = %index% +label-unfocused = %index% diff --git a/polybar/powerline-for-polybar.config b/polybar/powerline-for-polybar.config new file mode 100644 index 0000000..caac7a5 --- /dev/null +++ b/polybar/powerline-for-polybar.config @@ -0,0 +1,448 @@ +; ============================================================================ ; +; +; POWERLINE FOR POLYBAR - powerline-for-polybar.config +; +; ---------------------------------------------------------------------------- ; +; +; This file contains all the necessary stuff to build your own, Powerline-based, +; fancy Polybar setup. +; +; ---------------------------------------------------------------------------- ; +; +; All provided templates are documented in this file, with a description and +; the usage syntax. +; +; ============================================================================ ; + +; ============================================================================ +; +; :: STAND-ALONE MODULES :: +; +; ============================================================================ ; + +; ============================================================================ ; +; modules :: left-to-right +; ============================================================================ ; +; +; # Left-to-right starting arrow +; +; Display a starting arrow at the beginning of a left-to-right line. +; +; NOTE: You may want to add customized content here. DON'T ! Use a regular, +; left-to-right-item for this purpose. Background and foreground colors +; are set on a per module basis. +; +; Usage: +; [module/mystartingarrow] +; inherit = powerline-modules/left-to-right-starting-arrow +; background = #rrggbb +; background-next = #rrggbb +; +; Mandatory settings: +; background Color of starting arrow. People often wants this to match +; the main theme color. +; background-next Background color of first item in line. +; +[powerline-modules/left-to-right-starting-arrow] +type = custom/text +content-background = ${self.background-next} +content-foreground = ${self.background} +content = "" + +; +; # Left-to-right end-of-line separator +; +; Display a final arrow to nicely end your line with separators. +; +; Usage: +; [module/myendingarrow] +; inherit = powerline-modules/left-to-right-end-of-line-separator +; separator = #rrggbb +; +; Mandatory settings: +; separator Color of line item separator. +; +[powerline-modules/left-to-right-end-of-line-separator] +type = custom/text +content-foreground = ${self.separator} +content = "" + +; ============================================================================ ; +; modules :: right-to-left +; ============================================================================ ; + +; +; # Right-to-left starting arrow +; +; Display a starting arrow at the beginning of a right-to-left line. +; +; NOTE: You may want to add customized content here. DON'T ! Use a regular, +; right-to-left-item for this purpose. Background and foreground colors +; are set on a per module basis. +; +; Usage: +; [module/mystartingarrow] +; inherit = powerline-modules/right-to-left-starting-arrow +; background = #rrggbb +; background-next = #rrggbb +; +; Mandatory settings: +; background Color of starting arrow. People often wants this to match +; the main theme color. +; background-next Background color of first item in line. +; +[powerline-modules/right-to-left-starting-arrow] +type = custom/text +content-background = ${self.background-next} +content-foreground = ${self.background} +label-font = 1 +content = "  " + +; +; # Right-to-left end-of-line separator +; +; Display a final arrow to nicely end your line with separators. +; +; Usage: +; [module/myendingarrow] +; inherit = powerline-modules/right-to-left-end-of-line-separator +; separator = #rrggbb +; +; Mandatory settings: +; separator Color of line item separator. +; +[powerline-modules/right-to-left-end-of-line-separator] +type = custom/text +content-foreground = ${self.separator} +label-font = 1 +content = "  " + +; ============================================================================ ; +; +; :: MODULES TEMPLATES :: +; +; ============================================================================ ; + +; ============================================================================ ; +; templates :: left-to-right +; ============================================================================ ; + +; +; # Left-to-right in-line item +; +; Display a left-to-right, in-line item. +; +; Usage: +; [module/mymodule] +; inherit = powerline-templates/left-to-right-item +; background = #rrggbb +; background-next = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; background-next Background color of next item in line. Should be set on +; ${root.background} if current item is last in line. +; +[powerline-templates/left-to-right-item] +format-suffix-foreground = ${self.background} +format-suffix-background = ${self.background-next} +format-suffix = "" +format-volume-suffix-foreground = ${self.background} +format-volume-suffix-background = ${self.background-next} +format-volume-suffix = "" +format-muted-suffix-foreground = ${self.background} +format-muted-suffix-background = ${self.background-next} +format-muted-suffix = "" +format-mounted-suffix-foreground = ${self.background} +format-mounted-suffix-background = ${self.background-next} +format-mounted-suffix = "" +format-unmounted-suffix-foreground = ${self.background} +format-unmounted-suffix-background = ${self.background-next} +format-unmounted-suffix = "" +format-connected-suffix-foreground = ${self.background} +format-connected-suffix-background = ${self.background-next} +format-connected-suffix = "" +format-disconnected-suffix-foreground = ${self.background} +format-disconnected-suffix-background = ${self.background-next} +format-disconnected-suffix = "" +content-suffix-foreground = ${self.background} +content-suffix-background = ${self.background-next} +content-suffix = "" + +; +; # Left-to-right in-line item with separator +; +; Display a left-to-right, in-line item with separator. +; +; Usage: +; [module/mymodule] +; inherit = powerline-templates/left-to-right-item-with-separator +; background = #rrggbb +; separator = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; separator Color of line item separator. +; +[powerline-templates/left-to-right-item-with-separator] +; Prefixes +format-prefix-foreground = ${self.separator} +format-prefix-background = ${self.background} +format-prefix = "" +format-volume-prefix-foreground = ${self.separator} +format-volume-prefix-background = ${self.background} +format-volume-prefix = "" +format-muted-prefix-foreground = ${self.background} +format-muted-prefix-background = ${self.separator} +format-muted-prefix = "" +format-mounted-prefix-foreground = ${self.separator} +format-mounted-prefix-background = ${self.background} +format-mounted-prefix = "" +format-unmounted-prefix-foreground = ${self.separator} +format-unmounted-prefix-background = ${self.background} +format-unmounted-prefix = "" +format-connected-prefix-foreground = ${self.separator} +format-connected-prefix-background = ${self.background} +format-connected-prefix = "" +format-disconnected-prefix-foreground = ${self.separator} +format-disconnected-prefix-background = ${self.background} +format-disconnected-prefix = "" +content-prefix-foreground = ${self.separator} +content-prefix-background = ${self.background} +content-prefix = "" +; Suffixes +format-suffix-foreground = ${self.background} +format-suffix-background = ${self.separator} +format-suffix = "" +format-volume-suffix-foreground = ${self.background} +format-volume-suffix-background = ${self.separator} +format-volume-suffix = "" +format-muted-suffix-foreground = ${self.separator} +format-muted-suffix-background = ${self.background} +format-muted-suffix = "" +format-mounted-suffix-foreground = ${self.background} +format-mounted-suffix-background = ${self.separator} +format-mounted-suffix = "" +format-unmounted-suffix-foreground = ${self.background} +format-unmounted-suffix-background = ${self.separator} +format-unmounted-suffix = "" +format-connected-suffix-foreground = ${self.background} +format-connected-suffix-background = ${self.separator} +format-connected-suffix = "" +format-disconnected-suffix-foreground = ${self.background} +format-disconnected-suffix-background = ${self.separator} +format-disconnected-suffix = "" +content-suffix-foreground = ${self.background} +content-suffix-background = ${self.separator} +content-suffix = "" + +; +; # Left-to-right line-starting item with separator +; +; Display a left-to-right, *line starting* item with separator. +; +; NOTE: This template shall only be inherited by the leftmost item of a +; left-to-right line with separators. It avoids the appearance +; of a separating arrow half at the leftmost part of the item. +; +; Usage: +; [module/mystartingmodule] +; inherit = powerline-templates/left-to-right-starting-item-with-separator +; background = #rrggbb +; separator = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; separator Color of line item separator. +; +[powerline-templates/left-to-right-starting-item-with-separator] +; Suffixes needed only +format-suffix-foreground = ${self.background} +format-suffix-background = ${self.separator} +format-suffix = "" +format-volume-suffix-foreground = ${self.background} +format-volume-suffix-background = ${self.separator} +format-volume-suffix = "" +format-muted-suffix-foreground = ${self.separator} +format-muted-suffix-background = ${self.background} +format-muted-suffix = "" +format-mounted-suffix-foreground = ${self.background} +format-mounted-suffix-background = ${self.separator} +format-mounted-suffix = "" +format-unmounted-suffix-foreground = ${self.background} +format-unmounted-suffix-background = ${self.separator} +format-unmounted-suffix = "" +format-connected-suffix-foreground = ${self.background} +format-connected-suffix-background = ${self.separator} +format-connected-suffix = "" +format-disconnected-suffix-foreground = ${self.background} +format-disconnected-suffix-background = ${self.separator} +format-disconnected-suffix = "" +content-suffix-foreground = ${self.background} +content-suffix-background = ${self.separator} +content-suffix = "" + +; ============================================================================ ; +; templates :: right-to-left +; ============================================================================ ; + +; +; # Right-to-left in-line item +; +; Display a right-to-left, in-line item. +; +; Usage: +; [module/mymodule] +; inherit = powerline-templates/right-to-left-item +; background = #rrggbb +; background-next = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; background-next Background color of next item in line. Should be set on +; ${root.background} if current item is last in line. +; +[powerline-templates/right-to-left-item] +format-prefix-foreground = ${self.background} +format-prefix-background = ${self.background-next} +format-prefix = "" +format-volume-prefix-foreground = ${self.background} +format-volume-prefix-background = ${self.background-next} +format-volume-prefix = "" +format-muted-prefix-foreground = ${self.background} +format-muted-prefix-background = ${self.background-next} +format-muted-prefix = "" +format-mounted-prefix-foreground = ${self.background} +format-mounted-prefix-background = ${self.background-next} +format-mounted-prefix = "" +format-unmounted-prefix-foreground = ${self.background} +format-unmounted-prefix-background = ${self.background-next} +format-unmounted-prefix = "" +format-connected-prefix-foreground = ${self.background} +format-connected-prefix-background = ${self.background-next} +format-connected-prefix = "" +format-disconnected-prefix-foreground = ${self.background} +format-disconnected-prefix-background = ${self.background-next} +format-disconnected-prefix = "" +content-prefix-foreground = ${self.background} +content-prefix-background = ${self.background-next} +content-prefix = "" + +; +; # Right-to-left in-line item with separator +; +; Display a right-to-left, in-line item with separator. +; +; Usage: +; [module/mymodule] +; inherit = powerline-templates/right-to-left-item-with-separator +; background = #rrggbb +; separator = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; separator Color of line item separator. +; +[powerline-templates/right-to-left-item-with-separator] +; Prefixes +format-prefix-foreground = ${self.background} +format-prefix-background = ${self.separator} +format-prefix = "" +format-volume-prefix-foreground = ${self.background} +format-volume-prefix-background = ${self.separator} +format-volume-prefix = "" +format-muted-prefix-foreground = ${self.separator} +format-muted-prefix-background = ${self.background} +format-muted-prefix = "" +format-mounted-prefix-foreground = ${self.background} +format-mounted-prefix-background = ${self.separator} +format-mounted-prefix = "" +format-unmounted-prefix-foreground = ${self.background} +format-unmounted-prefix-background = ${self.separator} +format-unmounted-prefix = "" +format-connected-prefix-foreground = ${self.background} +format-connected-prefix-background = ${self.separator} +format-connected-prefix = "" +format-disconnected-prefix-foreground = ${self.background} +format-disconnected-prefix-background = ${self.separator} +format-disconnected-prefix = "" +content-prefix-foreground = ${self.background} +content-prefix-background = ${self.separator} +content-prefix = "" +; Suffixes +format-suffix-foreground = ${self.separator} +format-suffix-background = ${self.background} +format-suffix = "" +format-volume-suffix-foreground = ${self.separator} +format-volume-suffix-background = ${self.background} +format-volume-suffix = "" +format-muted-suffix-foreground = ${self.background} +format-muted-suffix-background = ${self.separator} +format-muted-suffix = "" +format-mounted-suffix-foreground = ${self.separator} +format-mounted-suffix-background = ${self.background} +format-mounted-suffix = "" +format-unmounted-suffix-foreground = ${self.separator} +format-unmounted-suffix-background = ${self.background} +format-unmounted-suffix = "" +format-connected-suffix-foreground = ${self.separator} +format-connected-suffix-background = ${self.background} +format-connected-suffix = "" +format-disconnected-suffix-foreground = ${self.separator} +format-disconnected-suffix-background = ${self.background} +format-disconnected-suffix = "" +content-suffix-foreground = ${self.separator} +content-suffix-background = ${self.background} +content-suffix = "" + +; +; # Right-to-left line-starting item with separator +; +; Display a right-to-left, *line starting* item with separator. +; +; NOTE: This template shall only be inherited by the rightmost item of a +; right-to-left line with separators. It avoids the appearance +; of a separating arrow half at the rightmost part of the item. +; +; Usage: +; [module/mystartingmodule] +; inherit = powerline-templates/right-to-left-starting-item-with-separator +; background = #rrggbb +; separator = #rrggbb +; (...) +; +; Mandatory settings: +; background Background color of current item +; separator Color of line item separator. +; +[powerline-templates/right-to-left-starting-item-with-separator] +; Prefixes needed only +format-prefix-foreground = ${self.background} +format-prefix-background = ${self.separator} +format-prefix = "" +format-volume-prefix-foreground = ${self.background} +format-volume-prefix-background = ${self.separator} +format-volume-prefix = "" +format-muted-prefix-foreground = ${self.separator} +format-muted-prefix-background = ${self.background} +format-muted-prefix = "" +format-mounted-prefix-foreground = ${self.background} +format-mounted-prefix-background = ${self.separator} +format-mounted-prefix = "" +format-unmounted-prefix-foreground = ${self.background} +format-unmounted-prefix-background = ${self.separator} +format-unmounted-prefix = "" +format-connected-prefix-foreground = ${self.background} +format-connected-prefix-background = ${self.separator} +format-connected-prefix = "" +format-disconnected-prefix-foreground = ${self.background} +format-disconnected-prefix-background = ${self.separator} +format-disconnected-prefix = "" +content-prefix-foreground = ${self.background} +content-prefix-background = ${self.separator} +content-prefix = ""