i3: re-arrange config file and add polybar

This commit is contained in:
Marco Thomas
2023-02-14 09:10:06 +01:00
parent c8c8d245fa
commit ca3f4e6430
5 changed files with 209 additions and 86 deletions

View File

@@ -1,67 +1,82 @@
set $mod Mod4
floating_modifier $mod
font pango:SFMono Bold 10
# screens
exec_always --no-startup-id ~/.screenlayout/default.sh
set $bg #2F383E
set $alt #56635f
set $fg #D3C6AA
set $accent #93b259
set $inactive #dfa000
set $alert #e67e80
workspace_layout tabbed
# https://wiki.archlinux.org/index.php/XDG_Autostart
# manage via gnome tweaks
exec --no-startup-id dex-autostart --autostart --environment i3
# locking
#
#### Screen(setup)
#
exec_always --no-startup-id ~/.screenlayout/default.sh
exec --no-startup-id light -S 25
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5
#
#### Locking
#
exec --no-startup-id xss-lock --transfer-sleep-lock -- xlock \
-mode space \
-echokeys \
-font "-*-*-*-r-*-*-34-*-*-*-*-*-*-*" \
-planfont "-*-*-*-r-*-*-34-*-*-*-*-*-*-*"
set $mode_system System (l)ock, l(o)gout, (s)uspend, (h)ibernate, (Shift+r)eboot, (Shift+s)hutdown
mode "$mode_system" {
bindsym l exec --no-startup-id loginctl lock-session, mode "default"
bindsym o exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id systemctl suspend, mode "default"
bindsym Shift+r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff, mode "default"
bindsym $mod+Ctrl+BackSpace exec --no-startup-id loginctl lock-session
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
#
#### Input
#
}
bindsym $mod+Ctrl+BackSpace mode "$mode_system"
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet
# audio control
bindsym $mod+a exec --no-startup-id pavucontrol -t 1
for_window [class="Pavucontrol"] fullscreen enable
# jp input - fcitx5 fcitx5-configtool fcitx5-gtk4 fcitx5-qt fcitx5-mozc
exec --no-startup-id fcitx5
# keyboard and mouse
# add 'Option "XkbOptions" "caps:swapescape"' to /etc/X11/xorg.conf.d/00-keyboard.conf
exec_always --no-startup-id setxkbmap eu
exec_always --no-startup-id xinput --set-prop 'pointer:Logitech MX Vertical' 'libinput Accel Profile Enabled' 0, 1
exec_always --no-startup-id xset r rate 250 50
# notifications
# fcitx5 fcitx5-configtool fcitx5-gtk4 fcitx5-qt fcitx5-mozc
exec --no-startup-id fcitx5
#
#### Networking
#
exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet
#
#### Audio
#
bindsym $mod+a exec --no-startup-id pavucontrol -t 1
for_window [class="Pavucontrol"] fullscreen enable
#
#### Notifications
#
bindsym Ctrl+space exec --no-startup-id dunstctl close-all
bindsym Ctrl+Shift+space exec --no-startup-id dunstctl history-pop
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
#
#### Launch programs
#
# start a terminal
bindsym $mod+Return exec --no-startup-id alacritty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+space exec --no-startup-id dmenu_run \
-m 0 \
-i \
@@ -72,30 +87,27 @@ bindsym $mod+space exec --no-startup-id dmenu_run \
-nb "#2f383e" \
-nf "#d3c6aa" \
-sb "#93b259" \
-sf "#2f383e" \
# screenshot
-sf "#2f383e"
bindsym $mod+Shift+s exec --no-startup-id flameshot gui
# change focus
#
#### Control i3
#
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# workspaces
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
@@ -118,34 +130,13 @@ bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# reload the configuration file
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
set $bg #2F383E
set $fg #D3C6AA
set $accent #93b259
set $inactive #dfa000
set $alert #e67e80
#
#### Default Session
#
bar {
status_command i3status
position top
output DP-1
colors {
statusline $fg
background $bg
focused_workspace $accent $bg $accent
inactive_workspace $bg $bg $fg
active_workspace $inactive $bg $inactive
urgent_workspace $alert $bg $alert
}
}
for_window [all] title_window_icon on
default_border none
# setup default session
for_window [class="firefox"] move to workspace 10
for_window [class="discord"] move to workspace 10
for_window [class="Spotify"] move to workspace 10
@@ -160,10 +151,22 @@ exec --no-startup-id firefox
exec --no-startup-id spotify
exec --no-startup-id discord
# wallpaper
exec_always --no-startup-id feh --bg-scale ~/cloud/images/wallpaper/wallpaper
#
#### Look
#
# schicky micky
# class border backgr. text indicator child_border
client.focused $bg $bg $fg $bg $bg
client.focused_inactive $bg $bg $alt $bg $bg
client.unfocused $bg $bg $alt $bg $bg
client.urgent $bg $bg $alert $bg $bg
for_window [all] title_window_icon on
default_border none
title_align center
exec_always --no-startup-id feh --bg-scale ~/cloud/images/wallpaper/wallpaper
exec_always --no-startup-id ~/.config/polybar/launch.sh
exec_always --no-startup-id pkill picom && picom
gaps inner 5

