From 4d22dadd30f099a8f2034a8090bcf8f80d947269 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Tue, 9 Aug 2022 11:27:28 +0300 Subject: [PATCH] Add sway configs again and remove colors --- configs/.profile | 13 ++ configs/sway/.profile | 13 ++ configs/sway/config | 101 +++++++++++++ configs/sway/themes/breeze-sway | 41 +++++ configs/waybar/config | 79 ++++++++++ configs/waybar/style.css | 255 ++++++++++++++++++++++++++++++++ tools/git.sh | 26 ++-- tools/install.sh | 13 +- tools/mac.sh | 8 +- tools/reinstall.sh | 8 +- tools/relink.sh | 14 +- tools/upgrade.sh | 8 +- 12 files changed, 533 insertions(+), 46 deletions(-) create mode 100644 configs/.profile create mode 100644 configs/sway/.profile create mode 100644 configs/sway/config create mode 100644 configs/sway/themes/breeze-sway create mode 100644 configs/waybar/config create mode 100644 configs/waybar/style.css diff --git a/configs/.profile b/configs/.profile new file mode 100644 index 0000000..bfa8c02 --- /dev/null +++ b/configs/.profile @@ -0,0 +1,13 @@ +. "$HOME/.cargo/env" +export QT_QPA_PLATFORMTHEME=qt5ct +export GPG_TTY=$(tty) + +export XDG_CURRENT_DESKTOP=sway +export BROWSER=firefox +export QT_QPA_PLATFORMTHEME=qt5ct +export ECORE_EVAS_ENGINE="wayland_egl" +export ELM_ACCEL="gl" +export MOZ_ENABLE_WAYLAND=1 +export MOZ_DBUS_REMOTE=1 +export GTK_CSD=0 + diff --git a/configs/sway/.profile b/configs/sway/.profile new file mode 100644 index 0000000..bfa8c02 --- /dev/null +++ b/configs/sway/.profile @@ -0,0 +1,13 @@ +. "$HOME/.cargo/env" +export QT_QPA_PLATFORMTHEME=qt5ct +export GPG_TTY=$(tty) + +export XDG_CURRENT_DESKTOP=sway +export BROWSER=firefox +export QT_QPA_PLATFORMTHEME=qt5ct +export ECORE_EVAS_ENGINE="wayland_egl" +export ELM_ACCEL="gl" +export MOZ_ENABLE_WAYLAND=1 +export MOZ_DBUS_REMOTE=1 +export GTK_CSD=0 + diff --git a/configs/sway/config b/configs/sway/config new file mode 100644 index 0000000..5272549 --- /dev/null +++ b/configs/sway/config @@ -0,0 +1,101 @@ +set $mod Mod4 +set $left h +set $down j +set $up k +set $right l +set $term alacritty +for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10 +set $menu exec $term --class=launcher -e env zsh -c "source ~/.profile && /usr/bin/sway-launcher-desktop" +set $filemgr pcmanfm-qt + +output * bg /usr/share/backgrounds/Iridescence-dark.png fill + +input * { + xkb_layout us,ru + xkb_options grp:alt_shift_toggle +} + +bar swaybar_command waybar +xwayland enable + +default_border pixel 2 +gaps inner 5 +font "JetBrains Mono" 13 + +exec swayidle -w \ + timeout 300 'swaylock -f -c 000000' \ + timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000' + +output * scale 2 + +include ~/.config/sway/themes/breeze-sway + + bindsym $mod+Return exec $term + bindsym $mod+Shift+f exec $filemgr + bindsym $mod+Shift+q kill + bindsym $mod+d exec $menu + floating_modifier $mod normal + bindsym $mod+Shift+c reload + 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' + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + 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 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + bindsym $mod+b splith + bindsym $mod+v splitv + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + bindsym $mod+f fullscreen + bindsym $mod+Shift+space floating toggle + bindsym $mod+space focus mode_toggle + bindsym $mod+a focus parent + bindsym $mod+Shift+minus move scratchpad + bindsym $mod+minus scratchpad show +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 + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + diff --git a/configs/sway/themes/breeze-sway b/configs/sway/themes/breeze-sway new file mode 100644 index 0000000..a5dd970 --- /dev/null +++ b/configs/sway/themes/breeze-sway @@ -0,0 +1,41 @@ +seat seat0 xcursor_theme "breeze_cursors" + +set $gnome-schema org.gnome.desktop.interface +exec_always { + gsettings set $gnome-schema gtk-theme 'Breeze-Dark' + gsettings set $gnome-schema icon-theme 'breeze-dark' + gsettings set $gnome-schema cursor-theme 'breeze_cursors' + gsettings set $gnome-schema font-name 'Noto Sans 10' +} + +# Colors based on Breeze Dark theme and Base16 Seti UI + +set $color0 #232629 +set $color1 #31363b +set $color2 #3B758C +set $color3 #41535B +set $color4 #43a5d5 +set $color5 #bdc3c7 +set $color6 #eeeeee +set $color7 #eff0f1 +set $color8 #da4453 +set $color9 #db7b55 +set $color10 #e6cd69 +set $color11 #9fca56 +set $color12 #3daee9 +set $color13 #2980b9 +set $color14 #a074c4 +set $color15 #8a553f + +# Colors with alpha +set $background-color #ff232629 +set $accent-color #ff3daee9 + +# Basic color configuration using the Base16 variables for windows and borders. +# Property Name Border BG Text Indicator Child Border +client.focused $color5 $color12 $color0 $color12 $color12 +client.focused_inactive $color1 $color1 $color5 $color3 $color1 +client.unfocused $color1 $color0 $color5 $color1 $color1 +client.urgent $color8 $color8 $color0 $color8 $color8 +client.placeholder $color0 $color0 $color5 $color0 $color0 +client.background $color7 diff --git a/configs/waybar/config b/configs/waybar/config new file mode 100644 index 0000000..3f81390 --- /dev/null +++ b/configs/waybar/config @@ -0,0 +1,79 @@ +{ + "height": 30, // Waybar height (to be removed for auto height) + "spacing": 0, // Gaps between modules (4px) + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": ["sway/window"], + "modules-right": ["idle_inhibitor", "network", "cpu", "memory", "keyboard-state", "sway/language", "clock", "tray"], + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%d.%m.%Y %H:%M:%S}", + "interval": 1 + }, + "cpu": { + "format": "CPU: {usage}%", + "tooltip": false + }, + "memory": { + "format": "RAM: {}%" + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{capacity}% {icon}", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "", + "format-ethernet": "", + "tooltip-format": "{ifname} via {essid} {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + // "format-alt": "{ifname} ({essid}): {ipaddr}/{cidr}" + }, +} diff --git a/configs/waybar/style.css b/configs/waybar/style.css new file mode 100644 index 0000000..c1284f0 --- /dev/null +++ b/configs/waybar/style.css @@ -0,0 +1,255 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: JetBrains Mono, FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.5; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each workspace name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +}/* + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +}*/ + +/*#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +}*/ + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { +/* background-color: #f53c3c; + color: #ffffff; + animation-name: blink;*/ + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +/*#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} +*/ +#language { + /*background: #00b093; + color: #740864;*/ + padding: 0 5px; + margin: 0 0px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} +/* +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} +*/ diff --git a/tools/git.sh b/tools/git.sh index eeeeae7..600c055 100755 --- a/tools/git.sh +++ b/tools/git.sh @@ -1,10 +1,6 @@ #!/bin/sh -GREEN="\033[32m" -RED="\033[31m" -CLEAR_COLOR="\033[0m" - -echo "${GREEN}Setting up git$CLEAR_COLOR" +echo "Setting up git" read -p "Enter your name for commits: " GITNAME git config --global user.name "$GITNAME" read -p "Enter your email for commits: " GITEMAIL @@ -30,17 +26,17 @@ then fi git config --global core.editor $GITEDITOR -echo "\n${RED}Git configured with:$CLEAR_COLOR" -echo "${GREEN}user.name: ${CLEAR_COLOR}$GITNAME" -echo "${GREEN}user.email: ${CLEAR_COLOR}$GITEMAIL" -echo "${GREEN}core.editor: ${CLEAR_COLOR}$GITEDITOR" -echo "${GREEN}pull.rebase: ${CLEAR_COLOR}false (merge)" +echo "\nGit configured with:" +echo "user.name: $GITNAME" +echo "user.email: $GITEMAIL" +echo "core.editor: $GITEDITOR" +echo "pull.rebase: false (merge)" if [[ $answer = [Yy] ]] then -echo "${GREEN}commit.codesign: ${CLEAR_COLOR}true" -echo "${GREEN}gpg.program: ${CLEAR_COLOR}gpg2" -echo "${GREEN}user.signingkey: ${CLEAR_COLOR}$GPGKEYID" +echo "commit.codesign: true" +echo "gpg.program: gpg2" +echo "user.signingkey: $GPGKEYID" else -echo "${GREEN}commit.codesign: ${CLEAR_COLOR}false" -fi \ No newline at end of file +echo "commit.codesign: false" +fi diff --git a/tools/install.sh b/tools/install.sh index d9f19c0..29d972f 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,11 +1,8 @@ #!/bin/sh CURRENTDIR="$(pwd)" -GREEN="\033[32m" -RED="\033[31m" -CLEAR_COLOR="\033[0m" -echo "${GREEN}Welcome to ivabus .dotfiles installer$CLEAR_COLOR" +echo "Welcome to ivabus .dotfiles installer" echo "Dotfiles will be installed to $HOME/.dotfiles" echo "Press enter to proceed" read A @@ -15,12 +12,12 @@ read A if ! command -v zsh > /dev/null then echo "zsh is not installed" - echo "${RED}Aborting.$CLEAR_COLOR" + echo "Aborting." exit 255 fi # install oh-my-zsh and plugins -echo "${GREEN}Installing oh-my-zsh and plugins$CLEAR_COLOR" +echo "Installing oh-my-zsh and plugins" ZSH="$HOME/.dotfiles/oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended > /dev/null 2>&1 curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.dotfiles/oh-my-zsh/custom/themes/ivabus.zsh-theme > /dev/null 2>&1 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.dotfiles/oh-my-zsh/custom/plugins/zsh-syntax-highlighting > /dev/null 2>&1 @@ -39,7 +36,7 @@ chmod +x $HOME/.dotfiles/utils/sway-launcher-desktop # linking dotfiles to their original locations -echo "${GREEN}Linking dotfiles$CLEAR_COLOR" +echo "Linking dotfiles" sh $HOME/.dotfiles/tools/relink.sh @@ -50,7 +47,7 @@ then sh $HOME/.dotfiles/tools/mac.sh fi -echo "${GREEN}Dotfiles installed and linked.$CLEAR_COLOR" +echo "Dotfiles installed and linked." read -p "Would you like to configure git? (y/N): " answer if [[ $answer = [Yy] ]]; then sh $HOME/.dotfiles/tools/git.sh diff --git a/tools/mac.sh b/tools/mac.sh index 89982c1..dc46479 100755 --- a/tools/mac.sh +++ b/tools/mac.sh @@ -1,14 +1,10 @@ #!/bin/bash -GREEN="\033[32m" -RED="\033[31m" -CLEAR_COLOR="\033[0m" - # configuring mac-only things # installing homebrew -echo "${GREEN}Installing Homebrew${CLEAR_COLOR}" +echo "Installing Homebrew" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" if [ "$(arch)" == "arm64" ] @@ -24,4 +20,4 @@ echo "pinentry-program $HOMEBREW_PREFIX/bin/pinentry-mac" >> $HOME/.gnupg/gpg-ag # install jb mono brew tap homebrew/cask-fonts -brew install --cask font-jetbrains-mono alacritty \ No newline at end of file +brew install --cask font-jetbrains-mono alacritty diff --git a/tools/reinstall.sh b/tools/reinstall.sh index c67f9e2..e518e4e 100755 --- a/tools/reinstall.sh +++ b/tools/reinstall.sh @@ -1,14 +1,10 @@ #!/bin/sh -GREEN="\033[32m" -RED="\033[31m" -CLEAR_COLOR="\033[0m" - -echo "${RED}Reinstalling dotfiles${CLEAR_COLOR}" +echo "Reinstalling dotfiles" echo "To proceed press enter" read A cd $HOME rm -rf $HOME/.dotfiles -sh -c "$(curl -fsSL https://ivabus.dev/dotfiles)" \ No newline at end of file +sh -c "$(curl -fsSL https://ivabus.dev/dotfiles)" diff --git a/tools/relink.sh b/tools/relink.sh index 37ccd6f..2b9b4c6 100755 --- a/tools/relink.sh +++ b/tools/relink.sh @@ -3,15 +3,17 @@ # script that (re)links all dotfiles during the installation or upgrade. # do not run manually -mkdir -p $HOME/.config/nvim $HOME/.config/alacritty $HOME/.config/sway $HOME/.config/waybar >/dev/null 2>&1 -rm -rf $HOME/.zshrc $HOME/.config/nvim/init.vim $HOME/.config/alacritty/alacritty.yml $HOME/.config/sway/* $HOME/.config/waybar/* >/dev/null 2>&1 +mkdir -p $HOME/.config/nvim $HOME/.config/alacritty >/dev/null 2>&1 +rm -rf $HOME/.zshrc $HOME/.config/nvim/init.vim $HOME/.config/alacritty/alacritty.yml $HOME/.config/sway $HOME/.config/waybar >/dev/null 2>&1 ln -s $HOME/.dotfiles/configs/zshrc $HOME/.zshrc echo ".zshrc linked: $HOME/.dotfiles/configs/zshrc -> $HOME/.zshrc" +ln -s $HOME/.dotfiles/configs/.profile $HOME/.profile +echo ".profile linked $HOME/.dotfiles/configs/.profile -> $HOME/.profile" ln -s $HOME/.dotfiles/configs/nvim.vim $HOME/.config/nvim/init.vim echo "neovim config linked: $HOME/.dotfiles/configs/nvim.vim -> $HOME/.config/nvim/init.vim" ln -s $HOME/.dotfiles/configs/alacritty.yml $HOME/.config/alacritty/alacritty.yml echo "alacritty config linked: $HOME/.dotfiles/configs/alacritty.yml -> $HOME/.config/alacritty/alacritty.yml" -ln -s $HOME/.dotfiles/configs/sway/sway $HOME/.config/sway/config -ln -s $HOME/.dotfiles/configs/sway/waybar/config $HOME/.config/waybar/config -ln -s $HOME/.dotfiles/configs/sway/waybar/style.css $HOME/.config/waybar/style.css -echo "sway and waybar configs linked" + +ln -s $HOME/.dotfiles/configs/sway $HOME/.config/ +ln -s $HOME/.dotfiles/configs/waybar $HOME/.config/ +echo "sway and waybar dotfiles installed" diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 42f79dc..0fcf076 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -4,11 +4,9 @@ # oh-my-zsh update included! CURRENTDIR="$(pwd)" -GREEN="\033[32m" -CLEAR_COLOR="\033[0m" cd $HOME/.dotfiles -echo "1) ${GREEN}Upgrading dotfiles$CLEAR_COLOR" +echo "1) Upgrading dotfiles" # ignore local changes @@ -22,6 +20,6 @@ else exit 1 fi sh tools/relink.sh -echo "2) ${GREEN}Upgrading oh-my-zsh$CLEAR_COLOR" +echo "2) Upgrading oh-my-zsh" zsh -c "source $ZSH/oh-my-zsh.sh && omz update" > /dev/null -cd $CURRENTDIR \ No newline at end of file +cd $CURRENTDIR