mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-03 23:04:21 +02:00
More configuration
Notably polybar
This commit is contained in:
parent
f306d92a0d
commit
662db00e36
8 changed files with 204 additions and 25 deletions
14
bin/polybar
Executable file
14
bin/polybar
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
export LAN=$(nmcli -t device | awk -F: '($2 == "ethernet") {print $1; exit}')
|
||||
export WLAN=$(nmcli -t device | awk -F: '($2 == "wifi") {print $1; exit}')
|
||||
export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
||||
export HEIGHT=$((20 * DPI / 96))
|
||||
|
||||
MONITOR=$(polybar --list-monitors | awk -F: '($0 ~ /primary/) {print $1; exit}') \
|
||||
polybar --reload primary &
|
||||
for MONITOR in $(polybar --list-monitors | awk -F: '($0 !~ /primary/) {print $1}'); do
|
||||
export MONITOR
|
||||
polybar --reload secondary &
|
||||
done
|
||||
wait
|
|
@ -40,3 +40,6 @@ xrandr --dpi $dpi
|
|||
echo Gdk/WindowScalingFactor $(( $dpi/96 ))
|
||||
echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) ))
|
||||
} > ~/.xsettingsd
|
||||
|
||||
# Restart polybar to take changes
|
||||
systemctl --user restart --no-block polybar.service
|
||||
|
|
44
config
44
config
|
@ -6,6 +6,7 @@ set $left h
|
|||
set $right l
|
||||
set $mod Mod4
|
||||
set $term vbeterm
|
||||
set $mediaplayer spotify
|
||||
|
||||
font pango:Terminus 9
|
||||
|
||||
|
@ -20,11 +21,28 @@ client.urgent #2f343a #d00000 #ffffff #d00000 #d00000
|
|||
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
|
||||
client.background #ffffff
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
# Audio
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
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
|
||||
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
|
||||
bindsym XF86AudioPlay exec --no-startup-id playerctl -p $mediaplayer play-pause
|
||||
bindsym XF86AudioPause exec --no-startup-id playerctl -p $mediaplayer pause
|
||||
bindsym XF86AudioStop exec --no-startup-id playerctl -p $mediaplayer stop
|
||||
bindsym XF86AudioNext exec --no-startup-id playerctl -p $mediaplayer next
|
||||
bindsym XF86AudioPrev exec --no-startup-id playerctl -p $mediaplayer previous
|
||||
mode "mediaplayer" {
|
||||
bindsym "z" exec --no-startup-id playerctl -p $mediaplayer previous; mode "default"
|
||||
bindsym "x" exec --no-startup-id playerctl -p $mediaplayer play-pause; mode "default"
|
||||
bindsym "c" exec --no-startup-id playerctl -p $mediaplayer pause; mode "default"
|
||||
bindsym "v" exec --no-startup-id playerctl -p $mediaplayer stop; mode "default"
|
||||
bindsym "b" exec --no-startup-id playerctl -p $mediaplayer next; mode "default"
|
||||
bindsym "m" exec pavucontrol; mode "default"
|
||||
bindsym "s" [class="(?i)$mediaplayer"] focus; mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym Return mode "default"
|
||||
}
|
||||
bindsym $mod+m mode "mediaplayer"
|
||||
|
||||
# use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
@ -39,22 +57,22 @@ bindsym $mod+x kill
|
|||
bindsym $mod+r exec --no-startup-id dmenu_run
|
||||
|
||||
# change focus
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
# resize focused window
|
||||
bindsym $mod+Ctrl+$left resize shrink width 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$down resize grow height 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$up resize shrink height 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$right resize grow width 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$left resize shrink width 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$down resize grow height 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$up resize shrink height 10 px or 10 ppt
|
||||
bindsym $mod+Ctrl+$right resize grow width 10 px or 10 ppt
|
||||
|
||||
# change split orientation
|
||||
bindsym $mod+v split toggle
|
||||
|
|
133
dotfiles/polybar.conf
Normal file
133
dotfiles/polybar.conf
Normal file
|
@ -0,0 +1,133 @@
|
|||
[colors]
|
||||
background = #a0000000
|
||||
foreground = #eaeaea
|
||||
highlight = #4c7899
|
||||
|
||||
[settings]
|
||||
screenchange-reload = false
|
||||
|
||||
[bar/secondary]
|
||||
enable-ipc = true
|
||||
width = 100%
|
||||
height = ${env:HEIGHT:}
|
||||
monitor = ${env:MONITOR:}
|
||||
monitor-strict = true
|
||||
dpi = ${env:DPI:}
|
||||
border-size = 0
|
||||
tray-position = none
|
||||
fixed-center = true
|
||||
module-margin = 1
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
font-0 = Hack:style=Regular:size=10;2
|
||||
font-1 = Font Awesome 5 Pro:style=Solid:size=10;2
|
||||
font-2 = Font Awesome 5 Brands:style=Regular:size=10;2
|
||||
|
||||
modules-left = i3
|
||||
modules-right = date
|
||||
|
||||
[bar/primary]
|
||||
inherit = bar/secondary
|
||||
modules-center = cpu memory pulseaudio ethernet wlan battery
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
format = <label-state> <label-mode>
|
||||
index-sort = true
|
||||
wrapping-scroll = false
|
||||
pin-workspaces = true
|
||||
enable-click = false
|
||||
enable-scroll = false
|
||||
|
||||
label-mode-background = ${colors.highlight}
|
||||
label-mode-padding = 1
|
||||
label-focused = %index%
|
||||
label-focused-background = ${colors.highlight}
|
||||
label-focused-padding = 1
|
||||
label-unfocused = %index%
|
||||
label-unfocused-padding = 1
|
||||
label-visible = %index%
|
||||
label-visible-background = ${self.label-focused-background}
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
label-urgent = %index%
|
||||
label-urgent-background = #a00000
|
||||
label-urgent-padding = 1
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
label = %percentage: 2%%
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 5
|
||||
label = %percentage_used: 2%%
|
||||
|
||||
[module/wlan]
|
||||
type = internal/network
|
||||
interface = ${env:WLAN:}
|
||||
interval = 5
|
||||
format-connected = <ramp-signal> <label-connected>
|
||||
label-connected = %essid% %downspeed:8% %upspeed:8%
|
||||
format-disconnected =
|
||||
ramp-signal-0 =
|
||||
ramp-signal-1 =
|
||||
ramp-signal-2 =
|
||||
|
||||
[module/ethernet]
|
||||
type = internal/network
|
||||
interface = ${env:LAN:}
|
||||
interval = 2
|
||||
format-connected = <label-connected>
|
||||
label-connected = %downspeed:8% %upspeed:8%
|
||||
format-disconnected =
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 2
|
||||
date = %a %d.%m
|
||||
time = %H:%M
|
||||
label = %date% %time%
|
||||
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
adapter = ADP1
|
||||
full-at = 99
|
||||
interval = 5
|
||||
format-charging = <animation-charging> <label-charging>
|
||||
label-charging = %percentage: 2%%
|
||||
format-discharging = <animation-discharging> <label-discharging>
|
||||
label-discharging = %percentage: 2%%
|
||||
format-full = <label-full>
|
||||
label-full =
|
||||
animation-charging-0 =
|
||||
animation-charging-1 =
|
||||
animation-charging-2 =
|
||||
animation-charging-3 =
|
||||
animation-charging-4 =
|
||||
animation-charging-framerate = 1000
|
||||
animation-discharging-0 =
|
||||
animation-discharging-1 =
|
||||
animation-discharging-2 =
|
||||
animation-discharging-3 =
|
||||
animation-discharging-4 =
|
||||
animation-discharging-framerate = 1000
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
use-ui-max = false
|
||||
format-volume = <ramp-volume> <label-volume>
|
||||
format-muted = <label-muted>
|
||||
label-volume = %percentage: 2%%
|
||||
label-muted =
|
||||
ramp-volume-0 =
|
||||
ramp-volume-1 =
|
||||
ramp-volume-2 =
|
||||
ramp-volume-3 =
|
||||
ramp-volume-4 =
|
||||
ramp-volume-5 =
|
||||
ramp-volume-6 =
|
||||
ramp-volume-7 =
|
|
@ -7,6 +7,7 @@ After=xsettingsd.service
|
|||
After=tmux.service
|
||||
After=ssh-agent.service
|
||||
Before=wallpaper.service
|
||||
Before=polybar.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/i3
|
||||
|
|
8
dotfiles/systemd/polybar.service
Normal file
8
dotfiles/systemd/polybar.service
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=Status bar for i3
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=%h/.config/i3/bin/polybar
|
||||
ExecStop=/usr/bin/polybar-msg cmd quit
|
||||
Restart=on-failure
|
|
@ -2,17 +2,18 @@
|
|||
Description=X session
|
||||
BindsTo=graphical-session.target
|
||||
Wants=autorandr.service
|
||||
Wants=dunst.socket
|
||||
Wants=i3.service
|
||||
Wants=picom.service
|
||||
Wants=inputplug.service
|
||||
Wants=misc-x.service
|
||||
Wants=picom.service
|
||||
Wants=policykit-agent.service
|
||||
Wants=polybar.service
|
||||
Wants=pulseaudio.service
|
||||
Wants=redshift.service
|
||||
Wants=ssh-agent.service
|
||||
Wants=tmux.service
|
||||
Wants=wallpaper.timer
|
||||
Wants=xiccd.service
|
||||
Wants=xsettingsd.service
|
||||
Wants=xss-lock.service
|
||||
Wants=tmux.service
|
||||
Wants=ssh-agent.service
|
||||
Wants=pulseaudio.service
|
||||
Wants=dunst.socket
|
||||
|
|
|
@ -24,13 +24,14 @@ while read source target; do
|
|||
ln -nsf ~/.config/i3/dotfiles/$source $HOME/$t
|
||||
done
|
||||
done <<EOF
|
||||
Xresources .Xresources
|
||||
gtkrc-2.0 .gtkrc-2.0
|
||||
gtk3.css .config/gtk-3.0/gtk.css
|
||||
qt5ct.conf .config/qt5ct/qt5ct.conf
|
||||
systemd .config/systemd/user
|
||||
dunstrc .config/dunst/dunstrc
|
||||
firefox.js .mozilla/firefox/*/user.js
|
||||
Xresources .Xresources
|
||||
gtkrc-2.0 .gtkrc-2.0
|
||||
gtk3.css .config/gtk-3.0/gtk.css
|
||||
qt5ct.conf .config/qt5ct/qt5ct.conf
|
||||
systemd .config/systemd/user
|
||||
dunstrc .config/dunst/dunstrc
|
||||
polybar.conf .config/polybar/config
|
||||
firefox.js .mozilla/firefox/*/user.js
|
||||
EOF
|
||||
rm -f ~/.config/gtk-3.0/settings.ini
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue