From f9c52d5fd3d633f5f9f9fa4b757a2c707c617f3c Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Thu, 28 Mar 2024 13:42:56 +0000 Subject: [PATCH] system recovery --- hypr/hyprland.conf | 29 ++------- hypr/hyprlock.conf | 10 +-- hypr/hyprpaper.conf | 16 ++--- kitty/kitty.conf | 2 +- nvim/init.lua | 4 +- nvim/lua/thomas/core/options.lua | 2 +- nvim/lua/thomas/plugins-setup.lua | 2 +- tmux/tmux.conf | 2 +- tofi/config | 4 +- waybar/config | 58 +++++++++-------- .../custom_modules/time_warrior_waybar.py | 54 ++++++++++++++++ waybar/style.css | 63 ++++++------------- zsh/thomas.zsh-theme | 6 +- zsh/zshrc | 13 ++-- 14 files changed, 136 insertions(+), 129 deletions(-) create mode 100755 waybar/resources/custom_modules/time_warrior_waybar.py diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 5c30d97..bbd1fa1 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,17 +1,3 @@ - -######################################################################################## -AUTOGENERATED HYPR CONFIG. -PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, -OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. -######################################################################################## - -# -# Please note not all available settings / options are set here. -# For a full list, see the wiki -# - -# autogenerated = 1 # remove this line to remove the warning - # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=HDMI-A-1,preferred,0x1440,1 # Dell monitor=DP-2,preferred,0x0,1 # AOC @@ -21,10 +7,11 @@ monitor=eDP-1,preferred,3440x1648,1 # ThinkPad # Execute your favorite apps at launch exec-once = hyprlock -exec-once = waybar & hyprpaper & hypridle & swaync +exec-once = waybar & hyprpaper & swaync exec-once=hyperctl setcursor Breeze 24 -gsettings set org.gnome.desktop.interface cursor-theme Breeze -gsettings set org.gnome.desktop.interface cursor-size 24 + +#gsettings set org.gnome.desktop.interface cursor-theme Breeze +#gsettings set org.gnome.desktop.interface cursor-size 24 # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf @@ -133,18 +120,14 @@ force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers disable_hyprland_logo = true } -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic-mouse-v1 { - sensitivity = -0.5 -} + # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. +# windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. # See https://wiki.hyprland.org/Configuring/Keywords/ for more diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf index 71eee4b..7a817e8 100644 --- a/hypr/hyprlock.conf +++ b/hypr/hyprlock.conf @@ -1,9 +1,9 @@ background { monitor = - path = /home/thomas/dotfiles/images/gruv_city.png + path = /home/thomas/Pictures/login_splash_screen.png color = rgba(40, 40, 40, 1.0) # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations - blur_passes = 4 # 0 disables blurring + blur_passes = 0 # 4 before disables blurring blur_size = 2 noise = 0.0117 contrast = 0.8916 @@ -13,8 +13,8 @@ background { } input-field { monitor = - size = 200, 50 - outline_thickness = 3 + size = 200, 38 + outline_thickness = 2 dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 dots_center = true @@ -32,7 +32,7 @@ input-field { } label { monitor = - text = Enter password, Thomas + text = Enter password color = rgba(235,219,178, 0.8) font_size = 25 font_family = Sys TT Bold diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf index cd6ddca..0189dc9 100644 --- a/hypr/hyprpaper.conf +++ b/hypr/hyprpaper.conf @@ -1,13 +1,9 @@ -preload = ~/Pictures/wallpapers/shah-gruv-aoc.png -preload = ~/Pictures/wallpapers/shah-gruv-dell.png -preload = ~/Pictures/wallpapers/shah-gruv-thinkpad.png -preload = ~/Pictures/wallpapers/gruv_city.jpg -preload = ~/Pictures/wallpapers/gruv_shroom.jpg -preload = ~/Pictures/wallpapers/gruv_woods.jpg -preload = ~/Pictures/grid-test.png +preload = ~/Pictures/Wallpapers/plain_gruv_thinkpad.png +preload = ~/Pictures/Wallpapers/plain_gruv_aoc.png +preload = ~/Pictures/Wallpapers/plain_gruv_dell.png -wallpaper = HDMI-A-1,~/Pictures/wallpapers/gruv_city.jpg -wallpaper = DP-2, ~/Pictures/wallpapers/gruv_city.jpg -wallpaper = eDP-1,~/Pictures/wallpapers/gruv_city.jpg +wallpaper = HDMI-A-1,~/Pictures/Wallpapers/plain_gruv_dell.png +wallpaper = DP-2,~/Pictures/Wallpapers/plain_gruv_aoc.png +wallpaper = eDP-1,~/Pictures/Wallpapers/plain_gruv_thinkpad.png splash = false diff --git a/kitty/kitty.conf b/kitty/kitty.conf index fe2eecc..35449f6 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -10,7 +10,7 @@ window_padding_width 5 remember_window_size no copy_on_select yes -background_opacity 0.9 +background_opacity 1 confirm_os_window_close 0 # hide_window_decorations no # wayland_titlebar_color background diff --git a/nvim/init.lua b/nvim/init.lua index f7485ac..d684209 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -28,6 +28,6 @@ require("thomas.plugins.nvim-tree") require("thomas.plugins.rainbow-delimiters") require("thomas.plugins.gitblame") require("thomas.plugins.zk") -require("thomas.plugins.noice") +-- require("thomas.plugins.noice") require("thomas.plugins.obsidian-nvim") -require("thomas.plugins.nvim-notify") +-- require("thomas.plugins.nvim-notify") diff --git a/nvim/lua/thomas/core/options.lua b/nvim/lua/thomas/core/options.lua index 3cb33fa..f450d74 100644 --- a/nvim/lua/thomas/core/options.lua +++ b/nvim/lua/thomas/core/options.lua @@ -25,6 +25,6 @@ opt.wrap = false opt.formatoptions = "cro" opt.backspace = "indent,eol,start" opt.conceallevel = 0 -vim.notify = require("notify") +-- vim.notify = require("notify") -- vim.g.gruvbox_material_background = "hard" vim.g.gruvbox_material_enable_bold = 1 diff --git a/nvim/lua/thomas/plugins-setup.lua b/nvim/lua/thomas/plugins-setup.lua index 63b5aa1..d034135 100644 --- a/nvim/lua/thomas/plugins-setup.lua +++ b/nvim/lua/thomas/plugins-setup.lua @@ -48,7 +48,7 @@ return packer.startup(function(use) use("zk-org/zk-nvim") use("ryanoasis/vim-devicons") use("tpope/vim-fugitive") - use("rcarriga/nvim-notify") + -- use("rcarriga/nvim-notify") use("tpope/vim-markdown") use("f-person/git-blame.nvim") use("lewis6991/gitsigns.nvim") -- show line modifications on left hand side diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 247353b..c197e15 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -13,7 +13,7 @@ set -g status-right 'tmux ' set -g window-status-format " #I:#W " set -g window-status-current-format " #I:#W " -set -g status-style "bg=#98971a,fg=#282828" +set -g status-style "bg=#a89984,fg=#282828" # set -g status-bg colour8 # set -g status-fg colour7 diff --git a/tofi/config b/tofi/config index b9ebffb..b6a3fd2 100644 --- a/tofi/config +++ b/tofi/config @@ -13,7 +13,7 @@ # characters not in the chosen font will fail to render. # # Otherwise, fonts are interpreted in Pango format. - font = "/usr/share/fonts/Sys1.1/Sys1.1.ttf" + font = ".local/share/fonts/Sys1.1.ttf" # Point size of text. font-size = 14 z @@ -229,7 +229,7 @@ z # Window offset from edge of screen. Only has an effect when anchored # to the relevant edge. Can be pixels or a percentage. - margin-top = 38 + margin-top = 43 margin-bottom = 0 margin-left = 0 margin-right = 0 diff --git a/waybar/config b/waybar/config index eb26b78..8a6b9e2 100644 --- a/waybar/config +++ b/waybar/config @@ -1,13 +1,14 @@ { "layer": "top", "margin": "0", - "height": 25, + "height": 25, "spacing": 0, - "modules-left": [ + +"modules-left": [ "custom/os", "hyprland/workspaces", "wlr/taskbar" - ], + ], "modules-center": [ ], "modules-right": [ @@ -18,7 +19,7 @@ "temperature", "backlight", "disk", - "custom/diskBackup", + "custom/diskBackup", "battery", "custom/wakatime", "clock", @@ -26,14 +27,13 @@ "custom/lock", "custom/restart", "custom/shutdown", - "custom/notification", + "custom/notification", ], - "wlr/taskbar": { "format": "{icon}", "icon-size": 20, - "icon-theme": "Pop Extended", + "icon-theme": "Pop", "tooltip-format": "{title}", "on-click": "activate", "on-click-middle": "close", @@ -90,19 +90,19 @@ "spacing": 10 }, "clock": { - "format": "󱑎 {:%H:%M}", - "format-alt": "󱑎 {:%d/%m/%Y}" + "format": "{:%H:%M}", + "format-alt": "{:%d/%m/%Y}" }, "cpu": { - "format": "󰛕 {usage}%", + "format": "CPU: {usage}%", "tooltip": false }, "memory": { - "format": " {}%", + "format": "Mem: {}%", }, "temperature": { "critical-threshold": 80, - "format": "{icon} {temperatureC}°C", + "format": "Temp: {temperatureC}°C", "format-icons": [ "󱩅", "󱩅", @@ -111,7 +111,7 @@ }, "backlight": { "device": "acpi_video1", - "format": "{icon} {percent}%", + "format": "Dim: {percent}%", "format-icons": [ "󰪞 ", "󰪟 ", @@ -127,9 +127,9 @@ "warning": 30, "critical": 15 }, - "format": "{icon} {capacity}%", - "format-charging": "{icon} {capacity}%", - "format-plugged": "{icon} {capacity}%", + "format": "Bat: {capacity}%", + "format-charging": "Bat: {capacity}%", + "format-plugged": "Bat: {capacity}%", "format-icons": [ "󰁻", "󰁼", @@ -142,12 +142,12 @@ "bat": "BAT2" }, "network": { - "format-wifi": "󰖩 {essid}", + "format-wifi": "Net: {essid}", "format-ethernet": "{ipaddr}/{cidr}", "tooltip-format": "{ifname} via {gwaddr}", "format-linked": "{ifname} (No IP)", - "format-disconnected": "󰖪 ", - "format-alt": "󰖩 {essid} ({signalStrength}%)" + "format-disconnected": "Net: none", + "format-alt": "Sig: {essid} ({signalStrength}%)" }, "pulseaudio": { "format": "{icon} {volume}%", @@ -172,15 +172,15 @@ }, "disk": { "interval": 30, - "format": "󰟸 {percentage_used}%", + "format": "Disk: {percentage_used}%", "path": "/home" }, "bluetooth": { "controller": "bluetoothctl", - "format": " active", - "format-connected": " connected", - "format-alt": " {device_alias}", - "format-connected-battery": " {device_battery_percentage}%", + "format": "BT: active", + "format-connected": "BT: connected", + "format-alt": "BT: {device_alias}", + "format-connected-battery": "BT: {device_battery_percentage}%", "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", @@ -201,8 +201,8 @@ "format": "" }, "custom/wakatime": { - "exec": "source $HOME/dotfiles/.env && python3 $HOME/.config/waybar/resources/custom_modules/wakatime_waybar.py", - "format": "󰲌 {}", + "exec": "source $HOME/.env && python3 $HOME/.config/waybar/resources/custom_modules/wakatime.py", + "format": "Code: {}", "return-type": "json", "interval": 600 }, @@ -240,7 +240,7 @@ "escape": true }, "custom/diskBackup": { - "format": "󰠘 {}", + "format": "Bak: {}", "exec": "df -h /media/backups | awk 'NR==2{print $5}'", "interval": 60 }, @@ -255,7 +255,5 @@ "custom/restart": { "format": "󰑓", "on-click": "systemctl reboot" - }, - - + } } diff --git a/waybar/resources/custom_modules/time_warrior_waybar.py b/waybar/resources/custom_modules/time_warrior_waybar.py new file mode 100755 index 0000000..e2fae6f --- /dev/null +++ b/waybar/resources/custom_modules/time_warrior_waybar.py @@ -0,0 +1,54 @@ +#! /usr/local/bin/python3 + +import subprocess +import json + + +def invoke_shell(proc): + try: + result = subprocess.run( + proc, + shell=True, + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + ) + return result.stdout.strip() + except subprocess.CalledProcessError as e: + return e.stderr.strip() + + +def timer_active() -> bool: + status = invoke_shell("timew get dom.active") + if status == "1": + return True + else: + return False + + +def generate_tooltip(): + tooltip = invoke_shell("timew summary :week") + return tooltip + + +def main(): + output = {} + try: + if timer_active(): + output["text"] = "󱫐" + output["class"] = "active" + else: + output["text"] = "󱫦" + output["class"] = "inactive" + except Exception as e: + output["text"] = "Error" + + print(json.dumps(output)) + + +if __name__ == "__main__": + main() + + +print(timer_active()) diff --git a/waybar/style.css b/waybar/style.css index 7b700ba..e929708 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -3,17 +3,14 @@ } window#waybar { - font-family: "Sys TT", "PragmataPro Mono Liga"; + font-family: "Sys TT", "Font Awesome"; background-color: #458588; border-bottom: 2px solid #282828; - /* background-color: rgba(40, 40, 40, 1); */ - font-size: 16px; } button { border-radius: 0; - /* box-shadow: inset 0 -3px transparent; */ border: none; opacity: 1; } @@ -36,9 +33,13 @@ tooltip label { margin-right: 10px; } +#custom-os { + padding: 0px 8px; + margin: 5px 3px 6px; +} + #clock, #custom-wakatime, -#custom-os, #network, #bluetooth, #cpu, @@ -48,7 +49,7 @@ tooltip label { #disk, #custom-diskBackup, #battery { - padding: 0px 8px; + padding: 2px 8px 0; margin: 5px 3px 6px; } @@ -58,7 +59,6 @@ tooltip label { padding: 0px 4px; } -#workspaces button, #custom-timewarrior, #custom-notification, #custom-lock, @@ -73,28 +73,21 @@ tooltip label { } #taskbar button { - color: #282828; background-color: #a89984; border: 2px solid; /* Base border */ border-color: #ebdbb2 #665c54 #665c54 #ebdbb2; } #workspaces button { - padding: 0; - padding-top: 3px; - /* padding-left: 2px; */ - /* padding-right: 2px; */ - /* margin-right: 5px; */ - + margin: 5px 0 6px; + font-size: 18px; + color: #ebdbb2; + padding: 3px 5px 0; background-color: #665c54; border: 2px solid; /* Base border */ border-color: #928374 #282828 #282828 #928374; } -/* #waybar .modules-left > *:first-child > * { */ -/* margin-left: 25px; */ -/* } */ - #workspaces > *:last-child { margin-right: 10px; } @@ -110,10 +103,6 @@ tooltip label { /* Colours */ #taskbar button.active { - /* background-color: #98971a; */ - /* border: 2px solid; /1* Base border *1/ */ - /* border-color: #b8bb27 #79740e #79740e #b8bb27; */ - background-color: #ebdbb2; border: 2px solid; /* Base border */ border-color: #fbf1c7 #a89984 #a89984 #fbf1c7; @@ -185,9 +174,6 @@ tooltip label { #workspaces button.active { color: #282828; - /* background-color: #98971a; */ - /* border: 2px solid; /1* Base border *1/ */ - /* border-color: #b8bb27 #79740e #79740e #b8bb27; */ background-color: #ebdbb2; border: 2px solid; /* Base border */ border-color: #fbf1c7 #a89984 #a89984 #fbf1c7; @@ -200,16 +186,6 @@ tooltip label { border-color: #b8bb27 #79740e #79740e #b8bb27; } -#custom-notification, -#custom-lock, -#custom-shutdown, -#custom-restart, -#custom-notification, -#custom-timewarrior.inactive { - /* background-color: #282828; */ - /* color: #ebdbb2; */ -} - #custom-timewarrior { margin-left: 10px; } @@ -220,15 +196,20 @@ tooltip label { margin-right: 10px; font-size: 18px; padding-right: 14px; - /* background-color: #458588; */ - /* border: 2px solid; /1* Base border *1/ */ - /* border-color: #83a598 #076678 #076678 #83a598; */ color: #282828; background-color: #a89984; border: 2px solid; /* Base border */ border-color: #ebdbb2 #665c54 #665c54 #ebdbb2; } +#custom-notification { + margin-left: 10px; +} + +#custom-timewarrior { + margin-right: 10px; +} + #custom-timewarrior, #custom-notification, #custom-lock, @@ -240,10 +221,4 @@ tooltip label { border: 2px solid; /* Base border */ border-color: #928374 #282828 #282828 #928374; color: #ebdbb2; - /* color: #282828; */ - /* background-color: #a89984; */ - /* border: 2px solid; /1* Base border *1/ */ - /* border-color: #ebdbb2 #665c54 #665c54 #ebdbb2; */ - - /* border: 2px solid #665c54; */ } diff --git a/zsh/thomas.zsh-theme b/zsh/thomas.zsh-theme index bfbfd1f..1da4f72 100644 --- a/zsh/thomas.zsh-theme +++ b/zsh/thomas.zsh-theme @@ -1,6 +1,6 @@ # -*- sh -*- vim:set ft=sh ai et sw=4 sts=4: # It might be bash like, but I can't have my co-workers knowing I use zsh -PROMPT='%{$fg_bold[green]%}%n@%m:%{$fg_bold[magenta]%}%2~$(git_prompt_info)%{$reset_color%}%(.) ' +PROMPT='%{$fg_bold[green]%}%n@%m %{$fg_bold[magenta]%}%2~$(git_prompt_info)%{$reset_color%}%(.) ' -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%} " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" diff --git a/zsh/zshrc b/zsh/zshrc index 3ff21ea..90a852b 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -15,6 +15,8 @@ alias gpt="chatgpt-cli" # Set properties based on OS +# ZSH_THEME="thomas" + ZSH_THEME="thomas" plugins=(git npm fzf-tab zsh-autosuggestions zsh-syntax-highlighting) @@ -24,22 +26,21 @@ plugins=(git npm fzf-tab zsh-autosuggestions zsh-syntax-highlighting) # User configuration export EDITOR='nvim' -source ~/dotfiles/.env +source ~/.env source $ZSH/oh-my-zsh.sh export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init --path)" +#export PYENV_ROOT="$HOME/.pyenv" +#export PATH="$PYENV_ROOT/bin:$PATH" +#eval "$(pyenv init --path)" export PATH="$HOME/.local/bin:$PATH" -export OPENAI_API_KEY=${OPENAI_API_KEY} +# export OPENAI_API_KEY=${OPENAI_API_KEY} -# eval "$(starship init zsh)" export PATH=$PATH:/home/thomas/.spicetify