merging waybar configs with my old ones

This commit is contained in:
Mark Riedesel 2024-06-12 14:24:17 -05:00
parent 93879b3ef7
commit a4740d2dc0
11 changed files with 264 additions and 132 deletions

View file

@ -36,7 +36,7 @@ set $swayidle swayidle -w \
before-sleep 'exec $locking & sleep $sleep_delay' \
after-resume '/usr/share/sway/scripts/keyboard-backlight-switch.sh on && swaymsg "output * dpms on" && brightnessctl -r'
set $disable_nm_applet_autostart '[ -x "$(command -v nm-applet)" ] && [ ! -f $HOME/.config/autostart/nm-applet.desktop ] && cp /etc/xdg/autostart/nm-applet.desktop $HOME/.config/autostart/nm-applet.desktop && echo "Hidden=true" >> $HOME/.config/autostart/nm-applet.desktop'
set $apply_background swaymsg 'output * bg $background fill'
set $apply_background swaymsg 'output * bg $wallpaper fill'
## daemons

View file

@ -0,0 +1,18 @@
exec_always {
$sway-script-dir/enable-gtk-theme.sh "$gtk-theme"
gsettings set org.gnome.desktop.interface icon-theme "$icon-theme"
gsettings set org.gnome.desktop.interface cursor-theme "$cursor-theme"
gsettings set org.gnome.desktop.interface font-name "$gui-font"
gsettings set org.gnome.desktop.input-sources show-all-sources true
gsettings set org.gnome.desktop.interface monospace-font-name "$term-font"
$sway-script-dir/fontconfig.sh "monospace" "$term-font"
gsettings set org.freedesktop.appearance color-scheme "$gtk-color-scheme"
gsettings set org.gnome.desktop.interface color-scheme "$gtk-color-scheme"
# make sure gtk-4.0 has the theme settings of the currently active theme
#/usr/share/sway/scripts/generate-bg.sh "$accent-color" "$text-color" "$background-color"
#kvantummanager --set "$kvantum-theme"
}

View file

@ -0,0 +1,35 @@
# don't show gaps if there's only one window on the desktop
smart_gaps on
# set floating mode for generated windows
for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable
for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 800 600
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
# set floating mode for specific applications
for_window [instance="lxappearance"] floating enable
for_window [app_id="pamac-manager"] floating enable
for_window [app_id="blueberry.py"] floating enable
for_window [app_id="dragon-drop"] floating enable, sticky enable
for_window [app_id="firefox" title="^Library$"] floating enable, border pixel 1, sticky enable
for_window [app_id="thunderbird" title=".*Reminder"] floating enable
for_window [app_id="floating_shell"] floating enable, border pixel 1, sticky enable
for_window [app_id="Manjaro.manjaro-settings-manager"] floating enable
for_window [app_id="" title="Picture in picture"] floating enable, sticky enable
for_window [app_id="" title="Picture-in-Picture"] floating enable, sticky enable
for_window [instance="around"] floating enable, sticky enable
for_window [app_id="xsensors"] floating enable
for_window [title="Save File"] floating enable
for_window [title="Firefox .*— Sharing Indicator"] floating enable, sticky enable, move to scratchpad
for_window [app_id="" title=".* is sharing your screen."] floating enable
for_window [title="^wlay$"] floating enable
# Don't allow applications to inhibit shortcuts, i.e. grab total control of the
# keyboard. Chrome currently abuses this by enabling it for all "--app=..."
# shortcuts.
seat * shortcuts_inhibitor disable

View file

@ -1,18 +1,43 @@
# autostart background applications
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# autostarts
exec {
$initialize_way_displays
$initialize_way_displays
$initialize_foot_server
$initialize_mounting_daemon
$initialize_poweralert_daemon
$initialize_idlehack_daemon
$initialize_workspace_icons
$initialize_swayr_daemon
$xdg-dirs
$swayidle
$swappy_notify
$flashfocus
$wlsunset
$autotiling
$cliphist_store
$cliphist_watch
$xdg-dirs
$swayidle
$swappy_notify
$autostart_dex
$flashfocus
$wlsunset
$autotiling
$cliphist_store
$cliphist_watch
}
# commands that "reload" something
exec_always {
$initialize_waybar
$initialize_waybar
$apply_background
$help_menu
$kanshi
$clip-persist
$mako
$auto_xdg_keyboard
$watch_playerctl
$calendar_daemon
$enable_noisetorch
$onscreen_bar --refresh
$create_rofi_config
$update_rofi_theme
#$disable_nm_applet_autostart
#$nm_applet
}