View File

@@ -1,14 +0,0 @@
general {
output_format = "i3bar"
colors = false
markup = pango
interval = 1
}
order += "read_file backlight"
order += "battery all"
order += "time"
time {
format = " %a %-d.%b %H:%M"
}

View File

@@ -3,6 +3,7 @@ corner-radius = 12;
rounded-corners-exclude = [
"class_g = 'dmenu'",
"class_g = 'Polybar'",
"class_g = 'i3bar'"
]

View File

@@ -0,0 +1,125 @@
[colors]
bg = #2f383e
alt = #56635f
fg = #d3c6aa
accent = #93b259
inactive = #dfa000
alert = #e67e80
[bar/main]
monitor = eDP-1
width = 100%
height = 50
radius = 0
line-size = 5
module-margin = 1
padding-right = 1
background = ${colors.bg}
foreground = ${colors.fg}
font-0 = "SFMono Nerd Font:weight=bold:pixelsize=20;5"
modules-left = i3 title
modules-center =
modules-right = backlight battery time
tray-position = right
tray-maxsize = 30
[module/title]
type = internal/xwindow
label-foreground = ${colors.alt}
[module/i3]
type = internal/i3
pin-workspaces = true
enable-click = true
enable-scroll = true
show-all = true
ws-icon-0 = 1;1
ws-icon-1 = 2;2
ws-icon-2 = 3;3
ws-icon-3 = 4;4
ws-icon-4 = 5;5
ws-icon-5 = 6;6
ws-icon-6 = 7;7
ws-icon-7 = 8;8
ws-icon-8 = 9;9
ws-icon-9 = 10;10
ws-icon-default =
format = <label-state>
format-background = ${colors.bg}
label-focused = %icon%
label-focused-padding = 1
label-focused-foreground = ${colors.accent}
label-unfocused = %icon%
label-unfocused-padding = 1
label-unfocused-foreground = ${colors.alt}
label-visible = %icon%
label-visible-padding = 1
label-urgent = %icon%
label-urgent-padding = 1
label-urgent-foreground = ${colors.alert}
[module/time]
type = internal/date
interval = 5
label = "%time%"
label-radius = 10
time = %H:%M
time-alt = %a %d.%b
[module/battery]
type = internal/battery
battery = BAT1
adapter = ADP1
low-at = 5
full-at = 99
format-charging = <animation-charging> <label-charging>
format-discharging = <ramp-capacity> <label-discharging>
format-full = <ramp-capacity> <label-full>
format-low = <label-low> <animation-low>
label-charging = %percentage%%
label-discharging = %percentage%%
label-full = %percentage%%
label-low = %percentage%%
ramp-capacity-0 = " "
ramp-capacity-1 = " "
ramp-capacity-2 = " "
ramp-capacity-3 = " "
ramp-capacity-4 = " "
animation-charging-0 = " "
animation-charging-1 = " "
animation-charging-2 = " "
animation-charging-3 = " "
animation-charging-4 = " "
animation-charging-framerate = 750
animation-low-0 = !
animation-low-1 =
animation-low-framerate = 200
[module/backlight]
type = internal/backlight
card = intel_backlight
label = " %percentage%%"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
polybar-msg cmd quit
killall -q polybar
# Launch bar1 and bar2
echo "---" | tee -a /tmp/polybar.log
polybar main 2>&1 | tee -a /tmp/polybar.log & disown