Moar swaaay

This commit is contained in:
Daniel Flanagan 2020-03-24 12:05:08 -05:00
parent 8c458a9084
commit 616099b54d
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
9 changed files with 134 additions and 170 deletions

View file

@ -12,28 +12,9 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec --
output * bg $HOME/.wallpaper fill output * bg $HOME/.wallpaper fill
# TODO: configured displays?
# output eDP-1 res 3200x1800 pos 0 0 scale 2
# output DVI-D-1 res 2560x1440@60Hz
# output DVI-D-1 transform 270
# output DP-1 res 3440x1440@100Hz
### Input configuration
#
# Example configuration:
#
#input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll 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.
bindsym $mod+Return exec $term bindsym $mod+Return exec $term
bindsym $mod+t exec $term bindsym $mod+t exec $term
bindsym $mod+Alt+Return exec urxvt
bindsym $mod+c kill bindsym $mod+c kill
bindsym $mod+Space exec $menu bindsym $mod+Space exec $menu
bindsym $mod+Shift+r reload bindsym $mod+Shift+r reload
@ -110,6 +91,8 @@ bindsym $mod+Shift+v exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym $mod+Shift+minus move scratchpad bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show bindsym $mod+minus scratchpad show
bindsym $mod+Control+Shift+l exec swaylock
mode "resize" { mode "resize" {
bindsym $left resize shrink width 10 px or 10 ppt bindsym $left resize shrink width 10 px or 10 ppt
bindsym $down resize grow height 10 px or 10 ppt bindsym $down resize grow height 10 px or 10 ppt
@ -147,5 +130,4 @@ client.focused #66d9ef #66d9ef #66d9ef #66d9ef #66d9ef
client.focused_inactive #111111 #111111 #ffffff #111111 #111111 client.focused_inactive #111111 #111111 #ffffff #111111 #111111
client.unfocused #111111 #111111 #ffffff #111111 #111111 client.unfocused #111111 #111111 #ffffff #111111 #111111
# include /etc/sway/config.d/*
include $ENV_PATH/sway/config.d/* include $ENV_PATH/sway/config.d/*

View file

@ -5,22 +5,17 @@
. "$DOTFILES_PATH/bin/prelude" . "$DOTFILES_PATH/bin/prelude"
has_command libinput-gestures-setup && libinput-gestures-setup start
has_command kdeconnect-indicator && kdeconnect-indicator &
has_command gnome-keyring-daemon && eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
# killall -9 urxvtd # killall -9 urxvtd
# urxvtd & # urxvtd &
# key repeat # key repeat
export WAYLAND_DISPLAY=wayland-0
export WLC_REPEAT_DELAY=200 export WLC_REPEAT_DELAY=200
export WLC_REPEAT_RATE=60 export WLC_REPEAT_RATE=60
# caps lock -> escape key mapping # caps lock -> escape key mapping
# export XKB_DEFAULT_OPTIONS=caps:escape # export XKB_DEFAULT_OPTIONS=caps:escape
# enable wayland support # enable wayland support for some applications
export QT_QPA_PLATFORM=wayland-egl export QT_QPA_PLATFORM=wayland-egl
export CLUTTER_BACKEND=wayland export CLUTTER_BACKEND=wayland
export SDL_VIDEODRIVER=wayland export SDL_VIDEODRIVER=wayland
@ -33,3 +28,7 @@ mako &
killall -9 dunst &> /dev/null killall -9 dunst &> /dev/null
sway sway
# has_command libinput-gestures-setup && libinput-gestures-setup start
# has_command kdeconnect-indicator && kdeconnect-indicator &
# has_command gnome-keyring-daemon && eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"

View file

@ -1,90 +1,60 @@
{ {
"layer": "top", // Waybar at top layer "layer": "top",
"position": "bottom", // Waybar position (top|bottom|left|right) "position": "bottom",
"height": 32, // Waybar height (to be removed for auto height) "output": ["DP-1"],
// "width": 1280, // Waybar width "height": 32,
// Choose the order of the modules "modules-left": ["sway/workspaces"],
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["clock"],
"modules-center": ["sway/window"],
"modules-right": [ "modules-right": [
// "mpd", "idle_inhibitor",
// "idle_inhibitor",
"pulseaudio", "pulseaudio",
"network", // "network",
"cpu", "cpu",
"memory", "memory",
"temperature", "temperature",
"backlight", "backlight",
"battery", "battery",
// "battery#bat2",
"clock",
"tray" "tray"
], ],
"sway/workspaces": { "sway/workspaces": {
"disable-scroll": false, "disable-scroll": false,
"persistent_workspaces": {
"1": [],
"2": [],
"3": [],
"4": [],
"5": [],
"6": [],
"7": [],
"8": [],
"9": []
// "10": []
},
"all-outputs": true, "all-outputs": true,
"format": "{name}: {icon}", "format": "{name}"
"format-icons": {
"1": "",
"2": "龜",
"3": "",
"4": "",
"5": "",
"urgent": "",
"focused": "",
"default": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
}, },
"idle_inhibitor": { "idle_inhibitor": {
"format": "{icon}", "format": "<span foreground=\"#666666\">{icon}</span>",
"format-icons": { "format-icons": {
"activated": "", "activated": "",
"deactivated": "" "deactivated": ""
} }
}, },
"tray": { "tray": {
// "icon-size": 21, "icon-size": 24,
"spacing": 10 "spacing": 4
}, },
"clock": { "clock": {
"interval": 1, "interval": 1,
"format": "{:%a %b %d %H:%M:%S}" "format": "{:%a %b %d %H:%M:%S}"
}, },
"cpu": { "cpu": {
"format": "{usage}% ", "format": "{usage} <span foreground=\"#666666\"></span>",
"tooltip": false "tooltip": true,
"interval": 3
}, },
"memory": { "memory": {
"format": "{}% " "format": "{} <span foreground=\"#666666\"></span>"
}, },
"temperature": { "temperature": {
// "thermal-zone": 2, // "thermal-zone": 2,
@ -113,11 +83,7 @@
// "format-full": "", // "format-full": "",
"format-icons": ["", "", "", "", ""] "format-icons": ["", "", "", "", ""]
}, },
"battery#bat2": {
"bat": "BAT2"
},
"network": { "network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ", "format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ", "format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ", "format-linked": "{ifname} (No IP) ",
@ -126,12 +92,14 @@
}, },
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}", "format": "{volume} <span foreground=\"#666666\">{icon}</span> {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}", //"format": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}", //"format-bluetooth": "{volume}% {icon} {format_source}",
"format-muted": " {format_source}", //"format-bluetooth-muted": " {icon} {format_source}",
"format-source": "{volume}% ", //"format-muted": " {format_source}",
"format-source-muted": "", "format-muted": "<span foreground=\"#666666\"></span> {format_source}",
"format-source": "<span foreground=\"#666666\">  </span>",
"format-source-muted": "<span foreground=\"#666666\"></span>",
"format-icons": { "format-icons": {
"headphones": "", "headphones": "",
"handsfree": "", "handsfree": "",
@ -142,17 +110,5 @@
"default": ["", "", ""] "default": ["", "", ""]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
} }
} }

View file

@ -10,8 +10,7 @@
window#waybar { window#waybar {
background-color: #111111; background-color: #111111;
color: #ffffff; color: #ffffff;
transition-property: background-color; transition: none;
transition-duration: .5s;
} }
window#waybar.hidden { window#waybar.hidden {
@ -27,6 +26,11 @@ window#waybar.chromium {
border: none; border: none;
} }
window#waybar.empty {
color: #666666;
background-color: #111111;
}
#workspaces button { #workspaces button {
padding: 0 0.75em; padding: 0 0.75em;
background-color: transparent; background-color: transparent;

View file

@ -57,7 +57,7 @@ _dotfiles_setup_link_files() {
echo -e " Linking (from/to):\n ~/$(realpath --relative-to="$HOME" "$source_file")\n $i" echo -e " Linking (from/to):\n ~/$(realpath --relative-to="$HOME" "$source_file")\n $i"
source_file="" source_file=""
else else
source_file="$i" source_file="$dfp/$i"
fi fi
done done
echo -e "\nDone.\n" echo -e "\nDone.\n"

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# TODO: ascii art header
if [[ $UID -ne 0 ]]; then if [[ $UID -ne 0 ]]; then
echo "Re-running with 'sudo -E'..." echo "Re-running with 'sudo -E'..."
sudo -E "$0" "$@" sudo -E "$0" "$@"
@ -13,19 +11,20 @@ source "${dfp}/bin/lib/setup_helpers.bash"
links=( links=(
# display manager files # display manager files
"$dfp/apps/de/sway/init" "/usr/bin/sway-lytedev" "apps/de/sway/init" "/usr/bin/sway-lytedev"
"$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/sway-lytedev.desktop" "apps/de/sway/dm-entry" "/usr/share/wayland-sessions/sway-lytedev.desktop"
# TODO: laptop-specific setup? part of laptop env?
# touchpad # touchpad
"$dfp/apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf" "apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf"
# udev rules # udev rules
"$dfp/apps/udev-rules/lowbat" "/etc/udev/rules.d/99-lowbat.rules" "apps/udev-rules/lowbat" "/etc/udev/rules.d/99-lowbat.rules"
# TODO: laptop-specific setup? "apps/udev-rules/wifi-powersave" "/etc/udev/rules.d/81-wifi-powersave.rules"
"$dfp/apps/udev-rules/wifi-powersave" "/etc/udev/rules.d/81-wifi-powersave.rules"
# tmpfiles # tmpfiles
"$dfp/apps/tmpfiles/disable-lid-wakeup" "/etc/tmpfiles.d/disable-lid-wakeup.conf" "apps/tmpfiles/disable-lid-wakeup" "/etc/tmpfiles.d/disable-lid-wakeup.conf"
) )
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-root-files.lock" "${links[@]}" _dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-root-files.lock" "${links[@]}"

3
env/desktop/sway/config.d/main vendored Normal file
View file

@ -0,0 +1,3 @@
output HDMI-A-1 res 2560x1440@60Hz pos 0 0
output HDMI-A-1 transform 270
output DP-1 res 3440x1440@100Hz pos 1440 1120

20
env/laptop/sway/config.d/main vendored Normal file
View file

@ -0,0 +1,20 @@
# TODO: setup displays
output HDMI-A-1 res 2560x1440@60Hz pos 0 0
output HDMI-A-1 transform 270
output DP-1 res 3440x1440@100Hz pos 1440 1120
# TODO: setup trackpad/gestures
### Input configuration
#
# Example configuration:
#
#input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll 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.

View file

@ -16,105 +16,106 @@ while test $# -gt 0; do
esac esac
done done
# TODO: note about setting up ~/.env (link to a folder in ./env)
# should prompt user, perhaps?
links=( links=(
# desktop environment files # desktop environment files
"$dfp/apps/de/bspwm/rc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" "apps/de/bspwm/rc" "$XDG_CONFIG_HOME/bspwm/bspwmrc"
"$dfp/apps/de/bspwm/wallpapers" "$HOME/.fehbg" "apps/de/bspwm/wallpapers" "$HOME/.fehbg"
"$dfp/apps/de/sway/config" "$XDG_CONFIG_HOME/sway/config" "apps/de/sway/config" "$XDG_CONFIG_HOME/sway/config"
"$dfp/apps/de/sway/lock" "$XDG_CONFIG_HOME/swaylock/config" "apps/de/sway/lock" "$XDG_CONFIG_HOME/swaylock/config"
"$dfp/apps/de/sxhkd/rc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc" "apps/de/sxhkd/rc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc"
"$dfp/apps/de/x/resources" "$HOME/.Xresources" "apps/de/x/resources" "$HOME/.Xresources"
"$dfp/apps/de/x/init" "$HOME/.xinitrc" "apps/de/x/init" "$HOME/.xinitrc"
"$dfp/apps/de/x/init" "$HOME/.vnc/xstartup" "apps/de/x/init" "$HOME/.vnc/xstartup"
"$dfp/apps/de/x/profile" "$HOME/.xprofile" "apps/de/x/profile" "$HOME/.xprofile"
"$dfp/apps/de/x/modmap" "$HOME/.xmodmap" "apps/de/x/modmap" "$HOME/.xmodmap"
"$dfp/apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf" "apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf"
"$dfp/apps/de/dunst/rc" "$XDG_CONFIG_HOME/dunst/dunstrc" "apps/de/dunst/rc" "$XDG_CONFIG_HOME/dunst/dunstrc"
"$dfp/apps/de/mako/" "$XDG_CONFIG_HOME/mako" "apps/de/mako/" "$XDG_CONFIG_HOME/mako"
"$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors" "bin/lib/colors/xresources" "$HOME/.Xresources.colors"
# shell files # shell files
"$dfp/apps/shell/bash/rc" "$HOME/.bashrc" "apps/shell/bash/rc" "$HOME/.bashrc"
"$dfp/apps/shell/bash/profile" "$HOME/.bash_profile" "apps/shell/bash/profile" "$HOME/.bash_profile"
"$dfp/apps/shell/tmux/conf" "$HOME/.tmux.conf" "apps/shell/tmux/conf" "$HOME/.tmux.conf"
"$dfp/apps/shell/tmux/layouts" "$HOME/.tmux/layouts" "apps/shell/tmux/layouts" "$HOME/.tmux/layouts"
"$dfp/apps/shell/fish/" "$XDG_CONFIG_HOME/fish" "apps/shell/fish/" "$XDG_CONFIG_HOME/fish"
# text editor files # text editor files
"$dfp/apps/neovim/" "$XDG_CONFIG_HOME/nvim" "apps/neovim/" "$XDG_CONFIG_HOME/nvim"
"$dfp/apps/neovim/" "$HOME/.vim" "apps/neovim/" "$HOME/.vim"
"$dfp/apps/neovim/init.vim" "$HOME/.vimrc" "apps/neovim/init.vim" "$HOME/.vimrc"
"$dfp/bin/lib/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim" "bin/lib/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim"
# gtk configuration files # gtk configuration files
"$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc-2.0" "apps/de/gtk/2rc" "$HOME/.gtkrc-2.0"
"$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc" "apps/de/gtk/2rc" "$HOME/.gtkrc"
"$dfp/apps/de/gtk/3settings.ini" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini" "apps/de/gtk/3settings.ini" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini"
# bar files # bar files
"$dfp/apps/de/polybar/config" "$XDG_CONFIG_HOME/polybar/config" "apps/de/polybar/config" "$XDG_CONFIG_HOME/polybar/config"
"$dfp/apps/de/waybar/" "$XDG_CONFIG_HOME/waybar" "apps/de/waybar/" "$XDG_CONFIG_HOME/waybar"
# irc files # irc files
"$dfp/apps/irssi/" "$HOME/.irssi" "apps/irssi/" "$HOME/.irssi"
"$dfp/apps/weechat/" "$HOME/.weechat" "apps/weechat/" "$HOME/.weechat"
# qutebrowser config files # qutebrowser config files
"$dfp/apps/qutebrowser/qutebrowser.conf" "$XDG_CONFIG_HOME/qutebrowser/qutebrowser.conf" "apps/qutebrowser/qutebrowser.conf" "$XDG_CONFIG_HOME/qutebrowser/qutebrowser.conf"
"$dfp/apps/qutebrowser/keys.conf" "$XDG_CONFIG_HOME/qutebrowser/keys.conf" "apps/qutebrowser/keys.conf" "$XDG_CONFIG_HOME/qutebrowser/keys.conf"
# sc-im config files and scripts # sc-im config files and scripts
"$dfp/apps/scim/rc" "$HOME/.scimrc" "apps/scim/rc" "$HOME/.scimrc"
"$dfp/apps/scim/lua" "$HOME/.scim/lua" "apps/scim/lua" "$HOME/.scim/lua"
# libinput configuration # libinput configuration
"$dfp/apps/de/libinput/gestures.conf" "$XDG_CONFIG_HOME/libinput-gestures.conf" "apps/de/libinput/gestures.conf" "$XDG_CONFIG_HOME/libinput-gestures.conf"
# gpg config # gpg config
"$dfp/apps/gpg/agent.conf" "$HOME/.gnupg/gpg-agent.conf" "apps/gpg/agent.conf" "$HOME/.gnupg/gpg-agent.conf"
# document viewer # document viewer
"$dfp/apps/zathura/" "$XDG_CONFIG_HOME/zathura" "apps/zathura/" "$XDG_CONFIG_HOME/zathura"
# htop # htop
"$dfp/apps/htop/rc" "$XDG_CONFIG_HOME/htop/htoprc" "apps/htop/rc" "$XDG_CONFIG_HOME/htop/htoprc"
# terminal emulator # terminal emulator
"$dfp/apps/alacritty/" "$XDG_CONFIG_HOME/alacritty" "apps/alacritty/" "$XDG_CONFIG_HOME/alacritty"
# kitty config # kitty config
"$dfp/apps/kitty/" "$XDG_CONFIG_HOME/kitty" "apps/kitty/" "$XDG_CONFIG_HOME/kitty"
# rofi config # rofi config
"$dfp/apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config" "apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config"
# ranger config # ranger config
"$dfp/apps/ranger/" "$XDG_CONFIG_HOME/ranger" "apps/ranger/" "$XDG_CONFIG_HOME/ranger"
# mutt config # mutt config
"$dfp/apps/mutt/rc" "$XDG_CONFIG_HOME/.muttrc" "apps/mutt/rc" "$XDG_CONFIG_HOME/.muttrc"
"$dfp/apps/mutt/rc" "$HOME/.muttrc" "apps/mutt/rc" "$HOME/.muttrc"
# neofetch config # neofetch config
"$dfp/apps/neofetch/config" "$XDG_CONFIG_HOME/neofetch/config" "apps/neofetch/config" "$XDG_CONFIG_HOME/neofetch/config"
# git config # git config
"$dfp/apps/git/config" "$HOME/.gitconfig" "apps/git/config" "$HOME/.gitconfig"
# fontconfig # fontconfig
"$dfp/apps/de/fontconfig/" "$XDG_CONFIG_HOME/fontconfig" "apps/de/fontconfig/" "$XDG_CONFIG_HOME/fontconfig"
# fontconfig # fontconfig
"$dfp/apps/elixir/iex.exs" "$HOME/.iex.exs" "apps/elixir/iex.exs" "$HOME/.iex.exs"
# XDG user directories # XDG user directories
"$dfp/apps/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs" "apps/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs"
) )
chmod 700 -R "$HOME/.bin" chmod 700 -R "$HOME/.bin"
# TODO: note about setting up ~/.env (link to a folder in ./env)
# TODO: pass interactive? # TODO: pass interactive?
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}" _dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}"