diff --git a/.config/environment.d/.profile b/.config/environment.d/.profile deleted file mode 100644 index e48cecd..0000000 --- a/.config/environment.d/.profile +++ /dev/null @@ -1,6 +0,0 @@ -export MOZ_ENABLE_WAYLAND=1 -export XDG_CURRENT_DESKTOP=sway -export XDG_SESSION_TYPE=wayland -export WLR_NO_HARDWARE_CURSORS=1 -#export WLR_NO_HARDWARE_CURSORS=0 -export WLR_RENDERER_ALLOW_SOFTWARE=1 diff --git a/.config/fuzzel/fuzzel.ini b/.config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..430448e --- /dev/null +++ b/.config/fuzzel/fuzzel.ini @@ -0,0 +1,95 @@ +# output= +font=JetBrainsMono:size=14 +dpi-aware=no +prompt="❯ " +# icon-theme=hicolor +# icons-enabled=yes +# fields=filename,name,generic +# password-character=* +# filter-desktop=no +# fuzzy=yes +# show-actions=no +terminal=footclient -e +# launch-prefix= +# list-executables-in-path=no + +# anchor=center +lines=16 +width=50 +tabs=4 +horizontal-pad=50 +vertical-pad=18 +inner-pad=10 + +image-size-ratio=.25 + +# line-height= +# letter-spacing=0 + +# layer = top +exit-on-keyboard-focus-loss = no + +[colors] +background=08052bdd +text=e3e3eaff +match=FFE57Fff +selection-match=FFE57Fff +selection=44475add +selection-text=FFFFFFff +border=6272A4ff + +[border] +# width=1 +# radius=10 + +[dmenu] +# mode=text # text|index +# exit-immediately-if-empty=no + +[key-bindings] +# cancel=Escape Control+g +# execute=Return KP_Enter Control+y +# execute-or-next=Tab +# execute-input=Shift+Return Shift+KP_Enter +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-line-backward=Control+u +# delete-next=Delete KP_Delete Control+d +# delete-next-word=Mod1+d Control+Delete Control+KP_Delete +# delete-line-forward=Control+k +# prev=Up Control+p +# prev-with-wrap=ISO_Left_Tab +# prev-page=Page_Up KP_Page_Up +# next=Down Control+n +# next-with-wrap=none +# next-page=Page_Down KP_Page_Down + +# custom-N: *dmenu mode only*. Like execute, but with a non-zero +# exit-code; custom-1 exits with code 10, custom-2 with 11, custom-3 +# with 12, and so on. + +# custom-1=Mod1+1 +# custom-2=Mod1+2 +# custom-3=Mod1+3 +# custom-4=Mod1+4 +# custom-5=Mod1+5 +# custom-6=Mod1+6 +# custom-7=Mod1+7 +# custom-8=Mod1+8 +# custom-9=Mod1+9 +# custom-10=Mod1+0 +# custom-11=Mod1+exclam +# custom-12=Mod1+at +# custom-13=Mod1+numbersign +# custom-14=Mod1+dollar +# custom-15=Mod1+percent +# custom-16=Mod1+dead_circumflex +# custom-17=Mod1+ampersand +# custom-18=Mod1+asterix +# custom-19=Mod1+parentleft diff --git a/.config/sway/cheatsheet b/.config/sway/cheatsheet index 629d698..6693a70 100644 --- a/.config/sway/cheatsheet +++ b/.config/sway/cheatsheet @@ -29,7 +29,7 @@ MOD+Return # kill focused window MOD+q -# Application menu - wofi: +# Application menu - Fuzzel: MOD+d # Activities: diff --git a/.config/sway/config b/.config/sway/config index 0a93add..fe16e15 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,6 +1,3 @@ -# Initial Setup -exec ~/set_once.sh - # Config for sway # # Read `man 5 sway` for a complete reference. @@ -8,6 +5,3 @@ exec ~/set_once.sh # # user config directory include $HOME/.config/sway/config.d/* - -# only enable this if every app you use is compatible with wayland -# xwayland disable diff --git a/.config/sway/config.d/50-systemd-user.conf b/.config/sway/config.d/50-systemd-user.conf deleted file mode 100644 index 8781db9..0000000 --- a/.config/sway/config.d/50-systemd-user.conf +++ /dev/null @@ -1,16 +0,0 @@ -# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment -# See FS#63021 -# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal. - -# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to. -exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway -exec systemctl --user import-environment DISPLAY \ - SWAYSOCK \ - WAYLAND_DISPLAY \ - XDG_CURRENT_DESKTOP - -exec hash dbus-update-activation-environment 2>/dev/null && \ - dbus-update-activation-environment --systemd DISPLAY \ - SWAYSOCK \ - XDG_CURRENT_DESKTOP=sway \ - WAYLAND_DISPLAY diff --git a/.config/sway/config.d/autostart_applications b/.config/sway/config.d/autostart_applications index a643b4f..6de6fda 100644 --- a/.config/sway/config.d/autostart_applications +++ b/.config/sway/config.d/autostart_applications @@ -1,12 +1,25 @@ +# Apply xed settings with self-destructing script +exec ~/.config/sway/scripts/xed_setup.sh + # Auth with polkit-gnome: exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +# Import environment variables for user systemd service manager +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK + +# Update dbux environments with display variables +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + # Desktop notifications exec mako # Network Applet exec nm-applet --indicator +# Start foot server +exec_always --no-startup-id foot --server + # Autotiling exec_always ~/.config/sway/scripts/autotiling diff --git a/.config/sway/config.d/default b/.config/sway/config.d/default index 84a6444..f87c19e 100644 --- a/.config/sway/config.d/default +++ b/.config/sway/config.d/default @@ -1,32 +1,20 @@ # Logo key. Use Mod1 for Alt. set $mod Mod4 -# Home row direction keys, like vim +# Add Vim key support set $left h set $down j set $up k set $right l -# audio control -set $sink_volume pactl get-sink-volume @DEFAULT_SINK@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//' -set $source_volume pactl get-source-volume @DEFAULT_SOURCE@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//' -set $volume_down $(pactl set-sink-volume @DEFAULT_SINK@ -5% && $sink_volume) -set $volume_up $(pactl set-sink-volume @DEFAULT_SINK@ +5% && $sink_volume) -set $volume_mute $(pactl set-sink-mute @DEFAULT_SINK@ toggle && pactl get-sink-mute @DEFAULT_SINK@ | sed -En "/no/ s/.*/$($sink_volume)/p; /yes/ s/.*/0/p") -set $mic_mute $(pactl set-source-mute @DEFAULT_SOURCE@ toggle && pactl get-source-mute @DEFAULT_SOURCE@ | sed -En "/no/ s/.*/$($source_volume)/p; /yes/ s/.*/0/p") - -# Start foot server -exec_always --no-startup-id foot --server - # Set default terminal emulator set $term footclient -# Your preferred application launcher -# Note: pass the final command to swaymsg so that the resulting window can be opened -# on the original workspace that the command was run on. -set $menu wofi -c ~/.config/wofi/config -I +# Application launcher +set $launcher fuzzel -set $powermenu ~/.config/waybar/scripts/power-menu.sh +# Power Menu +set $powermenu ~/.config/sway/scripts/power_menu.sh ### Idle configuration exec swayidle -w\ @@ -55,16 +43,14 @@ exec swayidle -w\ bindsym $mod+q kill # Start your launcher - bindsym $mod+d exec $menu + bindsym $mod+d exec $launcher # Activities - bindsym $mod+p exec ~/.config/wofi/windows.py + bindsym $mod+p exec ~/.config/sway/scripts/window_switcher.sh - # Drag floating windows by holding down $mod and left mouse button. + # Move windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. + # Change "normal" to "inverse" to switch left and right floating_modifier $mod normal # Reload the configuration file @@ -73,27 +59,28 @@ exec swayidle -w\ # # Moving around: # - # Move your focus around - bindsym $mod+$left focus left - bindsym $mod+$down focus down - bindsym $mod+$up focus up - bindsym $mod+$right focus right - # Or use $mod+[up|down|left|right] + # Change window focus bindsym $mod+Left focus left bindsym $mod+Down focus down bindsym $mod+Up focus up bindsym $mod+Right focus right + # Vim key support + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right - # Move the focused window with the same, but add Shift - bindsym $mod+Shift+$left move left - bindsym $mod+Shift+$down move down - bindsym $mod+Shift+$up move up - bindsym $mod+Shift+$right move right - # Ditto, with arrow keys + # Move the focused window bindsym $mod+Shift+Left move left bindsym $mod+Shift+Down move down bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right + # Vim key support + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # # Workspaces: # @@ -121,14 +108,15 @@ exec swayidle -w\ bindsym $mod+Shift+0 move container to workspace number 10 # Note: workspaces can have any name you want, not just numbers. # We just use 1-10 as the default. + # # Layout stuff: # - # You can "split" the current object of your focus with - # $mod+b or $mod+v, for horizontal and vertical splits - # respectively. - bindsym $mod+b splith + # Set how the current window will be split + # Split the window vertically bindsym $mod+v splitv + # Split the window horizontally + bindsym $mod+b splith # Switch the current container between different layout styles bindsym $mod+s layout stacking @@ -138,7 +126,7 @@ exec swayidle -w\ # Make the current focus fullscreen bindsym $mod+f fullscreen - # Toggle the current focus between tiling and floating mode + # Toggle between tiling and floating mode bindsym $mod+Shift+space floating toggle # Swap focus between the tiling area and the floating area @@ -161,30 +149,25 @@ exec swayidle -w\ # # Resizing containers: # -mode "resize" { - # left will shrink the containers width - # right will grow the containers width - # up will shrink the containers height - # down will grow the containers height - bindsym $left resize shrink width 10px - bindsym $right resize grow width 10px - bindsym $up resize shrink height 10px - bindsym $down resize grow height 10px + mode "resize" { + # Resize with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + # Resize with Vim keys + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" + } + bindsym $mod+r mode "resize" - # Ditto, with arrow keys - bindsym Left resize shrink width 10px - bindsym Right resize grow width 10px - bindsym Up resize shrink height 10px - bindsym Down resize grow height 10px - - # Return to default mode - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" - -# Resize floating windows with mouse scroll: + # Resize floating windows with mouse scroll: bindsym --whole-window --border $mod+button4 resize shrink height 5 px or 5 ppt bindsym --whole-window --border $mod+button5 resize grow height 5 px or 5 ppt bindsym --whole-window --border $mod+Shift+button4 resize shrink width 5 px or 5 ppt @@ -193,20 +176,13 @@ bindsym $mod+r mode "resize" # # Volume # - # Control volume trough pamixer - # bindsym --locked XF86AudioRaiseVolume exec pamixer -ui 2 - # bindsym --locked XF86AudioLowerVolume exec pamixer -ud 2 - # bindsym --locked XF86AudioMute exec pamixer -t - - # Control volume directly trough pactl - bindsym --locked XF86AudioRaiseVolume exec $volume_up - bindsym --locked XF86AudioLowerVolume exec $volume_down - bindsym --locked XF86AudioMute exec $volume_mute + bindsym XF86AudioRaiseVolume exec pamixer -ui 2 + bindsym XF86AudioLowerVolume exec pamixer -ud 2 + bindsym XF86AudioMute exec pamixer --toggle-mute # # Player # - bindsym XF86AudioPlay exec playerctl play - bindsym XF86AudioPause exec playerctl pause + bindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous # diff --git a/.config/sway/scripts/clamshell.sh b/.config/sway/scripts/clamshell.sh old mode 100644 new mode 100755 diff --git a/.config/sway/scripts/import-gsettings b/.config/sway/scripts/import-gsettings old mode 100644 new mode 100755 diff --git a/.config/sway/scripts/lockman.sh b/.config/sway/scripts/lockman.sh old mode 100644 new mode 100755 diff --git a/.config/sway/scripts/power_menu.sh b/.config/sway/scripts/power_menu.sh new file mode 100755 index 0000000..cad2e76 --- /dev/null +++ b/.config/sway/scripts/power_menu.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +SELECTION="$(printf "1 - Lock\n2 - Suspend\n3 - Log out\n4 - Reboot\n5 - Reboot to UEFI\n6 - Shutdown" | fuzzel --dmenu -a top-right -l 6 -w 20 -p "Select an option: ")" + +confirm_action() { + local action="$1" + CONFIRMATION="$(printf "No\nYes" | fuzzel --dmenu -a top-right -l 2 -w 20 -p "$action?")" + [ "$CONFIRMATION" = "Yes" ] +} + +case $SELECTION in + *"Lock") + swaylock;; + *"Suspend") + if confirm_action "Suspend"; then + systemctl suspend + fi;; + *"Log out") + if confirm_action "Log out"; then + swaymsg exit + fi;; + *"Reboot") + if confirm_action "Reboot"; then + systemctl reboot + fi;; + *"Reboot to UEFI") + if confirm_action "Reboot to UEFI"; then + systemctl reboot --firmware-setup + fi;; + *"Shutdown") + if confirm_action "Shutdown"; then + systemctl poweroff + fi;; +esac diff --git a/.config/sway/scripts/swayfader.py b/.config/sway/scripts/swayfader.py old mode 100644 new mode 100755 diff --git a/.config/sway/scripts/weather.sh b/.config/sway/scripts/weather.sh old mode 100644 new mode 100755 diff --git a/.config/sway/scripts/window_switcher.sh b/.config/sway/scripts/window_switcher.sh new file mode 100755 index 0000000..cc0032d --- /dev/null +++ b/.config/sway/scripts/window_switcher.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Define the lengths for each column +ws_length=2 +app_id_length=14 +name_length=50 + +# Fetch the data from swaymsg and format it +formatted_output=$(swaymsg -t get_tree | jq -r --arg ws_length "$ws_length" --arg app_id_length "$app_id_length" --arg name_length "$name_length" ' + def lpad($len; $char): + if (.|length) > $len then $char * ($len - (.|length)) +.[:$len-1] + "\u2026" else $char * ($len - (.|length)) +. end; + def rpad($len; $char): + if (.|length) > $len then.[:$len-1] + "\u2026" else. + $char * ($len - (.|length)) end; +.. + | objects + | select(.type == "workspace") as $ws + |.. + | objects + | select(has("app_id")) + | (if.focused then "*" else " " end) as $asterisk + | "\($asterisk)[\($ws.name | lpad($ws_length | tonumber; " "))]\((.app_id // "xwayland") | lpad($app_id_length | tonumber; " ")): \(.name | rpad($name_length | tonumber; " ")) (\(.id))" +') + +# Launch fuzzel with the formatted output +row=$(echo "$formatted_output" | fuzzel --dmenu --width=80 --lines=12) + +# Get the container ID from the selection and focus the container +if [ -n "$row" ]; then + winid="${row##*(}" + winid="${winid%%)*}" + swaymsg "[con_id=$winid] focus" +fi diff --git a/.config/sway/scripts/xed_setup.sh b/.config/sway/scripts/xed_setup.sh new file mode 100755 index 0000000..06fa18e --- /dev/null +++ b/.config/sway/scripts/xed_setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Apply xed settings +dbus-launch dconf load / < $HOME/.config/xed.dconf + +# Notify user settings have been applied +notify-send -i /usr/share/icons/Qogir/48/apps/accessories-text-editor.svg "Custom xed settings have been applied. " + +# Remove xed.dconf file +rm $HOME/.config/xed.dconf + +# Remove xed_setup.sh from autostart config +sed -i "/# Apply xed settings with self-destructing script/,+2d" $HOME/.config/sway/config.d/autostart_applications + +# Remove this script +rm $HOME/.config/sway/scripts/xed_setup.sh diff --git a/.config/waybar/config b/.config/waybar/config index 36df3ac..a0ce887 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -35,7 +35,7 @@ "custom/launcher": { "format":"", - "on-click": "exec wofi -c ~/.config/wofi/config -I", + "on-click": "exec fuzzel", "tooltip": false, }, @@ -183,7 +183,7 @@ "custom/power": { "format":"⏻", - "on-click": "exec ~/.config/waybar/scripts/power-menu.sh", + "on-click": "exec ~/.config/sway/scripts/power_menu.sh", "tooltip": false, }, } diff --git a/.config/waybar/scripts/keyhint.sh b/.config/waybar/scripts/keyhint.sh old mode 100644 new mode 100755 index 79b2768..d167db7 --- a/.config/waybar/scripts/keyhint.sh +++ b/.config/waybar/scripts/keyhint.sh @@ -1,2 +1,2 @@ #!/bin/sh -yad --title="EndeavourOS Sway-WM keybindings:" --no-buttons --geometry=400x345-15-400 --list --column=key: --column=description: --column=command: "ESC" "close this app" "" "=" "modkey" "(set mod Mod4)" "+enter" "Terminal" "(Foot)" "+d" "Application Menu" "(wofi)" "+p" "Activities" "(wofi)" "+o" "" "Open Broswer" "+n" "" "Open Files" "+q" "close focused app" "(kill)" "[Shift]+Print-key" "screenshot" "(grim)" "+Shift+e" "power-menu" "(wofi)" "+t" "open keybinding helper" "full list" +yad --title="EndeavourOS Sway-WM keybindings:" --no-buttons --geometry=400x345-15-400 --list --column=key: --column=description: --column=command: "ESC" "close this app" "" "=" "modkey" "(set mod Mod4)" "+enter" "Terminal" "(Foot)" "+d" "Application Menu" "(Fuzzel)" "+p" "Activities" "(Fuzzel)" "+o" "" "Open Broswer" "+n" "" "Open Files" "+q" "close focused app" "(kill)" "[Shift]+Print-key" "screenshot" "(grim)" "+Shift+e" "power-menu" "(Fuzzel)" "+t" "open keybinding helper" "full list" diff --git a/.config/waybar/scripts/power-menu.sh b/.config/waybar/scripts/power-menu.sh deleted file mode 100644 index edaa5d6..0000000 --- a/.config/waybar/scripts/power-menu.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -entries="Logout Suspend Reboot Shutdown" - -selected=$(printf '%s\n' $entries | wofi --conf=$HOME/.config/wofi/config.power --style=$HOME/.config/wofi/style.widgets.css | awk '{print tolower($1)}') - -case $selected in - logout) - swaymsg exit;; - suspend) - exec systemctl suspend;; - reboot) - exec systemctl reboot;; - shutdown) - exec systemctl poweroff -i;; -esac diff --git a/.config/waybar/scripts/weather.sh b/.config/waybar/scripts/weather.sh old mode 100644 new mode 100755 diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 6d3d568..a526505 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -68,7 +68,6 @@ #battery, #backlight, #clock, -#temperature, #custom-weather, #tray { padding:0.5rem 0.6rem; @@ -185,10 +184,6 @@ font-size: 13px; } -#temperature.critical { - color: red; -} - #custom-power { margin-left:15px; margin-right:15px; diff --git a/.config/wofi/config b/.config/wofi/config deleted file mode 100644 index 54f832c..0000000 --- a/.config/wofi/config +++ /dev/null @@ -1,18 +0,0 @@ -hide_scroll=true -show=drun -width=25% -lines=10 -line_wrap=word -term=footclient -allow_markup=true -always_parse_args=true -show_all=true -print_command=true -layer=overlay -allow_images=true -insensitive=true -prompt= -image_size=15 -display_generic=true -location=center -columns=2 diff --git a/.config/wofi/config.power b/.config/wofi/config.power deleted file mode 100644 index 0ad9ecf..0000000 --- a/.config/wofi/config.power +++ /dev/null @@ -1,9 +0,0 @@ -hide_search=true -hide_scroll=true -insensitive=true -show=dmenu -width=100 -lines=4 -location=top_right -x=-120 -y=10 diff --git a/.config/wofi/config.screenshot b/.config/wofi/config.screenshot deleted file mode 100644 index d18a3c8..0000000 --- a/.config/wofi/config.screenshot +++ /dev/null @@ -1,9 +0,0 @@ -hide_search=true -hide_scroll=true -insensitive=true -width=1 -show=dmenu -lines=5 -location=centre -x=870 -y=455 diff --git a/.config/wofi/style.css b/.config/wofi/style.css deleted file mode 100644 index fa32d93..0000000 --- a/.config/wofi/style.css +++ /dev/null @@ -1,48 +0,0 @@ -/* -Arc-Dark Color Scheme -*/ - -@define-color highlight #5294e2; -@define-color base1 #404552; -@define-color base2 #404552; -@define-color base3 #4b5160; - -*{ - font-family: UbuntuMono; -} - -window { - border: 1px solid @highlight; - background-color: @base1; -} - -#input { - margin-bottom: 15px; - padding:3px; - border-radius: 5px; - border:none; - color: black; -} - -#inner-box { - background-color: @base3; -} - -#outer-box { - margin: 5px; - padding:15px; - background-color: @base2; -} - -#text { - padding: 5px; - color: white; -} - -#entry:nth-child(even) { - background-color: @base1; -} - -#entry:selected { - background-color: @highlight; -} diff --git a/.config/wofi/style.widgets.css b/.config/wofi/style.widgets.css deleted file mode 100644 index 7718255..0000000 --- a/.config/wofi/style.widgets.css +++ /dev/null @@ -1,45 +0,0 @@ -/* -Arc-Dark Color Scheme -*/ - -@define-color highlight #5294e2; -@define-color base1 #404552; -@define-color base2 #40455; -@define-color base3 #4b5160; - -*{ - font-family: UbuntuMono; -} - -#window { - border: 1px solid @highlight; - margin: 0px 5px 0px 5px; -} - -#inner-box { - background-color: @base2; -} - -#outer-box { - margin: 5px; - padding:10px; - background-color: @base2; - margin-top: -22px; -} - -#text { - padding: 5px; - color: white; -} - -#entry:nth-child(even) { - background-color: @base1; -} - -#entry { - background-color: @base3; -} - -#entry:selected { - background-color: @highlight; -} diff --git a/.config/wofi/windows.py b/.config/wofi/windows.py deleted file mode 100644 index 6b41a60..0000000 --- a/.config/wofi/windows.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/python3 -import json -import subprocess -from argparse import ArgumentParser - -ENTER = "\n" - - -def get_windows(): - - command = "swaymsg -t get_tree" - process = subprocess.Popen( - command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - - process = subprocess.Popen( - command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - data = json.loads(process.communicate()[0]) - - # Select outputs that are active - windows = [] - for output in data["nodes"]: - - # The scratchpad (under __i3) is not supported - if output.get("name") != "__i3" and output.get("type") == "output": - workspaces = output.get("nodes", []) - for ws in workspaces: - if ws.get("type") == "workspace": - windows.extend(extract_nodes_iterative(ws)) - return windows - - -# Extracts all windows from a sway workspace json object -def extract_nodes_iterative(workspace): - all_nodes = [] - - floating_nodes = workspace.get("floating_nodes", []) - - for floating_node in floating_nodes: - all_nodes.append(floating_node) - - nodes = workspace.get("nodes", []) - - for node in nodes: - - # Leaf node - if not node.get("nodes"): - all_nodes.append(node) - # Nested node, handled iterative - else: - for inner_node in node.get("nodes"): - nodes.append(inner_node) - - return all_nodes - - -# Returns an array of all windows -def parse_windows(windows): - return [window.get("name") for window in windows] - - -# Returns a newline seperated UFT-8 encoded string of all windows for wofi -def build_wofi_string(windows): - return ENTER.join(windows).encode("UTF-8") - - -# Executes wofi with the given input string -def show_wofi(windows): - - command = 'wofi -c ~/.config/wofi/menu -s ~/.config/wofi/style.css -p "Windows: " -d -i --hide-scroll' - - process = subprocess.Popen( - command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE - ) - return process.communicate(input=windows)[0] - - -# Returns the sway window id of the window that was selected by the user inside wofi -def parse_id(windows, parsed_windows, selected): - if not selected: - return None - else: - selected = (selected.decode("UTF-8"))[:-1] # Remove new line character - window_index = int( - parsed_windows.index(selected) - ) # Get index of selected window in the parsed window array - return str( - windows[window_index].get("id") - ) # Get sway window id based on the index - - -# Switches the focus to the given id -def switch_window(id): - command = "swaymsg [con_id={}] focus".format(id) - - process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) - process.communicate()[0] - - -# Entry point -if __name__ == "__main__": - - parser = ArgumentParser(description="Wofi based window switcher") - - windows = get_windows() - - parsed_windows = parse_windows(windows) - - wofi_string = build_wofi_string(parsed_windows) - - selected = show_wofi(wofi_string) - - # Otherwise no point in running - if selected: - - selected_id = parse_id(windows, parsed_windows, selected) - - switch_window(selected_id) diff --git a/xed.dconf b/.config/xed.dconf similarity index 100% rename from xed.dconf rename to .config/xed.dconf diff --git a/.local/share/applications/avahi-discover.desktop b/.local/share/applications/avahi-discover.desktop new file mode 100644 index 0000000..8fb37ef --- /dev/null +++ b/.local/share/applications/avahi-discover.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Avahi Zeroconf Browser +Type=Application +NoDisplay=true diff --git a/.local/share/applications/bssh.desktop b/.local/share/applications/bssh.desktop new file mode 100644 index 0000000..040a71d --- /dev/null +++ b/.local/share/applications/bssh.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Avahi SSH Server Browser +Type=Application +NoDisplay=true diff --git a/.local/share/applications/bvnc.desktop b/.local/share/applications/bvnc.desktop new file mode 100644 index 0000000..41c6d20 --- /dev/null +++ b/.local/share/applications/bvnc.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Avahi VNC Server Browser +Type=Application +NoDisplay=true diff --git a/.local/share/applications/eos-log-tool.desktop b/.local/share/applications/eos-log-tool.desktop new file mode 100644 index 0000000..14c66c9 --- /dev/null +++ b/.local/share/applications/eos-log-tool.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=EndeavourOS log tool +NoDisplay=true diff --git a/.local/share/applications/eos-quickstart.desktop b/.local/share/applications/eos-quickstart.desktop new file mode 100644 index 0000000..990f140 --- /dev/null +++ b/.local/share/applications/eos-quickstart.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=EndeavourOS Quickstart Installer +Type=Application +NoDisplay=true diff --git a/.local/share/applications/eos-update.desktop b/.local/share/applications/eos-update.desktop new file mode 100644 index 0000000..109950b --- /dev/null +++ b/.local/share/applications/eos-update.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=eos-update +NoDisplay=true diff --git a/.local/share/applications/nm-connection-editor.desktop b/.local/share/applications/nm-connection-editor.desktop new file mode 100644 index 0000000..fa942c8 --- /dev/null +++ b/.local/share/applications/nm-connection-editor.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Advanced Network Configuration +Type=Application +NoDisplay=true diff --git a/.local/share/applications/org.codeberg.dnkl.foot-server.desktop b/.local/share/applications/org.codeberg.dnkl.foot-server.desktop new file mode 100644 index 0000000..8e62a81 --- /dev/null +++ b/.local/share/applications/org.codeberg.dnkl.foot-server.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Foot Server +Type=Application +NoDisplay=true diff --git a/.local/share/applications/org.codeberg.dnkl.footclient.desktop b/.local/share/applications/org.codeberg.dnkl.footclient.desktop new file mode 100644 index 0000000..bad534d --- /dev/null +++ b/.local/share/applications/org.codeberg.dnkl.footclient.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Foot Client +Type=Application +NoDisplay=true diff --git a/.local/share/applications/org.gnome.FileRoller.desktop b/.local/share/applications/org.gnome.FileRoller.desktop new file mode 100644 index 0000000..8faefdc --- /dev/null +++ b/.local/share/applications/org.gnome.FileRoller.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=File Roller +Type=Application +NoDisplay=true diff --git a/.local/share/applications/org.xfce.Catfish.desktop b/.local/share/applications/org.xfce.Catfish.desktop new file mode 100644 index 0000000..be40d7f --- /dev/null +++ b/.local/share/applications/org.xfce.Catfish.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Catfish File Search +Type=Application +NoDisplay=true diff --git a/.local/share/applications/org.xfce.mousepad-settings.desktop b/.local/share/applications/org.xfce.mousepad-settings.desktop new file mode 100644 index 0000000..6ca92e3 --- /dev/null +++ b/.local/share/applications/org.xfce.mousepad-settings.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Text Editor Settings +Type=Application +NoDisplay=true diff --git a/.local/share/applications/qv4l2.desktop b/.local/share/applications/qv4l2.desktop new file mode 100644 index 0000000..08f850b --- /dev/null +++ b/.local/share/applications/qv4l2.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Qt V4L2 test Utility +Type=Application +NoDisplay=true diff --git a/.local/share/applications/qvidcap.desktop b/.local/share/applications/qvidcap.desktop new file mode 100644 index 0000000..29503a6 --- /dev/null +++ b/.local/share/applications/qvidcap.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Qt V4L2 video capture utility +Type=Application +NoDisplay=true diff --git a/.local/share/applications/reflector-simple.desktop b/.local/share/applications/reflector-simple.desktop new file mode 100644 index 0000000..f0816ba --- /dev/null +++ b/.local/share/applications/reflector-simple.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Reflector Simple +Type=Application +NoDisplay=true diff --git a/.local/share/applications/stoken-gui-small.desktop b/.local/share/applications/stoken-gui-small.desktop new file mode 100644 index 0000000..94dc028 --- /dev/null +++ b/.local/share/applications/stoken-gui-small.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Software Token (small) +Type=Application +NoDisplay=true diff --git a/.local/share/applications/stoken-gui.desktop b/.local/share/applications/stoken-gui.desktop new file mode 100644 index 0000000..de44d9e --- /dev/null +++ b/.local/share/applications/stoken-gui.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Software Token +Type=Application +NoDisplay=true diff --git a/.local/share/applications/thunar-bulk-rename.desktop b/.local/share/applications/thunar-bulk-rename.desktop new file mode 100644 index 0000000..220d32a --- /dev/null +++ b/.local/share/applications/thunar-bulk-rename.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Bulk Rename +Type=Application +NoDisplay=true diff --git a/.local/share/applications/thunar-settings.desktop b/.local/share/applications/thunar-settings.desktop new file mode 100644 index 0000000..f92f5e8 --- /dev/null +++ b/.local/share/applications/thunar-settings.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=File Manager Settings +Type=Application +NoDisplay=true diff --git a/.local/share/applications/thunar-volman-settings.desktop b/.local/share/applications/thunar-volman-settings.desktop new file mode 100644 index 0000000..f3fe669 --- /dev/null +++ b/.local/share/applications/thunar-volman-settings.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Removable Drives and Media +Type=Application +NoDisplay=true diff --git a/.local/share/applications/xfce4-about.desktop b/.local/share/applications/xfce4-about.desktop new file mode 100644 index 0000000..ffba660 --- /dev/null +++ b/.local/share/applications/xfce4-about.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=About Xfce +Type=Application +NoDisplay=true diff --git a/.local/share/applications/yad-icon-browser.desktop b/.local/share/applications/yad-icon-browser.desktop new file mode 100644 index 0000000..939e4fc --- /dev/null +++ b/.local/share/applications/yad-icon-browser.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Icon Browser +Type=Application +NoDisplay=true diff --git a/.local/share/applications/yad-settings.desktop b/.local/share/applications/yad-settings.desktop new file mode 100644 index 0000000..e23611b --- /dev/null +++ b/.local/share/applications/yad-settings.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=YAD settings +Type=Application +NoDisplay=true diff --git a/.profile b/.profile deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 567d6d6..4093d87 100644 --- a/README.md +++ b/README.md @@ -10,34 +10,30 @@ [![Maintenance](https://img.shields.io/maintenance/yes/2024.svg)]() -## To Install Manually +## To Install Sway + +### With the EOS Installer + +1. In the live environment, choose "Fetch your install customization file" from the Welcome app. +2. Type or paste the URL for the Sway user_commands.bash file. +``` +https://raw.githubusercontent.com/EndeavourOS-Community-Editions/sway/main/setup_sway_isomode.bash +``` +![welcome_install-file](https://github.com/user-attachments/assets/0e6d57c2-1254-4179-8084-8797b9644682) + +3. Click OK , then proceed with the installation normally. Be sure to choose "no desktop" on the DE selection screen. + +![installer_no-desktop](https://github.com/user-attachments/assets/ca5582a9-094e-45d7-af1a-ebcf45e4dea5) + +### Manually (Post-Installation) git clone https://github.com/EndeavourOS-Community-Editions/sway.git cd sway - bash sway-install.sh + sudo ./sway-install.sh -## Contained In The Script - cp -R .config/* ~/.config/ - - cp .profile ~/.profile - - cp .gtkrc-2.0 ~/.gtkrc-2.0 - - chmod -R +x ~/.config/sway/scripts - - chmod -R +x ~/.config/waybar/scripts - - sudo pacman -Syu --needed --noconfirm - < packages-repository.txt - - dbus-launch dconf load / < xed.dconf - -SDDM is the default display manager - - systemctl enable sddm.service - - systemctl start sddm.service +You can examine the contents of the script here: https://github.com/EndeavourOS-Community-Editions/sway/blob/main/sway-install.sh ## Post install @@ -68,7 +64,7 @@ Main shortcuts: `~/.config/sway/cheatsheet` - MOD+Return = open floating terminal (Foot) - MOD+O = open Browser (firefox) - MOD+N = open File Manager (thunar) - - MOD+D= app menu (wofi) + - MOD+D= app menu (Fuzzel) - MOD+Q = close focused app [kill] - Shift+PrtSc = screenshot/bring up screenshot menu - MOD+SHIFT+E = power-menu diff --git a/etc/greetd/greetd.conf b/etc/greetd/greetd.conf new file mode 100644 index 0000000..f101aff --- /dev/null +++ b/etc/greetd/greetd.conf @@ -0,0 +1,6 @@ +[terminal] +vt = 1 + +[default_session] +command = "sway -c /etc/greetd/sway.cfg > /dev/null 2>&1" +user = "greeter" diff --git a/etc/greetd/regreet.toml b/etc/greetd/regreet.toml new file mode 100644 index 0000000..f172f22 --- /dev/null +++ b/etc/greetd/regreet.toml @@ -0,0 +1,51 @@ +# ReGreet configuration +# See README at https://github.com/rharish101/ReGreet#configuration + +[background] +# Path to the background image +path = "/usr/share/endeavouros/backgrounds/endeavouros-wallpaper.png" + +# How the background image covers the screen if the aspect ratio doesn't match +# Available values: "Fill", "Contain", "Cover", "ScaleDown" +# Refer to: https://docs.gtk.org/gtk4/enum.ContentFit.html +# NOTE: This is ignored if ReGreet isn't compiled with GTK v4.8 support. +fit = "Cover" + +# The entries defined in this section will be passed to the session as environment variables when it is started +[env] +XDG_SESSION_TYPE = "wayland" +XDG_CURRENT_DESKTOP = "sway" +XDG_SESSION_DESKTOP = "sway" + +# Uncomment if you experience issues with your cursor +#export WLR_NO_HARDWARE_CURSORS = "1" + +# Uncomment if you are running in a virtual machine or have an underpowered GPU +#export WLR_RENDERER_ALLOW_SOFTWARE = "1" + +[GTK] +# Whether to use the dark theme +application_prefer_dark_theme = true + +# Cursor theme name +cursor_theme_name = "Adwaita" + +# Font name and size +font_name = "Cantarell 12" + +# Icon theme name +icon_theme_name = "Adwaita" + +# GTK theme name +theme_name = "Adwaita" + +[commands] +# The command used to reboot the system +reboot = [ "systemctl", "reboot" ] + +# The command used to shut down the system +poweroff = [ "systemctl", "poweroff" ] + +[appearance] +# The message that initially displays on startup +greeting_msg = "Welcome Back!" diff --git a/etc/greetd/sway.cfg b/etc/greetd/sway.cfg new file mode 100644 index 0000000..9815c06 --- /dev/null +++ b/etc/greetd/sway.cfg @@ -0,0 +1,3 @@ +# Config for sway + +exec "regreet; swaymsg exit" diff --git a/.gtkrc-2.0 b/home_config/.gtkrc-2.0 similarity index 100% rename from .gtkrc-2.0 rename to home_config/.gtkrc-2.0 diff --git a/.nanorc b/home_config/.nanorc similarity index 100% rename from .nanorc rename to home_config/.nanorc diff --git a/packages-repository.txt b/packages-repository.txt index 717ac16..d417145 100644 --- a/packages-repository.txt +++ b/packages-repository.txt @@ -1,13 +1,14 @@ acpi arc-gtk-theme-eos awesome-terminal-fonts -bluez-utils brightnessctl dex egl-wayland -eos-sddm-theme file-roller foot +fuzzel +greetd +greetd-regreet grim gtk-engine-murrine gtk-layer-shell @@ -16,8 +17,8 @@ jq mako network-manager-applet nwg-look +pamixer polkit-gnome -sddm slurp swappy sway @@ -35,7 +36,6 @@ ttf-ubuntu-font-family waybar wayland-protocols wl-clipboard -wofi xdg-desktop-portal-wlr xed xorg-xwayland diff --git a/set_once.sh b/set_once.sh deleted file mode 100644 index 8c14921..0000000 --- a/set_once.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -dbus-launch dconf load / < ~/xed.dconf -chmod -R +x ~/.config/sway/scripts -chmod -R +x ~/.config/waybar/scripts -chmod -R +x ~/.config/wofi/windows.py -case "$(systemd-detect-virt)" in - kvm | qemu) sed -i ~/.profile -e 's|^#\(export WLR_RENDERER_ALLOW_SOFTWARE=1\)$|\1|' ;; -esac -sed -i 's|\(exec ~/set_once.sh\)|# \1|' ~/.config/sway/config -rm ~/xed.dconf -rm ~/set_once.sh diff --git a/setup.sh b/setup.sh deleted file mode 100644 index 370feb0..0000000 --- a/setup.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -if [ -f /tmp/new_username.txt ] -then - NEW_USER=$(cat /tmp/new_username.txt) -else - NEW_USER=$(cat /tmp/$chroot_path/etc/passwd | grep "/home" |cut -d: -f1 |head -1) -fi - -git clone https://github.com/EndeavourOS-Community-Editions/sway.git -cd sway -cp -R .config /home/$NEW_USER/ -chmod -R +x /home/$NEW_USER/.config/sway/scripts -chmod -R +x /home/$NEW_USER/.config/waybar/scripts -chmod +x /home/$NEW_USER/.config/wofi/windows.py -cp .profile /home/$NEW_USER/ -chown -R $NEW_USER:$NEW_USER /home/$NEW_USER/.config -chown $NEW_USER:$NEW_USER /home/$NEW_USER/.profile -cd .. -rm -rf sway diff --git a/setup_sway_isomode.bash b/setup_sway_isomode.bash index 17dbffe..1472729 100644 --- a/setup_sway_isomode.bash +++ b/setup_sway_isomode.bash @@ -1,18 +1,39 @@ #!/usr/bin/env bash username="$1" + +# Clone the repo +echo "Cloning the EOS Community Sway repo..." git clone https://github.com/EndeavourOS-Community-Editions/sway.git -cd sway -cp -R .config /home/$username/ -chmod -R +x /home/$username/.config/sway/scripts -chmod -R +x /home/$username/.config/waybar/scripts -chmod +x /home/$username/.config/wofi/windows.py -cp .profile /home/$username/ -chown -R $username:$username /home/$username/.config -chown $username:$username /home/$username/.profile -cd .. +# Install the custom package list +echo "Installing needed packages..." +pacman -S --noconfirm --noprogressbar --needed --disable-download-timeout $(< ./sway/packages-repository.txt) + +# Deploy user configs +echo "Deploying user configs..." +rsync -a sway/.config "/home/${username}/" +rsync -a sway/.local "/home/${username}/" +rsync -a sway/home_config/ "/home/${username}/" +# Restore user ownership +chown -R "${username}:${username}" "/home/${username}" + +# Deploy system configs +echo "Deploying system configs..." +rsync -a --chown=root:root sway/etc/ /etc/ + +# Check if the script is running in a virtual machine +if systemd-detect-virt | grep -vq "none"; then + echo "Virtual machine detected; enabling WLR_RENDERER_ALLOW_SOFTWARE variable in ReGreet config..." + # Uncomment WLR_RENDERER_ALLOW_SOFTWARE variable in ReGreet config + sed -i '/^#export WLR_RENDERER_ALLOW_SOFTWARE/s/^#//' /etc/greetd/regreet.toml +fi + +# Remove the repo +echo "Removing the EOS Community Sway repo..." rm -rf sway -wget https://raw.githubusercontent.com/EndeavourOS-Community-Editions/sway/main/packages-repository.txt -pacman -S --needed --noconfirm - < packages-repository.txt -rm packages-repository.txt -systemctl enable sddm + +# Enable the Greetd service +echo "Enabling the Greetd service..." +systemctl enable greetd.service + +echo "Installation complete." diff --git a/sway-install.sh b/sway-install.sh index 67e8466..b421a02 100644 --- a/sway-install.sh +++ b/sway-install.sh @@ -1,15 +1,42 @@ #!/bin/bash -# Easy setup for testing +username="$(logname)" -cp -R .config/* ~/.config/ -cp .profile ~/.profile -cp .gtkrc-2.0 ~/.gtkrc-2.0 -chmod -R +x ~/.config/sway/scripts -chmod -R +x ~/.config/waybar/scripts +# Check for sudo +if [ "$EUID" -ne 0 ]; then + echo "This script must be run with sudo." + exit 1 +fi -# Insert `source ~/.profile` after the line that defines SDDM_USER_SHELL in wayland-session -sudo sed -ie '/^SDDM_USER_SHELL/a source ~\/.profile' /usr/share/sddm/scripts/wayland-session +# Install the custom package list +echo "Installing needed packages..." +pacman -S --noconfirm --noprogressbar --needed --disable-download-timeout $(< packages-repository.txt) -sudo pacman -Syu --needed --noconfirm - < packages-repository.txt -dbus-launch dconf load / < xed.dconf +# Deploy user configs +echo "Deploying user configs..." +rsync -a .config "/home/${username}/" +rsync -a .local "/home/${username}/" +rsync -a home_config/ "/home/${username}/" +# Restore user ownership +chown -R "${username}:${username}" "/home/${username}" + +# Deploy system configs +echo "Deploying system configs..." +rsync -a --chown=root:root etc/ /etc/ + +# Check if the script is running in a virtual machine +if systemd-detect-virt | grep -vq "none"; then + echo "Virtual machine detected; enabling WLR_RENDERER_ALLOW_SOFTWARE variable in ReGreet config..." + # Uncomment WLR_RENDERER_ALLOW_SOFTWARE variable in ReGreet config + sed -i '/^#export WLR_RENDERER_ALLOW_SOFTWARE/s/^#//' /etc/greetd/regreet.toml +fi + +# Enable the Greetd service +echo "Enabling the Greetd service..." +systemctl enable greetd.service + +# Remove the repo +echo "Removing the EOS Community Sway repo..." +rm -rf ../sway + +echo "Installation complete."