View file

@ -1,7 +1,7 @@
# shellcheck disable=SC2148,SC2086,SC2154,SC2046,SC2016
### Variables
#
set $theme "$sway-config-dir/themes/dracula"
set $theme "$sway-config-dir/themes/dynamic"
include $theme/theme.conf
# Logo key. Use Mod1 for Alt and Mod4 for Super.
@ -80,7 +80,7 @@ set $sleep_timeout_ac 3600
set $sleep_delay 2
### Autostart applications definition. Can be removed soon-ish as it is being imported in userspace.
include /etc/sway/autostart
#include /etc/sway/autostart
# hide cursor after 5 seconds of inactivty
seat seat0 hide_cursor 5000

View file

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3840 2160">
<path d="M0 0h3840v2160H0z" fill="#0b1812" />
<path fill="#ABA194" d="m2388.34 1439.64 136.94 50.68 484.28-184.24v-67.12l-311.86-91.16-484.36 156.56v70.66l136.94 50.7 38.34-14.54Zm0 0"/>
<path fill="#ABA194" d="M2562.38 1432.2v72.14l135.24 50.16 484.7-179.48-.52-72.2Zm-190.28-119.82c-5.9-130.46 130.2-200.72 230.7-254.28 87.76-46.46 197.44-107.12 174.8-220.64-4.72-23.56-42-13.72-37.28 10.08 10.4 51.96-20.04 91.32-60.86 121.3-47.88 35.24-103.08 60.2-155.44 88.8-96.26 53.1-196.04 137.1-191.08 254.74 1.88 24.02 40.34 24.02 39.16 0Zm0 0"/>
<path fill="#ABA194" d="M2541.24 1098.4c133.5 27 274.58-11.7 373.4-103 17.94-16.72-9.42-43.26-27.36-26.56-88.2 81.94-216.3 117.64-335.66 93.38-24.54-4.58-34.92 31.12-10.4 36.16Zm0 0"/>
<path fill="#917886" d="m2697.88 1125.08-484.32 179.34 137.04 50 348.02-128.9 174.98 63.88 136.28-50.44Zm0 0"/>
<path fill="#917886" d="m2697.48 1253.4-309.4 114.9 136.6 50 309.38-114.9Zm348.06-.56L2562.6 1432.2l136.58 50 482.94-179.34Zm40.36-437.34c13.7.46 29.5 3.66 35.86 15.8 5.2 10.06 1.2 21.96-5.9 30.42-7.78 8.24-17.92 12.82-28.78 16.94a538.05 538.05 0 0 1-167.48 38.22c-15.8.92-32.54 1.14-47.88-3.66-15.34-4.8-29-16.24-33.5-31.12-9.44-34.56 68.4-45.78 89.4-49.44 21-3.66 42-6.18 63-7.1 31.84-2.28 62.74-11.44 95.28-10.06Zm-545.14 10.76c35.14 8.24 94.6-31.14 121.24-43.72 34.2-16.26 69.84-28.6 104.52-43.72 13.2-5.72 56.6-19 56.84-37.76.94-23.34-45.06-24.5-59.92-22.88-30.42 2.96-59.92 12.12-89.16 20.36-30 8.74-59.07 20.4-86.8 34.8-21 10.74-49.8 29.98-62.06 49.88-7.78 12.14-7.3 30 4.72 38.22a27.86 27.86 0 0 0 10.62 4.8Zm0 0"/>
<path fill="#917886" d="M2756.14 763.08c5.88-3.44 12.02-6.18 17.92-9.16 49.78-22.88 107.1-41.64 163.48-45.76 49.3-3.66 103.54-12.36 152.38.46 25.24 6.62 53.08 30.44 39.86 53.08-9.9 16.94-50 39.84-67.7 52.42-64.64 44.4-154.98 64.08-237.54 68.2-59.92 2.98-158.76-30.44-104.02-93.14 9.42-10.3 21.92-18.54 35.6-26.1Zm321.98 278.32c-21-50.36-147.2 5.02-175.98 22.88-10.6 6.64-21.92 16.7-19.58 28.6 2.14 12.82 17.94 18.78 31.62 20.38 33.26 4.12 188.72-12.36 163.94-71.86ZM2681.6 878.66c-5.2 33.2-51.44 69.8-82.34 80.1-29.96 10.3-79.96-11.2-61.56-46.46 16.28-30.66 96.72-85.6 131.86-63.16 9.9 6.18 13.68 18.76 12.02 29.52Zm88.68 165.24c49.36 5.65 99.36-.3 146.02-17.4 10.4-3.64 21-8.68 25.24-18.76a19.7 19.7 0 0 0-5.2-21.96 21.07 21.07 0 0 0-22.64-3.66c-13.68-14.66-37.74-13.28-57.8-9.6a349.69 349.69 0 0 0-91.52 32.02c-10.38 5.5-21.94 14.66-18.86 25.4 2.82 9.4 14.86 12.82 24.76 13.96Zm0 0"/>
<path fill="#917886" d="M2827.6 1005.24c65.12 14.18 136.6-4.12 192.26-39.14 7.32-4.6 15.34-11.68 14.16-20.38-1.66-10.3-15.34-13.72-26.66-13.28-63.46.92-127.62 16.26-182.82 47.4-6.36 3.4-13.2 9.14-11.56 15.78 1.88 5.94 8.72 8.46 14.62 9.6Zm-326.24-83.78c5.9-7.1 11.1-15.8 8.5-24.02-12.04-46-76.66 13.72-92 27.46-19.58 17.4-18.88 32.72 13.2 32.72 26.66-.46 54.5-17.6 70.3-36.16Zm0 0"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -1,97 +0,0 @@
#!/usr/bin/env python3
import dbus
import json
import logging, sys
import os
import math
level = logging.DEBUG if os.environ.get("DEBUG") == "true" else logging.INFO
logging.basicConfig(stream=sys.stderr, level=level)
CONNECTIVITY_STRENGTH_SYMBOL = ["󰞃", "󰢼", "󰢽", "󰢾", "󰢾"]
BATTERY_PERCENTAGE_SYMBOL = ["󱃍", "󰁺", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"]
bus = dbus.SessionBus()
valent_object = bus.get_object("ca.andyholmes.Valent", "/ca/andyholmes/Valent")
valent_interface = dbus.Interface(valent_object, "org.freedesktop.DBus.ObjectManager")
managed_objects = valent_interface.GetManagedObjects()
dangerously_empty = False
connected = False
no_connectivity = False
devices = []
for path in managed_objects:
device = {}
device["state"] = (
"connected"
if managed_objects[path].get("ca.andyholmes.Valent.Device", {}).get("State", 0)
== 3
else "disconnected"
)
device["id"] = (
managed_objects[path].get("ca.andyholmes.Valent.Device", {}).get("Id", 0)
)
device["name"] = (
managed_objects[path].get("ca.andyholmes.Valent.Device", {}).get("Name", 0)
)
device_obj = bus.get_object("ca.andyholmes.Valent", path)
device_action_interface = dbus.Interface(device_obj, "org.gtk.Actions")
battery_state = device_action_interface.Describe("battery.state")[2][0]
device["battery_percentage"] = battery_state["percentage"]
device["battery_status"] = (
"discharging" if battery_state["charging"] == 0 else "charging"
)
connectivity_state = device_action_interface.Describe("connectivity_report.state")[
2
][0]["signal-strengths"]["1"]
device["connectivity_strength"] = connectivity_state["signal-strength"]
if device["state"] == "connected":
connected = True
if device["connectivity_strength"] <= 1:
no_connectivity = True
if device["battery_percentage"] <= 15 and device["battery_status"] == "discharging":
dangerously_empty = True
devices.append(device)
data = {}
data["alt"] = (
"no-devices"
if len(devices) == 0
else "dangerously-empty"
if dangerously_empty
else "no-signal"
if no_connectivity
else "connected"
if connected
else "disconnected"
)
data["class"] = data["alt"]
data["tooltip"] = ""
logging.debug(devices)
tooltip = []
for device in devices:
battery_symbol = math.ceil(round(device["battery_percentage"] / 10, 0))
details = (
f"\t{CONNECTIVITY_STRENGTH_SYMBOL[device['connectivity_strength']]} {BATTERY_PERCENTAGE_SYMBOL[battery_symbol]} {device['battery_percentage']}% ({device['battery_status']})"
if device["state"] == "connected"
else ""
)
tooltip.append(f"{device['name']} ({device['state']}){details}")
data["tooltip"] = "\n".join(tooltip)
print(json.dumps(data))

30
.config/sway/scripts/zeit.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env sh
tracking=$(zeit tracking --no-colors)
case $1'' in
'status')
text=$(echo "$tracking" | sed -z 's/\n/\\n/g' | grep -q 'tracking' && echo "tracking" || echo "stopped")
tooltip=$tracking'\r(zeit time tracker)'
echo "{\"text\":\"$text\",\"tooltip\":\"$tooltip\",\"class\":\"$text\",\"alt\":\"$text\"}"
;;
'click')
if echo "$tracking" | grep -q 'tracking'; then
zeit finish
else
swaymsg exec \$zeit_list
fi
;;
'track')
input=$(cat -)
task=$(echo $input | pcregrep -io1 '└── (.+) \[.+')
project=$(echo $input | pcregrep -io1 '.+\[(.+)\]')
if [ "$task" = "" ] || [ "$project" = "" ]; then
notify-send "You did not select a task!"
exit 1
fi
zeit track -p "$project" -t "$task"
notify-send "Tracking $task in $project"
;;
esac

