From 0cbb143d3125242ba3f55e142a812d3d2b124925 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Fri, 5 May 2023 15:34:30 +0200 Subject: [PATCH] updated rofi --- .config/rofi/colors/nord.rasi | 17 ++ .config/rofi/config.rasi | 2 - .config/rofi/current-color.rasi | 1 + .config/rofi/launcher.rasi | 309 ++++++++++++++++++++++++++++++++ .config/rofi/powermenu.rasi | 167 +++++++++++++++++ .config/rofi/powermenu.sh | 44 +++++ 6 files changed, 538 insertions(+), 2 deletions(-) create mode 100644 .config/rofi/colors/nord.rasi create mode 120000 .config/rofi/current-color.rasi create mode 100644 .config/rofi/launcher.rasi create mode 100644 .config/rofi/powermenu.rasi create mode 100755 .config/rofi/powermenu.sh diff --git a/.config/rofi/colors/nord.rasi b/.config/rofi/colors/nord.rasi new file mode 100644 index 0000000..5db33c0 --- /dev/null +++ b/.config/rofi/colors/nord.rasi @@ -0,0 +1,17 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #2E3440FF; + background-alt: #383E4AFF; + foreground: #E5E9F0FF; + selected: #81A1C1FF; + active: #A3BE8CFF; + urgent: #BF616AFF; +} + diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi index b895572..e69de29 100644 --- a/.config/rofi/config.rasi +++ b/.config/rofi/config.rasi @@ -1,2 +0,0 @@ - @import "/home/niklas/.cache/wal/colors-rofi-dark" - diff --git a/.config/rofi/current-color.rasi b/.config/rofi/current-color.rasi new file mode 120000 index 0000000..3bc6400 --- /dev/null +++ b/.config/rofi/current-color.rasi @@ -0,0 +1 @@ +colors/nord.rasi \ No newline at end of file diff --git a/.config/rofi/launcher.rasi b/.config/rofi/launcher.rasi new file mode 100644 index 0000000..67f9000 --- /dev/null +++ b/.config/rofi/launcher.rasi @@ -0,0 +1,309 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Rofi Theme File + * Rofi Version: 1.7.3 + **/ + +/*****----- Configuration -----*****/ +configuration { + modi: "drun,filebrowser,window"; + show-icons: true; + display-drun: ""; + display-run: ""; + display-filebrowser: ""; + display-window: ""; + drun-display-format: "{name}"; + window-format: "{w} · {c} · {t}"; +} + +/*****----- Global Properties -----*****/ +@import "current-color.rasi" + +* { + border-colour: var(selected); + handle-colour: var(selected); + background-colour: var(background); + foreground-colour: var(foreground); + alternate-background: var(background-alt); + normal-background: var(background); + normal-foreground: var(foreground); + urgent-background: var(urgent); + urgent-foreground: var(background); + active-background: var(active); + active-foreground: var(background); + selected-normal-background: var(selected); + selected-normal-foreground: var(background); + selected-urgent-background: var(active); + selected-urgent-foreground: var(background); + selected-active-background: var(urgent); + selected-active-foreground: var(background); + alternate-normal-background: var(background); + alternate-normal-foreground: var(foreground); + alternate-urgent-background: var(urgent); + alternate-urgent-foreground: var(background); + alternate-active-background: var(active); + alternate-active-foreground: var(background); +} + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 600px; + x-offset: 0px; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 10px; + border-color: @border-colour; + cursor: "default"; + /* Backgroud Colors */ + background-color: @background-colour; + /* Backgroud Image */ + //background-image: url("/path/to/image.png", none); + /* Simple Linear Gradient */ + //background-image: linear-gradient(red, orange, pink, purple); + /* Directional Linear Gradient */ + //background-image: linear-gradient(to bottom, pink, yellow, magenta); + /* Angle Linear Gradient */ + //background-image: linear-gradient(45, cyan, purple, indigo); +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 30px; + border: 0px solid; + border-radius: 0px 0px 0px 0px; + border-color: @border-colour; + background-color: transparent; + children: [ "inputbar", "message", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @border-colour; + background-color: transparent; + text-color: @foreground-colour; + children: [ "textbox-prompt-colon", "entry", "mode-switcher" ]; +} + +prompt { + enabled: true; + background-color: inherit; + text-color: inherit; +} +textbox-prompt-colon { + enabled: true; + padding: 5px 0px; + expand: false; + str: ""; + background-color: inherit; + text-color: inherit; +} +entry { + enabled: true; + padding: 5px 0px; + background-color: inherit; + text-color: inherit; + cursor: text; + placeholder: "Search..."; + placeholder-color: inherit; +} +num-filtered-rows { + enabled: true; + expand: false; + background-color: inherit; + text-color: inherit; +} +textbox-num-sep { + enabled: true; + expand: false; + str: "/"; + background-color: inherit; + text-color: inherit; +} +num-rows { + enabled: true; + expand: false; + background-color: inherit; + text-color: inherit; +} +case-indicator { + enabled: true; + background-color: inherit; + text-color: inherit; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 1; + lines: 8; + cycle: true; + dynamic: true; + scrollbar: true; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 5px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @border-colour; + background-color: transparent; + text-color: @foreground-colour; + cursor: "default"; +} +scrollbar { + handle-width: 5px ; + handle-color: @handle-colour; + border-radius: 10px; + background-color: @alternate-background; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 5px 10px; + border: 0px solid; + border-radius: 10px; + border-color: @border-colour; + background-color: transparent; + text-color: @foreground-colour; + cursor: pointer; +} +element normal.normal { + background-color: var(normal-background); + text-color: var(normal-foreground); +} +element normal.urgent { + background-color: var(urgent-background); + text-color: var(urgent-foreground); +} +element normal.active { + background-color: var(active-background); + text-color: var(active-foreground); +} +element selected.normal { + background-color: var(selected-normal-background); + text-color: var(selected-normal-foreground); +} +element selected.urgent { + background-color: var(selected-urgent-background); + text-color: var(selected-urgent-foreground); +} +element selected.active { + background-color: var(selected-active-background); + text-color: var(selected-active-foreground); +} +element alternate.normal { + background-color: var(alternate-normal-background); + text-color: var(alternate-normal-foreground); +} +element alternate.urgent { + background-color: var(alternate-urgent-background); + text-color: var(alternate-urgent-foreground); +} +element alternate.active { + background-color: var(alternate-active-background); + text-color: var(alternate-active-foreground); +} +element-icon { + background-color: transparent; + text-color: inherit; + size: 24px; + cursor: inherit; +} +element-text { + background-color: transparent; + text-color: inherit; + highlight: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +/*****----- Mode Switcher -----*****/ +mode-switcher{ + enabled: true; + spacing: 10px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @border-colour; + background-color: transparent; + text-color: @foreground-colour; +} +button { + padding: 5px 10px; + border: 0px solid; + border-radius: 10px; + border-color: @border-colour; + background-color: @alternate-background; + text-color: inherit; + cursor: pointer; +} +button selected { + background-color: var(selected-normal-background); + text-color: var(selected-normal-foreground); +} + +/*****----- Message -----*****/ +message { + enabled: true; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px 0px 0px 0px; + border-color: @border-colour; + background-color: transparent; + text-color: @foreground-colour; +} +textbox { + padding: 8px 10px; + border: 0px solid; + border-radius: 10px; + border-color: @border-colour; + background-color: @alternate-background; + text-color: @foreground-colour; + vertical-align: 0.5; + horizontal-align: 0.0; + highlight: none; + placeholder-color: @foreground-colour; + blink: true; + markup: true; +} +error-message { + padding: 10px; + border: 2px solid; + border-radius: 10px; + border-color: @border-colour; + background-color: @background-colour; + text-color: @foreground-colour; +} + diff --git a/.config/rofi/powermenu.rasi b/.config/rofi/powermenu.rasi new file mode 100644 index 0000000..11a76ca --- /dev/null +++ b/.config/rofi/powermenu.rasi @@ -0,0 +1,167 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Rofi Theme File + * Rofi Version: 1.7.3 + **/ + +/*****----- Configuration -----*****/ +configuration { + show-icons: false; +} + +/*****----- Global Properties -----*****/ +@import "current-color.rasi" + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 605px; + x-offset: 0px; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 4px; + border-color: @selected; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 20px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + children: [ "inputbar", "message", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 0px; + border: 0px; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + children: [ "textbox-prompt-colon", dummy, "prompt"]; +} + +dummy { + background-color: transparent; +} + +textbox-prompt-colon { + enabled: true; + expand: false; + str: ""; + padding: 10px 14px; + border-radius: 4px; + background-color: @urgent; + text-color: @background; +} +prompt { + enabled: true; + padding: 10px; + border-radius: 4px; + background-color: @active; + text-color: @background; +} + +/*****----- Message -----*****/ +message { + enabled: true; + margin: 0px; + padding: 10px; + border: 0px solid; + border-radius: 4px; + border-color: @selected; + background-color: @background-alt; + text-color: @foreground; +} +textbox { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; + horizontal-align: 0.5; + placeholder-color: @foreground; + blink: true; + markup: true; +} +error-message { + padding: 10px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: @background; + text-color: @foreground; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 5; + lines: 1; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 10px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: "default"; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 0px; + margin: 0px; + padding: 10px; + border: 0px solid; + border-radius: 4px; + border-color: @selected; + background-color: @background-alt; + text-color: @foreground; + cursor: pointer; +} +element-text { + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.5; +} +element selected.normal { + border: 0px 2px 0px 2px; + border-radius: 4px; + background-color: var(selected); + text-color: var(background); +} + diff --git a/.config/rofi/powermenu.sh b/.config/rofi/powermenu.sh new file mode 100755 index 0000000..4b15c30 --- /dev/null +++ b/.config/rofi/powermenu.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env sh + +ROFI_CONFIG_DIR="$XDG_CONFIG_HOME/rofi/" + +UPTIME="`uptime -p | sed -e 's/up //g'`" + +SHUTDOWN="" +RESTART="" +LOCK="" +LOGOUT="" +WINDOWS="" + +rofi_cmd(){ + echo -e "$SHUTDOWN\n$WINDOWS\n$RESTART\n$LOGOUT\n$LOCK" | \ + rofi -dmenu \ + -p "Power" \ + -mesg "Uptime: $UPTIME" \ + -theme ${ROFI_CONFIG_DIR}/powermenu.rasi +} + + +selection=$(rofi_cmd) + +case ${selection} in + $SHUTDOWN) + systemctl poweroff + ;; + $RESTART) + systemctl reboot + ;; + $LOCK) + # TODO + ;; + $LOGOUT) + if [[ "$XDG_CURRENT_DESKTOP" == 'Hyprland' ]]; then + hyprctl dispatch exit + fi + ;; + $WINDOWS) + # TODO + # grub-set-default + ;; +esac +