[sway] Bring config up to date

This commit is contained in:
lara 2021-02-15 00:02:01 +01:00
parent 734c05a6da
commit c82ef3eb3a
5 changed files with 71 additions and 12 deletions

19
bin/import-gsettings Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
# Inspired from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# usage: import-gsettings
config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
gnome_schema="org.gnome.desktop.interface"
gtk_theme="$(sed -nE '/^gtk-theme-name/s/^gtk-theme-name\s*=\s*//p' "$config")"
icon_theme="$(sed -nE '/^gtk-icon-theme-name/s/^gtk-icon-theme-name\s*=\s*//p' "$config")"
cursor_theme="$(sed -nE '/^gtk-cursor-theme-name/s/^gtk-cursor-theme-name\s*=\s*//p' "$config")"
font_theme="$(sed -nE '/^gtk-font-name/s/^gtk-font-name\s*=\s*//p' "$config")"
gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
gsettings set "$gnome_schema" icon-theme "$icon_theme"
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
gsettings set "$gnome_schema" font-name "$font_name"

View file

@ -41,7 +41,7 @@
# The transparency of the window. Range: [0; 100]. # The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is # This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). # present (e.g. xcompmgr, compiz, etc.).
transparency = 30 transparency = 20
# The height of the entire notification. If the height is smaller # The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised # than the font height and padding combined, it will be raised

View file

@ -34,7 +34,18 @@ set $ws8 "8:8"
set $ws9 "9:9" set $ws9 "9:9"
set $ws10 "10:10" set $ws10 "10:10"
# Your preferred terminal emulator # Your preferred terminal emulator
set $term kitty --single-instance set $term kitty --single-instance --instance-group i3
# Other utilities
set $backlightinc light -A 5
set $backlightdec light -U 5
set $volinc volcont --up
set $voldec volcont --down
set $voltog volcont --toggle
set $cliplumber cliplumber
set $mpdtoggle mpc toggle
set $mpdnext mpc next
set $mpdprev mpc prev
# Font for window titles and bar # Font for window titles and bar
font pango:Hack 8 font pango:Hack 8
@ -60,7 +71,7 @@ client.background $base07
# Basics: # Basics:
# exit i3/sway # exit i3/sway
bindsym $mod+Shift+e exec $exit bindsym $mod+Shift+q exec $exit
# lock session # lock session
bindsym Mod4+l exec $lock bindsym Mod4+l exec $lock
@ -72,12 +83,24 @@ client.background $base07
bindsym $mod+Return exec $term bindsym $mod+Return exec $term
# call clipboard plumber # call clipboard plumber
bindsym $mod+v exec cliplumber bindsym $mod+v exec $cliplumber
# volume control # volume control
bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute bindsym XF86AudioRaiseVolume exec $volinc
bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute bindsym XF86AudioLowerVolume exec $voldec
bindsym XF86AudioMute exec amixer -q set Master toggle bindsym XF86AudioMute exec $voltog
# MPD control
bindsym $mod+greater exec $mpdnext
bindsym $mod+less exec $mpdprev
bindsym $mod+p exec $mpdtoggle
bindsym XF86AudioNext exec $mpdnext
bindsym XF86AudioPrev exec $mpdprev
bindsym XF86AudioPlay exec $mpdtoggle
# brightness control (using Super because MSI weirdness)
bindsym Mod4+Up exec $backlightinc
bindsym Mod4+Down exec $backlightdec
# reload the configuration file # reload the configuration file
bindsym $mod+Shift+r reload bindsym $mod+Shift+r reload
@ -208,6 +231,9 @@ bindsym $mod+Ctrl+$down resize grow height 5 px or 5 ppt
bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt
bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt
# App specific settings
for_window [class="mpv"] floating enable
### Status Bar ### Status Bar
# #
# Read `man 5 sway-bar` for more information about this section. # Read `man 5 sway-bar` for more information about this section.

View file

@ -269,3 +269,6 @@ set $lock i3lock -c 000000
# Application launcher # Application launcher
set $menu dmenu_run set $menu dmenu_run
# App specific settings
for_window [class="mpv"] floating enable

View file

@ -7,7 +7,7 @@
include ../i3/common include ../i3/common
# exit sway (logs you out of your Wayland session) # exit sway (logs you out of your Wayland session)
set $exit swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' set $exit swaymsg exit
# Screen locker # Screen locker
set $lock swaylock -f -c 000000 set $lock swaylock -f -c 000000
@ -16,17 +16,28 @@ set $lock swaylock -f -c 000000
# Note: it's recommended that you pass the final command to sway # Note: it's recommended that you pass the final command to sway
set $menu dmenu_path | bemenu | xargs swaymsg exec -- set $menu dmenu_path | bemenu | xargs swaymsg exec --
# App specific settings
for_window [app_id="mpv"] floating enable
# Default wallpaper # Default wallpaper
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# Apps autostart (run on each config reload)
exec_always {
import-gsettings
}
# Set keyboard layout # Set keyboard layout
input * xkb_layout fr,ru input * xkb_layout fr,ru,fr
input * xkb_variant ,phonetic input * xkb_variant oss,phonetic,bepo
input * xkb_options grp:shift_caps_toggle input * xkb_options grp:shift_caps_toggle
input * xkb_numlock enable input * xkb_numlock enable
# Configure touchpad # Configure touchpad (man 5 sway-input)
input * tap enabled input type:touchpad {
tap enabled
tap_button_map lmr
}
############ ############
# Examples # # Examples #