Getting comfy in sway

This commit is contained in:
Joachim Nielandt 2023-08-30 22:17:40 +02:00
parent 46df8b7b62
commit c985dce6eb
5 changed files with 104 additions and 56 deletions

View File

@ -1,2 +1,7 @@
#rofi -show run #rofi -show run
rofi -show run -modi "run,drun,ssh,window" -sidebar-mode -show-icons #monitor="$(swaymsg -t get_outputs | jq '[.[].focused] | index(true)')"
#monitor=""$(swaymsg -t get_workspaces | jq -e "map(select(.focused == true).num)[0]-(.|length)" | tr -d "-")
# get the focused monitor - kanshi could mess up the order so we get the monitorname instead
monitor="$(swaymsg -t get_outputs | jq -c '.[] | select(.focused) | select(.id)' | jq -c '.name')"
# show rofi on the focused monitor
rofi -show run -modi "run,drun,ssh,window" -sidebar-mode -show-icons -monitor "$monitor"

View File

@ -17,7 +17,6 @@ default_border pixel
# Font # Font
font pango:Hasklig Medium 9 font pango:Hasklig Medium 9
# https://github.com/Alexays/Waybar/issues/1093#issuecomment-841846291 # https://github.com/Alexays/Waybar/issues/1093#issuecomment-841846291
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \ exec hash dbus-update-activation-environment 2>/dev/null && \
@ -28,9 +27,22 @@ exec wmname LG3D
# https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist
#XDG_CURRENT_DESKTOP=sway #XDG_CURRENT_DESKTOP=sway
#MOZ_ENABLE_WAYLAND=1 #MOZ_ENABLE_WAYLAND=1
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway exec_always {
exec systemctl --user stop pipewire xdg-desktop-portal xdg-desktop-portal-wlr dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec systemctl --user start pipewire systemctl --user stop pipewire xdg-desktop-portal xdg-desktop-portal-wlr
exec systemctl --user start pipewire
}
# start kanshi for auto-output management
exec_always {
pkill kanshi
kanshi
}
# wayland clipboard manager
exec {
wl-paste --watch cliphist store
}
### Idle configuration ### Idle configuration
# #
@ -113,36 +125,15 @@ assign [class="Thunderbird"] $ws2
#bindsym $mod+Pause mode $mode_system #bindsym $mod+Pause mode $mode_system
#bindsym $mod+F12 mode $mode_system #bindsym $mod+F12 mode $mode_system
# do a nice menu for keyboard layouts
# TODO convert to wayland, using dconf-editor perhaps?
set $mode_xkbmap "Layout aus bus-intl cus-altgr dgb egb-intl fdvorak"
mode $mode_xkbmap {
bindsym a exec --no-startup-id setxkbmap us, mode "default"
bindsym b exec --no-startup-id setxkbmap us intl, mode "default"
bindsym c exec --no-startup-id setxkbmap us altgr-intl, mode "default"
bindsym d exec --no-startup-id setxkbmap gb, mode "default"
bindsym e exec --no-startup-id setxkbmap gb intl, mode "default"
bindsym f exec --no-startup-id setxkbmap dvorak, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Ctrl+k mode $mode_xkbmap
# do a nice menu for custom launches # toggle keyboard layouts with scroll lock
set $mode_launch " adefault start-up bnoise-fix cdual dhorizontal etearing" input "type:keyboard" {
mode $mode_launch { xkb_layout us,us
# These are all the default programs launching at startup. xkb_variant intl,
bindsym a exec thunderbird, exec signal-desktop, exec ferdi, exec obsidian mode "default", exec teams --no-sandbox, exec slack xkb_options grp:sclk_toggle
# execute default horizontal layout of monitors
bindsym d exec autorandr horizontal, mode "default"
# this fixes tearing on nvidia
bindsym e exec nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
} }
bindsym $mod+F10 mode "$mode_launch" $bindsym $mod+F9 mode "$mode_keyboard"
############# #############
# Status Bar # Status Bar
@ -160,7 +151,7 @@ exec --no-startup-id mako
# start multi touch support # start multi touch support
exec --no-startup-id libinput-gestures-setup start exec --no-startup-id libinput-gestures-setup start
# start greenclip, this somehow fails to start at launch (sometimes?) # start greenclip, this somehow fails to start at launch (sometimes?)
exec --no-startup-id greenclip daemon>/dev/null #exec --no-startup-id greenclip daemon>/dev/null
# autostart background applications # autostart background applications
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

View File

@ -9,10 +9,14 @@ bindsym $mod+Shift+q kill
# Launchers # Launchers
bindsym $mod+d exec ~/.config/rofi/runrofi.sh bindsym $mod+d exec ~/.config/rofi/runrofi.sh
#bindsym $mod+Shift+d exec "albert show" #bindsym $mod+Shift+d exec "albert show"
bindsym $mod+c exec rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' #this is the i3 manager
#bindsym $mod+C exec rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}'
bindsym $mod+C exec ~/.config/rofi/runcliphist.sh
#
# Screenshot # Screenshot
bindsym --release Print exec ~/.config/i3/screenshot.sh #bindsym --release Print exec grim -g "$(slurp)" "/home/joachim/pictures/screenshots/$(date +'%s_grim.png')"
bindsym --release Print exec ~/scripts/grim.screenshot.sh
# Custom 'help' screen # Custom 'help' screen
# bindsym $mod+F1 exec $term -e chezmoi edit ~/.dotfiles/README.md # bindsym $mod+F1 exec $term -e chezmoi edit ~/.dotfiles/README.md
@ -72,8 +76,8 @@ set $ws8 number 8
set $ws9 number 9 set $ws9 number 9
set $ws10 number 10 set $ws10 number 10
# Special workspaces names # Special workspaces names
set $ws11 "" set $ws11 number 11
set $ws12 "" set $ws12 number 12
# Switch to workspace # Switch to workspace
bindsym $mod+1 workspace $ws1 bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2 bindsym $mod+2 workspace $ws2
@ -107,8 +111,8 @@ bindsym $mod+Shift+period move container to workspace $ws12, exec $focus_ws $ws1
# You can "split" the current object of your focus with # You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits # $mod+b or $mod+v, for horizontal and vertical splits
# respectively. # respectively.
bindsym $mod+b splith bindsym $mod+m splith
bindsym $mod+v splitv bindsym $mod+n splitv
# Switch the current container between different layout styles # Switch the current container between different layout styles
bindsym $mod+s layout stacking bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed bindsym $mod+w layout tabbed
@ -158,9 +162,11 @@ $bindsym --locked XF86AudioLowerVolume exec $volume_down
$bindsym --locked XF86AudioMute exec $volume_mute $bindsym --locked XF86AudioMute exec $volume_mute
# modes # modes
$bindsym $mod+r mode $mode_resize bindsym $mod+r mode $mode_resize
$bindsym $mod+F12 mode $mode_shutdown bindsym $mod+F12 mode $mode_shutdown
$bindsym $mod+F11 mode $mode_audio bindsym $mod+F11 mode $mode_audio
bindsym $mod+Ctrl+k mode $mode_xkbmap
bindsym $mod+F10 mode $mode_launch
## Action // Scale up  ## ## Action // Scale up  ##
bindsym $mod+equal exec $scale_up bindsym $mod+equal exec $scale_up

View File

@ -70,19 +70,64 @@ mode --pango_markup $mode_shutdown {
set $mode_audio "Audio    - + 0 y" set $mode_audio "Audio    - + 0 y"
mode $mode_audio { mode $mode_audio {
# Increase / decrease volume for the running sink only # Increase / decrease volume for the running sink only
bindsym k exec $volume_up $bindsym k exec $volume_up
# Decrease # Decrease
bindsym j exec $volume_down $bindsym j exec $volume_down
# Mute sound # Mute sound
bindsym 0 exec $volume_mute $bindsym 0 exec $volume_mute
# Start mps-youtube # Start mps-youtube
bindsym y exec --no-startup-id urxvt -e mpsyt, mode "default" $bindsym y exec --no-startup-id urxvt -e mpsyt, mode "default"
# Toggle pause/play # Toggle pause/play
bindsym space exec playerctl play-pause $bindsym space exec playerctl play-pause
#bindsym XF86AudioPause exec playerctl pause #bindsym XF86AudioPause exec playerctl pause
#bindsym XF86AudioNext exec playerctl next #bindsym XF86AudioNext exec playerctl next
#bindsym XF86AudioPrev exec playerctl previous #bindsym XF86AudioPrev exec playerctl previous
# back to normal: Enter or Escape # back to normal: Enter or Escape
$bindsym Return mode "default"
$bindsym Escape mode "default"
}
#set $mode_keyboard "us-intl (a), us-altgr-intl (b)"
#mode $mode_keyboard {
# bindsym a exec swaymsg input type:keyboard xkb_variant intl
# bindsym b exec swaymsg input type:keyboard xkb_variant altgr-intl
# bindsym return mode "default"
# bindsym escape mode "default"
#}
#
# do a nice menu for keyboard layouts
# TODO convert to wayland, using dconf-editor perhaps?
set $mode_keys "keys"
mode $mode_keys {
bindsym Return mode "default"
bindsym Escape mode "default"
}
# do a nice menu for keyboard layouts
# TODO convert to wayland, using dconf-editor perhaps?
set $mode_xkbmap "Layout aus bus-intl cus-altgr dgb egb-intl fdvorak"
mode $mode_xkbmap {
bindsym a exec --no-startup-id setxkbmap us, mode "default"
bindsym b exec --no-startup-id setxkbmap us intl, mode "default"
bindsym c exec --no-startup-id setxkbmap us altgr-intl, mode "default"
bindsym d exec --no-startup-id setxkbmap gb, mode "default"
bindsym e exec --no-startup-id setxkbmap gb intl, mode "default"
bindsym f exec --no-startup-id setxkbmap dvorak, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# do a nice menu for custom exec launches
set $mode_launch " adefault start-up bnoise-fix cdual dhorizontal etearing"
mode $mode_launch {
# These are all the default programs launching at startup.
bindsym a exec thunderbird, exec signal-desktop, exec ferdi, exec obsidian mode "default", exec teams --no-sandbox, exec slack
# execute default horizontal layout of monitors
bindsym d exec autorandr horizontal, mode "default"
# this fixes tearing on nvidia
bindsym e exec nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
# back to normal: Enter or Escape
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
} }

View File

@ -98,8 +98,9 @@
"spacing": 10 "spacing": 10
}, },
"cpu": { "cpu": {
"format": "{usage}%  {icon}", //"format": "{usage}%  {icon}",
"format-icons": ["󱟒", "󱟓", "󱟕"], "format": "{usage}% {icon}",
"format-icons": ["<span foreground=\"#b8bb26\"></span>", "<span foreground=\"#f38019\"></span>", "<span foreground=\"#fb4934\"></span>"],
"tooltip": true "tooltip": true
}, },
"memory": { "memory": {
@ -156,15 +157,15 @@
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}", "format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}", "format-bluetooth": "{volume}% {icon}  {format_source}",
"format-bluetooth-muted": " {icon} {format_source}", "format-bluetooth-muted": "󰗿 {icon}  {format_source}",
"format-muted": " {format_source}", "format-muted": " {format_source}",
"format-source": "{volume}% ", "format-source": "{volume}% ",
"format-source-muted": "", "format-source-muted": "",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "hands-free": "󰙌",
"headset": "", "headset": "󰋎",
"phone": "", "phone": "",
"portable": "", "portable": "",
"car": "", "car": "",