From dc36449701cc6801a0fe4269462589eebaa554a0 Mon Sep 17 00:00:00 2001 From: tiago Date: Fri, 23 Feb 2024 23:04:39 +0000 Subject: [PATCH] nvim transparency now decent and more theme related stuff --- .Xresources | 2 +- .../nvim/lua/tsousa/plugins/colorscheme.lua | 10 +++-- .config/rofi/colors/catppuccin-dark.rasi | 10 ++--- .../rofi/colors/gruvbox-material-dark.rasi | 9 ++++ .../rofi/colors/gruvbox-material-light.rasi | 8 ++++ .local/share/scripts/powermenu.sh | 41 +++++++++++++++++++ .local/share/scripts/theme-selector.sh | 10 +++-- 7 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 .config/rofi/colors/gruvbox-material-dark.rasi create mode 100644 .config/rofi/colors/gruvbox-material-light.rasi create mode 100755 .local/share/scripts/powermenu.sh diff --git a/.Xresources b/.Xresources index 7b9e756..c45c245 100644 --- a/.Xresources +++ b/.Xresources @@ -2,4 +2,4 @@ !#include ".Xresources.d/gruvbox-dark" !#include ".Xresources.d/gruvbox-light" -st.alpha: 1 +st.alpha: 0.95 diff --git a/.config/nvim/lua/tsousa/plugins/colorscheme.lua b/.config/nvim/lua/tsousa/plugins/colorscheme.lua index e577d72..f2e0172 100644 --- a/.config/nvim/lua/tsousa/plugins/colorscheme.lua +++ b/.config/nvim/lua/tsousa/plugins/colorscheme.lua @@ -3,6 +3,10 @@ local background = "dark" function SetColor() vim.cmd.colorscheme(color) vim.opt.background = background + + -- transparency + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) end return { @@ -14,9 +18,9 @@ return { -- flavour = "macchiato", -- latte, frappe, macchiato, mocha background = { dark = "macchiato", - light = "mocha", + light = "latte", }, - transparent_background = true, + transparent_background = false, term_colors = false, integrations = { cmp = true, @@ -35,7 +39,7 @@ return { "sainnhe/gruvbox-material", priority = 1000, config = function() - local contrast = "hard" + local contrast = "medium" if background == "light" then contrast = "soft" end diff --git a/.config/rofi/colors/catppuccin-dark.rasi b/.config/rofi/colors/catppuccin-dark.rasi index be65366..2d0b627 100644 --- a/.config/rofi/colors/catppuccin-dark.rasi +++ b/.config/rofi/colors/catppuccin-dark.rasi @@ -1,8 +1,8 @@ * { - background: #1E1D2FFF; + background: #24273AFF; background-alt: #282839FF; - foreground: #D9E0EEFF; - selected: #7AA2F7FF; - active: #ABE9B3FF; - urgent: #F28FADFF; + foreground: #CAD3F5FF; + selected: #8AADF4FF; + active: #A6DA95FF; + urgent: #ED8796FF; } diff --git a/.config/rofi/colors/gruvbox-material-dark.rasi b/.config/rofi/colors/gruvbox-material-dark.rasi new file mode 100644 index 0000000..11b945e --- /dev/null +++ b/.config/rofi/colors/gruvbox-material-dark.rasi @@ -0,0 +1,9 @@ +* { + background: #282828; + background-alt: #1D2021; + foreground: #D4BE98; + selected: #7DAEA3; + active: #A9B665; + urgent: #EA6962; +} + diff --git a/.config/rofi/colors/gruvbox-material-light.rasi b/.config/rofi/colors/gruvbox-material-light.rasi new file mode 100644 index 0000000..68d5e3a --- /dev/null +++ b/.config/rofi/colors/gruvbox-material-light.rasi @@ -0,0 +1,8 @@ +* { + background: #F2E5BC; + background-alt: #FBF1C7; + foreground: #654735; + selected: #45707A; + active: #6C782E; + urgent: #C14A4A; +} diff --git a/.local/share/scripts/powermenu.sh b/.local/share/scripts/powermenu.sh new file mode 100755 index 0000000..96f30a9 --- /dev/null +++ b/.local/share/scripts/powermenu.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Define options +options="Shutdown\nRestart\nSuspend\nLock" + +# Prompt user to select an option using Rofi +selected_option=$(echo -e "$options" | rofi -dmenu -p "Power Menu") + +# Function to display confirmation dialog +confirm_action() { + rofi -dmenu -p "$1" <<<"Yes\nNo" +} + +# Perform action based on selected option +case $selected_option in +"Shutdown") + confirmation=$(confirm_action "Shutdown?") + if [ "$confirmation" == "Yes" ]; then + systemctl poweroff + else + exit 0 + fi + ;; +"Restart") + confirmation=$(confirm_action "Restart?") + if [ "$confirmation" == "Yes" ]; then + systemctl reboot + else + exit 0 + fi + ;; +"Suspend") + systemctl suspend + ;; +"Lock") + i3-msg exit + ;; +*) + exit 0 + ;; +esac diff --git a/.local/share/scripts/theme-selector.sh b/.local/share/scripts/theme-selector.sh index b6dd002..fed4d63 100644 --- a/.local/share/scripts/theme-selector.sh +++ b/.local/share/scripts/theme-selector.sh @@ -9,11 +9,14 @@ theme_options=( ) # rofi script to get what theme to use -chosen=$(printf '%s\n' "${theme_options[@]}" | rofi -dmenu -p "Choose a theme") +chosen=$(printf '%s\n' "${theme_options[@]}" | rofi -dmenu -p "Theme") -theme=$(echo "${chosen}" | cut -d- -f1) -background=$(echo "${chosen}" | cut -d- -f2) +theme=$(echo "${chosen}" | rev | cut -d- -f2- | rev) +background=$(echo "${chosen}" | awk -F'-' '{print $NF}') + +echo "Theme: ${theme}" +echo "Background: ${background}" # change rofi theme sed -i "s/\(@import \".config\/rofi\/colors\/\).*/\1${theme}-${background}.rasi\"/" ~/.config/rofi/config.rasi @@ -24,5 +27,6 @@ sed -i "s/\(local background = \).*/\1\"${background}\"/" ~/.config/nvim/lua/tso # change xresources xresources_themes=".Xresources.d" sed -i "s/#include \".*\"/#include \"~\/${xresources_themes}\/${theme}-${background}\"/" ~/.Xresources +xrdb ~/.Xresources