From 3cd88225da1b087081864933d722e471f18afed2 Mon Sep 17 00:00:00 2001 From: natemaia Date: Wed, 22 Dec 2021 18:08:26 -0800 Subject: [PATCH] Update sway and dk configs --- bspwm-home/.config/bspwm/bspwmrc | 2 +- bspwm-home/.config/{sxhkd => bspwm}/sxhkdrc | 0 dk-home/.config/dk/dkrc | 153 +++++++++ dk-home/.config/dk/sxhkdrc | 97 ++++++ sway-home/.config/sway/autostart | 3 + sway-home/.config/sway/config | 326 ++++++++++++++++++++ sway-home/.config/sway/outputs | 5 + sway-home/.config/sway/variables | 7 + 8 files changed, 592 insertions(+), 1 deletion(-) rename bspwm-home/.config/{sxhkd => bspwm}/sxhkdrc (100%) create mode 100755 dk-home/.config/dk/dkrc create mode 100644 dk-home/.config/dk/sxhkdrc create mode 100644 sway-home/.config/sway/autostart create mode 100644 sway-home/.config/sway/config create mode 100644 sway-home/.config/sway/outputs create mode 100644 sway-home/.config/sway/variables diff --git a/bspwm-home/.config/bspwm/bspwmrc b/bspwm-home/.config/bspwm/bspwmrc index 8b8f82bb..b3915988 100755 --- a/bspwm-home/.config/bspwm/bspwmrc +++ b/bspwm-home/.config/bspwm/bspwmrc @@ -4,7 +4,7 @@ xsetroot -cursor_name left_ptr # key bindings -sxhkd & +sxhkd -c "$HOME/.config/bspwm/sxhkdrc" & # panel tint2 & diff --git a/bspwm-home/.config/sxhkd/sxhkdrc b/bspwm-home/.config/bspwm/sxhkdrc similarity index 100% rename from bspwm-home/.config/sxhkd/sxhkdrc rename to bspwm-home/.config/bspwm/sxhkdrc diff --git a/dk-home/.config/dk/dkrc b/dk-home/.config/dk/dkrc new file mode 100755 index 00000000..b0c40c21 --- /dev/null +++ b/dk-home/.config/dk/dkrc @@ -0,0 +1,153 @@ +#!/bin/sh + +# example dkrc to show some basic command usage and error reporting + +# determine where to place the log file +logfile="$HOME/.dkrc.log" +[ -d "$HOME/.local/share/xorg" ] && logfile="$HOME/.local/share/xorg/dkrc.log" +: > "$logfile" + + +# (re)load sxhkd for keybinds +if hash sxhkd >/dev/null 2>&1; then + pkill sxhkd + sxhkd -c "$HOME/.config/dk/sxhkdrc" & +fi + +{ # compound command to redirect all output + + # workspace settings + # ------------------------ + + # initialize 10 workspaces (1-10) (default: 1/monitor) + dkcmd set numws=10 + + # default workspace '_' values used when allocating new workspaces + # can be applied to all existing workspaces when passed 'apply' after ws=_ + dkcmd set ws=_ apply layout=tile master=1 stack=3 gap=0 msplit=0.5 ssplit=0.5 + + # use grid layout, padding, and gaps on workspace 10 + dkcmd set ws=10 layout=grid pad left=200 right=200 top=100 bottom=100 gap width=50 + + # change workspace names (default: number == name) + # dkcmd set \ + # ws=1 name="edit" \ + # ws=2 name="web" \ + # ws=3 name="😀" \ + # ws=4 name="😠" \ + # ws=5 name="5" \ + # ws=6 name="6" \ + # ws=7 name="7" \ + # ws=8 name="8" \ + # ws=9 name="9" \ + # ws=10 name="10" + + # enable static workspaces and assign them to monitors (only relevant for multiple monitors) + # aside - + # many that come from other workspace models tried dk and requested this feature + # try embracing the default behaviour and allow access to any workspace from any monitor + # you might end up liking it :) + # + # mon1='DisplayPort-0' + # mon2='HDMI-A-0' + # dkcmd set static_ws=true \ + # ws=1 mon=$mon1 \ + # ws=2 mon=$mon1 \ + # ws=3 mon=$mon1 \ + # ws=4 mon=$mon1 \ + # ws=5 mon=$mon1 \ + # ws=6 mon=$mon2 \ + # ws=7 mon=$mon2 \ + # ws=8 mon=$mon2 \ + # ws=9 mon=$mon2 \ + # ws=10 mon=$mon2 + + + # global settings + # --------------------- + + # focus windows when receiving activation and enable focus-follows-mouse + dkcmd set focus_open=true focus_urgent=true focus_mouse=true + + # place clients at the tail and ignore size hints on tiled windows + dkcmd set tile_tohead=0 tile_hints=false + + # minimum width/height for resizing, and minimum allowed on-screen when moving + dkcmd set win_minwh=50 win_minxy=10 + + # disable gaps and borders in single window layouts + dkcmd set smart_gap=true smart_border=true + + # define mouse mod and move/resize buttons + dkcmd set mouse mod=alt move=button1 resize=button3 + + + # borders + # --------- + + # traditional + # set border width and colour for each window state + # dkcmd set border width=1 colour focus='#6699cc' unfocus='#000000' urgent='#ee5555' + + # alternative + # enable split borders and colours, width is overall width, outer width consumes some of width. + # outer width must be less than width, outer width of 0 will be single borders + dkcmd set border width=5 outer_width=3 \ + colour \ + focus='#6699cc' \ + unfocus='#444444' \ + urgent='#ee5555' \ + outer_focus='#222222' \ + outer_unfocus='#222222' \ + outer_urgent='#222222' + + + # window rules + # -------------- + + # rule class, instance, and title regexes (*ALWAYS* CASE INSENSITIVE) + + # open window(s) on a specific workspace (assigned monitor) + dkcmd rule class="^gimp$" ws=2 + + # open window(s) on a monitor by number or name (active workspace on monitor) + dkcmd rule class="^chromium$" mon="HDMI-A-0" + + # open window(s) and use a callback function (user defined in config.h) + # we also ignore=true to stop the window from being resized on it's own from events + # eg. mpv --x11-name=albumart /path/to/media + dkcmd rule class="^mpv$" instance="^albumart$" float=true ignore=true callback=albumart bw=0 + + # open window(s) in a floating state + dkcmd rule class="^(pavucontrol|transmission-gtk|steam|lxappearance)$" float=true + + # open window(s) with a specific geometry and coordinates (floating only!) + dkcmd rule class="^google-chrome$" title="^open files$" float=true w=1280 h=720 + + # open window(s) with sticky and floating enabled to view on all workspaces. + dkcmd rule class="^stickyterm$" stick=true float=true w=1280 h=720 + dkcmd rule class="^scratchpad$" float=true + + # focus window and workspace on opening + dkcmd rule class="^firefox$" ws=1 focus=true + + # update or remove an existing rule with the same match patterns + dkcmd rule class="^firefox$" mon="HDMI-A-0" + dkcmd rule remove class="^firefox$" + + # apply current rule set to all existing windows + dkcmd rule apply '*' + + # delete all rules + # dkcmd rule remove '*' + +} >> "$logfile" 2>&1 # append responses + +# inform of any errors in a notification +if grep -q 'error:' "$logfile"; then + hash notify-send && notify-send -t 0 -u critical "dkrc has errors" \ + "$(awk '/error:/ {sub(/^error: /, ""); gsub(/> %title" + +# gaps +gaps inner 4 +gaps outer 0 +smart_gaps on + +# font +font pango:monospace 11 + +# mod key used for most binds +# Mod1 = Alt +# Mod4 = Super +set $Mod Mod4 + +# direction keys +set $up l +set $down k +set $left j +set $right semicolon + +# The file we include below is created and will be overwritten by nwg-shell-config GUI! +# +include ~/.config/sway/variables +# + +############### Apply GTK settings ################## + +set $gnome-schema org.gnome.desktop.interface +exec_always ~/.local/bin/import-gsettings \ + gtk-theme:gtk-theme-name \ + icon-theme:gtk-icon-theme-name \ + cursor-theme:gtk-cursor-theme-name + +############### Autostart ################## + +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec mako --icons 1 --markup 1 --actions 1 --padding 10 --background-color "#81a1c1" --default-timeout 10000 +exec ~/.azotebg + +# The files we include below are created and will be overwritten by nwg-shell-config GUI! +# +include ~/.config/sway/outputs +include ~/.config/sway/autostart +# + +output * adaptive_sync on + +# monitors (edit & unhash) +# set $Mon1 eDP-1 +# set $Mon2 HDMI-A-1 + +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $launcher nwg-drawer | xargs swaymsg exec -- + +### Turn off screen on lid closed +set $laptop eDP-1 +bindswitch lid:on output $laptop disable +bindswitch lid:off output $laptop enable + +### Idle configuration +exec swayidle -w \ + timeout 3000 'swaylock -f -c 000000' \ + timeout 3300 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 3000 seconds of inactivity, then turn off +# your displays after another 3300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +############### Input configuration ################## +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# middle_emulation enabled +# } +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +input "type:touchpad" { + tap enabled + dwt enabled + drag enabled + scroll_factor 0.7 + pointer_accel 0.1 + accel_profile flat +} + +# keyboard layout +input "type:keyboard" { + xkb_layout $lang +} + +# numlock on/off +# input * xkb_numlock disabled + +############# Bindings ################## + +# kill focused window +bindsym $Mod+Shift+q kill +bindsym Mod1+q kill +bindsym Mod1+F4 kill + +# launchers +bindsym Control+space exec $launcher +bindsym Mod1+F1 exec $launcher + +# core +bindsym $Mod+t exec $term +bindsym $Mod+Return exec $term +bindsym Control+Shift+t exec $term +bindsym $Mod+w exec $browser +bindsym $Mod+f exec $filemanager + +# Exit menu +bindsym $Mod+x exec $exit + +# Exit sway (default way to log you out of your Wayland session) +bindsym $Mod+Shift+e exec 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' + +# screenshot +bindsym Print exec ~/.local/bin/screenshot fullscreen +bindsym Control+Print exec swappy -g "0,0 1920x1080" +bindsym Shift+Control+Print exec grim -g "$(slurp)" - | swappy -f - + +# audio +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous +bindsym XF86AudioStop exec playerctl stop +bindsym XF86AudioMute exec pamixer -t +bindsym XF86AudioRaiseVolume exec pamixer -i 2 +bindsym XF86AudioLowerVolume exec pamixer -d 2 + +# backlight +bindsym XF86MonBrightnessUp exec light -A 5 +bindsym XF86MonBrightnessDown exec light -U 5 + +# Reload the configuration file +bindsym $Mod+Shift+c reload + +########### Workspace Bindings ############### + +# switch to workspace +bindsym $Mod+1 workspace number 1 +bindsym $Mod+2 workspace number 2 +bindsym $Mod+3 workspace number 3 +bindsym $Mod+4 workspace number 4 +bindsym $Mod+5 workspace number 5 +bindsym $Mod+6 workspace number 6 +bindsym $Mod+7 workspace number 7 +bindsym $Mod+8 workspace number 8 + +# switch to workspace - numpad alternatives +bindsym $Mod+Mod2+KP_1 workspace number 1 +bindsym $Mod+Mod2+KP_2 workspace number 2 +bindsym $Mod+Mod2+KP_3 workspace number 3 +bindsym $Mod+Mod2+KP_4 workspace number 4 +bindsym $Mod+Mod2+KP_5 workspace number 5 +bindsym $Mod+Mod2+KP_6 workspace number 6 +bindsym $Mod+Mod2+KP_7 workspace number 7 +bindsym $Mod+Mod2+KP_8 workspace number 8 + +# switch to next or previous workspace +bindsym $Mod+Mod1+Left workspace prev +bindsym $Mod+Mod1+Right workspace next + +# move focused container to workspace +bindsym $Mod+Shift+1 move container to workspace number 1; workspace number 1 +bindsym $Mod+Shift+2 move container to workspace number 2; workspace number 2 +bindsym $Mod+Shift+3 move container to workspace number 3; workspace number 3 +bindsym $Mod+Shift+4 move container to workspace number 4; workspace number 4 +bindsym $Mod+Shift+5 move container to workspace number 5; workspace number 5 +bindsym $Mod+Shift+6 move container to workspace number 6; workspace number 6 +bindsym $Mod+Shift+7 move container to workspace number 7; workspace number 7 +bindsym $Mod+Shift+8 move container to workspace number 8; workspace number 8 + +# move focused container to workspace - numpad alternatives +bindsym $Mod+Shift+Mod2+KP_End move container to workspace number 1; workspace number 1 +bindsym $Mod+Shift+Mod2+KP_Down move container to workspace number 2; workspace number 2 +bindsym $Mod+Shift+Mod2+KP_Next move container to workspace number 3; workspace number 3 +bindsym $Mod+Shift+Mod2+KP_Left move container to workspace number 4; workspace number 4 +bindsym $Mod+Shift+Mod2+KP_Begin move container to workspace number 5; workspace number 5 +bindsym $Mod+Shift+Mod2+KP_Right move container to workspace number 6; workspace number 7 +bindsym $Mod+Shift+Mod2+KP_Home move container to workspace number 7; workspace number 7 +bindsym $Mod+Shift+Mod2+KP_Up move container to workspace number 8; workspace number 8 + +# Workspace to monitor assignment (edit & unhash) +# workspace 1 output $Mon1 +# workspace 2 output $Mon1 +# workspace 3 output $Mon1 +# workspace 4 output $Mon1 +# workspace 5 output $Mon1 +# workspace 6 output $Mon1 +# workspace 7 output $Mon1 +# workspace 8 output $Mon1 + +############ Container/Window control ############ + +# Scratchpad, Floating +bindsym $Mod+space floating toggle +floating_modifier Mod1 normal + +# Sway has a "scratchpad", which is a bag of holding for windows. +# You can send windows there and get them back later. + +# Move the currently focused window to the scratchpad +bindsym $Mod+Shift+z move scratchpad + +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +bindsym $Mod+z scratchpad show + +# change focus +bindsym $Mod+$left focus left +bindsym $Mod+$down focus down +bindsym $Mod+$up focus up +bindsym $Mod+$right focus right + +# alternatively, you can use the cursor keys: +bindsym $Mod+Left focus left +bindsym $Mod+Down focus down +bindsym $Mod+Up focus up +bindsym $Mod+Right focus right + +# move focus to the parent container +bindsym $Mod+p focus parent + +# move focused window +bindsym $Mod+Shift+$left move left +bindsym $Mod+Shift+$down move down +bindsym $Mod+Shift+$up move up +bindsym $Mod+Shift+$right move right + +# alternatively, you can use the cursor keys: +bindsym $Mod+Shift+Up move up +bindsym $Mod+Shift+Down move down +bindsym $Mod+Shift+Left move left +bindsym $Mod+Shift+Right move right + +# Resizing containers +mode "resize" { + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $Mod+r mode "resize" + +# Size +bindsym Mod1+Up resize shrink height 10 px or 1 ppt +bindsym Mod1+Down resize grow height 10 px or 1 ppt +bindsym Mod1+Left resize shrink width 10 px or 1 ppt +bindsym Mod1+Right resize grow width 10 px or 1 ppt + +# layout toggle +bindsym Mod1+Tab layout toggle tabbed split +bindsym $Mod+Tab layout toggle splitv splith + +# switch to workspace with urgent window +for_window [urgent="latest"] focus +focus_on_window_activation focus + +# container layout +bindsym $Mod+h split h +bindsym $Mod+v split v +bindsym $Mod+Shift+t layout tabbed +bindsym $Mod+Shift+s layout stacking +bindsym $Mod+Shift+h layout toggle split + +default_orientation horizontal + +# make the current focus fullscreen +bindsym $Mod+Shift+f fullscreen + +############### Border & Gaps ############### + +hide_edge_borders both + +# changing border style +bindsym $Mod+n border normal +bindsym $Mod+y border pixel 1 +bindsym $Mod+u border none + +# change gaps +bindsym $Mod+plus gaps inner current plus 5 +bindsym $Mod+minus gaps inner current minus 5 +bindsym $Mod+Shift+plus gaps outer current plus 5 +bindsym $Mod+Shift+minus gaps outer current minus 5 +bindsym $Mod+Control+plus gaps inner all plus 5 +bindsym $Mod+Control+minus gaps inner all minus 5 +bindsym $Mod+Control+Shift+plus gaps outer all plus 5 +bindsym $Mod+Control+Shift+minus gaps outer all minus 5 + +############ application settings ############ + +# focus, floating, & sticky +for_window [app_id="(?i)(?:pavucontrol|blueman-manager|galculator|azote|gnome-disks)"] floating enable +for_window [app_id="(?i)(?:firefox|chromium)"] border none +for_window [title="(?i)(?:copying|deleting|moving)"] floating enable + +popup_during_fullscreen smart diff --git a/sway-home/.config/sway/outputs b/sway-home/.config/sway/outputs new file mode 100644 index 00000000..91943b20 --- /dev/null +++ b/sway-home/.config/sway/outputs @@ -0,0 +1,5 @@ +output "LVDS-1" { + mode 1366x768@59Hz + pos 0 0 + transform normal +} diff --git a/sway-home/.config/sway/variables b/sway-home/.config/sway/variables new file mode 100644 index 00000000..0a776df0 --- /dev/null +++ b/sway-home/.config/sway/variables @@ -0,0 +1,7 @@ +set $term foot +set $browser MOZ_ENABLE_WAYLAND=1 firefox +set $filemanager thunar +set $dock nwg-dock -d +set $drawer nwg-drawer +set $exit nwg-bar +set $lang pl