diff --git a/.settings/browser.sh b/.settings/browser.sh index 4994c67..3f99ac0 100755 --- a/.settings/browser.sh +++ b/.settings/browser.sh @@ -1 +1 @@ -chromium \ No newline at end of file +brave diff --git a/.settings/networkmanager.sh b/.settings/networkmanager.sh index 14ecab4..a3a46da 100755 --- a/.settings/networkmanager.sh +++ b/.settings/networkmanager.sh @@ -1,2 +1 @@ -# nm-connection-editor alacritty -e nmtui \ No newline at end of file diff --git a/hypr/conf/animation.conf b/hypr/conf/animation.conf index eb0250a..22756e7 100644 --- a/hypr/conf/animation.conf +++ b/hypr/conf/animation.conf @@ -1 +1 @@ -source = ~/dotfiles/hypr/conf/animations/default.conf \ No newline at end of file +source = ~/dotfiles/hypr/conf/animations/animations-fast.conf diff --git a/hypr/conf/animations/default.conf b/hypr/conf/animations/default.conf index 566f68c..ba78c65 100644 --- a/hypr/conf/animations/default.conf +++ b/hypr/conf/animations/default.conf @@ -1,6 +1,6 @@ # ----------------------------------------------------- # Animations -# name: "Default" +# name "Default" # ----------------------------------------------------- animations { enabled = true diff --git a/hypr/conf/keyboard.conf b/hypr/conf/keyboard.conf index bc2d785..3f6bf51 100644 --- a/hypr/conf/keyboard.conf +++ b/hypr/conf/keyboard.conf @@ -1,12 +1,13 @@ # ----------------------------------------------------- # Keyboard Layout +# https://wiki.hyprland.org/Configuring/Variables/#input # ----------------------------------------------------- input { - kb_layout = us + kb_layout = de kb_variant = kb_model = kb_options = - + follow_mouse = 1 touchpad { natural_scroll = false diff --git a/hypr/conf/monitor.conf b/hypr/conf/monitor.conf index 6be3934..b92ff66 100644 --- a/hypr/conf/monitor.conf +++ b/hypr/conf/monitor.conf @@ -1 +1 @@ -source = ~/dotfiles/hypr/conf/monitors/default.conf +source = ~/dotfiles/hypr/conf/monitors/2560x1440@120.conf diff --git a/hypr/conf/monitors/1920x1080.conf b/hypr/conf/monitors/1920x1080.conf index 980be0e..03c52f7 100644 --- a/hypr/conf/monitors/1920x1080.conf +++ b/hypr/conf/monitors/1920x1080.conf @@ -3,4 +3,5 @@ # name: "Default" # ----------------------------------------------------- -monitor=,1920x1080,auto,1 \ No newline at end of file +monitor=,1920x1080,auto,1 +# 122314 lkasldkasl kjd diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index cddb0b7..0fbd1b6 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -5,7 +5,6 @@ # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| # |___/|_| # -# by Stephan Raabe (2023) # ----------------------------------------------------- # ----------------------------------------------------- @@ -56,4 +55,4 @@ source = ~/dotfiles/hypr/conf/custom.conf # ----------------------------------------------------- # Environment for xdg-desktop-portal-hyprland # ----------------------------------------------------- -exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP \ No newline at end of file +# exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP \ No newline at end of file diff --git a/hypr/scripts/settings.sh b/hypr/scripts/settings.sh new file mode 100755 index 0000000..40159f0 --- /dev/null +++ b/hypr/scripts/settings.sh @@ -0,0 +1,2 @@ +cd ~/hyprland-settings +./settings.sh dotfiles \ No newline at end of file diff --git a/hypr/settings/.library/excludes.txt b/hypr/settings/.library/excludes.txt new file mode 100644 index 0000000..4cc686b --- /dev/null +++ b/hypr/settings/.library/excludes.txt @@ -0,0 +1,9 @@ +.gitignore +.git +.dev +README.md +CHANGELOG +LICENSE +install.sh +create.sh +.target.sh \ No newline at end of file diff --git a/hypr/settings/.library/library.sh b/hypr/settings/.library/library.sh new file mode 100644 index 0000000..2a0e7db --- /dev/null +++ b/hypr/settings/.library/library.sh @@ -0,0 +1,254 @@ +# Settings Library + +# Load module +_getModules() { + clear + + # Get path to parent folder to go back + back="$(dirname "$1")" + + # Load module config + if [ -f $1/init.sh ]; then + source $1/init.sh + fi + + # Load module config + if [ -f $1/config.sh ]; then + source $1/config.sh + else + echo "ERROR: config.sh doesn't exists in $1" + exit + fi + + clickArr+=("/") + clickArr+=("$name") + echo "You are here:" ${clickArr[@]} + + # Load module + if [ -f $1/module.sh ]; then + source $1/module.sh + else + echo "ERROR: module.sh doesn't exists in $1" + # exit 0 + fi + + # Read folder + modules=$(find $1 -maxdepth 1 -type d) + count=0 + + # Check if subfolders exists + for value in $modules + do + if [[ ! "$value" == "$1" ]]; then + # Check if custom version of module exists and skip original module + if [ ! -d "$value-custom" ]; then + ((count++)) + fi + fi + done + + # Create Navigation + unset modulesArr + if [[ ! $count == 0 ]]; then + + # Get modules folders + for value in $modules + do + if [[ ! "$value" == "$1" ]]; then + if [[ ! $value == *"-custom" ]]; then + if [ ! -d "$value-custom" ]; then + if [ -f $value/config.sh ]; then + source $value/config.sh + modulesArr+=("$order:$name:$value") + else + echo "ERROR: config.sh doesn't exists in $value" + exit + fi + else + if [ -f $value-custom/config.sh ]; then + source $value-custom/config.sh + modulesArr+=("$order:$name:$value-custom") + else + echo "ERROR: config.sh doesn't exists in $value-custom" + exit + fi + fi + fi + fi + done + # Sort array by order + IFS=$'\n' modulesArr=($(sort <<<"${modulesArr[*]}")) + unset nameList + unset pathList + + # Output + for value in "${modulesArr[@]}" + do + name="$(cut -d':' -f2 <<<"$value")" + path="$(cut -d':' -f3 <<<"$value")" + nameList+=("$name") + pathList+=("$path") + done + if [[ "$back" == "$installFolder/settings" ]]; then + nameList+=("EXIT") + else + nameList+=("BACK") + fi + echo "" + selected=$(gum choose ${nameList[@]}) + case $selected in + BACK) + _goBack + break;; + EXIT) + clear + exit + break;; + * ) + + ;; + esac + if [ ! -z $selected ] ;then + for i in "${!nameList[@]}"; do + if [[ "${nameList[$i]}" = "${selected}" ]]; then + nameIndex="${i}" + fi + done + current="${pathList[$nameIndex]}" + _getModules "$current" + else + if [[ "$back" == "$installFolder/settings" ]]; then + clear + exit + else + _goBack + fi + fi + fi +} + +# _getConfSelector conf/monitor.conf conf/monitors/ +_getConfSelector() { + cur=$(cat $installFolder/conf/$1) + echo "Folder: $installFolder/conf/$2" + echo "In use: ${cur##*/}" + echo "" + echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" + sel=$(gum file $installFolder/conf/$2) + if [ -z $sel ] ;then + _goBack + fi + echo "File ${sel##*/} selected." + echo "" +} + +_getConfEditor() { + selected=$(gum choose "EXECUTE" "EDIT" "COPY" "DELETE" "CANCEL") + case $selected in + EXECUTE) + _writeConf $1 $2 + break;; + EDIT) + vim $sel + sleep 1 + _reloadModule + break;; + COPY) + echo "Define the new file name. Please use [a-zA-Z1-9_-]+.conf" + filename=$(gum input --value="custom-${sel##*/}" --placeholder "Enter your filename") + if [ -z $filename ] ;then + echo "ERROR: No filename specified." + else + if ! [[ $filename =~ ^[a-zA-Z1-9_-]+.conf ]]; then + echo "ERROR: Wrong filename format. Please use [a-zA-Z1-9_-]+.conf" + else + if [ -f $(dirname $sel)/$filename ] ;then + echo "ERROR: File already exists." + else + cp $sel $(dirname $sel)/$filename + _reloadModule + fi + fi + fi + _getConfEditor $1 $2 + break;; + DELETE) + if gum confirm "Do you really want to delete the file ${sel##*/}?" ;then + rm $sel + _reloadModule + else + _getConfEditor $1 $2 + fi + break;; + * ) + ;; + esac +} + +# _writeConf conf/monitor.conf $sel +_writeConf() { + if [ ! -z $2 ] ;then + sel=$(echo "$2" | sed "s+"\/home\/$USER"+~+") + echo "source = $sel" > $installFolder/conf/$1 + fi +} + +# Return the version of the hyprland-settings script +_getVersion() { + echo $version +} + +# Write the header to a page +_getHeader() { + figlet "$1" + if [ ! -z "$2" ]; then + echo "by $2" + fi + echo "" +} + +# Update the breadcrumb and opens parent page +_goBack() { + unset clickArr[-1] + unset clickArr[-1] + unset clickArr[-1] + unset clickArr[-1] + _getModules "$back" +} + +_reloadModule() { + unset clickArr[-1] + unset clickArr[-1] + _getModules "$current" +} + +# Replace the variables in a template and publish to location +_replaceByTemplate() { + template=$1 + variables=$2 + values=$3 + publishto=$4 +} + +# Back Button +_getBackBtn() { + echo "" + gum choose "Back" + _goBack +} + +_getBackRepeatBtn() { + echo "" + selected=$(gum choose "REPEAT" "BACK") + case $selected in + BACK) + _goBack + break;; + REPEAT) + _getModules "$current" + break;; + * ) + + ;; + esac +} diff --git a/hypr/settings/.library/version.sh b/hypr/settings/.library/version.sh new file mode 100644 index 0000000..46ad1e8 --- /dev/null +++ b/hypr/settings/.library/version.sh @@ -0,0 +1 @@ +version="2.0" \ No newline at end of file diff --git a/hypr/settings/modules/appearance/animations/config.sh b/hypr/settings/modules/appearance/animations/config.sh new file mode 100644 index 0000000..d86114c --- /dev/null +++ b/hypr/settings/modules/appearance/animations/config.sh @@ -0,0 +1,3 @@ +name="Animations" +order=1 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/appearance/animations/module.sh b/hypr/settings/modules/appearance/animations/module.sh new file mode 100755 index 0000000..1a8387e --- /dev/null +++ b/hypr/settings/modules/appearance/animations/module.sh @@ -0,0 +1,7 @@ +#!/bin/bash +_getHeader "$name" "$author" + +sel="" +_getConfSelector animation.conf animations +_getConfEditor animation.conf $sel +_reloadModule \ No newline at end of file diff --git a/hypr/settings/modules/appearance/config.sh b/hypr/settings/modules/appearance/config.sh new file mode 100644 index 0000000..120552e --- /dev/null +++ b/hypr/settings/modules/appearance/config.sh @@ -0,0 +1,3 @@ +name="Appearance" +order=2 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/appearance/module.sh b/hypr/settings/modules/appearance/module.sh new file mode 100755 index 0000000..3889b63 --- /dev/null +++ b/hypr/settings/modules/appearance/module.sh @@ -0,0 +1,3 @@ +#!/bin/bash +_getHeader "$name" + diff --git a/hypr/settings/modules/appearance/windows/config.sh b/hypr/settings/modules/appearance/windows/config.sh new file mode 100644 index 0000000..6117022 --- /dev/null +++ b/hypr/settings/modules/appearance/windows/config.sh @@ -0,0 +1,3 @@ +name="Windows" +order=1 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/appearance/windows/module.sh b/hypr/settings/modules/appearance/windows/module.sh new file mode 100755 index 0000000..3632c39 --- /dev/null +++ b/hypr/settings/modules/appearance/windows/module.sh @@ -0,0 +1,7 @@ +#!/bin/bash +_getHeader "$name" "$author" + +sel="" +_getConfSelector window.conf windows +_getConfEditor window.conf $sel +_reloadModule \ No newline at end of file diff --git a/hypr/settings/modules/config.sh b/hypr/settings/modules/config.sh new file mode 100644 index 0000000..85aa4e2 --- /dev/null +++ b/hypr/settings/modules/config.sh @@ -0,0 +1,6 @@ +name="Settings" +description="The settings script will help you to configure your Hyprland installation." +author="Stephan Raabe ML4W" +order=1 +email="mail@ml4w.com" +homepage="https://gitlab.com/stephan-raabe/dotfiles" \ No newline at end of file diff --git a/hypr/settings/modules/init.sh b/hypr/settings/modules/init.sh new file mode 100644 index 0000000..e69de29 diff --git a/hypr/settings/modules/keybindings/config.sh b/hypr/settings/modules/keybindings/config.sh new file mode 100644 index 0000000..f7ccb0d --- /dev/null +++ b/hypr/settings/modules/keybindings/config.sh @@ -0,0 +1,4 @@ +name="Keybindings" +order=2 +author="Stephan Raabe ML4W" + diff --git a/hypr/settings/modules/keybindings/init.sh b/hypr/settings/modules/keybindings/init.sh new file mode 100644 index 0000000..e69de29 diff --git a/hypr/settings/modules/keybindings/module.sh b/hypr/settings/modules/keybindings/module.sh new file mode 100755 index 0000000..eb78cce --- /dev/null +++ b/hypr/settings/modules/keybindings/module.sh @@ -0,0 +1,8 @@ +#!/bin/bash +_getHeader "$name" + +sel="" +_getConfSelector keybinding.conf keybindings +_getConfEditor keybinding.conf $sel +_reloadModule + diff --git a/hypr/settings/modules/module.sh b/hypr/settings/modules/module.sh new file mode 100755 index 0000000..510693a --- /dev/null +++ b/hypr/settings/modules/module.sh @@ -0,0 +1,6 @@ +#!/bin/bash +_getHeader "$name" "$author" +echo "$homepage ($email)" +echo "Version" $(_getVersion) +echo "" +echo $description diff --git a/hypr/settings/modules/system/config.sh b/hypr/settings/modules/system/config.sh new file mode 100644 index 0000000..b3606d9 --- /dev/null +++ b/hypr/settings/modules/system/config.sh @@ -0,0 +1,3 @@ +name="System" +order=2 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/system/custom/config.sh b/hypr/settings/modules/system/custom/config.sh new file mode 100644 index 0000000..f3d3c3a --- /dev/null +++ b/hypr/settings/modules/system/custom/config.sh @@ -0,0 +1,3 @@ +name="Custom" +order=10 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/system/custom/module.sh b/hypr/settings/modules/system/custom/module.sh new file mode 100755 index 0000000..6e64203 --- /dev/null +++ b/hypr/settings/modules/system/custom/module.sh @@ -0,0 +1,6 @@ +#!/bin/bash +_getHeader "$name" "$author" +vim ~/dotfiles/hypr/conf/custom.conf +_goBack + + diff --git a/hypr/settings/modules/system/environment/config.sh b/hypr/settings/modules/system/environment/config.sh new file mode 100644 index 0000000..2603204 --- /dev/null +++ b/hypr/settings/modules/system/environment/config.sh @@ -0,0 +1,3 @@ +name="Environment" +order=05 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/system/environment/module.sh b/hypr/settings/modules/system/environment/module.sh new file mode 100755 index 0000000..0c8d050 --- /dev/null +++ b/hypr/settings/modules/system/environment/module.sh @@ -0,0 +1,7 @@ +#!/bin/bash +_getHeader "$name" "$author" + +sel="" +_getConfSelector environment.conf environments +_getConfEditor environment.conf $sel +_reloadModule diff --git a/hypr/settings/modules/system/module.sh b/hypr/settings/modules/system/module.sh new file mode 100755 index 0000000..e3efe99 --- /dev/null +++ b/hypr/settings/modules/system/module.sh @@ -0,0 +1,2 @@ +#!/bin/bash +_getHeader "$name" diff --git a/hypr/settings/modules/system/monitor/config.sh b/hypr/settings/modules/system/monitor/config.sh new file mode 100644 index 0000000..7cea267 --- /dev/null +++ b/hypr/settings/modules/system/monitor/config.sh @@ -0,0 +1,3 @@ +name="Monitor" +order=01 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/system/monitor/module.sh b/hypr/settings/modules/system/monitor/module.sh new file mode 100755 index 0000000..dc08ba7 --- /dev/null +++ b/hypr/settings/modules/system/monitor/module.sh @@ -0,0 +1,7 @@ +#!/bin/bash +_getHeader "$name" "$author" + +sel="" +_getConfSelector monitor.conf monitors +_getConfEditor monitor.conf $sel +_reloadModule \ No newline at end of file diff --git a/hypr/settings/modules/system/windowrules/config.sh b/hypr/settings/modules/system/windowrules/config.sh new file mode 100644 index 0000000..3441ea8 --- /dev/null +++ b/hypr/settings/modules/system/windowrules/config.sh @@ -0,0 +1,4 @@ +name="Windowrules" +order=09 +author="Stephan Raabe ML4W" + diff --git a/hypr/settings/modules/system/windowrules/module.sh b/hypr/settings/modules/system/windowrules/module.sh new file mode 100755 index 0000000..893258b --- /dev/null +++ b/hypr/settings/modules/system/windowrules/module.sh @@ -0,0 +1,7 @@ +#!/bin/bash +_getHeader "$name" "$author" + +sel="" +_getConfSelector windowrule.conf windowrules +_getConfEditor windowrule.conf $sel +_reloadModule diff --git a/hypr/settings/modules/waybar/appslabel/config.sh b/hypr/settings/modules/waybar/appslabel/config.sh new file mode 100644 index 0000000..6879886 --- /dev/null +++ b/hypr/settings/modules/waybar/appslabel/config.sh @@ -0,0 +1,2 @@ +name="Apps Label" +order=1 diff --git a/hypr/settings/modules/waybar/appslabel/module.sh b/hypr/settings/modules/waybar/appslabel/module.sh new file mode 100755 index 0000000..346857d --- /dev/null +++ b/hypr/settings/modules/waybar/appslabel/module.sh @@ -0,0 +1,47 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the label of the Apps Starter" + +# Define File +targetFile="$HOME/dotfiles/waybar/modules.json" + +# Define Markers +startMarker="\/\/ START APPS LABEL" +endMarker="\/\/ END APPS LABEL" + +# Define Replacement Template +customtemplate="\"format\": \"VALUE\"," + +# Select Value +customvalue=$(gum input --placeholder="Define the Apps label") + +if [ ! -z $customvalue ]; then + # Replace in Template + customtext="${customtemplate/VALUE/"$customvalue"}" + + # Ensure that markers are in target file + if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then + echo "Exists" + + # Write into File + sed -i '/'"$startMarker"'/,/'"$endMarker"'/ { + //!d + /'"$startMarker"'/a\ + '"$customtext"' + }' $targetFile + + # Reload Waybar + $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 + _goBack + + else + echo "ERROR: Marker not found." + sleep 2 + _goBack + fi +else + echo "ERROR: Define a value." + sleep 2 + _goBack +fi diff --git a/hypr/settings/modules/waybar/config.sh b/hypr/settings/modules/waybar/config.sh new file mode 100644 index 0000000..be14a96 --- /dev/null +++ b/hypr/settings/modules/waybar/config.sh @@ -0,0 +1,2 @@ +name="Waybar" +order=1 diff --git a/hypr/settings/modules/waybar/date/config.sh b/hypr/settings/modules/waybar/date/config.sh new file mode 100644 index 0000000..cfd51d7 --- /dev/null +++ b/hypr/settings/modules/waybar/date/config.sh @@ -0,0 +1,2 @@ +name="Date Format" +order=1 diff --git a/hypr/settings/modules/waybar/date/module.sh b/hypr/settings/modules/waybar/date/module.sh new file mode 100755 index 0000000..7dce111 --- /dev/null +++ b/hypr/settings/modules/waybar/date/module.sh @@ -0,0 +1,46 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the date format for the clock module. Default: {:%Y-%m-%d}" +# Define File +targetFile="$HOME/dotfiles/waybar/modules.json" + +# Define Markers +startMarker="\/\/ START CLOCK FORMAT" +endMarker="\/\/ END CLOCK FORMAT" + +# Define Replacement Template +customtemplate="\"format-alt\": \"VALUE\"" + +# Select Value +customvalue=$(gum input --placeholder="Define the date format") + +if [ ! -z $customvalue ]; then + # Replace in Template + customtext="${customtemplate/VALUE/"$customvalue"}" + + # Ensure that markers are in target file + if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then + echo "Exists" + + # Write into File + sed -i '/'"$startMarker"'/,/'"$endMarker"'/ { + //!d + /'"$startMarker"'/a\ + '"$customtext"' + }' $targetFile + + # Reload Waybar + $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 + _goBack + + else + echo "ERROR: Marker not found." + sleep 2 + _goBack + fi +else + echo "ERROR: Define a value." + sleep 2 + _goBack +fi diff --git a/hypr/settings/modules/waybar/defaults/browser/config.sh b/hypr/settings/modules/waybar/defaults/browser/config.sh new file mode 100644 index 0000000..b550897 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/browser/config.sh @@ -0,0 +1,2 @@ +name="Browser" +order=1 diff --git a/hypr/settings/modules/waybar/defaults/browser/module.sh b/hypr/settings/modules/waybar/defaults/browser/module.sh new file mode 100755 index 0000000..d47b5a1 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/browser/module.sh @@ -0,0 +1,23 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the start command to start the browser." + +# Define File +targetFile="$HOME/dotfiles/.settings/browser.sh" + +# Current Value +echo "Current Value: $(cat $targetFile)" + +# Select Value +customvalue=$(gum input --placeholder "Command to start") +if [ ! -z $customvalue ] ;then + # Write into file + echo "$customvalue" > $targetFile +else + echo "Please define a command" + sleep 1 +fi + _goBack + + diff --git a/hypr/settings/modules/waybar/defaults/config.sh b/hypr/settings/modules/waybar/defaults/config.sh new file mode 100644 index 0000000..69b50bc --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/config.sh @@ -0,0 +1,3 @@ +name="Quick Launcher" +order=1 +author="Stephan Raabe ML4W" diff --git a/hypr/settings/modules/waybar/defaults/filemanager/config.sh b/hypr/settings/modules/waybar/defaults/filemanager/config.sh new file mode 100644 index 0000000..34f6e32 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/filemanager/config.sh @@ -0,0 +1,2 @@ +name="Filemanager" +order=1 diff --git a/hypr/settings/modules/waybar/defaults/filemanager/module.sh b/hypr/settings/modules/waybar/defaults/filemanager/module.sh new file mode 100755 index 0000000..2e02420 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/filemanager/module.sh @@ -0,0 +1,23 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the start command to start the filemanager." + +# Define File +targetFile="$HOME/dotfiles/.settings/filemanager.sh" + +# Current Value +echo "Current Value: $(cat $targetFile)" + +# Select Value +customvalue=$(gum input --placeholder "Command to start") +if [ ! -z $customvalue ] ;then + # Write into file + echo "$customvalue" > $targetFile +else + echo "Please define a command" + sleep 1 +fi + _goBack + + diff --git a/hypr/settings/modules/waybar/defaults/module.sh b/hypr/settings/modules/waybar/defaults/module.sh new file mode 100755 index 0000000..e3efe99 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/module.sh @@ -0,0 +1,2 @@ +#!/bin/bash +_getHeader "$name" diff --git a/hypr/settings/modules/waybar/defaults/networkmanager/config.sh b/hypr/settings/modules/waybar/defaults/networkmanager/config.sh new file mode 100644 index 0000000..c9a29e8 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/networkmanager/config.sh @@ -0,0 +1,2 @@ +name="Network" +order=1 diff --git a/hypr/settings/modules/waybar/defaults/networkmanager/module.sh b/hypr/settings/modules/waybar/defaults/networkmanager/module.sh new file mode 100755 index 0000000..7f25ba8 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/networkmanager/module.sh @@ -0,0 +1,23 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the start command to start the networkmanager." + +# Define File +targetFile="$HOME/dotfiles/.settings/networkmanager.sh" + +# Current Value +echo "Current Value: $(cat $targetFile)" + +# Select Value +customvalue=$(gum input --placeholder "Command to start") +if [ ! -z $customvalue ] ;then + # Write into file + echo "$customvalue" > $targetFile +else + echo "Please define a command" + sleep 1 +fi + _goBack + + diff --git a/hypr/settings/modules/waybar/defaults/software/config.sh b/hypr/settings/modules/waybar/defaults/software/config.sh new file mode 100644 index 0000000..391e1e0 --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/software/config.sh @@ -0,0 +1,2 @@ +name="Software" +order=1 diff --git a/hypr/settings/modules/waybar/defaults/software/module.sh b/hypr/settings/modules/waybar/defaults/software/module.sh new file mode 100755 index 0000000..fef12ac --- /dev/null +++ b/hypr/settings/modules/waybar/defaults/software/module.sh @@ -0,0 +1,23 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Define the start command to start the software manager." + +# Define File +targetFile="$HOME/dotfiles/.settings/software.sh" + +# Current Value +echo "Current Value: $(cat $targetFile)" + +# Select Value +customvalue=$(gum input --placeholder "Command to start") +if [ ! -z $customvalue ] ;then + # Write into file + echo "$customvalue" > $targetFile +else + echo "Please define a command" + sleep 1 +fi + _goBack + + diff --git a/hypr/settings/modules/waybar/module.sh b/hypr/settings/modules/waybar/module.sh new file mode 100755 index 0000000..510693a --- /dev/null +++ b/hypr/settings/modules/waybar/module.sh @@ -0,0 +1,6 @@ +#!/bin/bash +_getHeader "$name" "$author" +echo "$homepage ($email)" +echo "Version" $(_getVersion) +echo "" +echo $description diff --git a/hypr/settings/modules/waybar/workspaces/config.sh b/hypr/settings/modules/waybar/workspaces/config.sh new file mode 100644 index 0000000..2116569 --- /dev/null +++ b/hypr/settings/modules/waybar/workspaces/config.sh @@ -0,0 +1,2 @@ +name="Workspaces" +order=1 diff --git a/hypr/settings/modules/waybar/workspaces/module.sh b/hypr/settings/modules/waybar/workspaces/module.sh new file mode 100755 index 0000000..5129bb1 --- /dev/null +++ b/hypr/settings/modules/waybar/workspaces/module.sh @@ -0,0 +1,40 @@ +#!/bin/bash +_getHeader "$name" "$author" + +# Define File +targetFile="$HOME/dotfiles/waybar/modules.json" + +# Define Markers +startMarker="\/\/ START WORKSPACE" +endMarker="\/\/ END WORKSPACES" + +# Define Replacement Template +customtemplate="\"*\": VALUE" + +# Select Value +customvalue=$(gum choose 5 6 7 8 9 10) + +# Replace in Template +customtext="${customtemplate/VALUE/"$customvalue"}" + +# Ensure that markers are in target file +if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then + echo "Exists" + + # Write into File + sed -i '/'"$startMarker"'/,/'"$endMarker"'/ { + //!d + /'"$startMarker"'/a\ + '"$customtext"' + }' $targetFile + + # Reload Waybar + $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 + _goBack + +else + echo "ERROR: Marker not found." + sleep 2 + _goBack +fi + diff --git a/hypr/settings/settings.sh b/hypr/settings/settings.sh index bc5e5c8..371d057 100755 --- a/hypr/settings/settings.sh +++ b/hypr/settings/settings.sh @@ -1,244 +1,27 @@ #!/bin/bash +# ____ _ _ _ +# / ___| ___| |_| |_(_)_ __ __ _ ___ +# \___ \ / _ \ __| __| | '_ \ / _` / __| +# ___) | __/ |_| |_| | | | | (_| \__ \ +# |____/ \___|\__|\__|_|_| |_|\__, |___/ +# |___/ +# The Hyprland Settings Script +# by Stephan Raabe (2023) +# ----------------------------------------------------- -_settingsCustom() { - clear -cat <<"EOF" - ____ _ - / ___| _ ___| |_ ___ _ __ ___ -| | | | | / __| __/ _ \| '_ ` _ \ -| |__| |_| \__ \ || (_) | | | | | | - \____\__,_|___/\__\___/|_| |_| |_| - -EOF - echo "You can edit here the ~/dotfiles/hypr/conf/custom.conf directly" - echo "to add more individual configurations to the hyprland.conf." - echo "" - echo "Press ESC to proceed." - echo "" - filevalue=$(gum write --show-line-numbers --height 15 --width 70 --value="$(cat ~/dotfiles/hypr/conf/custom.conf)") - clear -cat <<"EOF" - ____ _ - / ___| _ ___| |_ ___ _ __ ___ -| | | | | / __| __/ _ \| '_ ` _ \ -| |__| |_| \__ \ || (_) | | | | | | - \____\__,_|___/\__\___/|_| |_| |_| - -EOF - if gum confirm "Do you want to save your changes into ~/dotfiles/hypr/conf/custom.conf?" ;then - echo "$filevalue" > ~/dotfiles/hypr/conf/custom.conf - fi - _settingsMenu -} +clear +installFolder=$(dirname "$(pwd)") -_settingsDecoration() { - clear -cat <<"EOF" - ____ _ _ -| _ \ ___ ___ ___ _ __ __ _| |_(_) ___ _ __ ___ -| | | |/ _ \/ __/ _ \| '__/ _` | __| |/ _ \| '_ \/ __| -| |_| | __/ (_| (_) | | | (_| | |_| | (_) | | | \__ \ -|____/ \___|\___\___/|_| \__,_|\__|_|\___/|_| |_|___/ - -EOF - cur=$(cat ~/dotfiles/hypr/conf/decoration.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/decorations/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/decoration.conf - _settingsDecoration - fi - _settingsMenu -} +# Source files +source .library/version.sh +source .library/library.sh -_settingsWindow() { - clear -cat <<"EOF" -__ ___ _ -\ \ / (_)_ __ __| | _____ _____ - \ \ /\ / /| | '_ \ / _` |/ _ \ \ /\ / / __| - \ V V / | | | | | (_| | (_) \ V V /\__ \ - \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ |___/ - -EOF - cur=$(cat ~/dotfiles/hypr/conf/window.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/windows/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/window.conf - _settingsWindow - fi - _settingsMenu -} +# Define global variables +modules_path="modules" +current="" +back="" +clickArr="" +confDir="conf" -_settingsAnimation() { - clear -cat <<"EOF" - _ _ _ _ - / \ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___ - / _ \ | '_ \| | '_ ` _ \ / _` | __| |/ _ \| '_ \/ __| - / ___ \| | | | | | | | | | (_| | |_| | (_) | | | \__ \ -/_/ \_\_| |_|_|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/ - -EOF - cur=$(cat ~/dotfiles/hypr/conf/animation.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/animations/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/animation.conf - _settingsAnimation - fi - _settingsMenu -} - -_settingsMonitor() { - clear -cat <<"EOF" - __ __ _ _ -| \/ | ___ _ __ (_) |_ ___ _ __ -| |\/| |/ _ \| '_ \| | __/ _ \| '__| -| | | | (_) | | | | | || (_) | | -|_| |_|\___/|_| |_|_|\__\___/|_| - -EOF - cur=$(cat ~/dotfiles/hypr/conf/monitor.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/monitors/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/monitor.conf - fi - _settingsMenu -} - -_settingsEnvironment() { - clear -cat <<"EOF" - _____ _ _ -| ____|_ ____ _(_)_ __ ___ _ __ _ __ ___ ___ _ __ | |_ -| _| | '_ \ \ / / | '__/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| -| |___| | | \ V /| | | | (_) | | | | | | | | | __/ | | | |_ -|_____|_| |_|\_/ |_|_| \___/|_| |_|_| |_| |_|\___|_| |_|\__| - -EOF - - cur=$(cat ~/dotfiles/hypr/conf/environment.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Please restart Hyprland after changing the environment." - echo "If you select KVM it's recommended to shutdown your system and start again." - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/environments/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/environment.conf - fi - _settingsMenu -} - -_settingsKeybinding() { - clear -cat <<"EOF" - _ __ _ _ _ _ -| |/ /___ _ _| |__ (_)_ __ __| (_)_ __ __ _ ___ -| ' // _ \ | | | '_ \| | '_ \ / _` | | '_ \ / _` / __| -| . \ __/ |_| | |_) | | | | | (_| | | | | | (_| \__ \ -|_|\_\___|\__, |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___/ - |___/ |___/ - -EOF - cur=$(cat ~/dotfiles/hypr/conf/keybinding.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/keybindings/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/keybinding.conf - fi - _settingsMenu -} - -_settingsWindowrule() { - clear -cat <<"EOF" -__ ___ _ _ -\ \ / (_)_ __ __| | _____ ___ __ _ _| | ___ ___ - \ \ /\ / /| | '_ \ / _` |/ _ \ \ /\ / / '__| | | | |/ _ \/ __| - \ V V / | | | | | (_| | (_) \ V V /| | | |_| | | __/\__ \ - \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ |_| \__,_|_|\___||___/ - -EOF - - cur=$(cat ~/dotfiles/hypr/conf/windowrule.conf) - echo "In use: ${cur##*/}" - echo "" - echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):" - sel=$(gum file ~/dotfiles/hypr/conf/windowrules/) - if [ ! -z $sel ] ;then - sel=$(echo "$sel" | sed "s+"\/home\/$USER"+~+") - echo "source = $sel" > ~/dotfiles/hypr/conf/windowrule.conf - fi - _settingsMenu -} - -_settingsMenu() { - clear -cat <<"EOF" - ____ _ _ _ -/ ___| ___| |_| |_(_)_ __ __ _ ___ -\___ \ / _ \ __| __| | '_ \ / _` / __| - ___) | __/ |_| |_| | | | | (_| \__ \ -|____/ \___|\__|\__|_|_| |_|\__, |___/ - |___/ - -EOF - if [ -f ~/dotfiles/version ] ;then - echo "Version: $(cat ~/dotfiles/version)" - echo "" - fi - menu=$(gum choose "Decorations" "Windows" "Animations" "Monitors" "Environments" "Keybindings" "Windowrules" "Custom" "EXIT") - case $menu in - Decorations) - _settingsDecoration - break;; - Windows) - _settingsWindow - break;; - Animations) - _settingsAnimation - break;; - Monitors) - _settingsMonitor - break;; - Environments) - _settingsEnvironment - break;; - Keybindings) - _settingsKeybinding - break;; - Windowrules) - _settingsWindowrule - break;; - Custom) - _settingsCustom - break;; - * ) - exit - ;; - esac -} - -_settingsMenu \ No newline at end of file +# Start Application +_getModules $(pwd)/$modules_path diff --git a/hypr/start-settings.sh b/hypr/start-settings.sh new file mode 100755 index 0000000..2ec713f --- /dev/null +++ b/hypr/start-settings.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd settings +./settings.sh \ No newline at end of file diff --git a/waybar/modules.json b/waybar/modules.json index de60ed0..3c15275 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -21,7 +21,9 @@ "default": "" }, "persistent-workspaces": { - "*": 5 + // START WORKSPACES + "*": 5 + // END WORKSPACES } }, @@ -105,7 +107,7 @@ // Settings "custom/settings": { "format": "", - "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/hypr/settings/settings.sh", + "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/hypr/start-settings.sh", "tooltip": false }, @@ -167,7 +169,9 @@ // Rofi Application Launcher "custom/appmenu": { + // START APPS LABEL "format": "Apps", + // END APPS LABEL "on-click": "rofi -show drun -replace", "on-click-right": "~/dotfiles/hypr/scripts/keybindings.sh", "tooltip": false @@ -201,7 +205,9 @@ "clock": { // "timezone": "America/New_York", "tooltip-format": "{:%Y %B}\n{calendar}", + // START CLOCK FORMAT "format-alt": "{:%Y-%m-%d}" + // END CLOCK FORMAT }, // System