View file

@ -0,0 +1,19 @@
# dynamic
include $HOME/.cache/wal/colors-sway
#set $fg $color3
#set $bg $color1
set $background-color $color0
set $text-color $color6
set $selection-color $color1
set $accent-color $color12
# Basic color configuration using the Base16 variables for windows and borders.
# Property Name Border BG Text Indicator Child Border
client.focused $color12 $color12 $color0 $color6 $color12
client.focused_inactive $color1 $color1 $color5 $color3 $color1
client.unfocused $color1 $color0 $color5 $color6 $color1
client.urgent $color8 $color8 $color0 $color9 $color8
client.placeholder $color0 $color0 $color5 $color0 $color0
client.background $color7

View file

@ -18,7 +18,7 @@
"position": "top",
"modules-left": ["custom/menu", "sway/workspaces", "custom/scratchpad"],
"modules-center": ["custom/wf-recorder", "sway/mode", "custom/weather"],
"modules-center": ["custom/wf-recorder", "sway/mode"],
"modules-right": [
// informational
"sway/language",
@ -33,11 +33,10 @@
// connecting
"network",
"bluetooth",
"custom/valent",
// media
"custom/playerctl",
"custom/idle_inhibitor",
"custom/idle-inhibitor",
"custom/dnd",
"pulseaudio",
"backlight",
@ -69,7 +68,7 @@
"clock": {
"interval": 60,
"format": "{:%e %b %Y %H:%M}",
"format": "{:%a, %b %d %I:%M%p %Z %d/%m/%Y}",
"tooltip": true,
"tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
"on-click": "swaymsg exec \\$calendar"
@ -159,9 +158,9 @@
"format": "󰀼 {}",
"interval": 3600,
"return-type": "json",
"exec-if": "$HOME/.config/scripts/checkupdates.sh check",
"exec": "$HOME/.config/scripts/checkupdates.sh status",
"on-click": "$HOME/.config/scripts/checkupdates.sh check && swaymsg exec \\$update-manager",
"exec-if": "$HOME/.config/sway/scripts/checkupdates.sh check",
"exec": "$HOME/.config/sway/scripts/checkupdates.sh status",
"on-click": "$HOME/.config/sway/scripts/checkupdates.sh check && swaymsg exec \\$update-manager",
"on-click-middle": "waybar-signal pacman",
"signal": 14
},
@ -189,7 +188,7 @@
"one": "󰖯",
"many": "󰖲"
},
"exec": "/bin/sh $HOME/.config/scripts/scratchpad.sh",
"exec": "/bin/sh $HOME/.config/sway/scripts/scratchpad.sh",
"on-click": "swaymsg 'scratchpad show'",
"signal": 7
},
@ -203,9 +202,9 @@
"on": "󰌵",
"off": "󰌶"
},
"exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= $HOME/.config/scripts/sunset.sh",
"on-click": "$HOME/.config/scripts/sunset.sh toggle",
"exec-if": "$HOME/.config/scripts/sunset.sh check",
"exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= $HOME/.config/sway/scripts/sunset.sh",
"on-click": "$HOME/.config/sway/scripts/sunset.sh toggle",
"exec-if": "$HOME/.config/sway/scripts/sunset.sh check",
"signal": 6
},
@ -279,8 +278,8 @@
"tracking": "󰖷",
"stopped": "󰋣"
},
"exec": "$HOME/.config/waybar/scripts/zeit.sh status",
"on-click": "$HOME/.config/scripts/zeit.sh click; waybar-signal zeit",
"exec": "$HOME/.config/sway/scripts/zeit.sh status",
"on-click": "$HOME/.config/sway/scripts/zeit.sh click; waybar-signal zeit",
"exec-if": "[ -x \"$(command -v zeit)\" ]",
"signal": 10
},
@ -293,9 +292,9 @@
"default": "󰚢",
"dnd": "󰚣"
},
"on-click": "$HOME/.config/scripts/dnd.sh toggle; waybar-signal dnd",
"on-click-right": "$HOME/.config/scripts/dnd.sh restore",
"exec": "$HOME/.config/scripts/dnd.sh status",
"on-click": "$HOME/.config/sway/scripts/dnd.sh toggle; waybar-signal dnd",
"on-click-right": "$HOME/.config/sway/scripts/dnd.sh restore",
"exec": "$HOME/.config/sway/scripts/dnd.sh status",
"signal": 11
},
@ -308,9 +307,9 @@
"on": "󰃡",
"off": "󰃠"
},
"exec": "$HOME/.config/scripts/wluma.sh",
"on-click": "$HOME/.config/scripts/wluma.sh toggle",
"exec-if": "$HOME/.config/scripts/wluma.sh check",
"exec": "$HOME/.config/sway/scripts/wluma.sh",
"on-click": "$HOME/.config/sway/scripts/wluma.sh toggle",
"exec-if": "$HOME/.config/sway/scripts/wluma.sh check",
"signal": 12
},
@ -318,7 +317,7 @@
"format": "{icon}",
"tooltip": true,
"interval": 60,
"exec": "$HOME/.config/scripts/valent.py",
"exec": "$HOME/.config/sway/scripts/valent.py",
"exec-if": "[ -x \"$(command -v valent)\" ]",
"return-type": "json",
"format-icons": {
@ -333,7 +332,7 @@
"signal": 13
},
"custom/idle_inhibitor": {
"custom/idle-inhibitor": {
"interval": 60,
"return-type": "json",
"format": "{icon}",

View file

@ -1,2 +1,95 @@
@import "/usr/share/sway/templates/waybar/style.css";
@import url("../../.cache/wal/colors-waybar.css");
@define-color warning_color @color15;
@define-color error_color @color14;
@define-color focused_color @color8;
@keyframes blink-warning {
70% {
color: @wm_icon_bg;
}
to {
color: @wm_icon_bg;
background-color: @warning_color;
}
}
@keyframes blink-critical {
70% {
color: @wm_icon_bg;
}
to {
color: @wm_icon_bg;
background-color: @error_color;
}
}
* {
border-radius: 0;
border: none;
margin: 0;
min-height: 0;
padding: 0;
font-family: Font Awesome, "JetBrainsMono NF", "Roboto Mono", "Ubuntu", "Droid", "MesloLGL Nerd Font", Roboto, sans-serif;
}
window#waybar {
color: @foreground;
background: rgba(0, 0, 0, 0);
}
.modules-right,
.modules-left {
margin: 0;
padding: 2px 10px;
background-color: alpha(@background, 0.7);
}
.modules-right {
border-radius: 0 0 0 10px;
}
.modules-left {
border-radius: 0 0 10px 0;
}
#backlight,
#battery,
#bluetooth,
#clock,
#cpu,
#custom-adaptive-light,
#custom-clipboard,
#custom-dnd,
#custom-github,
#custom-idle-inhibitor,
#custom-menu,
#custom-scratchpad,
#custom-sunset,
#custom-weather,
#custom-zeit,
#language,
#memory,
#mode,
#network,
#network,
#pulseaudio,
#temperature,
#tray
{
padding: 0 10px;
}
#workspaces button {
padding-bottom: 2px;
color: @foreground;
}
#workspaces button.focused {
border-color: @focused_color;
}
#workspaces button.urgent {
border-color: @error_color;
color: @error_color;
}