From de1730c1acefe5523e080bfc5bf421341824a6a4 Mon Sep 17 00:00:00 2001 From: samedamci Date: Tue, 24 Mar 2020 11:46:16 +0100 Subject: [PATCH] Add theme switcher and alternative magenta colorscheme --- botfiles/.config/dunst/dunstrc | 17 +++-- .../qutebrowser/qsettings/QtProject.conf | 4 +- botfiles/.config/rofi/config | 7 ++- botfiles/.config/rofi/theme.rasi | 62 ++++++++----------- botfiles/.config/sxhkd/sxhkdrc.laptop | 4 ++ botfiles/.config/sxhkd/sxhkdrc.pc | 3 + botfiles/.scripts/autostart | 10 +-- botfiles/.scripts/bindinglist | 3 + botfiles/.scripts/themeswitcher | 62 +++++++++++++++++++ updot | 6 +- 10 files changed, 119 insertions(+), 59 deletions(-) create mode 100755 botfiles/.scripts/bindinglist create mode 100644 botfiles/.scripts/themeswitcher diff --git a/botfiles/.config/dunst/dunstrc b/botfiles/.config/dunst/dunstrc index 7d9e960..e853a52 100644 --- a/botfiles/.config/dunst/dunstrc +++ b/botfiles/.config/dunst/dunstrc @@ -16,7 +16,7 @@ padding = 15 horizontal_padding = 15 frame_width = 1 - frame_color = "#144949" + frame_color = "#144949" #alignment = left #x = 15 #y = 15 @@ -83,23 +83,20 @@ [urgency_low] # IMPORTANT: colors have to be defined in quotation marks. # Otherwise the "#" and following would be interpreted as a comment. - background = "#071616" - foreground = "#cccccc" - frame_color = "#144949" + background = "#071616" + foreground = "#dfdfdf" timeout = 5 # Icon for notifications with low urgency, uncomment to enable #icon = ~/.local/share/arch.png [urgency_normal] - background = "#071616" - foreground = "#cccccc" - frame_color = "#144949" + background = "#071616" + foreground = "#dfdfdf" timeout = 5 [urgency_critical] - background = "#10a0200" - foreground = "#cccccc" - frame_color = "#dfdfdf" + background = "#071616" + foreground = "#dfdfdf" timeout = 0 # Every section that isn't one of the above is interpreted as a rules to diff --git a/botfiles/.config/qutebrowser/qsettings/QtProject.conf b/botfiles/.config/qutebrowser/qsettings/QtProject.conf index a500389..cfef6b3 100644 --- a/botfiles/.config/qutebrowser/qsettings/QtProject.conf +++ b/botfiles/.config/qutebrowser/qsettings/QtProject.conf @@ -1,8 +1,8 @@ [FileDialog] history=file:///home/samedamci/Pictures/Screenshots, file:///home/samedamci/.scripts/rofi-keepassxc, file:///home/samedamci/Pictures, file:///home/samedamci, file:///home/samedamci/Downloads/Telegram Desktop -lastVisited=file:///home/samedamci/Downloads/Telegram Desktop +lastVisited=file:///home/samedamci/Pictures/Screenshots qtVersion=5.14.1 shortcuts=file:, file:///home/samedamci sidebarWidth=90 -treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xec\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xff\0\0\0\x1\0\0\0\0\0\0\0?\0\0\0\x1\0\0\0\0\0\0\0@\0\0\0\x1\0\0\0\0\0\0\0n\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff) +treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\x3\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xec\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xff\0\0\0\x1\0\0\0\0\0\0\0?\0\0\0\x1\0\0\0\0\0\0\0@\0\0\0\x1\0\0\0\0\0\0\0n\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff) viewMode=Detail diff --git a/botfiles/.config/rofi/config b/botfiles/.config/rofi/config index 567dda5..5a32928 100644 --- a/botfiles/.config/rofi/config +++ b/botfiles/.config/rofi/config @@ -2,6 +2,9 @@ rofi.modi: drun rofi.font: DejaVu San Mono for Powerline 12 rofi.show-icons: true rofi.m: 0 -rofi.lines: 20 -rofi.width: 30 +rofi.lines: 13 +rofi.width: 20 rofi.theme: theme +rofi.location: 1 +rofi.xoffset: 10 +rofi.yoffset: 40 diff --git a/botfiles/.config/rofi/theme.rasi b/botfiles/.config/rofi/theme.rasi index 7c7d813..2a933fe 100644 --- a/botfiles/.config/rofi/theme.rasi +++ b/botfiles/.config/rofi/theme.rasi @@ -1,50 +1,38 @@ * { - maincolor: #144949; + maincolor: #144949; highlight: bold #e2a478; urgentcolor: #dfdfdf; - fg: #dfdfdf; - bg: #071616; + foreground: #dfdfdf; + background: #071616; blackselect: #22262e; - /* hack */ - /* maincolor: #007700; */ - /* highlight: bold #00bb00; */ - /* urgentcolor: #007700; */ - - /* fg: #007700; */ - /* bg: #000000; */ - /* blackselect: #001100; */ - /* cyan: #004400; */ - background-color: @bg; + background-color: @background; show-icons: true; } window { - background-color: @bg; + background-color: @background; border: 1; border-color: @maincolor; padding: 0; - anchor: center; - location: center; - y-offset: 20; } mainbox { - background-color: @bg; + background-color: @background; spacing: 0px; children: [inputbar, message, listview]; } message { padding: 6px 10px; - background-color:@bg; + background-color:@background; } textbox { text-color:@urgentcolor; padding: 10px 10px; - background-color:@bg; + background-color:@background; } listview { @@ -54,7 +42,7 @@ listview { spacing: 0px; padding: 1px 0px 0px 0px; margin: 0px 0px 1px 0px; - background: @bg; + background: #071616; } element { @@ -63,62 +51,62 @@ element { element normal.normal { padding: 0px 15px; - background-color: @bg; + background-color: @background; text-color: @urgentcolor; } element normal.urgent { - background-color: @bg; + background-color: @background; text-color: @urgentcolor; } element normal.active { - background-color: @bg; + background-color: @background; text-color: @maincolor; } element selected.normal { background-color: @blackselect; - text-color: @fg; + text-color: @foreground; } element selected.urgent { background-color: @urgentcolor; - text-color: @bg; + text-color: @background; } element selected.active { background-color: @maincolor; - text-color: @bg; + text-color: @background; } element alternate.normal { - background-color: @bg; - text-color: @fg; + background-color: @background; + text-color: @foreground; } element alternate.urgent { - background-color: @bg; + background-color: @background; text-color: @urgentcolor; } element alternate.active { - background-color: @bg; + background-color: @background; text-color: @maincolor; } scrollbar { - background-color: @bg; + background-color: @background; handle-color: @cyan; handle-width: 15px; } mode-switcher { - background-color: @bg; + background-color: @background; } button { - background-color: @bg; + background-color: @background; text-color: @cyan; } @@ -127,7 +115,7 @@ button selected { } inputbar { - background-color: @bg; + background-color: @background; spacing: 0px; } @@ -139,13 +127,13 @@ prompt { entry { padding:6px 10px; - background-color:@bg; + background-color:@background; text-color:@urgentcolor; } case-indicator { padding:6px 10px; text-color:@maincolor; - background-color:@bg; + background-color:@background; } /* vim:ft=css diff --git a/botfiles/.config/sxhkd/sxhkdrc.laptop b/botfiles/.config/sxhkd/sxhkdrc.laptop index f4443e7..dedccb1 100644 --- a/botfiles/.config/sxhkd/sxhkdrc.laptop +++ b/botfiles/.config/sxhkd/sxhkdrc.laptop @@ -69,6 +69,10 @@ super + n # kaomoji-rofi super + e $SCRD/kaomoji-rofi/kaomoji.sh +# theme switcher +super + v + $SCRD/themeswitcher + #~~~~~~~~~~~~ # WM CONTROL diff --git a/botfiles/.config/sxhkd/sxhkdrc.pc b/botfiles/.config/sxhkd/sxhkdrc.pc index c632c9c..0613594 100644 --- a/botfiles/.config/sxhkd/sxhkdrc.pc +++ b/botfiles/.config/sxhkd/sxhkdrc.pc @@ -73,6 +73,9 @@ super + n # kaomoji-rofi super + e $SCRD/kaomoji-rofi/kaomoji.sh +# themeswitcher +super + v + $SCRD/themeswitcher #~~~~~~~~~~~~ # WM CONTROL diff --git a/botfiles/.scripts/autostart b/botfiles/.scripts/autostart index cfe1663..ef851a9 100755 --- a/botfiles/.scripts/autostart +++ b/botfiles/.scripts/autostart @@ -16,19 +16,19 @@ fi # Polybar killall -q polybar -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done +while pgrep -u $UID -x polybar >/dev/null; do killall -q polybar; done polybar polybarexe & -# Polybar +# sxhkd killall -q sxhkd -while pgrep -u $UID -x sxhkd >/dev/null; do sleep 1; done +while pgrep -u $UID -x sxhkd >/dev/null; do killall -q sxhkd; done sxhkd & # Dunst killall -q dunst -while pgrep -u $UID -x dunst >/dev/null; do sleep 1; done +while pgrep -u $UID -x dunst >/dev/null; do killall -q dunst; done dunst & # Picom killall -q picom -while pgrep -u $UID -x picom >/dev/null; do sleep 1; done +while pgrep -u $UID -x picom >/dev/null; do killall -q picom; done picom & # Set keyboard layout & key swaping diff --git a/botfiles/.scripts/bindinglist b/botfiles/.scripts/bindinglist new file mode 100755 index 0000000..f5a5962 --- /dev/null +++ b/botfiles/.scripts/bindinglist @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +awk '/^[a-z]/ && last {print $0,"\t",last} {last=""} /^#/{last=$0}' ~/.config/sxhkd/sxhkdrc | column -t -s $'\t' | fzf --preview '' --height 100% diff --git a/botfiles/.scripts/themeswitcher b/botfiles/.scripts/themeswitcher new file mode 100644 index 0000000..e42e8a2 --- /dev/null +++ b/botfiles/.scripts/themeswitcher @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +xfile="$HOME/.Xresources" + +theme="$(printf "cyan\nmagenta" | rofi -dmenu -i -p "Theme" -l 2)" + +case "$theme" in + cyan) + bg="#071616" + bunfoc="#353234" + bfoc="#144949" + dselb="#144949" + ;; + magenta) + bg="#211019" + bunfoc="#2d060e" + bfoc="#4c1139" + dselb="#4c1139" + ;; + *) exit;; +esac + +sed -i \ + -e "s/\*\.background:.*/\*\.background: $bg/" \ + -e "s/\*\.border_unfocused:.*/\*\.border_unfocused: $bunfoc/" \ + -e "s/\*\.border_focused:.*/\*\.border_focused: $bfoc/" \ + -e "s/dmenu\.selbackground:.*/dmenu\.selbackground: $dselb/" \ + $xfile + +# get colors +xrdb "$xfile" + +fg=$(xrdb -query | awk '/\*.foreground/ { printf $2 }') +bg=$(xrdb -query | awk '/\*.background/ { printf $2 }') +bfoc=$(xrdb -query | awk '/\*.border_focused/ { printf $2 }') + +# black=$(xrdb -query | awk '/color0/ { printf $2 }') +# red=$(xrdb -query | awk '/color1:/ { printf $2 }') +# green=$(xrdb -query | awk '/color2/ { printf $2 }') +# yellow=$(xrdb -query | awk '/color3/ { printf $2 }') +# blue=$(xrdb -query | awk '/color4/ { printf $2 }') +# magenta=$(xrdb -query | awk '/color5/ { printf $2 }') +# cyan=$(xrdb -query | awk '/color6/ { printf $2 }') +# white=$(xrdb -query | awk '/color7/ { printf $2 }') + +# dunst +sed -i \ + -e "s/^\s*foreground.*/ foreground = \"$fg\"/" \ + -e "s/^\s*background.*/ background = \"$bg\"/" \ + -e "s/^\s*frame_color.*/ frame_color = \"$bfoc\"/" \ + ~/.config/dunst/dunstrc + +# rofi +sed -i \ + -e "s/foreground:.*/foreground: ${fg};/" \ + -e "s/background:.*/background: ${bg};/" \ + -e "s/maincolor:.*/maincolor: ${bfoc};/" \ + ~/.config/rofi/theme.rasi + +bspc wm -r + +notify-send "Theme changed!" diff --git a/updot b/updot index 6fd2098..92cc744 100755 --- a/updot +++ b/updot @@ -5,8 +5,8 @@ echo "Adding configs to dotfiles repo..." cd ~ cp .zshrc .Xresources .profile .shellrc .bashrc .zprofile .bash_profile .local/share/TelegramDesktop/tdata/shortcuts-custom.json ~/Dotfiles/botfiles/ &>/dev/null cd ~/.scripts/ -cp autostart lockscreen powermenu screenshot update-check updater websearch ~/Dotfiles/botfiles/.scripts/ &>/dev/null -cd ~/.config +cp * ~/Dotfiles/botfiles/.scripts/ &>/dev/null +cd ~/.config/ if [ "$HOSTNAME" = "pc" ]; then cat sxhkd/sxhkdrc > sxhkd/sxhkdrc.pc @@ -16,7 +16,7 @@ elif [ "$HOSTNAME" = "laptop" ]; then cat polybar/config > polybar/config.laptop fi -cp -r autostart flake8 bspwm dconf dunst gtk-3.0 gtk-2.0 homepage mpd ncmpcpp neofetch nvim picom polybar qutebrowser ranger rofi sxhkd vifm vis vlc wallpapers yay zsh ~/Dotfiles/botfiles/.config/ &>/dev/null +cp -r flake8 bspwm dconf dunst gtk-3.0 gtk-2.0 homepage mpd ncmpcpp neofetch nvim picom polybar qutebrowser ranger rofi sxhkd vifm vis vlc wallpapers yay zsh ~/Dotfiles/botfiles/.config/ &>/dev/null cd ~/Dotfiles/botfiles/.config/ rm -rf nvim/bundle zsh/plugins mpd/database zsh/history mpd/mpd.log mpd/pid mpd/state mpd/sticker.sql vis/vis.log ncmpcpp/lyrics sxhkd/sxhkdrc polybar/config vifm/vifminfo