From eccc27307fcaa46552334bc06bda087b5aa9dc0a Mon Sep 17 00:00:00 2001 From: eshanized Date: Mon, 6 Jan 2025 23:22:10 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat:=20add=20shell=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/local/bin/apply.sh | 30 +++++++++++++++++++++++++++ usr/local/bin/start.sh | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 usr/local/bin/apply.sh create mode 100644 usr/local/bin/start.sh diff --git a/usr/local/bin/apply.sh b/usr/local/bin/apply.sh new file mode 100644 index 0000000..60cee01 --- /dev/null +++ b/usr/local/bin/apply.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Usage: import-gsettings +# This script imports GTK settings from a configuration file and applies them using gsettings. + +# Define the configuration file path +CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" + +# Exit if the configuration file does not exist +if [ ! -f "$CONFIG" ]; then + echo "Configuration file not found: $CONFIG" >&2 + exit 1 +fi + +# Define the GNOME schema for settings +GNOME_SCHEMA="org.gnome.desktop.interface" + +# Extract settings from the configuration file +GTK_THEME="$(grep -E '^gtk-theme-name' "$CONFIG" | cut -d'=' -f2 | xargs)" +ICON_THEME="$(grep -E '^gtk-icon-theme-name' "$CONFIG" | cut -d'=' -f2 | xargs)" +CURSOR_THEME="$(grep -E '^gtk-cursor-theme-name' "$CONFIG" | cut -d'=' -f2 | xargs)" +FONT_NAME="$(grep -E '^gtk-font-name' "$CONFIG" | cut -d'=' -f2 | xargs)" + +# Validate and apply each setting +[ -n "$GTK_THEME" ] && gsettings set "$GNOME_SCHEMA" gtk-theme "$GTK_THEME" +[ -n "$ICON_THEME" ] && gsettings set "$GNOME_SCHEMA" icon-theme "$ICON_THEME" +[ -n "$CURSOR_THEME" ] && gsettings set "$GNOME_SCHEMA" cursor-theme "$CURSOR_THEME" +[ -n "$FONT_NAME" ] && gsettings set "$GNOME_SCHEMA" font-name "$FONT_NAME" + +echo "Settings successfully imported from $CONFIG." diff --git a/usr/local/bin/start.sh b/usr/local/bin/start.sh new file mode 100644 index 0000000..bea2fdc --- /dev/null +++ b/usr/local/bin/start.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +cd ~ # Ensure we're starting in the user's home directory + +# GTK2 configuration +export GTK2_RC_FILES="$HOME/.gtkrc-2.0" # Set GTK2 configuration file + +# Session and desktop environment +export XDG_SESSION_TYPE=wayland # Set session type to Wayland +export XDG_SESSION_DESKTOP=hyprland # Set desktop environment to Hyprland + +# Mozilla Firefox and Wayland integration +export MOZ_ENABLE_WAYLAND=1 # Enable Firefox in Wayland mode +export MOZ_DBUS_REMOTE=1 # Fixes "Firefox is already running, but not responding" +export MOZ_WAYLAND_USE_VAAPI=1 # Enable VAAPI for hardware-accelerated video +export GDK_BACKEND=wayland,x11 # Use Wayland if available, fallback to X11 if not + +# Elementary and Clutter settings +export ECORE_EVAS_ENGINE=wayland-egl # Use Wayland EGL for EFL applications +export ELM_ENGINE=wayland_egl # Use Wayland EGL engine for elementary apps + +# Java settings +export _JAVA_AWT_WM_NONREPARENTING=1 # Disables AWT window reparenting in Java apps +export NO_AT_BRIDGE=1 # Disable assistive technologies (AT) bridge + +# Wayland-specific backend for bemenu +export BEMENU_BACKEND=wayland # Set bemenu to use Wayland backend + +# SDL (Simple DirectMedia Layer) settings +export SDL_VIDEODRIVER=wayland # Force SDL to use Wayland backend (could cause issues with older SDL games) + +# Qt application settings +export QT_QPA_PLATFORM=wayland # Force Qt to use Wayland as its platform + +# FZF default options for better color scheme and readability +export FZF_DEFAULT_OPTS=" \ +--color=bg+:-1,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \ +--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \ +--color=marker:#f5e0dc,fg+:#a6e3a1,prompt:#cba6f7,hl+:#f38ba8" + +# Allow user to customize this script by overriding with a personal script +hyprstart="$HOME/.config/hypr/hyprstart" # Path to user-defined script +[ -x $hyprstart ] && . $hyprstart # Source the script if it exists and is executable + +# Launch Hyprland +exec Hyprland # Start the Hyprland Wayland compositor