diff --git a/nix/sway.nix b/nix/sway.nix index be6efe9..87b60c1 100644 --- a/nix/sway.nix +++ b/nix/sway.nix @@ -1,42 +1,246 @@ -# sway.nix imported by my configuration.nix -{ pkgs, ... }: - { + lib, + pkgs, + ... +}: { programs.sway = { enable = true; wrapperFeatures.gtk = true; # Needed for GTK apps to work. extraSessionCommands = '' - export SDL_VIDEODRIVER = wayland - export QT_QPA_PLATFORM = wayland - export XDG_SESSION_TYPE = wayland + export SDL_VIDEODRIVER = wayland + export QT_QPA_PLATFORM = wayland + export XDG_SESSION_TYPE = wayland ''; + extraPackages = with pkgs; [ + brightnessctl + foot + grim + pulseaudio + swayidle + swaylock + wmenu + + ulauncher + wl-mirror + wl-clipboard + ]; }; - # XWayland depends on this (already declared in configuration.nix) - # services.xserver.enable = true; # Required for Sway as per https://nixos.wiki/wiki/Sway security.polkit.enable = true; - # Allow user to run swaylock - # security.pam.services.swaylock = {}; + xdg.portal.enable = true; + + environment.etc."sway/config" = let + mod = "Mod4"; + term = "kitty"; - # Required for brightness and volume keys (accompanied by some sway config stuff) - users.users.bashbunni.extraGroups = [ "video" ]; - programs.light.enable = true; + unpack = set: lib.lists.foldr (a: b: a // b) {} (builtins.attrValues set); - # Other basic settings - networking.networkmanager.enable = true; # for internet - services.blueman.enable = true; # for bluetooth + mod4Keybinds = unpack (builtins.mapAttrs (key: cmd: {"${mod}+${key}" = cmd;}) { + # General + "Shift+q" = "kill"; + "Shift+c" = "swaymsg reload"; + "Shift+r" = "swaymsg restart"; + "r" = "mode \"resize\""; + # Executables + "Return" = "exec ${term}"; + "d" = "exec --no-startup-id rofi -combi-modi window#drun -show combi -modi combi -show-icons"; + "g" = "exec --no-startup-id rofi -show window"; + "m" = "exec ~/.config/emacs/bin/doom run"; + "F4" = "exec --no-startup-id flameshot gui"; + "Print" = "exec --no-startup-id flameshot screen"; + "Shift+e" = "exec swaynag -t warning -m 'Exit sway?' -B 'Yes, exit sway' 'swaymsg exit'"; + # Layout + "f" = "fullscreen toggle"; + "s" = "layout stacking"; + "w" = "layout tabbed"; + "e" = "layout toggle split"; + "h" = "split h"; + "v" = "split v"; + "Shift+space" = "floating toggle"; + "space" = "focus mode_toggle"; + "a" = "focus parent"; + # Focus + "j" = "focus left"; + "k" = "focus down"; + "l" = "focus up"; + "semicolon" = "focus right"; + "Left" = "focus left"; + "Down" = "focus down"; + "Up" = "focus up"; + "Right" = "focus right"; + "o" = "move workspace to output right"; + "Shift+j" = "focus output left"; + "Shift+k" = "focus output right"; + # Move + "Shift+Left" = "move left"; + "Shift+Down" = "move down"; + "Shift+Up" = "move up"; + "Shift+Right" = "move right"; + }); - # Select between Gnome and Sway at Startup -# services.xserver.displayManager.sessionPackages = with pkgs; [ sway ]; + generalKeybinds = { + "Print" = "exec --no-startup-id flameshot gui"; + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%"; + "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + }; - environment.systemPackages = with pkgs; [ - ulauncher # A program launcher - xdg-desktop-portal - wl-mirror - wl-clipboard - ]; - # Fix waybar not launching outside of dbus-run-session. - xdg.portal.enable = true; + ws = map toString (lib.range 1 9); + workspaceKeybinds = + builtins.listToAttrs ( + lib.concatMap (i: [ + { + name = "${mod}+${i}"; + value = "workspace number ${i}"; + } + { + name = "${mod}+Shift+${i}"; + value = "move container to workspace number ${i}"; + } + ]) + ws + ) + // { + "${mod}+0" = "workspace number 10"; + "${mod}+Shift+0" = "move container to workspace number 10"; + }; + + allKeybinds = mod4Keybinds // generalKeybinds // workspaceKeybinds; + + keybindings = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (key: cmd: "bindsym ${key} ${cmd}") allKeybinds + ); + + colorAttrs = { + focused = { + border = "#EA3AE9"; + background = "#EA3AE9"; + text = "#F8F8F2"; + indicator = "#EA3AE9"; + childBorder = "#EA3AE9"; + }; + focused_inactive = { + border = "#44475A"; + background = "#44475A"; + text = "#F8F8F2"; + indicator = "#44475A"; + childBorder = "#44475A"; + }; + unfocused = { + border = "#282A36"; + background = "#282A36"; + text = "#BFBFBF"; + indicator = "#282A36"; + childBorder = "#282A36"; + }; + urgent = { + border = "#44475A"; + background = "#FF5555"; + text = "#F8F8F2"; + indicator = "#FF5555"; + childBorder = "#FF5555"; + }; + placeholder = { + border = "#282A36"; + background = "#282A36"; + text = "#F8F8F2"; + indicator = "#282A36"; + childBorder = "#282A36"; + }; + background = { + border = "#F8F8F2"; + background = ""; + text = ""; + indicator = ""; + childBorder = ""; + }; + }; + + colors = lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + name: c: + if name == "background" + then "client.background ${c.border}" + else "client.${name} ${c.border} ${c.background} ${c.text} ${c.indicator} ${c.childBorder}" + ) + colorAttrs + ); + + resizeModeBinds = { + "j" = "resize shrink width 10 px or 10 ppt"; + "k" = "resize grow height 10 px or 10 ppt"; + "l" = "resize shrink height 10 px or 10 ppt"; + "semicolon" = "resize grow width 10 px or 10 ppt"; + "Left" = "resize shrink width 10 px or 10 ppt"; + "Down" = "resize grow height 10 px or 10 ppt"; + "Up" = "resize shrink height 10 px or 10 ppt"; + "Right" = "resize grow width 10 px or 10 ppt"; + "Return" = "mode \"default\""; + "Escape" = "mode \"default\""; + "${mod}+r" = "mode \"default\""; + }; + + resizeMode = '' + mode "resize" { + ${lib.concatStringsSep "\n " (lib.mapAttrsToList (key: cmd: "bindsym ${key} ${cmd}") resizeModeBinds)} + } + ''; + + startupCmds = [ + "--no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork" + "--no-startup-id nm-applet" + "emacs --daemon" + "dbus-launch waybar" + "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK" + "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" + ]; + + wallpaper = "/home/bashbunni/Pictures/background.png"; + + setWallpaper = pkgs.writeShellScriptBin "set-wallpaper" '' + if [ -f ${wallpaper} ]; then + swaymsg "output * background ${wallpaper} fill" + else + swaymsg "output * bg #00A86B" + fi + ''; + + startupAlways = [ + "${setWallpaper}/bin/set-wallpaper" + ]; + + startup = lib.concatStringsSep "\n" ( + map (cmd: "exec ${cmd}") startupCmds + ++ map (cmd: "exec_always ${cmd}") startupAlways + ); + + designAttrs = { + smart_borders = "on"; + "gaps inner" = "5"; + "gaps outer" = "3"; + default_border = "pixel 3"; + floating_modifier = mod; + "font pango" = "\"Terminess Nerd Font\" Medium 20"; + }; + + design = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (key: val: "${key} ${val}") designAttrs + ); + + mainConfig = '' + set $mod ${mod} + set $term ${term} + + ${design} + ${colors} + ${startup} + ${keybindings} + ${resizeMode} + ''; + in { + source = pkgs.writeText "sway-config" mainConfig; + }; } diff --git a/sway/.config/sway/config b/sway/.config/sway/config deleted file mode 100644 index 883cab5..0000000 --- a/sway/.config/sway/config +++ /dev/null @@ -1,225 +0,0 @@ -# i3 config file (v4) -# Please see https://i3wm.org/docs/userguide.html for a complete reference! - -# Start modifiers -set $mod Mod4 - -# R: Use flameshot instead of i3-scrot. Print to capture a screenshot with the UI, mod+Print to capture screen -bindsym Print exec --no-startup-id flameshot gui -bindsym $mod+Print --release exec --no-startup-id flameshot screen -bindsym $mod+F4 exec --no-startup-id flameshot gui - -# https://nardifairuz.wordpress.com/2019/06/25/using-i3-with-multiple-monitors/ - -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. -font pango:monospace 8 -# set $background /home/bashbunni/Pictures/paint-wallpaper.jpg -exec_always bash -c '[ -f home/bashbunni/Pictures/background.png ] && swaymsg "output * background /home/bashbunni/Pictures/background.png fill" || swaymsg "output * bg #00A86B"' - -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -#font pango:DejaVu Sans Mono 8 - -# The combination of xss-lock, nm-applet and pactl is a popular choice, so -# they are included here as an example. Modify as you see fit. - -# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the -# screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork - -# NetworkManager is the most popular way to manage wireless networks on Linux, -# and nm-applet is a desktop environment-independent system tray GUI for it. -exec --no-startup-id nm-applet - -# Use pactl to adjust volume in PulseAudio. -set $refresh_i3status killall -SIGUSR1 i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status -bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -set $term kitty -bindsym $mod+Return exec $term - -# kill focused window -bindsym $mod+Shift+q kill - -# start dmenu (a program launcher) -# There also is the (new) i3-dmenu-desktop which only displays applications -# shipping a .desktop file. It is a wrapper around dmenu, so you need that -# installed. -# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop - -# change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon 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 between monitors -bindsym $mod+o move workspace to output right - -# focus monitors -bindsym $mod+Shift+j focus output left -bindsym $mod+Shift+k focus output right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# split in horizontal orientation -bindsym $mod+h split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -# Define names for default workspaces for which we configure key bindings later on. -# We use variables to avoid repeating the names in multiple places. -set $ws1 "1" -set $ws2 "2" -set $ws3 "3" -set $ws4 "4" -set $ws5 "5" -set $ws6 "6" - -# switch to workspace -bindsym $mod+1 workspace number $ws1 -bindsym $mod+2 workspace number $ws2 -bindsym $mod+3 workspace number $ws3 -bindsym $mod+4 workspace number $ws4 -bindsym $mod+5 workspace number $ws5 -bindsym $mod+6 workspace number $ws6 -bindsym $mod+7 workspace number $ws7 -bindsym $mod+8 workspace number $ws8 -bindsym $mod+9 workspace number $ws9 -bindsym $mod+0 workspace number $ws10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number $ws1 -bindsym $mod+Shift+2 move container to workspace number $ws2 -bindsym $mod+Shift+3 move container to workspace number $ws3 -bindsym $mod+Shift+4 move container to workspace number $ws4 -bindsym $mod+Shift+5 move container to workspace number $ws5 -bindsym $mod+Shift+6 move container to workspace number $ws6 -bindsym $mod+Shift+7 move container to workspace number $ws7 -bindsym $mod+Shift+8 move container to workspace number $ws8 -bindsym $mod+Shift+9 move container to workspace number $ws9 -bindsym $mod+Shift+0 move container to workspace number $ws10 - -# reload the configuration file -bindsym $mod+Shift+c swaymsg reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r swaymsg restart -# exit i3 (logs you out of your X 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' - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape or $mod+r - bindsym Return mode "default" - bindsym Escape mode "default" - bindsym $mod+r mode "default" -} - -corner_radius 10 -blur enable -blur_passes 2 -blur_radius 2 -layer_effects "waybar" "blur enable; shadows enable; corner_radius 6" - -bindsym $mod+r mode "resize" - -# class border bground text indicator child_border -client.focused #EA3AE9 #EA3AE9 #F8F8F2 #EA3AE9 #EA3AE9 -client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A -client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36 -client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555 -client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36 - -client.background #F8F8F2 - -# start rofi -bindsym $mod+d exec --no-startup-id rofi -combi-modi window#drun -show combi -modi combi -show-icons -bindsym $mod+g exec --no-startup-id rofi -show window - -exec emacs --daemon -bindsym $mod+m exec ~/.config/emacs/bin/doom run - -# manage monitors -# workspace 1 output HDMI-A-2 -# workspace 2 output eDP-1 -# exec_always xrandr --output HDMI-A-2 --primary --left-of eDP-1 -# exec swaymsg output eDP-1 mode 1920x1080@120Hz - -# set external display as primary -# output HDMI-A-2 pos 0 0 -# output HDMI-A-2 scale 1.2 - -# disable laptop screen when lid is closed -# bindswitch lid:on output eDP-1 disable -# bindswitch lid:off output eDP-1 enable - -# design -smart_borders on -gaps inner 5 -gaps outer 3 -default_border pixel 3 -font pango:"Terminess Nerd Font" Medium 20 - -# Run services. -# exec waybar -exec dbus-launch waybar -# fix slow app startup time in Sway. e.g. files -exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK -exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK -# exec_always 'killall -q waybar; waybar' diff --git a/sway/.config/sway/config-old b/sway/.config/sway/config-old deleted file mode 100644 index 6840228..0000000 --- a/sway/.config/sway/config-old +++ /dev/null @@ -1,194 +0,0 @@ -# i3 config file (v4) -# -# Please see https://i3wm.org/docs/userguide.html for a complete reference! -# -# This config file uses keycodes (bindsym) and was written for the QWERTY -# layout. -# -# To get a config file with the same key positions, but for your current -# layout, use the i3-config-wizard -# - -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. -font pango:monospace 8 - -# bb: make your mod key a variable so that you can change it -set $mod Mod1 - -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -#font pango:DejaVu Sans Mono 8 - -# The combination of xss-lock, nm-applet and pactl is a popular choice, so -# they are included here as an example. Modify as you see fit. - -# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the -# screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork - -# NetworkManager is the most popular way to manage wireless networks on Linux, -# and nm-applet is a desktop environment-independent system tray GUI for it. -# exec --no-startup-id nm-applet - -# Use pactl to adjust volume in PulseAudio. -set $refresh_i3status killall -SIGUSR1 i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status -bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status - -# use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec i3-sensible-terminal - -# kill focused window -bindsym $mod+Shift+q kill - -# bb: use rofi on dmenu -bindsym $mod+d exec --no-startup-id rofi -combi-modi window#drun#ssh -theme solarized -show combi -bindsym $mod+c exec --no-startup-id "rofi -show calc -modi calc -theme solarized -no-show-match -no-sort" - -# Use Mouse+$mod to drag floating windows -floating_modifier $mod - -# There also is the (new) i3-dmenu-desktop which only displays applications -# shipping a .desktop file. It is a wrapper around dmenu, so you need that -# installed. -# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop - -# bb: change focus with vikeys -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right - -# bb: move focused window with arrow keys -bindsym $mod+Left move left -bindsym $mod+Down move down -bindsym $mod+Up move up -bindsym $mod+Right move right - -# split in horizontal orientation -bindsym $mod+h split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -# move the currently focused window to the scratchpad -bindsym $mod+Shift+minus 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+minus scratchpad show - -# Define names for default workspaces for which we configure key bindings later on. -# We use variables to avoid repeating the names in multiple places. -set $ws1 "1" -set $ws2 "2" -set $ws3 "3" -set $ws4 "4" -set $ws5 "5" -set $ws6 "6" -set $ws7 "7" -set $ws8 "8" -set $ws9 "9" -set $ws10 "10" - -# switch to workspace -bindsym $mod+1 workspace number $ws1 -bindsym $mod+2 workspace number $ws2 -bindsym $mod+3 workspace number $ws3 -bindsym $mod+4 workspace number $ws4 -bindsym $mod+5 workspace number $ws5 -bindsym $mod+6 workspace number $ws6 -bindsym $mod+7 workspace number $ws7 -bindsym $mod+8 workspace number $ws8 -bindsym $mod+9 workspace number $ws9 -bindsym $mod+0 workspace number $ws10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number $ws1 -bindsym $mod+Shift+2 move container to workspace number $ws2 -bindsym $mod+Shift+3 move container to workspace number $ws3 -bindsym $mod+Shift+4 move container to workspace number $ws4 -bindsym $mod+Shift+5 move container to workspace number $ws5 -bindsym $mod+Shift+6 move container to workspace number $ws6 -bindsym $mod+Shift+7 move container to workspace number $ws7 -bindsym $mod+Shift+8 move container to workspace number $ws8 -bindsym $mod+Shift+9 move container to workspace number $ws9 -bindsym $mod+Shift+0 move container to workspace number $ws10 - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym $left resize shrink width 10 px or 10 ppt - bindsym $down resize grow height 10 px or 10 ppt - bindsym $up resize shrink height 10 px or 10 ppt - bindsym $right resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape or $mod+r - bindsym Return mode "default" - bindsym Escape mode "default" - bindsym $mod+r mode "default" -} - -bindsym $mod+r mode "resize" - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - status_command i3status -} - -####################################################################### -# automatically start i3-config-wizard to offer the user to create a -# keysym-based config which used their favorite modifier (alt or windows) -# -# i3-config-wizard will not launch if there already is a config file -# in ~/.config/i3/config (or $XDG_CONFIG_HOME/i3/config if set) or -# ~/.i3/config. -# -# Please remove the following exec line: -####################################################################### -exec i3-config-wizard diff --git a/sway/.config/sway/sway_bar.sh b/sway/.config/sway/sway_bar.sh deleted file mode 100644 index 2636bbf..0000000 --- a/sway/.config/sway/sway_bar.sh +++ /dev/null @@ -1,69 +0,0 @@ -# Change this according to your device -################ -# Variables -################ - -# Keyboard input name -keyboard_input_name="1:1:AT_Translated_Set_2_keyboard" - -# Date and time -date_and_week=$(date "+%Y/%m/%d (w%-V)") -current_time=$(date "+%H:%M") - -############# -# Commands -############# - -# Battery or charger -battery_charge=$(upower --show-info $(upower --enumerate | grep 'BAT') | egrep "percentage" | awk '{print $2}') -battery_status=$(upower --show-info $(upower --enumerate | grep 'BAT') | egrep "state" | awk '{print $2}') - -# Audio and multimedia -audio_volume=$(pamixer --sink `pactl list sinks short | grep RUNNING | awk '{print $1}'` --get-volume) -audio_is_muted=$(pamixer --sink `pactl list sinks short | grep RUNNING | awk '{print $1}'` --get-mute) -media_artist=$(playerctl metadata artist) -media_song=$(playerctl metadata title) -player_status=$(playerctl status) - -# Network -network=$(ip route get 1.1.1.1 | grep -Po '(?<=dev\s)\w+' | cut -f1 -d ' ') -# interface_easyname grabs the "old" interface name before systemd renamed it -interface_easyname=$(dmesg | grep $network | grep renamed | awk 'NF>1{print $NF}') -ping=$(ping -c 1 www.google.es | tail -1| awk '{print $4}' | cut -d '/' -f 2 | cut -d '.' -f 1) - -# Others -language=$(swaymsg -r -t get_inputs | awk '/1:1:AT_Translated_Set_2_keyboard/;/xkb_active_layout_name/' | grep -A1 '\b1:1:AT_Translated_Set_2_keyboard\b' | grep "xkb_active_layout_name" | awk -F '"' '{print $4}') -loadavg_5min=$(cat /proc/loadavg | awk -F ' ' '{print $2}') - -if [ $battery_status = "discharging" ]; -then - battery_pluggedin='⚠' -else - battery_pluggedin='⚡' -fi - -if ! [ $network ] -then - network_active="⛔" -else - network_active="⇆" -fi - -if [ $player_status = "Playing" ] -then - song_status='▶' -elif [ $player_status = "Paused" ] -then - song_status='⏸' -else - song_status='⏹' -fi - -if [ $audio_is_muted = "true" ] -then - audio_active='🔇' -else - audio_active='🔊' -fi - -echo "🎧 $song_status $media_artist - $media_song | ⌨ $language | $network_active $interface_easyname ($ping ms) | 🏋 $loadavg_5min | $audio_active $audio_volume% | $battery_pluggedin $battery_charge | $date_and_week 🕘 $current_time"