✨ feat: Introduce customizable modules and settings for enhanced user experience

This commit is contained in:
sankalp committed 2025-07-29 21:03:08 +05:45
1 parent eaa3b7e17d
commit 5789013e2e
67 files changed
-29663

No files matched your search

-6
View File
@@ -1,6 +0,0 @@
from .data import *
# Import only specific names actually defined in data.py
# This prevents circular imports by not importing everything
from .data import APP_NAME, APP_NAME_CAP, CACHE_DIR, CONFIG_FILE, STATE_DIR
-1
View File
@@ -1 +0,0 @@
{}
-58
View File
@@ -1,58 +0,0 @@
{
"prefix_restart": "SHIFT ALT",
"suffix_restart": "T",
"prefix_bluetooth": "SHIFT ALT",
"suffix_bluetooth": "B",
"prefix_emoji": "SUPER",
"suffix_emoji": "E",
"prefix_cliphist": "SUPER",
"suffix_cliphist": "V",
"prefix_kanban": "SUPER",
"suffix_kanban": "T",
"prefix_toolbox": "SUPER",
"suffix_toolbox": "S",
"prefix_walls": "SUPER",
"suffix_walls": "W",
"prefix_launcher": "SUPER",
"suffix_launcher": "D",
"prefix_power": "SUPER",
"suffix_power": "X",
"prefix_tmux": "SUPER",
"suffix_tmux": "Z",
"prefix_notifications": "SUPER",
"suffix_notifications": "N",
"prefix_window_switcher": "ALT",
"suffix_window_switcher": "W",
"prefix_restart_inspector": "SUPER SHIFT",
"suffix_restart_inspector": "T",
"vertical": false,
"vertical_right_align": false,
"bottom_bar": true,
"centered_bar": true,
"terminal_command": "kitty -e",
"wallpapers_dir": "/home/sankalp/Pictures/wallpapers",
"dock_enabled": true,
"dock_always_occluded": false,
"dock_icon_size": 28,
"osd_enabled": true,
"bar_button_app_visible": true,
"bar_tray_visible": true,
"bar_workspaces_visible": true,
"bar_metrics_visible": true,
"bar_language_visible": true,
"bar_date_time_visible": true,
"bar_updates_visible": true,
"bar_indicators_visible": true,
"corners_visible": true,
"bar_metrics_disks": [
"/"
],
"metrics_visible": {
"cpu": true,
"ram": true,
"disk": true,
"swap": true,
"gpu": false
},
"enabled_osd": true
}
File diff suppressed because it is too large. Load diff
-17
View File
@@ -1,17 +0,0 @@
{
"commands": {
"/wp": "launcher.open(\"wallpapers\")",
"/em": "launcher.open(\"emoji\")",
"/ch": "launcher.open(\"cliphist\")",
"/kb": "launcher.open(\"kanban\")",
"/bt": "launcher.open(\"bluetooth\")",
"/sh": "launcher.open(\"sh\")",
"/pw": "launcher.open(\"power\")",
"/nw": "launcher.open(\"wifi\")",
"/cl": "launcher.open(\"calendar\")",
"/tl": "launcher.open(\"tools\")",
"/tx": "launcher.open(\"tmux\")",
"/ws": "launcher.open(\"window-switcher\")"
},
"pinned_apps": []
}
-1292
View File
File diff suppressed because it is too large. Load diff
-120
View File
@@ -1,120 +0,0 @@
import os
import json
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GLib
from fabric.utils import get_relative_path
APP_NAME = "modus"
APP_NAME_CAP = "Modus"
CACHE_DIR = str(GLib.get_user_cache_dir()) + f"/{APP_NAME}"
STATE_DIR = str(GLib.get_user_state_dir() + f"/{APP_NAME}")
USERNAME = os.getlogin()
HOSTNAME = os.uname().nodename
HOME_DIR = os.path.expanduser("~")
CONFIG_DIR = os.path.expanduser(f"~/{APP_NAME}")
screen = Gdk.Screen.get_default()
CURRENT_WIDTH = screen.get_width()
CURRENT_HEIGHT = screen.get_height()
WALLPAPERS_DIR_DEFAULT = get_relative_path("../assets/wallpaper")
MATUGEN_STATE_FILE = os.path.join(CONFIG_DIR, "matugen")
CONFIG_FILE = get_relative_path("../config/assets/config.json")
if os.path.exists(CONFIG_FILE):
with open(CONFIG_FILE, "r") as f:
config = json.load(f)
WALLPAPERS_DIR = config.get("wallpapers_dir", WALLPAPERS_DIR_DEFAULT)
VERTICAL = config.get("vertical", False) # Use saved value or False as default
VERTICAL_RIGHT_ALIGN = config.get("vertical_right_align", False) # Right side by default
BOTTOM_BAR = config.get("bottom_bar", False) # Use saved value or False as default
CENTERED_BAR = config.get("centered_bar", False) # Load centered bar setting
TERMINAL_COMMAND = config.get(
"terminal_command", "kitty -e"
) # Load terminal command
DOCK_ENABLED = config.get("dock_enabled", True) # Load dock visibility setting
DOCK_ALWAYS_OCCLUDED = config.get(
"dock_always_occluded", False
) # Load dock hover-only setting
DOCK_ICON_SIZE = config.get("dock_icon_size", 28) # Load dock icon size setting
OSD_ENABLED = config.get("osd_enabled", True) # Load OSD visibility setting
# Load bar component visibility settings
BAR_COMPONENTS_VISIBILITY = {
"button_app": config.get("bar_button_app_visible", True),
"tray": config.get("bar_tray_visible", True),
# "button_tools": config.get("bar_button_tools_visible", True),
"workspaces": config.get("bar_workspaes_visible", True),
"metrics": config.get("bar_metrics_visible", True),
"language": config.get("bar_language_visible", True),
"date_time": config.get("bar_date_time_visible", True),
"updates": config.get("bar_updates_visible", True),
"indicators": config.get("bar_indicators", True),
}
BAR_METRICS_DISKS = config.get("bar_metrics_disks", ["/"])
METRICS_VISIBLE = config.get(
"metrics_visible",
{"cpu": True, "ram": True, "disk": True, "swap": True},
)
else:
WALLPAPERS_DIR = WALLPAPERS_DIR_DEFAULT
VERTICAL = False # Default value when no config exists
VERTICAL_RIGHT_ALIGN = False # Default to right alignment
BOTTOM_BAR = False # Default value for bottom bar
CENTERED_BAR = False # Default value for centered bar
DOCK_ENABLED = True # Default value for dock visibility
DOCK_ALWAYS_OCCLUDED = False # Default value for dock hover-only mode
OSD_ENABLED = True # Default value for OSD visibility
TERMINAL_COMMAND = "kitty -e" # Default terminal command when no config
DOCK_ICON_SIZE = 28 # Default dock icon size when no config
# Default values for component visibility (all visible)
BAR_COMPONENTS_VISIBILITY = {
"button_aps": True,
"tray": True,
# "button_tools": True,
"workspaces": True,
"metrics": True,
"language": True,
"date_time": True,
"indicators": True,
"updates": True,
}
BAR_METRICS_DISKS = ["/"]
METRICS_VISIBLE = {
"cpu": True,
"ram": True,
"disk": True,
"swap": True,
}
def read_config():
config_path = get_relative_path("./assets/modus.json")
with open(config_path, "r") as file:
# Load JSON data into a Python dictionary
data = json.load(file)
return data
def load_config():
"""Load the configuration from config.json"""
config_path = get_relative_path("./assets/config.json")
config = {}
if os.path.exists(config_path):
try:
with open(config_path, "r") as f:
config = json.load(f)
except Exception as e:
print(f"Error loading config: {e}")
return config
-11
View File
@@ -1,11 +0,0 @@
$wallpaper = /home/sankalp/Pictures/wallpapers/background.png
$background = 0e1514
$foreground = dde4e2
$primary = 81d5ca
$secondary = b1ccc7
$tertiary = aec9e6
$surface = 0e1514
$surface_bright = 343a39
$outline = 899390
$error = ff5945
-41
View File
@@ -1,41 +0,0 @@
listener {
timeout = 500 # in seconds.
on-timeout = notify-send "You are idle!" # command to run when timeout has passed.
on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}
-150
View File
@@ -1,150 +0,0 @@
source = ~/Modus/config/hypr/colors.conf
# Configuration
# (general settings)
general {
grace = 2
hide_cursor = true
ignore_empty_input = true
text_trim = true
}
# (background config)
background {
monitor =
path = $wallpaper # only png supported for now
# color = rgba(26,17,16, 1.0)
blur_passes = 3 # 0 disables blurring
blur_size = 1
noise = 0.01
contrast = 0.8916
brightness = 0.7
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
# Password input
input-field {
monitor =
size = 256, 48
outline_thickness = -1
dots_size = 0.33
dots_spacing = 0.45
dots_center = true
dots_rounding = -1
outer_color = rgba(0,0,0,0)
inner_color = rgba(0,0,0,0)
font_color = 0xff$foreground
fade_on_empty = true
fade_timeout = 1000
font_family = Product Sans
placeholder_text =
hide_input = false
rounding = 4
check_color = 0xff$tertiary
fail_color = 0xff$error
capslock_color = 0xff$secondary
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i>
fail_transition = 200
capslock_color = -1
numlock_color = -1
bothlock_color = -1
invert_numlock = false
swap_font_color = false
position = 0, 150
halign = center
valign = bottom
}
#
# Time
# (hours)
label {
monitor =
text = cmd[update:1000] echo -e "$(date +"%H")"
color = 0xff$foreground
shadow_pass = 2
shadow_size = 3
shadow_color = rgb(0,0,0)
shadow_boost = 1.2
font_size = 150
font_family = Product Sans Light
position = 0, 90
halign = center
valign = center
}
# (minutes)
label {
monitor =
text = cmd[update:1000] echo -e "$(date +"%M")"
color = 0xff$foreground
font_size = 150
font_family = Product Sans Light
position = 0, -90
halign = center
valign = center
}
#
# Date
# (label)
label {
monitor =
text = cmd[update:1000] echo -e "$(date +"%A, %B %d")"
color = 0xff$foreground
font_size = 15
font_family = Product Sans Medium
position = 100, -75
shadow_passes = 5
shadow_size = 10
halign = left
valign = top
}
# (icon)
label {
monitor =
text = calendar_today
color = 0xff$foreground
font_size = 15
font_family = Material Symbols Outlined
position = 75, -75
shadow_passes = 5
shadow_size = 10
halign = left
valign = top
}
#
# Input layout
# (label)
label {
monitor =
text = $LAYOUT
color = 0xff$foreground
font_size = 15
font_family = Product Sans Medium
position = 100, -110
shadow_passes = 5
shadow_size = 10
halign = left
valign = top
}
# (icon)
label {
monitor =
text = keyboard
color = 0xff$foreground
font_size = 15
font_family = Material Symbols Outlined
position = 75, -112
shadow_passes = 5
shadow_size = 10
halign = left
valign = top
}
#
-88
View File
@@ -1,88 +0,0 @@
# Generated by Modus - DO NOT EDIT MANUALLY
exec-once = python /home/sankalp/Modus/main.py
exec = pgrep -x "hypridle" > /dev/null || hypridle
exec = swww-daemon
exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store
$fabricSend = fabric-cli exec modus
$scriptsDir = /home/sankalp/Modus/config/scripts/
# Key Bindings
bind = SHIFT ALT, T, exec, killall modus; python /home/sankalp/Modus/main.py # Reload Modus
bind = SHIFT ALT, B, exec, $fabricSend 'launcher.open("bluetooth")' # Bluetooth
bind = SUPER, N, exec, $fabricSend 'launcher.open("notification-center")' # Notifications
bind = SUPER, E, exec, $fabricSend 'launcher.open("emoji")' # Emoji
bind = SUPER, V, exec, $fabricSend 'launcher.open("cliphist")' # Clipboard History
bind = SUPER, T, exec, $fabricSend 'launcher.open("kanban")' # Kanban
bind = SUPER, Z, exec, $fabricSend 'launcher.open("tmux")' # Tmux Manager
bind = SUPER, S, exec, $fabricSend 'launcher.open("tools")' # Toolbox
bind = SUPER, W, exec, $fabricSend 'launcher.open("wallpapers")' # Wallpaper Selector
bind = SUPER, D, exec, $fabricSend 'launcher.open("launcher")' # App Launcher
bind = ALT, W, exec, $fabricSend 'launcher.open("window-switcher")' # Window Switcher
bind = SUPER, X, exec, $fabricSend 'launcher.open("power")' # Power Menu
bind = SUPER SHIFT, T, exec, killall modus; GTK_DEBUG=interactive python /home/sankalp/Modus/main.py # Restart with inspector
# Wallpapers directory: /home/sankalp/Pictures/wallpapers
# Source color scheme
source = /home/sankalp/Modus/config/hypr/colors.conf
general {
col.active_border = 0xff$primary
col.inactive_border = 0xff$surface
gaps_in = 2
gaps_out = 4
border_size = 2
layout = dwindle
}
decoration {
blur {
enabled = yes
size = 5
passes = 3
new_optimizations = yes
contrast = 1
brightness = 1
}
rounding = 14
shadow {
enabled = true
range = 10
render_power = 2
color = rgba(0, 0, 0, 0.25)
}
}
animations {
enabled = true
# Animation curves
bezier = linear, 0, 0, 1, 1
bezier = md3_standard, 0.2, 0, 0, 1
bezier = md3_decel, 0.05, 0.7, 0.1, 1
bezier = md3_accel, 0.3, 0, 0.8, 0.15
bezier = overshot, 0.05, 0.9, 0.1, 1.1
bezier = crazyshot, 0.1, 1.5, 0.76, 0.92
bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0
bezier = menu_decel, 0.1, 1, 0, 1
bezier = menu_accel, 0.38, 0.04, 1, 0.07
bezier = easeInOutCirc, 0.85, 0, 0.15, 1
bezier = easeOutCirc, 0, 0.55, 0.45, 1
bezier = easeOutExpo, 0.16, 1, 0.3, 1
bezier = softAcDecel, 0.26, 0.26, 0.15, 1
bezier = md2, 0.4, 0, 0.2, 1
animation = windows, 1, 3, md3_decel, popin 60%
animation = windowsIn, 1, 3, md3_decel, popin 60%
animation = windowsOut, 1, 3, md3_accel, popin 60%
animation = border, 1, 10, default
animation = fade, 1, 3, md3_decel
animation = layers, 1, 2, md3_decel, slide
animation = layersIn, 1, 3, menu_decel, slide
animation = layersOut, 1, 1.6, menu_accel, slide
animation = fadeLayersIn, 1, 2, menu_decel
animation = fadeLayersOut, 1, 4.5, menu_accel
animation = workspaces, 1, 7, menu_decel, slide
animation = specialWorkspace, 1, 3, md3_decel, slidevert
}
@@ -1,11 +0,0 @@
$wallpaper = {{image}}
$background = {{colors.background.default.hex_stripped}}
$foreground = {{colors.on_background.default.hex_stripped}}
$primary = {{colors.primary.default.hex_stripped}}
$secondary = {{colors.secondary.default.hex_stripped}}
$tertiary = {{colors.tertiary.default.hex_stripped}}
$surface = {{colors.surface.default.hex_stripped}}
$surface_bright = {{colors.surface_bright.default.hex_stripped}}
$outline = {{colors.outline.default.hex_stripped}}
$error = {{colors.error.default.hex_stripped | set_lightness: -20.0}}
-44
View File
@@ -1,44 +0,0 @@
:vars {
--foreground: {{colors.on_background.default.hex}};
--background: {{colors.background.default.hex}};
--cursor: {{colors.on_background.default.hex}};
--primary: {{colors.primary.default.hex}};
--primary-container: {{colors.primary_container.default.hex}};
--on-primary: {{colors.on_primary.default.hex}};
--on-primary-container: {{colors.on_primary_container.default.hex}};
--secondary: {{colors.secondary.default.hex}};
--on-secondary: {{colors.on_secondary.default.hex}};
--secondary-container: {{colors.secondary_container.default.hex}};
--tertiary: {{colors.tertiary.default.hex}};
--tertiary-container: {{colors.tertiary_container.default.hex}};
--on-tertiary: {{colors.on_tertiary.default.hex}};
--on-tertiary-container: {{colors.on_tertiary_container.default.hex}};
--surface: {{colors.surface.default.hex}};
--surface-container: {{colors.surface_container.default.hex}};
--surface-bright: {{colors.surface_bright.default.hex}};
--surface-variant: {{colors.surface_variant.default.hex}};
--surface-container-low: {{colors.surface_container_low.default.hex}};
--on-surface: {{colors.on_surface.default.hex}};
--error: {{colors.error.default.hex}};
--error-dim: {{colors.error.default.hex | set_lightness: -10.0}};
--on-error: {{colors.on_error.default.hex}};
--error-container: {{colors.error_container.default.hex}};
--on-error-container: {{colors.on_error_container.default.hex}};
--outline: {{colors.outline.default.hex}};
--outline-variant: {{colors.outline_variant.default.hex}};
--shadow: {{colors.shadow.default.hex}};
--red: {{colors.red.default.hex}};
--red-dim: {{colors.red.default.hex | set_lightness: -10.0}};
--green: {{colors.green.default.hex}};
--green-dim: {{colors.green.default.hex | set_lightness: -10.0}};
--yellow: {{colors.yellow.default.hex}};
--yellow-dim: {{colors.yellow.default.hex | set_lightness: -10.0}};
--blue: {{colors.blue.default.hex}};
--blue-dim: {{colors.blue.default.hex | set_lightness: -10.0}};
--magenta: {{colors.magenta.default.hex}};
--magenta-dim: {{colors.magenta.default.hex | set_lightness: -10.0}};
--cyan: {{colors.cyan.default.hex}};
--cyan-dim: {{colors.cyan.default.hex | set_lightness: -10.0}};
--white: {{colors.white.default.hex}};
}
-29
View File
@@ -1,29 +0,0 @@
@use "sass:color";
<* for name, value in colors *>
${{name}}: {{value.default.hex}};
<* endfor *>
// Custom Color
$red: {{colors.red.default.hex}};
$red-dim: {{colors.red.default.hex | set_lightness: -10.0}};
$green: {{colors.green.default.hex}};
$green-dim: {{colors.green.default.hex | set_lightness: -10.0}};
$yellow: {{colors.yellow.default.hex}};
$yellow-dim: {{colors.yellow.default.hex | set_lightness: -10.0}};
$blue: {{colors.blue.default.hex}};
$blue-dim: {{colors.blue.default.hex | set_lightness: -10.0}};
$magenta: {{colors.magenta.default.hex}};
$magenta-dim: {{colors.magenta.default.hex | set_lightness: -10.0}};
$cyan: {{colors.cyan.default.hex}};
$cyan-dim: {{colors.cyan.default.hex | set_lightness: -10.0}};
$white: {{colors.white.default.hex}};
$theme: 'dark';
$surface_transparent: color.scale($surface, $alpha: -20%);
$inverse_surface_transparent: color.scale($inverse_surface, $alpha: -92%);
$inverse_surface_transparent_variant: color.scale(
$inverse_surface,
$alpha: -82%
);
$inverse_surface_transparent_overlay: linear-gradient(0deg, $inverse_surface_transparent, $inverse_surface_transparent);
$inverse_surface_transparent_variant_overlay: linear-gradient(0deg, $inverse_surface_transparent_variant, $inverse_surface_transparent_variant);
-166
View File
@@ -1,166 +0,0 @@
#!/bin/bash
# Print usage information
print_usage() {
cat <<"EOF"
Usage: screen-tools.sh [mode] [option]
Modes:
screenshot [option] Take a screenshot
Options:
p Print all screens
s Snip current screen
sf Snip current screen (frozen)
m Print focused monitor
[mockup] Optional: Add mockup effect to screenshot
record Start/Stop screen recording
ocr Perform OCR on selected area
EOF
}
# OCR functionality
do_ocr() {
sleep 0.25
ocr_text=$(grimblast --freeze save area - | tesseract -l eng - - 2>/dev/null)
# Check if OCR was successful
if [[ -n "$ocr_text" ]]; then
echo -n "$ocr_text" | wl-copy
notify-send -a "Modus" "OCR Success" "Text Copied to Clipboard"
else
notify-send -a "Modus" "OCR Failed" "No text recognized or operation failed"
fi
}
# Screen recording functionality
do_screenrecord() {
if [ -z "$XDG_VIDEOS_DIR" ]; then
XDG_VIDEOS_DIR="$HOME/Videos"
fi
local save_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}/Recordings"
mkdir -p "$save_dir"
if pgrep -f "gpu-screen-recorder" >/dev/null; then
pkill -SIGINT -f "gpu-screen-recorder"
sleep 1
local last_video=$(ls -t "$save_dir"/*.mp4 2>/dev/null | head -n 1)
local action=$(notify-send -a "Modus" "⬜ Recording stopped" \
-A "view=View" -A "open=Open folder")
if [ "$action" = "view" ] && [ -n "$last_video" ]; then
xdg-open "$last_video"
elif [ "$action" = "open" ]; then
xdg-open "$save_dir"
fi
exit 0
fi
local output_file="$save_dir/$(date +%Y-%m-%d-%H-%M-%S).mp4"
notify-send -a "Modus" "🔴 Recording started"
gpu-screen-recorder -w screen -q ultra -a default_output -ac opus -cr full -f 60 -o "$output_file"
}
# Screenshot functionality
do_screenshot() {
sleep 0.25
if [ -z "$XDG_PICTURES_DIR" ]; then
XDG_PICTURES_DIR="$HOME/Pictures"
fi
local save_dir="${3:-$XDG_PICTURES_DIR/Screenshots}"
local save_file=$(date +'%y%m%d_%Hh%Mm%Ss_screenshot.png')
local full_path="$save_dir/$save_file"
mkdir -p "$save_dir"
local mockup_mode="$2"
case $1 in
p) grimblast copysave screen "$full_path" ;;
s) grimblast copysave area "$full_path" ;;
sf) grimblast --freeze copysave area "$full_path" ;;
m) grimblast copysave output "$full_path" ;;
*)
echo "Invalid screenshot mode"
print_usage
exit 1
;;
esac
if [ -f "$full_path" ]; then
if [ "$mockup_mode" = "mockup" ]; then
local temp_file="${full_path%.png}_temp.png"
cropped_file="${full_path%.png}_cropped.png"
local mockup_file="${full_path%.png}_mockup.png"
# First crop the top pixel using a different approach
# Use +0+1 to start at y-coordinate 1 (skipping the first pixel row)
magick "$full_path" -crop +0+1 +repage "$cropped_file"
magick "$cropped_file" \
\( +clone -alpha extract -draw 'fill black polygon 0,0 0,20 20,0 fill white circle 20,20 20,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
\) -alpha off -compose CopyOpacity -composite "$temp_file"
magick "$temp_file" \
\( +clone -background black -shadow 60x20+0+10 -alpha set -channel A -evaluate multiply 1 +channel \) \
+swap -background none -layers merge +repage "$mockup_file"
rm "$temp_file" "$cropped_file"
mv "$mockup_file" "$full_path"
if command -v wl-copy >/dev/null 2>&1; then
wl-copy <"$full_path"
elif command -v xclip >/dev/null 2>&1; then
xclip -selection clipboard -t image/png <"$full_path"
fi
fi
local action=$(notify-send -a "Modus" -i "$full_path" "Screenshot saved" "in $full_path" \
-A "view=View" -A "edit=Edit" -A "open=Open Folder")
case "$action" in
view) xdg-open "$full_path" ;;
edit) swappy -f "$full_path" ;;
open) xdg-open "$save_dir" ;;
esac
else
notify-send -a "Modus" "Screenshot Aborted"
fi
}
# Handle command line arguments
if [ $# -eq 0 ]; then
print_usage
exit 1
fi
case "$1" in
screenshot)
if [ $# -lt 2 ]; then
echo "Error: Screenshot mode requires an option"
print_usage
exit 1
fi
do_screenshot "$2" "$3"
;;
record)
do_screenrecord
;;
ocr)
do_ocr
;;
*)
echo "Error: Invalid mode '$1'"
print_usage
exit 1
;;
esac
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/env sh
# Check if animations are disabled (game mode is active)
check_gamemode() {
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 0 ]; then
echo "t"
return 0
else
echo "f"
return 1
fi
}
# Toggle game mode state
toggle_gamemode() {
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ]; then
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:shadow:enabled 0;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0"
exit
fi
hyprctl reload
}
# Main script logic
case "$1" in
check)
check_gamemode
;;
*)
toggle_gamemode
;;
esac
-75
View File
@@ -1,75 +0,0 @@
#!/bin/bash
pick_rgb() {
# Execute hyprpicker with RGB format and save the output to a variable
hyprpicker -a -n -f rgb && sleep 0.1
# Create a temporal 64x64 PNG file with the color in /tmp using convert
magick -size 64x64 xc:"rgb($(wl-paste))" /tmp/color.png
# Send a notification using the file as an icon
notify-send "RGB color picked" "rgb($(wl-paste))" -i /tmp/color.png -a "Hyprpicker"
# Remove the temporal file
rm /tmp/color.png
# Exit
exit 0
}
pick_hex() {
# Execute hyprpicker and save the output to a variable
hyprpicker -a -n -f hex && sleep 0.1
# Create a temporal 64x64 PNG file with the color in /tmp using convert
magick -size 64x64 xc:"$(wl-paste)" /tmp/color.png
# Send a notification using the file as an icon
notify-send "HEX color picked" "$(wl-paste)" -i /tmp/color.png -a "Hyprpicker"
# Remove the temporal file
rm /tmp/color.png
# Exit
exit 0
}
pick_hsv() {
# Copy the color to the clipboard
echo -n "$(hyprpicker -n -f hsv)" | wl-copy -n
# Create a temporal 64x64 PNG file with the color in /tmp using convert
magick -size 64x64 xc:"hsv($(wl-paste))" /tmp/color.png
# Send a notification using the file as an icon
notify-send "HSV color picked" "hsv($(wl-paste))" -i /tmp/color.png -a "Hyprpicker"
# Remove the temporal file
rm /tmp/color.png
# Exit
exit 0
}
case "$1" in
-rgb)
pick_rgb
;;
-hsv)
pick_hsv
;;
-hex)
pick_hex
;;
*)
echo "Usage: $0 [-rgb|-hex|-hsv]"
exit 1
;;
esac
-182
View File
@@ -1,182 +0,0 @@
#!/bin/bash
# Word of caution: Changing this may break the update module, be careful!
# Function to check updates for Arch-based distros
check_arch_updates() {
official_updates=0
aur_updates=0
flatpak_updates=0
tooltip=""
# Get the number of official updates
official_updates=$(checkupdates 2>/dev/null | wc -l)
# Determine the AUR helper
if command -v paru &>/dev/null; then
aur_helper="paru"
else
aur_helper="yay"
fi
# Get the number of AUR updates
aur_updates=$($aur_helper -Qum 2>/dev/null | wc -l)
# Check for Flatpak updates
if command -v flatpak &>/dev/null; then
flatpak_updates=$(flatpak remote-ls --updates | wc -l)
fi
# Calculate total updates
total_updates=$((official_updates + aur_updates + flatpak_updates))
# Build the tooltip
tooltip="󰣇 Official: $official_updates\n󰮯 AUR: $aur_updates\n Flatpak: $flatpak_updates"
# Output JSON
echo "{\"total\":\"$total_updates\", \"tooltip\":\"$tooltip\"}"
}
# Function to check updates for Ubuntu-based distros
check_ubuntu_updates() {
official_updates=0
flatpak_updates=0
tooltip=""
# Get the number of official updates
official_updates=$(apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst)
# Check for Flatpak updates
if command -v flatpak &>/dev/null; then
flatpak_updates=$(flatpak remote-ls --updates | wc -l)
fi
# Calculate total updates
total_updates=$((official_updates + flatpak_updates))
# Build the tooltip
tooltip="󰕈 Official: $official_updates\n Flatpak: $flatpak_updates"
# Output JSON
echo "{\"total\":\"$total_updates\", \"tooltip\":\"$tooltip\"}"
}
# Function to check updates for Fedora-based distros
check_fedora_updates() {
official_updates=0
flatpak_updates=0
tooltip=""
# Get the number of official updates
official_updates=$(dnf list updates -q | tail -n +2 | wc -l)
# Check for Flatpak updates
if command -v flatpak &>/dev/null; then
flatpak_updates=$(flatpak remote-ls --updates | wc -l)
fi
# Calculate total updates
total_updates=$((official_updates + flatpak_updates))
# Build the tooltip
tooltip="󰣛 Official: $official_updates\n Flatpak: $flatpak_updates"
# Output JSON
echo "{\"total\":\"$total_updates\", \"tooltip\":\"$tooltip\"}"
}
# Function to check updates for openSUSE-based distros
check_opensuse_updates() {
official_updates=0
flatpak_updates=0
tooltip=""
# Get the number of official updates (skip header lines)
official_updates=$(zypper lu | tail -n +3 | wc -l)
# Check for Flatpak updates
if command -v flatpak &>/dev/null; then
flatpak_updates=$(flatpak remote-ls --updates | wc -l)
fi
# Calculate total updates
total_updates=$((official_updates + flatpak_updates))
# Build the tooltip
tooltip=" Official: $official_updates\n Flatpak: $flatpak_updates"
# Output JSON
echo "{\"total\":\"$total_updates\", \"tooltip\":\"$tooltip\"}"
}
# Function to update Arch-based distros
update_arch() {
kitty --title "System Update" sh -c "
fastfetch
yay -Syu
read -n 1 -p 'Press any key to continue...'
"
}
# Function to update Ubuntu-based distros
update_ubuntu() {
kitty --title "System Update" sh -c "
neofetch
sudo apt update && sudo apt upgrade -y
read -n 1 -p 'Press any key to continue...'
"
}
# Function to update Fedora-based distros
update_fedora() {
kitty --title "System Update" sh -c "
neofetch
sudo dnf upgrade -y
read -n 1 -p 'Press any key to continue...'
"
}
# Function to update openSUSE-based distros
update_opensuse() {
kitty --title "System Update" sh -c "
neofetch
sudo zypper up -y
read -n 1 -p 'Press any key to continue...'
"
}
# Main case handling for different distributions
case "$1" in
-arch)
if [ -z "$2" ]; then
check_arch_updates
else
update_arch
fi
;;
-ubuntu)
if [ -z "$2" ]; then
check_ubuntu_updates
else
update_ubuntu
fi
;;
-fedora)
if [ -z "$2" ]; then
check_fedora_updates
else
update_fedora
fi
;;
-suse)
if [ -z "$2" ]; then
check_opensuse_updates
else
update_opensuse
fi
;;
*)
echo "Usage: $0 [-arch|-ubuntu|-fedora|-suse] [up (optional)]"
exit 1
;;
esac