commit 2b776d7cce6185d63f47248b692f2cbc36498f2e Author: k4rli Date: Mon Jul 7 22:30:20 2025 +0300 initial commit diff --git a/add-144hz-mode.sh b/add-144hz-mode.sh new file mode 100755 index 0000000..0a39cce --- /dev/null +++ b/add-144hz-mode.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Script to add 144Hz mode to Sway +# Based on the xrandr command: xrandr --newmode "2560x1440_144.00_rb2" 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync + +echo "Adding 144Hz mode to Sway..." + +# Add the custom mode using modeline (same timing as xrandr) +swaymsg output HDMI-A-1 modeline "2560x1440_144.00_rb2" 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync + +# Set the mode +swaymsg output HDMI-A-1 mode 2560x1440_144.00_rb2 + +echo "144Hz mode should now be active. Check with: swaymsg -t get_outputs" \ No newline at end of file diff --git a/config b/config new file mode 100644 index 0000000..01a9f79 --- /dev/null +++ b/config @@ -0,0 +1,503 @@ +# Sway config based on Regolith i3 setup - Arch Linux version +# Copy this to ~/.config/sway/config and edit it to your liking. +# Read `man 5 sway` for a complete reference. + +############################################################################### +# Variables and Basic Setup +############################################################################### + +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +set $alt Mod1 + +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +# Workspace keys +set $ws1_key 1 +set $ws2_key 2 +set $ws3_key 3 +set $ws4_key 4 +set $ws5_key 5 +set $ws6_key 6 +set $ws7_key 7 +set $ws8_key 8 +set $ws9_key 9 +set $ws10_key 0 +set $ws_high_key Ctrl + +# Workspace numbers +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 +set $ws11 11 +set $ws12 12 +set $ws13 13 +set $ws14 14 +set $ws15 15 +set $ws16 16 +set $ws17 17 +set $ws18 18 +set $ws19 19 + +# Movement key bindings +set $move_left Shift+h +set $move_down Shift+j +set $move_up Shift+k +set $move_right Shift+l + +# Your preferred terminal emulator (Arch Linux alternatives) +set $term kitty +# Your preferred application launcher +set $menu fuzzel +# File manager (Arch alternatives) +set $filemanager thunar + +############################################################################### +# Output configuration +############################################################################### + +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill + +# 144Hz monitor configuration +# Add custom 144Hz mode for your monitor +# Using the same timing as your xrandr command: 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync +output HDMI-A-1 { + modeline 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync +} + +# You can get the names of your outputs by running: swaymsg -t get_outputs + +############################################################################### +# Idle configuration +############################################################################### + +# Lock screen after 300 seconds of inactivity, then turn off displays +exec swayidle -w \ + timeout 900 'swaylock -f -c 000000' \ + timeout 1800 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + before-sleep 'swaylock -f -c 000000' + +############################################################################### +# Input configuration +############################################################################### + +# Estonian keyboard layout configuration +input type:keyboard { + xkb_layout "ee" + xkb_variant "nodeadkeys" +} + +# Enable touchpad tap, natural scroll +input type:touchpad { + dwt enabled + tap enabled + natural_scroll enabled + middle_emulation enabled +} + +# Disable mouse acceleration for all pointer devices +input type:pointer { + accel_profile flat +} + +############################################################################### +# Window and Application Styling +############################################################################### + +# Floating window rules +floating_maximum_size -1 x -1 +for_window [app_id="floating_window"] floating enable + +# Border configuration +default_floating_border pixel 1 +default_border pixel 1 + +# Hiding borders adjacent to the screen edges. +hide_edge_borders smart + +# Enable popup during fullscreen +popup_during_fullscreen smart + +# Window focus follows mouse +focus_follows_mouse no + +# Auto back and forth workspace switching +workspace_auto_back_and_forth no + +# Use Mouse+$mod to drag floating windows +floating_modifier $mod normal + +############################################################################### +# Key bindings +############################################################################### + +############################################################################### +# Launcher dialogs +############################################################################### + +## Launch // Terminal // <> Enter ## +bindsym $mod+Return exec $term + +## Launch // Browser // <> Enter ## +bindsym $mod+Shift+Return exec xdg-open http:// + +## Launch // Application // <> Space ## +bindsym $mod+space exec $menu + +## Launch // Command // <> Space ## +bindsym $mod+Shift+space exec $term + +## Navigate // Window by Name // <> Space ## +bindsym $mod+Ctrl+space exec swaymsg -t get_tree | jq -r '..|select(.pid? and .visible?)|.name+" ["+.app_id+"]"' | fuzzel --dmenu | xargs -I {} swaymsg '[title="{}"] focus' + +## Launch // File Search // <> Space ## +bindsym $mod+$alt+space exec $filemanager + +############################################################################### +# Session Management +############################################################################### + +## Session // Exit App // <> q ## +bindsym $mod+Shift+q kill + +## Session // Terminate App // <> q ## +bindsym $mod+$alt+q exec --no-startup-id kill -9 $(swaymsg -t get_tree | jq '.. | select(.focused?).pid // empty') + +## Session // Reload WM Config // <> c ## +bindsym $mod+Shift+c reload + +## Session // Restart WM // <> r ## +bindsym $mod+Ctrl+r reload + +## Session // Logout // <> e ## +bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + +## Session // Reboot // <> b ## +bindsym $mod+Shift+b exec systemctl reboot + +## Session // Power Down // <> p ## +bindsym $mod+Shift+p exec systemctl poweroff + +## Session // Lock Screen // <> Escape ## +bindsym $mod+Escape exec swaylock -f -c 000000 + +## Session // Sleep // <> s ## +bindsym $mod+Shift+s exec systemctl suspend + +############################################################################### +# System Management (Arch Linux alternatives) +############################################################################### + +## Modify // Settings // <> c ## +bindsym $mod+c exec env XDG_CURRENT_DESKTOP=GNOME gnome-control-center + +## Modify // Display Settings // <> d ## +bindsym $mod+d exec wdisplays + +## Modify // Wifi Settings // <> w ## +bindsym $mod+w exec nm-connection-editor + +## Modify // Bluetooth Settings // <> b ## +bindsym $mod+b exec blueman-manager + +## Launch // File Browser // <> n ## +bindsym $mod+Shift+n exec $filemanager + +############################################################################### +# Window and Workspace Navigation +############################################################################### + +## Navigate // Relative Parent // <> a ## +bindsym $mod+a focus parent + +## Navigate // Relative Child // <> z ## +bindsym $mod+z focus child + +## Navigate // Relative Window // <> ↑ ↓ ← → ## +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +## Navigate // Relative Window // <> k j h l ## +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +## Navigate // Workspaces 1-10 // <> 0..9 ## +bindsym $mod+$ws1_key workspace number $ws1 +bindsym $mod+$ws2_key workspace number $ws2 +bindsym $mod+$ws3_key workspace number $ws3 +bindsym $mod+$ws4_key workspace number $ws4 +bindsym $mod+$ws5_key workspace number $ws5 +bindsym $mod+$ws6_key workspace number $ws6 +bindsym $mod+$ws7_key workspace number $ws7 +bindsym $mod+$ws8_key workspace number $ws8 +bindsym $mod+$ws9_key workspace number $ws9 +bindsym $mod+$ws10_key workspace number $ws10 + +## Navigate // Workspace 11 - 19 // <> 1..9 ## +bindsym $mod+$ws_high_key+$ws1_key workspace number $ws11 +bindsym $mod+$ws_high_key+$ws2_key workspace number $ws12 +bindsym $mod+$ws_high_key+$ws3_key workspace number $ws13 +bindsym $mod+$ws_high_key+$ws4_key workspace number $ws14 +bindsym $mod+$ws_high_key+$ws5_key workspace number $ws15 +bindsym $mod+$ws_high_key+$ws6_key workspace number $ws16 +bindsym $mod+$ws_high_key+$ws7_key workspace number $ws17 +bindsym $mod+$ws_high_key+$ws8_key workspace number $ws18 +bindsym $mod+$ws_high_key+$ws9_key workspace number $ws19 + +## Navigate // Next Workspace // <> Tab ## +bindsym $mod+Tab workspace next + +## Navigate // Next Workspace // <> → ## +bindsym $mod+$alt+Right workspace next + +## Navigate // Next Workspace on Output // <> Tab ## +bindsym $mod+Ctrl+Tab workspace next_on_output + +## Navigate // Next Workspace on Output // <> l ## +bindsym $mod+Ctrl+l workspace next_on_output + +## Navigate // Previous Workspace // <> Tab ## +bindsym $mod+Shift+Tab workspace prev + +## Navigate // Previous Workspace // <> ← ## +bindsym $mod+$alt+Left workspace prev + +## Navigate // Previous Workspace on Output // <> Tab ## +bindsym $mod+Ctrl+Shift+Tab workspace prev_on_output + +## Navigate // Previous Workspace on Output // <> h ## +bindsym $mod+Ctrl+h workspace prev_on_output + +## Navigate // Scratchpad // <> a ## +bindsym $mod+Ctrl+a scratchpad show + +############################################################################### +# Window and Workspace Configuration +############################################################################### + +## Modify // Window Position // <> ↑ ↓ ← → ## +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +## Modify // Window Position // <> k j h l ## +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +## Modify // Containing Workspace // <> ↑ ↓ ← → ## +bindsym $mod+Ctrl+Shift+Left move workspace to output left +bindsym $mod+Ctrl+Shift+Right move workspace to output right +bindsym $mod+Ctrl+Shift+Up move workspace to output up +bindsym $mod+Ctrl+Shift+Down move workspace to output down + +## Modify // Containing Workspace // <> k j h l ## +bindsym $mod+Ctrl+Shift+h move workspace to output left +bindsym $mod+Ctrl+Shift+j move workspace to output down +bindsym $mod+Ctrl+Shift+k move workspace to output up +bindsym $mod+Ctrl+Shift+l move workspace to output right + +## Modify // Vertical Window Orientation // <> v ## +bindsym $mod+v splitv + +## Modify // Horizontal Window Orientation // <> g ## +bindsym $mod+g splith + +## Modify // Toggle Window Orientation // <> BackSpace ## +bindsym $mod+BackSpace split toggle + +## Modify // Window Fullscreen Toggle // <> f ## +bindsym $mod+f fullscreen toggle + +## Modify // Window Floating Toggle // <> f ## +bindsym $mod+Shift+f floating toggle + +## Modify // Move to Scratchpad // <> m ## +bindsym $mod+Ctrl+m move to scratchpad + +## Modify // Tile/Float Focus Toggle // <> t ## +bindsym $mod+Shift+t focus mode_toggle + +## Modify // Window Layout Mode // <> t ## +bindsym $mod+t layout toggle tabbed splith splitv + +# Move focused container to workspace +## Modify // Move Window to Workspace 1 - 10 // <> 0..9 ## +bindsym $mod+Shift+$ws1_key move container to workspace number $ws1 +bindsym $mod+Shift+$ws2_key move container to workspace number $ws2 +bindsym $mod+Shift+$ws3_key move container to workspace number $ws3 +bindsym $mod+Shift+$ws4_key move container to workspace number $ws4 +bindsym $mod+Shift+$ws5_key move container to workspace number $ws5 +bindsym $mod+Shift+$ws6_key move container to workspace number $ws6 +bindsym $mod+Shift+$ws7_key move container to workspace number $ws7 +bindsym $mod+Shift+$ws8_key move container to workspace number $ws8 +bindsym $mod+Shift+$ws9_key move container to workspace number $ws9 +bindsym $mod+Shift+$ws10_key move container to workspace number $ws10 + +## Modify // Move Window to Workspace 11 - 19// <> 1..9 ## +bindsym $mod+Shift+$ws_high_key+$ws1_key move container to workspace number $ws11 +bindsym $mod+Shift+$ws_high_key+$ws2_key move container to workspace number $ws12 +bindsym $mod+Shift+$ws_high_key+$ws3_key move container to workspace number $ws13 +bindsym $mod+Shift+$ws_high_key+$ws4_key move container to workspace number $ws14 +bindsym $mod+Shift+$ws_high_key+$ws5_key move container to workspace number $ws15 +bindsym $mod+Shift+$ws_high_key+$ws6_key move container to workspace number $ws16 +bindsym $mod+Shift+$ws_high_key+$ws7_key move container to workspace number $ws17 +bindsym $mod+Shift+$ws_high_key+$ws8_key move container to workspace number $ws18 +bindsym $mod+Shift+$ws_high_key+$ws9_key move container to workspace number $ws19 + +# Move focused container to workspace and follow +## Modify // Carry Window to Workspace 1 - 10// <> 0..9 ## +bindsym $mod+$alt+$ws1_key move container to workspace number $ws1; workspace number $ws1 +bindsym $mod+$alt+$ws2_key move container to workspace number $ws2; workspace number $ws2 +bindsym $mod+$alt+$ws3_key move container to workspace number $ws3; workspace number $ws3 +bindsym $mod+$alt+$ws4_key move container to workspace number $ws4; workspace number $ws4 +bindsym $mod+$alt+$ws5_key move container to workspace number $ws5; workspace number $ws5 +bindsym $mod+$alt+$ws6_key move container to workspace number $ws6; workspace number $ws6 +bindsym $mod+$alt+$ws7_key move container to workspace number $ws7; workspace number $ws7 +bindsym $mod+$alt+$ws8_key move container to workspace number $ws8; workspace number $ws8 +bindsym $mod+$alt+$ws9_key move container to workspace number $ws9; workspace number $ws9 +bindsym $mod+$alt+$ws10_key move container to workspace number $ws10; workspace number $ws10 + +## Modify // Carry Window to Workspace 11 - 19 // <> 1..9 ## +bindsym $mod+$alt+$ws_high_key+$ws1_key move container to workspace number $ws11; workspace number $ws11 +bindsym $mod+$alt+$ws_high_key+$ws2_key move container to workspace number $ws12; workspace number $ws12 +bindsym $mod+$alt+$ws_high_key+$ws3_key move container to workspace number $ws13; workspace number $ws13 +bindsym $mod+$alt+$ws_high_key+$ws4_key move container to workspace number $ws14; workspace number $ws14 +bindsym $mod+$alt+$ws_high_key+$ws5_key move container to workspace number $ws15; workspace number $ws15 +bindsym $mod+$alt+$ws_high_key+$ws6_key move container to workspace number $ws16; workspace number $ws16 +bindsym $mod+$alt+$ws_high_key+$ws7_key move container to workspace number $ws17; workspace number $ws17 +bindsym $mod+$alt+$ws_high_key+$ws8_key move container to workspace number $ws18; workspace number $ws18 +bindsym $mod+$alt+$ws_high_key+$ws9_key move container to workspace number $ws19; workspace number $ws19 + +# Layout bindings (matching i3 defaults) +bindsym $mod+s layout stacking +bindsym $mod+e layout toggle split + +# 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. +bindsym $mod+minus scratchpad show + +############################################################################### +# Resize Mode +############################################################################### + +## Resize // Enter Resize Mode // <> r ## +mode "Resize Mode" { + # These bindings trigger as soon as you enter the resize mode + + ## Resize // Resize Window // ↑ ↓ ← → ## + bindsym Left resize shrink width 6 px or 6 ppt + bindsym Down resize grow height 6 px or 6 ppt + bindsym Up resize shrink height 6 px or 6 ppt + bindsym Right resize grow width 6 px or 6 ppt + + bindsym Shift+Left resize shrink width 24 px or 24 ppt + bindsym Shift+Down resize grow height 24 px or 24 ppt + bindsym Shift+Up resize shrink height 24 px or 24 ppt + bindsym Shift+Right resize grow width 24 px or 24 ppt + + ## Resize // Resize Window // k j h l ## + bindsym $left resize shrink width 6 px or 6 ppt + bindsym $down resize grow height 6 px or 6 ppt + bindsym $up resize shrink height 6 px or 6 ppt + bindsym $right resize grow width 6 px or 6 ppt + + bindsym Shift+$left resize shrink width 24 px or 24 ppt + bindsym Shift+$down resize grow height 24 px or 24 ppt + bindsym Shift+$up resize shrink height 24 px or 24 ppt + bindsym Shift+$right resize grow width 24 px or 24 ppt + + ## Resize // Exit Resize Mode // Escape or Enter ## + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} +bindsym $mod+r mode "Resize Mode" + +############################################################################### +# Media keys and utilities +############################################################################### + +# Volume control (works with both PulseAudio and PipeWire) +bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/volume-notify-sway.sh +bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && ~/.config/sway/volume-notify-sway.sh +bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && ~/.config/sway/volume-notify-sway.sh +bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + +# Brightness control +bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ + +# Screenshots +bindsym Print exec grim +bindsym $mod+Print exec grim -g "$(slurp)" + +## Modify // Toggle Bar // <> i ## +bindsym $mod+i bar mode toggle + +############################################################################### +# Bar Configuration +############################################################################### + +bar { + position bottom + mode dock + font pango:monospace 10 + separator_symbol " " + strip_workspace_numbers yes + workspace_min_width 36 + + # Try to use i3status-rust for better functionality, fallback to basic status + status_command i3status-rs ~/.config/sway/i3status-rust.toml || while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done + + colors { + background #000000 + statusline #ffffff + separator #666666 + + # border backgr. text + focused_workspace #4c7899 #285577 #ffffff + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + } +} + +############################################################################### +# Autostart Applications +############################################################################### + +# Start background applications +exec --no-startup-id systemctl --user import-environment XDG_CURRENT_DESKTOP DISPLAY WAYLAND_DISPLAY +exec --no-startup-id hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP DISPLAY WAYLAND_DISPLAY + +# Start essential services (Arch Linux) +exec mako # Notification daemon +exec lxqt-policykit-agent # Authentication agent (comment out if not needed) + +exec --no-startup-id blueman-applet +exec --no-startup-id nm-applet + +# Include additional config files if they exist +include /etc/sway/config.d/* diff --git a/fix-mt7921-wifi.sh b/fix-mt7921-wifi.sh new file mode 100755 index 0000000..ef405b6 --- /dev/null +++ b/fix-mt7921-wifi.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Fix MT7921 WiFi slow connection and stability issues +# Run as root or with sudo + +echo "Fixing MT7921 WiFi issues..." + +# 1. Set power management to off (already done, but ensure it's persistent) +echo "Setting WiFi power management to off..." +for iface in $(iw dev | awk '/Interface/ {print $2}'); do + iw dev "$iface" set power_save off +done + +# 2. Create NetworkManager config to disable power saving +echo "Creating NetworkManager config..." +cat < /dev/null; then + sudo iwreg set 00 +else + echo "iwreg not found, skipping regulatory domain setting" +fi + +# 6. Reload services +echo "Reloading services..." +sudo systemctl reload NetworkManager +sudo udevadm control --reload-rules +sudo udevadm trigger + +echo "" +echo "MT7921 WiFi fixes applied!" +echo "" +echo "To apply kernel parameter changes, you need to:" +echo "1. Reboot the system (systemd-boot automatically uses the updated config)" +echo "" +echo "If issues persist, try these additional steps:" +echo "- Check if your router supports WPA3, try WPA2 instead" +echo "- Try connecting to 2.4GHz instead of 5GHz" +echo "- Update your kernel to the latest version" \ No newline at end of file diff --git a/i3status-rust.toml b/i3status-rust.toml new file mode 100644 index 0000000..8491db8 --- /dev/null +++ b/i3status-rust.toml @@ -0,0 +1,75 @@ +# Advanced i3status-rust configuration +# Based on the i3xrocks blocks from your i3 setup + +[[block]] +block = "net" +format = " $icon {$signal_strength $ssid $frequency|Wired connection} via $device " +interval = 1 + +[[block]] +block = "cpu" +interval = 5 +format = " $icon $utilization " +format_alt = " $icon $frequency{ $boost} " + +[[block]] +block = "memory" +format = " $icon $mem_used_percents.eng(w:2) " +interval = 10 + +[[block]] +block = "battery" +device = "BAT0" +format = " $icon $percentage $time " +interval = 10 +missing_format = "" + +[[block]] +block = "sound" +format = " $icon $volume " +click = [ + {button = "left", cmd = "pavucontrol"}, + {button = "right", cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"}, +] + +[[block]] +block = "bluetooth" +mac = "" +format = " $icon $label " +disconnected_format = "" + +# Custom weather block using your wttr.in script +# [[block]] +# block = "custom" +# command = "~/.config/sway/weather-sway.sh" +# format = " 🌤 $text " +# interval = 1800 +# click = [ +# {button = "left", update = true}, +# {button = "right", update = true}, +# ] + +# Alternative: Weather with custom location +# Uncomment and modify this block if you want weather for a different city +[[block]] +block = "custom" +command = "weather_location='Tallinn' ~/.config/sway/weather-sway.sh" +format = "$text" +interval = 1800 + +# Alternative: Weather with different format +# Format options: https://github.com/chubin/wttr.in +# 1 = current conditions, 2 = current + today, 3 = current + today + tomorrow, 4 = current + 3 days +# [[block]] +# block = "custom" +# command = "weather_format='2' ~/.config/sway/weather-sway.sh" +# format = " 📅 $text " +# interval = 1800 + +[[block]] +block = "time" +format = " $icon $timestamp.datetime(f:'%Y-%m-%d %H:%M:%S') " +interval = 1 + +[icons] +icons = "awesome4" diff --git a/install-arch-sway-requirements.sh b/install-arch-sway-requirements.sh new file mode 100644 index 0000000..3a03382 --- /dev/null +++ b/install-arch-sway-requirements.sh @@ -0,0 +1,187 @@ +#!/bin/bash +# Install Arch Linux packages and setup for Sway + +set -e + +echo "Installing Sway requirements and packages for Arch Linux..." +echo "===========================================================" +echo "" +echo "This script will install packages and configure services for Sway." +echo "You can comment out sections you don't want to install." +echo "" + +# === CORE SWAY PACKAGES === +# Comment out this section if you already have Sway installed +# echo "=== Installing Core Sway Packages ===" +# echo "Installing: sway swaylock swayidle fuzzel foot i3status-rust" +# sudo pacman -S --needed sway swaylock swayidle fuzzel foot i3status-rust +# echo "✓ Core Sway packages installed" +# echo "" + +# === ESSENTIAL SYSTEM PACKAGES === +# Comment out this section if you don't want these system packages +echo "=== Installing Essential System Packages ===" +echo "Installing: file manager, screenshots, brightness, display config" +sudo pacman -S --needed thunar grim slurp brightnessctl wdisplays +echo "✓ Essential system packages installed" +echo "" + +# === NOTIFICATION SYSTEM === +# Comment out this section if you don't want notifications +echo "=== Installing Notification System ===" +echo "Installing: mako (notification daemon)" +sudo pacman -S --needed mako +echo "✓ Notification system installed" +echo "" + +# === AUDIO SYSTEM === +# Comment out this section if you already have audio configured +# echo "=== Installing Audio System (PipeWire) ===" +# echo "Installing: pipewire, pipewire-pulse, pipewire-alsa, wireplumber" +# sudo pacman -S --needed pipewire pipewire-pulse pipewire-alsa wireplumber +# echo "✓ Audio system installed" +# echo "" + +# === NETWORK AND BLUETOOTH === +# Comment out this section if you don't want NetworkManager/Bluetooth +# echo "=== Installing Network and Bluetooth ===" +# echo "Installing: networkmanager, blueman, network-manager-applet" +# sudo pacman -S --needed networkmanager blueman network-manager-applet +# echo "✓ Network and Bluetooth packages installed" +# echo "" + +# === WAYLAND INTEGRATION === +# Comment out this section if you don't need screen sharing/file pickers +echo "=== Installing Wayland Integration ===" +echo "Installing: xdg-desktop-portal-wlr (screen sharing, file pickers)" +sudo pacman -S --needed xdg-desktop-portal-wlr +echo "✓ Wayland integration installed" +echo "" + +# === FONTS === +# Comment out this section if you don't want additional fonts +echo "=== Installing Fonts ===" +echo "Installing: ttf-font-awesome, ttf-dejavu, noto-fonts, noto-fonts-emoji" +sudo pacman -S --needed ttf-font-awesome ttf-dejavu noto-fonts noto-fonts-emoji +echo "✓ Fonts installed" +echo "" + +# === VISUAL ENHANCEMENTS === +# Comment out this section if you don't want icon themes +echo "=== Installing Visual Enhancements ===" +echo "Installing: papirus-icon-theme" +sudo pacman -S --needed papirus-icon-theme +echo "✓ Visual enhancements installed" +echo "" + +# === UTILITIES === +# Comment out this section if you don't want these utilities +echo "=== Installing Utilities ===" +echo "Installing: curl, libnotify, jq, pavucontrol, thunar-volman, gvfs" +sudo pacman -S --needed curl libnotify jq pavucontrol thunar-volman gvfs +echo "✓ Utilities installed" +echo "" + +# === AUTHENTICATION AGENT (OPTIONAL) === +# Comment out this section if you don't want GUI password prompts +echo "=== Installing Authentication Agent (Optional) ===" +echo "Choose one or comment out entirely:" +echo "" +echo "1. lxqt-policykit (recommended: lightweight Qt-based)" +echo "2. polkit-dumb-agent (minimal: command-line only)" +echo "3. Skip (no GUI password prompts)" +echo "" +read -p "Enter choice (1/2/3): " auth_choice + +case $auth_choice in + 1) + echo "Installing lxqt-policykit..." + sudo pacman -S --needed lxqt-policykit + echo "✓ lxqt-policykit installed" + echo "Note: Auto-started in Sway config" + ;; + 2) + echo "Installing polkit-dumb-agent..." + sudo pacman -S --needed polkit-dumb-agent + echo "✓ polkit-dumb-agent installed" + echo "Note: You'll need to update Sway config to use this instead" + ;; + 3) + echo "Skipping authentication agent" + echo "Note: Comment out 'exec lxqt-policykit-agent' in Sway config" + ;; + *) + echo "Invalid choice, skipping authentication agent" + ;; +esac +echo "" + +# === ENABLE SERVICES === +# Comment out this section if you don't want to enable services +echo "=== Enabling Services ===" + +# NetworkManager +echo "Enabling NetworkManager..." +if ! systemctl is-enabled NetworkManager >/dev/null 2>&1; then + sudo systemctl enable NetworkManager + echo "✓ NetworkManager enabled" +else + echo "✓ NetworkManager already enabled" +fi + +if ! systemctl is-active NetworkManager >/dev/null 2>&1; then + sudo systemctl start NetworkManager + echo "✓ NetworkManager started" +else + echo "✓ NetworkManager already running" +fi + +# PipeWire (user services) +# echo "Enabling PipeWire services..." +# systemctl --user enable pipewire pipewire-pulse wireplumber 2>/dev/null || true +# systemctl --user start pipewire pipewire-pulse wireplumber 2>/dev/null || true +# echo "✓ PipeWire services enabled and started" +# echo "" + +# === CONFIGURATION NOTES === +echo "==========================================" +echo "✅ Package installation complete!" +echo "==========================================" +echo "" +echo "🔧 Additional setup recommendations:" +echo "" +echo "1. Add to your shell rc file (~/.bashrc or ~/.zshrc):" +echo " export XDG_CURRENT_DESKTOP=sway" +echo " export XDG_SESSION_DESKTOP=sway" +echo "" +echo "2. Weather configuration:" +echo " - Default location: Pärnu (wttr.in, no API key needed)" +echo " - Shows weather + sunrise/sunset times" +echo " - Left click: detailed weather notification" +echo " - Right click: open wttr.in website" +echo " - Change location: edit ~/.config/sway/weather-sway.sh" +echo "" +echo "3. Key applications configured:" +echo " - Terminal: foot" +echo " - File manager: thunar" +echo " - Launcher: fuzzel" +echo " - Display settings: wdisplays" +echo " - Network: nm-connection-editor" +echo " - Bluetooth: blueman-manager" +echo "" +echo "4. Alternative applications you might prefer:" +echo " - Terminal: alacritty, kitty, wezterm" +echo " - File manager: nautilus, dolphin, nemo, pcmanfm" +echo " - Launcher: wofi, rofi-wayland, bemenu" +echo "" +echo "5. To customize apps, edit variables in ~/.config/sway/config:" +echo " - set \$term foot" +echo " - set \$filemanager thunar" +echo " - set \$menu fuzzel" +echo "" +echo "6. For HiDPI displays, add to Sway config:" +echo " output * scale 1.5" +echo "" +echo "🚀 Ready to use Sway!" +echo " - Log out and select Sway from display manager" +echo " - Or start from TTY with: sway" diff --git a/install-arch-sway.sh b/install-arch-sway.sh new file mode 100755 index 0000000..6df490d --- /dev/null +++ b/install-arch-sway.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Install Sway configuration files only - Arch Linux version + +set -e + +echo "Installing Sway configuration files for Arch Linux..." +echo "=======================================================" + +# Create sway config directory +mkdir -p ~/.config/sway +echo "✓ Created ~/.config/sway directory" + +# Backup existing sway config if it exists +if [ -f ~/.config/sway/config ]; then + echo "⚠ Backing up existing sway config to ~/.config/sway/config.backup" + cp ~/.config/sway/config ~/.config/sway/config.backup +fi + +# === SWAY CONFIG === +# Comment out this section if you don't want to install the main config +echo "" +echo "Installing main Sway config..." +cp config ~/.config/sway/config +echo "✓ Sway config installed to ~/.config/sway/config" + +# === I3STATUS-RUST CONFIG === +# Comment out this section if you don't want i3status-rust +echo "" +echo "Installing i3status-rust config..." +cp i3status-rust.toml ~/.config/sway/i3status-rust.toml +echo "✓ i3status-rust config installed to ~/.config/sway/i3status-rust.toml" + +# === WEATHER SCRIPT === +# Comment out this section if you don't want the weather script +echo "" +echo "Installing weather script..." +cp weather-sway.sh ~/.config/sway/weather-sway.sh +chmod +x ~/.config/sway/weather-sway.sh +echo "✓ Weather script installed to ~/.config/sway/weather-sway.sh" + +# === VOLUME NOTIFY SCRIPT === +# Comment out this section if you don't want volume notifications +if [ -f volume-notify-sway.sh ]; then + echo "" + echo "Installing volume notify script..." + cp volume-notify-sway.sh ~/.config/sway/volume-notify-sway.sh + chmod +x ~/.config/sway/volume-notify-sway.sh + echo "✓ Volume notify script installed to ~/.config/sway/volume-notify-sway.sh" +else + echo "" + echo "⚠ volume-notify-sway.sh not found, skipping..." +fi + +echo "" +echo "==========================================" +echo "✅ Sway configuration installation complete!" +echo "==========================================" +echo "" +echo "Next steps:" +echo "1. Run ./install-arch-sway-requirements.sh to install packages" +echo "2. Log out and select Sway from your display manager" +echo "3. Or start Sway from TTY with: sway" +echo "" +echo "Config files installed:" +echo "- ~/.config/sway/config (main Sway config)" +echo "- ~/.config/sway/i3status-rust.toml (status bar config)" +echo "- ~/.config/sway/weather-sway.sh (weather script)" +if [ -f ~/.config/sway/volume-notify-sway.sh ]; then + echo "- ~/.config/sway/volume-notify-sway.sh (volume notifications)" +fi \ No newline at end of file diff --git a/volume-notify-sway.sh b/volume-notify-sway.sh new file mode 100755 index 0000000..01b4312 --- /dev/null +++ b/volume-notify-sway.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Kill any existing volume notification +pkill -f "notify-send.*Volume" + +# Get current volume and mute status +volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | awk '{print $5}') +muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') + +if [ "$muted" = "yes" ]; then + notify-send -t 1000 "Volume" "Muted" +else + notify-send -t 1000 "Volume" "$volume" +fi \ No newline at end of file diff --git a/weather-sway.sh b/weather-sway.sh new file mode 100755 index 0000000..40a0ba9 --- /dev/null +++ b/weather-sway.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -Eeu -o pipefail + +# Simplified weather script for i3status-rust +# Based on the original weather script but adapted for Sway/i3status-rust + +# Information on the various formats: https://github.com/chubin/wttr.in +VALUE_WEATHER_FORMAT=${weather_format:-"1"} +VALUE_WEATHER_FORMAT="?format=${VALUE_WEATHER_FORMAT}" + +# Determine units to use for temperature +# We don't supply a default here because wttr.in is "smart" enough to choose for us +WEATHER_UNIT=${weather_unit:-""} +if [ -n "${WEATHER_UNIT}" ]; then + WEATHER_UNIT="&${WEATHER_UNIT}" +fi + +# Location (defaults to Pärnu as in your original script) +VALUE_WEATHER_LOCATION=${weather_location:-"Pärnu"} +VALUE_WEATHER_ERROR_MESSAGE=${error_message:-"⛔"} +VALUE_FETCH_WEATHER_URL="https://wttr.in/${VALUE_WEATHER_LOCATION}${VALUE_WEATHER_FORMAT}${WEATHER_UNIT}" + +# Get weather data +WEATHER=$(curl -sS "$VALUE_FETCH_WEATHER_URL" 2>/dev/null || echo "${VALUE_WEATHER_ERROR_MESSAGE}") + +# Get sunrise/sunset data +VALUE_SUNSET_SUNRISE_FORMAT="?format=%S-%s%20%m+" +SUNRISE_SUNSET=$(curl -sS "https://wttr.in/${VALUE_WEATHER_LOCATION}${VALUE_SUNSET_SUNRISE_FORMAT}${WEATHER_UNIT}" 2>/dev/null || echo "") + +if [ -n "$SUNRISE_SUNSET" ]; then + SUNRISE_VALUE=$(echo ${SUNRISE_SUNSET} | cut -c 1-5) + SUNSET_VALUE=$(echo ${SUNRISE_SUNSET} | cut -c 10-14) + SUNRISE_SUNSET_TEXT=" (${SUNRISE_VALUE}-${SUNSET_VALUE})" +else + SUNRISE_SUNSET_TEXT="" +fi + +# Check for errors +if echo "${WEATHER}" | grep -q -P "Unknown\slocation"; then + WEATHER=${VALUE_WEATHER_ERROR_MESSAGE} +fi + +# Output for i3status-rust (plain text) +echo "${WEATHER}${SUNRISE_SUNSET_TEXT}" + +# Handle click events (for i3status-rust custom block) +if [ "${BLOCK_BUTTON:-}" = "1" ]; then + # Left click - show detailed weather + FULL_WEATHER=$(curl -sS "https://wttr.in/${VALUE_WEATHER_LOCATION}?format=%l:+%c+%f+%h+%p+%P+%m+%w+%S+%s" 2>/dev/null || echo "${VALUE_WEATHER_ERROR_MESSAGE}") + notify-send "Weather Details" "$FULL_WEATHER" -t 10000 +elif [ "${BLOCK_BUTTON:-}" = "3" ]; then + # Right click - open weather website + xdg-open "https://wttr.in/${VALUE_WEATHER_LOCATION}" >/dev/null 2>&1 & +fi \ No newline at end of file diff --git a/wifi-powersave-off.sh b/wifi-powersave-off.sh new file mode 100755 index 0000000..4bc3853 --- /dev/null +++ b/wifi-powersave-off.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Disable WiFi power saving for all wireless interfaces +# Run as root or with sudo + +for iface in $(iw dev | awk '/Interface/ {print $2}'); do + echo "Disabling power saving for $iface..." + iw dev "$iface" set power_save off +done + +echo "WiFi power saving disabled for all interfaces." + +echo "To make this persistent across reboots, create a NetworkManager config: /etc/NetworkManager/conf.d/wifi-powersave.conf" +cat <