diff --git a/home-manager/features/linux-desktop.nix b/home-manager/features/linux-desktop.nix index d300e78..812be3a 100644 --- a/home-manager/features/linux-desktop.nix +++ b/home-manager/features/linux-desktop.nix @@ -5,6 +5,7 @@ ./hyprpaper.nix ./audio.nix ./nix.nix + ./rofi/rofi.nix ../apps/element.nix ../apps/eww ./terminal.nix @@ -14,7 +15,6 @@ feh networkmanagerapplet # network control hyprlock # lock screen - rofi # launcher swayidle # lock on idle swayosd # volume pop-up swaynotificationcenter # notifications diff --git a/home-manager/features/neovim/config/lua/plugins/copilot.lua b/home-manager/features/neovim/config/lua/plugins/copilot.lua new file mode 100644 index 0000000..195ec54 --- /dev/null +++ b/home-manager/features/neovim/config/lua/plugins/copilot.lua @@ -0,0 +1,9 @@ +return { + "zbirenbaum/copilot.lua", + opts = { + filetypes = { + markdown = false, + help = false, + }, + }, +} diff --git a/home-manager/features/rofi/config/powermenu/colors.rasi b/home-manager/features/rofi/config/powermenu/colors.rasi new file mode 100644 index 0000000..103ad63 --- /dev/null +++ b/home-manager/features/rofi/config/powermenu/colors.rasi @@ -0,0 +1,18 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + * + * Available Colors Schemes + * + * adapta catppuccin everforest navy paper + * arc cyberpunk gruvbox nord solarized + * black dracula lovelace onedark yousai + * + **/ + +/* Import color-scheme from `colors` directory */ + +@import "~/.config/rofi/colors/onedark.rasi" diff --git a/home-manager/features/rofi/config/powermenu/fonts.rasi b/home-manager/features/rofi/config/powermenu/fonts.rasi new file mode 100644 index 0000000..430c73d --- /dev/null +++ b/home-manager/features/rofi/config/powermenu/fonts.rasi @@ -0,0 +1,12 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Fonts + * + **/ + +* { + font: "JetBrains Mono Nerd Font 10"; +} diff --git a/home-manager/features/rofi/config/powermenu/powermenu.sh b/home-manager/features/rofi/config/powermenu/powermenu.sh new file mode 100755 index 0000000..17af197 --- /dev/null +++ b/home-manager/features/rofi/config/powermenu/powermenu.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +## Author : Aditya Shakya (adi1090x) +## Github : @adi1090x +# +## Rofi : Power Menu + +## Edited by Periodic + +dir="$(pwd)" + +# CMDs +uptime="$(uptime | awk -F ' ' '{print $2}' | sed -e 's/,//g')" +host=`hostname` + +# Options +shutdown='' +reboot='' +lock='' +suspend='' +logout='' +yes='' +no='' + +# Rofi CMD +rofi_cmd() { + rofi -dmenu \ + -p "Uptime: $uptime" \ + -mesg "Uptime: $uptime" \ + -theme ${dir}/style.rasi +} + +# Confirmation CMD +confirm_cmd() { + rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \ + -theme-str 'mainbox {children: [ "message", "listview" ];}' \ + -theme-str 'listview {columns: 2; lines: 1;}' \ + -theme-str 'element-text {horizontal-align: 0.5;}' \ + -theme-str 'textbox {horizontal-align: 0.5;}' \ + -dmenu \ + -p 'Confirmation' \ + -mesg 'Are you Sure?' \ + -theme ${dir}/style.rasi +} + +# Ask for confirmation +confirm_exit() { + echo -e "$yes\n$no" | confirm_cmd +} + +# Pass variables to rofi dmenu +run_rofi() { + echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd +} + +# Execute Command +run_cmd() { + selected="$(confirm_exit)" + if [[ "$selected" == "$yes" ]]; then + if [[ $1 == '--shutdown' ]]; then + systemctl poweroff + elif [[ $1 == '--reboot' ]]; then + systemctl reboot + elif [[ $1 == '--suspend' ]]; then + mpc -q pause + amixer set Master mute + systemctl suspend + elif [[ $1 == '--logout' ]]; then + if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then + openbox --exit + elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then + bspc quit + elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then + i3-msg exit + elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then + qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then + qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif command -v hyprctl &>/dev/null; then + hyprctl dispatch exit + fi + fi + else + exit 0 + fi +} + +# Actions +chosen="$(run_rofi)" +case ${chosen} in + $shutdown) + run_cmd --shutdown + ;; + $reboot) + run_cmd --reboot + ;; + $lock) + if [[ -x '/usr/bin/betterlockscreen' ]]; then + betterlockscreen -l + elif [[ -x '/usr/bin/i3lock' ]]; then + i3lock + elif command -v hyprlock &>/dev/null; then + hyprlock + fi + ;; + $suspend) + run_cmd --suspend + ;; + $logout) + run_cmd --logout + ;; +esac diff --git a/home-manager/features/rofi/config/powermenu/style.rasi b/home-manager/features/rofi/config/powermenu/style.rasi new file mode 100644 index 0000000..e310106 --- /dev/null +++ b/home-manager/features/rofi/config/powermenu/style.rasi @@ -0,0 +1,170 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Rofi Theme File + * Rofi Version: 1.7.3 + **/ + +/*****----- Configuration -----*****/ +configuration { + show-icons: false; +} + +/*****----- Global Properties -----*****/ +@import "shared/colors.rasi" +@import "shared/fonts.rasi" + +/* +USE_BUTTONS=YES +*/ + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 800px; + x-offset: 0px; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 15px; + margin: 0px; + padding: 30px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + children: [ "inputbar", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 15px; + margin: 0px; + padding: 0px; + border: 0px; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + children: [ "textbox-prompt-colon", "prompt"]; +} + +dummy { + background-color: transparent; +} + +textbox-prompt-colon { + enabled: true; + expand: false; + str: ""; + padding: 12px 16px; + border-radius: 0px; + background-color: @urgent; + text-color: @background; +} +prompt { + enabled: true; + padding: 12px; + border-radius: 0px; + background-color: @active; + text-color: @background; +} + +/*****----- Message -----*****/ +message { + enabled: true; + margin: 0px; + padding: 12px; + border: 0px solid; + border-radius: 0px; + 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: 12px; + 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: 15px; + 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: 40px 10px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: @background-alt; + text-color: @foreground; + cursor: pointer; +} +element-text { + font: "feather bold 32"; + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.5; +} +element selected.normal { + background-color: var(selected); + text-color: var(background); +} diff --git a/home-manager/features/rofi/rofi.nix b/home-manager/features/rofi/rofi.nix new file mode 100644 index 0000000..cd89744 --- /dev/null +++ b/home-manager/features/rofi/rofi.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + rofi + ]; + + home.file.".config/rofi" = { + source = ./config; + recursive = true; + }; +}