commit 75df859eebdefdf4c152b782ec8cbdc717932bbf Author: Kevin MacMartin Date: Tue Jan 10 12:48:24 2023 -0500 Initial commit diff --git a/check-pkg b/check-pkg new file mode 100644 index 0000000..5d499bc --- /dev/null +++ b/check-pkg @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +packages=( + gnome-themes-extra + autotiling + blueman + bluez + bluez-utils + dconf-editor + eog + file-roller + gnome-keyring + grim + groff + mako + network-manager-applet + networkmanager + noto-fonts-emoji + nwg-bar + nwg-displays + papirus-icon-theme + pavucontrol + pipewire-alsa + pipewire-pulse + playerctl + qt5-wayland + seahorse + slurp + sway + swaybg + swayidle + swaylock + ttf-liberation + ttf-nerd-fonts-symbols-2048-em + waybar + wl-clipboard + xdg-user-dirs + xfce4-appfinder + xfce4-terminal + xfconf + xorg-server + xorg-xkill + xorg-xprop + xorg-xwayland +) + +for pkg in "${packages[@]}"; do + pacman -Qi "$pkg" >/dev/null 2>&1 || echo "$pkg" +done diff --git a/config/mako/config b/config/mako/config new file mode 100644 index 0000000..27e67a3 --- /dev/null +++ b/config/mako/config @@ -0,0 +1,23 @@ +anchor=top-center +sort=-time +layer=overlay +background-color=#4b5162 +width=300 +height=500 +padding=10 +border-size=0 +border-color=#285577 +border-radius=5 +font=Liberation Sans 12 +icons=1 +max-icon-size=64 +default-timeout=5000 +ignore-timeout=1 + +[urgency=high] +border-color=#bf616a +default-timeout=0 + +[category=mpd] +default-timeout=2000 +group-by=category diff --git a/config/nwg-bar/bar.json b/config/nwg-bar/bar.json new file mode 100644 index 0000000..fabff57 --- /dev/null +++ b/config/nwg-bar/bar.json @@ -0,0 +1,22 @@ +[ + { + "label": "Lock", + "exec": "swaylock -f -i $HOME/.config/sway/wallpapers/lockscreen_wallpaper.jpg", + "icon": "/home/prurigro/.config/nwg-bar/icons/system-lock-screen.svg" + }, + { + "label": "Logout", + "exec": "swaymsg exit", + "icon": "/home/prurigro/.config/nwg-bar/icons/system-log-out.svg" + }, + { + "label": "Reboot", + "exec": "systemctl reboot", + "icon": "/home/prurigro/.config/nwg-bar/icons/system-reboot.svg" + }, + { + "label": "Shutdown", + "exec": "systemctl -i poweroff", + "icon": "/home/prurigro/.config/nwg-bar/icons/system-shutdown.svg" + } +] diff --git a/config/nwg-bar/icons/system-lock-screen.svg b/config/nwg-bar/icons/system-lock-screen.svg new file mode 100644 index 0000000..2950447 --- /dev/null +++ b/config/nwg-bar/icons/system-lock-screen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/nwg-bar/icons/system-log-out.svg b/config/nwg-bar/icons/system-log-out.svg new file mode 100644 index 0000000..2fad506 --- /dev/null +++ b/config/nwg-bar/icons/system-log-out.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/nwg-bar/icons/system-reboot.svg b/config/nwg-bar/icons/system-reboot.svg new file mode 100644 index 0000000..cb16bdb --- /dev/null +++ b/config/nwg-bar/icons/system-reboot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/nwg-bar/icons/system-shutdown.svg b/config/nwg-bar/icons/system-shutdown.svg new file mode 100644 index 0000000..77a77be --- /dev/null +++ b/config/nwg-bar/icons/system-shutdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/nwg-bar/style.css b/config/nwg-bar/style.css new file mode 100644 index 0000000..a85bd6d --- /dev/null +++ b/config/nwg-bar/style.css @@ -0,0 +1,39 @@ +window { + background-color: rgba (0, 0, 0, 0.0) +} + +/* Outer bar container, takes all the window width/height */ +#outer-box { + margin: 0px +} + +/* Inner bar container, surrounds buttons */ +#inner-box { + background-color: @theme_base_color; + border-radius: 10px; + border-style: none; + border-width: 1px; + border-color: rgba (156, 142, 122, 0.7); + padding: 5px; + margin: 5px +} + +button, image { + background: none; + border: none; + box-shadow: none +} + +button { + padding-left: 10px; + padding-right: 10px; + margin: 5px +} + +button:focus { + background-color: rgba (255, 255, 255, 0.1) +} + +button:hover { + background-color: rgba (255, 255, 255, 0.1) +} diff --git a/config/sway/config b/config/sway/config new file mode 100644 index 0000000..32c0048 --- /dev/null +++ b/config/sway/config @@ -0,0 +1,253 @@ +# Sway Configuration +# +# Read `man 5 sway` for a complete reference. + +# Disable xwayland +#xwayland disable + +# Font +font Liberation Mono 12 + +# Background +output "*" bg ~/.config/sway/wallpapers/wallpaper.jpg fill + +# Logo key. Use Mod1 for Alt. +set $mod Mod4 + +# Direction keys +set $left Left +set $down Down +set $up Up +set $right Right + +# Your preferred terminal emulator +set $term xfce4-terminal + +# Keyboard +input "1:1:AT_Translated_Set_2_keyboard" { + xkb_layout us,ca + xkb_variant ,multix + xkb_options grp:shifts_toggle +} + +# Touchpad +input type:touchpad { + dwt enabled + tap disabled + natural_scroll enabled + tap_button_map lrm + click_method clickfinger +} + +# Screen Lock +exec swayidle -w \ + timeout 300 'swaylock -f -i $HOME/.config/sway/wallpapers/lockscreen_wallpaper.jpg' \ + timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000' + +# Autostart +exec systemctl start --user gnome-keyring-daemon +exec blueman-applet +exec nm-applet --indicator +exec --no-startup-id mako +exec $HOME/.config/sway/scripts/inactive-windows-transparency.py +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec autotiling + +# GTK Theme +set $gnome-schema org.gnome.desktop.interface + +exec_always { + gsettings set $gnome-schema gtk-theme 'Adwaita-dark' + gsettings set $gnome-schema icon-theme 'Papirus-Dark' +} + +### Key bindings + +# +# Misc: +# + +# Start a terminal +bindsym Ctrl+Alt+t exec $term + +# Start a file manager +bindsym Ctrl+Alt+f exec thunar + +# Kill focused window +bindsym $mod+w kill + +# Start your launcher +bindsym $mod+space exec xfce4-appfinder + +# Drag floating 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. +floating_modifier $mod normal + +# Reload the configuration file +bindsym $mod+Shift+c reload + +# Lock screen +bindsym $mod+l exec swaylock -f -i $HOME/.config/sway/wallpapers/lockscreen_wallpaper.jpg + +# Show options to lock, logout, reboot or shutdown +bindsym Ctrl+Alt+Delete exec nwg-bar -t bar.json + +# Media +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindcode 248 exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +# Brightness controls +#bindsym XF86MonBrightnessDown exec brightnessctl set 5%- +#bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ + +# Screenshots +bindsym Print exec $HOME/.config/sway/scripts/grimshot.sh save output +bindsym Shift+Print exec $HOME/.config/sway/scripts/grimshot.sh save active +bindsym Ctrl+Print exec $HOME/.config/sway/scripts/grimshot.sh save area + +# +# 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 + +# 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 + +# +# Workspaces: +# + +# Switch to next/previous workspace +bindsym $mod+p workspace prev +bindsym $mod+n workspace next + +# Switch to a particular workspace +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 + +# Move focused container and switch to a particular workspace +bindsym $mod+Shift+1 move container to workspace number 1; workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2; workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3; workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4; workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5; workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6; workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7; workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8; workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9; workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10; workspace number 10 + +# Note: workspaces can have any name you want, not just numbers. +# We just use 1-10 as the default. + +# +# Layout stuff: +# + +default_border pixel 2 +default_floating_border normal 2 +gaps inner 20 + +# You can "split" the current object of your focus with +# $mod+b or $mod+v, for horizontal and vertical splits +# respectively. +bindsym $mod+h splith +bindsym $mod+v splitv + +# Switch the current container between different layout styles +bindsym $mod+s layout stacking +bindsym $mod+t layout tabbed +bindsym $mod+Shift+s layout toggle split +bindsym $mod+Shift+t layout toggle split + +# Make the current focus fullscreen +bindsym $mod+f fullscreen + +# Toggle the current focus between tiling and floating mode +bindsym $mod+Return floating toggle + +# Swap focus between the tiling area and the floating area +bindsym Alt+Tab focus mode_toggle + +# +# Scratchpad: +# + +# Sway has a "scratchpad", which is a bag of holding for windows. +# You can send windows there and get them back later. +# 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 + +# +# 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 $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 "resize" + +# +# Rules +# + +for_window [app_id="blueman-manager"] floating enable, resize set width 680 height 400, move position center +for_window [app_id="xfce4-appfinder"] floating enable, resize set width 680 height 480, move position center +for_window [app_id="eog"] floating enable, move position center +for_window [app_id="org.gnome.Calculator"] floating enable, move position center +for_window [app_id="nm-connection-editor"] floating enable, move position center +for_window [app_id="org.keepassxc.KeePassXC"] floating enable, move position center +for_window [app_id="pavucontrol"] floating enable, resize set width 680 height 400, move position center +for_window [class="^.*"] inhibit_idle fullscreen +for_window [app_id="^.*"] inhibit_idle fullscreen + +# +# Status Bar: +# + +bar { + swaybar_command waybar +} + +include /etc/sway/config.d/* diff --git a/config/sway/config.d/50-systemd-user.conf b/config/sway/config.d/50-systemd-user.conf new file mode 100644 index 0000000..72e5dcd --- /dev/null +++ b/config/sway/config.d/50-systemd-user.conf @@ -0,0 +1,7 @@ +# 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. + +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK diff --git a/config/sway/scripts/autoname-workspaces.py b/config/sway/scripts/autoname-workspaces.py new file mode 100755 index 0000000..297d91b --- /dev/null +++ b/config/sway/scripts/autoname-workspaces.py @@ -0,0 +1,130 @@ +#!/usr/bin/python + +# This script requires i3ipc-python package (install it from a system package manager +# or pip). +# It adds icons to the workspace name for each open window. +# Set your keybindings like this: set $workspace1 workspace number 1 +# Add your icons to WINDOW_ICONS. +# Based on https://github.com/maximbaz/dotfiles/blob/master/bin/i3-autoname-workspaces + +import argparse +import i3ipc +import logging +import re +import signal +import sys + +WINDOW_ICONS = { + "firefox": "", +} + +DEFAULT_ICON = "󰀏" + + +def icon_for_window(window): + app_id = window.app_id + if app_id is not None and len(app_id) > 0: + app_id = app_id.lower() + if app_id in WINDOW_ICONS: + return WINDOW_ICONS[app_id] + logging.info("No icon available for window with app_id: %s" % str(app_id)) + else: + # xwayland support + class_name = window.window_class + if len(class_name) > 0: + class_name = class_name.lower() + if class_name in WINDOW_ICONS: + return WINDOW_ICONS[class_name] + logging.info( + "No icon available for window with class_name: %s" % str(class_name) + ) + return DEFAULT_ICON + + +def rename_workspaces(ipc): + for workspace in ipc.get_tree().workspaces(): + name_parts = parse_workspace_name(workspace.name) + icon_tuple = () + for w in workspace: + if w.app_id is not None or w.window_class is not None: + icon = icon_for_window(w) + if not ARGUMENTS.duplicates and icon in icon_tuple: + continue + icon_tuple += (icon,) + name_parts["icons"] = " ".join(icon_tuple) + " " + new_name = construct_workspace_name(name_parts) + ipc.command('rename workspace "%s" to "%s"' % (workspace.name, new_name)) + + +def undo_window_renaming(ipc): + for workspace in ipc.get_tree().workspaces(): + name_parts = parse_workspace_name(workspace.name) + name_parts["icons"] = None + new_name = construct_workspace_name(name_parts) + ipc.command('rename workspace "%s" to "%s"' % (workspace.name, new_name)) + ipc.main_quit() + sys.exit(0) + + +def parse_workspace_name(name): + return re.match( + "(?P[0-9]+):?(?P\w+)? ?(?P.+)?", name + ).groupdict() + + +def construct_workspace_name(parts): + new_name = str(parts["num"]) + if parts["shortname"] or parts["icons"]: + new_name += ":" + + if parts["shortname"]: + new_name += parts["shortname"] + + if parts["icons"]: + new_name += " " + parts["icons"] + + return new_name + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="This script automatically changes the workspace name in sway depending on your open applications." + ) + parser.add_argument( + "--duplicates", + "-d", + action="store_true", + help="Set it when you want an icon for each instance of the same application per workspace.", + ) + parser.add_argument( + "--logfile", + "-l", + type=str, + default="/tmp/sway-autoname-workspaces.log", + help="Path for the logfile.", + ) + args = parser.parse_args() + global ARGUMENTS + ARGUMENTS = args + + logging.basicConfig( + level=logging.INFO, + filename=ARGUMENTS.logfile, + filemode="w", + format="%(message)s", + ) + + ipc = i3ipc.Connection() + + for sig in [signal.SIGINT, signal.SIGTERM]: + signal.signal(sig, lambda signal, frame: undo_window_renaming(ipc)) + + def window_event_handler(ipc, e): + if e.change in ["new", "close", "move"]: + rename_workspaces(ipc) + + ipc.on("window", window_event_handler) + + rename_workspaces(ipc) + + ipc.main() diff --git a/config/sway/scripts/grimshot.sh b/config/sway/scripts/grimshot.sh new file mode 100755 index 0000000..921837f --- /dev/null +++ b/config/sway/scripts/grimshot.sh @@ -0,0 +1,154 @@ +#!/bin/sh + +## Grimshot: a helper for screenshots within sway +## Requirements: +## - `grim`: screenshot utility for wayland +## - `slurp`: to select an area +## - `swaymsg`: to read properties of current window +## - `wl-copy`: clipboard utility +## - `jq`: json utility to parse swaymsg output +## - `notify-send`: to show notifications +## Those are needed to be installed, if unsure, run `grimshot check` +## +## See `man 1 grimshot` or `grimshot usage` for further details. + +getTargetDirectory() { + test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ + . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + + echo ${XDG_SCREENSHOTS_DIR:-${XDG_PICTURES_DIR:-$HOME}} +} + +if [ "$1" = "--notify" ]; then + NOTIFY=yes + shift 1 +else + NOTIFY=no +fi + +ACTION=${1:-usage} +SUBJECT=${2:-screen} +FILE=${3:-$(getTargetDirectory)/$(date -Ins).png} + +if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then + echo "Usage:" + echo " grimshot [--notify] (copy|save) [active|screen|output|area|window] [FILE|-]" + echo " grimshot check" + echo " grimshot usage" + echo "" + echo "Commands:" + echo " copy: Copy the screenshot data into the clipboard." + echo " save: Save the screenshot to a regular file or '-' to pipe to STDOUT." + echo " check: Verify if required tools are installed and exit." + echo " usage: Show this message and exit." + echo "" + echo "Targets:" + echo " active: Currently active window." + echo " screen: All visible outputs." + echo " output: Currently active output." + echo " area: Manually select a region." + echo " window: Manually select a window." + exit +fi + +notify() { + notify-send -t 3000 -a grimshot "$@" +} +notifyOk() { + [ "$NOTIFY" = "no" ] && return + + TITLE=${2:-"Screenshot"} + MESSAGE=${1:-"OK"} + notify "$TITLE" "$MESSAGE" +} +notifyError() { + if [ $NOTIFY = "yes" ]; then + TITLE=${2:-"Screenshot"} + MESSAGE=${1:-"Error taking screenshot with grim"} + notify -u critical "$TITLE" "$MESSAGE" + else + echo $1 + fi +} + +die() { + MSG=${1:-Bye} + notifyError "Error: $MSG" + exit 2 +} + +check() { + COMMAND=$1 + if command -v "$COMMAND" > /dev/null 2>&1; then + RESULT="OK" + else + RESULT="NOT FOUND" + fi + echo " $COMMAND: $RESULT" +} + +takeScreenshot() { + FILE=$1 + GEOM=$2 + OUTPUT=$3 + if [ ! -z "$OUTPUT" ]; then + grim -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" + elif [ -z "$GEOM" ]; then + grim "$FILE" || die "Unable to invoke grim" + else + grim -g "$GEOM" "$FILE" || die "Unable to invoke grim" + fi +} + +if [ "$ACTION" = "check" ] ; then + echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..." + check grim + check slurp + check swaymsg + check wl-copy + check jq + check notify-send + exit +elif [ "$SUBJECT" = "area" ] ; then + GEOM=$(slurp -d) + # Check if user exited slurp without selecting the area + if [ -z "$GEOM" ]; then + exit + fi + WHAT="Area" +elif [ "$SUBJECT" = "active" ] ; then + FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') + GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') + APP_ID=$(echo "$FOCUSED" | jq -r '.app_id') + WHAT="$APP_ID window" +elif [ "$SUBJECT" = "screen" ] ; then + GEOM="" + WHAT="Screen" +elif [ "$SUBJECT" = "output" ] ; then + GEOM="" + OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') + WHAT="$OUTPUT" +elif [ "$SUBJECT" = "window" ] ; then + GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) + # Check if user exited slurp without selecting the area + if [ -z "$GEOM" ]; then + exit + fi + WHAT="Window" +else + die "Unknown subject to take a screen shot from" "$SUBJECT" +fi + +if [ "$ACTION" = "copy" ] ; then + takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" + notifyOk "$WHAT copied to buffer" +else + if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then + TITLE="Screenshot of $SUBJECT" + MESSAGE=$(basename "$FILE") + notifyOk "$MESSAGE" "$TITLE" + echo $FILE + else + notifyError "Error taking screenshot with grim" + fi +fi diff --git a/config/sway/scripts/inactive-windows-transparency.py b/config/sway/scripts/inactive-windows-transparency.py new file mode 100755 index 0000000..ce8d8de --- /dev/null +++ b/config/sway/scripts/inactive-windows-transparency.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +# This script requires i3ipc-python package (install it from a system package manager +# or pip). +# It makes inactive windows transparent. Use `transparency_val` variable to control +# transparency strength in range of 0…1 or use the command line argument -o. + +import argparse +import i3ipc +import signal +import sys +from functools import partial + +def on_window_focus(inactive_opacity, ipc, event): + global prev_focused + global prev_workspace + + focused_workspace = ipc.get_tree().find_focused() + + if focused_workspace == None: + return + + focused = event.container + workspace = focused_workspace.workspace().num + + if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 + focused.command("opacity 1") + if workspace == prev_workspace: + prev_focused.command("opacity " + inactive_opacity) + prev_focused = focused + prev_workspace = workspace + + +def remove_opacity(ipc): + for workspace in ipc.get_tree().workspaces(): + for w in workspace: + w.command("opacity 1") + ipc.main_quit() + sys.exit(0) + + +if __name__ == "__main__": + transparency_val = "0.95" + + parser = argparse.ArgumentParser( + description="This script allows you to set the transparency of unfocused windows in sway." + ) + parser.add_argument( + "--opacity", + "-o", + type=str, + default=transparency_val, + help="set opacity value in range 0...1", + ) + args = parser.parse_args() + + ipc = i3ipc.Connection() + prev_focused = None + prev_workspace = ipc.get_tree().find_focused().workspace().num + + for window in ipc.get_tree(): + if window.focused: + prev_focused = window + else: + window.command("opacity " + args.opacity) + for sig in [signal.SIGINT, signal.SIGTERM]: + signal.signal(sig, lambda signal, frame: remove_opacity(ipc)) + ipc.on("window::focus", partial(on_window_focus, args.opacity)) + ipc.main() diff --git a/config/sway/wallpapers/lockscreen_wallpaper.jpg b/config/sway/wallpapers/lockscreen_wallpaper.jpg new file mode 100644 index 0000000..6117bc6 Binary files /dev/null and b/config/sway/wallpapers/lockscreen_wallpaper.jpg differ diff --git a/config/sway/wallpapers/wallpaper.jpg b/config/sway/wallpapers/wallpaper.jpg new file mode 100644 index 0000000..c7d03f6 Binary files /dev/null and b/config/sway/wallpapers/wallpaper.jpg differ diff --git a/config/swaylock/config b/config/swaylock/config new file mode 100644 index 0000000..11e7bae --- /dev/null +++ b/config/swaylock/config @@ -0,0 +1,24 @@ +# indicator +# no-unlock-indicator +# daemonize +indicator-caps-lock +# datestr=%A +image=$HOME/.config/sway/swaylock.png +scaling=fill +font=UbuntuMono +font-size=20 + +# Ring +indicator-radius=115 +# line-uses-ring +line-color=#3b4252 +text-color=#d8dee9 +inside-color=#2e344098 +inside-ver-color=#5e81ac +line-ver-color=#5e81ac +ring-ver-color=#5e81ac98 +ring-color=#4c566a +key-hl-color=#5e81ac +separator-color=#4c566a +layout-text-color=#eceff4 +line-wrong-color=#d08770 diff --git a/config/systemd/user/gnome-keyring-daemon.service b/config/systemd/user/gnome-keyring-daemon.service new file mode 100644 index 0000000..827e0a3 --- /dev/null +++ b/config/systemd/user/gnome-keyring-daemon.service @@ -0,0 +1,14 @@ +[Unit] +Description=GNOME Keyring daemon + +Requires=gnome-keyring-daemon.socket + +[Service] +Type=simple +StandardError=journal +ExecStart=/usr/bin/gnome-keyring-daemon --foreground --components="pkcs11,secrets,ssh" --control-directory=%t/keyring +Restart=on-failure + +[Install] +Also=gnome-keyring-daemon.socket +WantedBy=default.target diff --git a/config/waybar/config b/config/waybar/config new file mode 100644 index 0000000..97edb62 --- /dev/null +++ b/config/waybar/config @@ -0,0 +1,93 @@ +{ + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + // "height": 30, // Waybar height (to be removed for auto height) + "margin": "20 20 0 20", + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/window"], + "modules-center": ["clock"], + "modules-right": ["backlight", "battery", "custom/mem", "pulseaudio", "tray"], + + //*************************** + //* Modules configuration * + //*************************** + + "sway/workspaces": { + "disable-scroll": true, + + "persistent_workspaces": { + "1": [], + "2": [], + "3": [], + "4": [] + } + }, + + "sway/window": { + "max-length": 80 + }, + + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%a, %d %b, %I:%M %p}" + }, + + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "reverse-scrolling": 0, + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": "婢 {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "0% ", + + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["奄", "奔", "墳"] + }, + + "on-click": "pavucontrol", + "min-length": 8 + }, + + "custom/mem": { + "format": "{} ", + "interval": 3, + "exec": "free -h | awk '/Mem:/{printf $3}'", + "tooltip": false + }, + + "backlight": { + "device": "intel_backlight", + "format": "{percent}% {icon}", + "format-icons": ["","","","", "", "", ""], + "min-length": 7 + }, + + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["🪫", "🪫", "🪫", "🔋", "🔋", "🔋", "🔋", "🔋", "🔋", "🔋"], + "on-update": "$HOME/.config/waybar/scripts/battery.sh" + }, + + "tray": { + "icon-size": 16, + "spacing": 8 + } +} diff --git a/config/waybar/scripts/battery.sh b/config/waybar/scripts/battery.sh new file mode 100755 index 0000000..a7249db --- /dev/null +++ b/config/waybar/scripts/battery.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +CRIT=${1:-15} + +while read -r capacity; do + stat="$(cat "${capacity/capacity/status}")" + perc="$(cat "$capacity")" + bat="$(cut --delimiter='/' -f5 <<< "$capacity")" + + if (( perc <= CRIT )) && [[ "$stat" = 'Discharging' ]]; then + notify-send --urgency=critical 'Battery Low' "Current charge of $bat: $perc%" + fi +done < <(find /sys/class/power_supply/*/ -type f -name capacity) diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..a88b840 --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,186 @@ +* { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Liberation Mono; + min-height: 20px; + padding-top: 1px; +} + +window#waybar { + background: transparent; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#workspaces { + margin-right: 8px; + border-radius: 10px; + transition: none; + background: #3c384a; +} + +#workspaces button { + transition: none; + color: #7c818c; + background: transparent; + padding: 5px; + font-size: 18px; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + border-radius: inherit; + color: #3c384a; + background: #7c818c; +} + +#workspaces button.persistent { + font-size: 12px; +} + +#workspaces button.focused { + color: white; + font-size: 18px; +} + +#window { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +window#waybar.empty #window { + background: transparent; +} + +#keyboard-state { + margin-right: 8px; + padding-right: 16px; + border-radius: 0px 10px 10px 0px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#mode { + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#clock { + padding-left: 16px; + padding-right: 16px; + border-radius: 10px 10px 10px 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#pulseaudio { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#custom-mem { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#temperature { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#backlight { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#battery { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +#battery.charging { + color: #ffffff; + background-color: #26A65B; +} + +#battery.warning:not(.charging) { + background-color: #ffbe61; + color: black; +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#tray { + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #ffffff; + background: #3c384a; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} diff --git a/packages b/packages new file mode 100644 index 0000000..18b97dd --- /dev/null +++ b/packages @@ -0,0 +1,43 @@ +gnome-themes-extra +autotiling +blueman +bluez +bluez-utils +dconf-editor +eog +file-roller +gnome-keyring +grim +groff +mako +network-manager-applet +networkmanager +noto-fonts-emoji +nwg-bar +nwg-displays +papirus-icon-theme +pavucontrol +pipewire-alsa +pipewire-pulse +playerctl +qt5-wayland +seahorse +slurp +sway +swaybg +swayidle +swaylock +thunar +thunar-volman +ttf-liberation +ttf-nerd-fonts-symbols-2048-em +waybar +wl-clipboard +xdg-user-dirs +xfce4-appfinder +xfce4-terminal +xfconf +xorg-server +xorg-xkill +xorg-xprop +xorg-xwayland