Compare commits

...

8 Commits

8 changed files with 104 additions and 62 deletions

View File

@ -18,6 +18,8 @@ local hotkeys_popup = require("awful.hotkeys_popup")
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
---@diagnostic disable: undefined-global
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
@ -52,6 +54,10 @@ end
local theme = "theme_dark.lua"
beautiful.init(gears.filesystem.get_configuration_dir() .. theme)
local function set_wallpaper(s)
gears.wallpaper.set(beautiful.bg_wallpaper)
end
local function switch_theme()
if theme == "theme_dark.lua" then
theme = "theme_light.lua"
@ -61,6 +67,11 @@ local function switch_theme()
awful.spawn("lupan-set-theme dark")
end
beautiful.init(gears.filesystem.get_configuration_dir() .. theme)
set_wallpaper()
for s in screen do
awful.tag.viewtoggle(s.tags[1])
awful.tag.viewtoggle(s.tags[1])
end
end
-- This is used later as the default terminal and editor to run.
@ -141,10 +152,6 @@ local tasklist_buttons = gears.table.join(
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
gears.wallpaper.set(beautiful.bg_wallpaper)
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
@ -202,7 +209,7 @@ awful.screen.connect_for_each_screen(function(s)
end)
-- }}}
function layout_menu()
local function layout_menu()
local layouts = {}
for i, layout in pairs(awful.layout.layouts) do
layouts[i] =
@ -217,7 +224,7 @@ function layout_menu()
end
-- {{{ Key bindings
globalkeys = gears.table.join(
local globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{ description = "show help", group = "awesome" }),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
@ -322,7 +329,7 @@ globalkeys = gears.table.join(
{ description = "show the menubar", group = "launcher" })
)
clientkeys = gears.table.join(
local clientkeys = gears.table.join(
awful.key({ modkey, }, "f",
function(c)
c.fullscreen = not c.fullscreen
@ -416,7 +423,7 @@ for i = 1, 9 do
)
end
clientbuttons = gears.table.join(
local clientbuttons = gears.table.join(
awful.button({}, 1, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true })
end),
@ -514,21 +521,6 @@ client.connect_signal("manage", function(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({}, 1, function()
c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.move(c)
end),
awful.button({}, 3, function()
c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.resize(c)
end)
)
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", { raise = false })

View File

@ -9,18 +9,18 @@ theme.font = "GoMono Nerd Font 10.5"
theme.tasklist_disable_icon = true
theme.wibar_height = 40
theme.bg_normal = "#1e293b"
theme.bg_focus = "#475569"
theme.bg_urgent = "#ff5555"
theme.bg_minimize = "#444444"
theme.bg_normal = "#292b3d"
theme.bg_focus = "#454654"
theme.bg_urgent = "#dfaa9f"
theme.bg_minimize = "#5c5e70"
theme.bg_systray = theme.bg_normal
theme.tasklist_bg_focus = "#334155"
theme.tasklist_bg_focus = "#3d405c"
theme.fg_normal = "#64748B"
theme.fg_focus = "#94A3B8"
theme.fg_urgent = "#111827"
theme.fg_minimize = "#ffffff"
theme.taglist_fg_empty = "#334155"
theme.fg_normal = "#7a7fb8"
theme.fg_focus = "#b3b6d6"
theme.fg_urgent = theme.bg_focus
theme.fg_minimize = "#b9bac6"
theme.taglist_fg_empty = "#535888"
theme.useless_gap = dpi(1)
theme.border_width = dpi(2)
@ -28,7 +28,7 @@ theme.border_normal = "#708090"
theme.border_focus = "#a0522d"
theme.border_marked = "#91231c"
theme.bg_wallpaper = "#4a4a4a"
theme.bg_wallpaper = "#505262"
-- You can use your own layout icons like this:
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"

View File

@ -9,18 +9,18 @@ theme.font = "GoMono Nerd Font 10.5"
theme.tasklist_disable_icon = true
theme.wibar_height = 40
theme.bg_normal = "#0c4a6e"
theme.bg_focus = "#0284c7"
theme.bg_urgent = "#ff5555"
theme.bg_minimize = "#444444"
theme.bg_normal = "#292b3d"
theme.bg_focus = "#999fe6"
theme.bg_urgent = "#dfaa9f"
theme.bg_minimize = "#5c5e70"
theme.bg_systray = theme.bg_normal
theme.tasklist_bg_focus = "#075985"
theme.tasklist_bg_focus = "#7e85cd"
theme.fg_normal = "#cbd5e1"
theme.fg_focus = "#bae6fd"
theme.fg_urgent = "#111827"
theme.fg_minimize = "#ffffff"
theme.taglist_fg_empty = "#9ca3af"
theme.fg_normal = "#9599c6"
theme.fg_focus = "#252637"
theme.fg_urgent = theme.fg_focus
theme.fg_minimize = "#b9bac6"
theme.taglist_fg_empty = "#6469a0"
theme.useless_gap = dpi(1)
theme.border_width = dpi(2)
@ -28,7 +28,7 @@ theme.border_normal = "#bebebe"
theme.border_focus = "#ff7f50"
theme.border_marked = "#91231c"
theme.bg_wallpaper = "#dde1e3"
theme.bg_wallpaper = "#9d9eaf"
-- You can use your own layout icons like this:
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"

View File

@ -0,0 +1,10 @@
alias v=nvim
alias ll='ls -l'
if which exa > /dev/null; then
alias ls='exa --icons'
alias tree='exa --tree --icons'
fi
alias nocaps='setxkbmap pl -option ctrl:nocaps'
alias fixdp='xrandr --output DP-0 --right-of DP-2'

View File

@ -0,0 +1,4 @@
alias hs='history -$HISTSIZE | rg'
alias -s pdf=zathura
alias -s {jpg,jpeg,png}=sxiv

View File

@ -6,8 +6,6 @@ export FZF_DEFAULT_OPTS='--color=bw,hl:green,hl+:green'
zstyle ':fzf-tab:*' fzf-flags $FZF_DEFAULT_OPTS
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
plug "zap-zsh/supercharge"
plug "zap-zsh/exa"
plug "zap-zsh/vim"
autoload -Uz compinit
@ -30,3 +28,28 @@ zstyle ':vcs_info:*' nvcsformats '%F{green}%~%f%b '
zstyle ':vcs_info:*' enable git
PS1='%B%F{blue}%n@%m%f ${vcs_info_msg_0_}%B%#%f%b '
RPROMPT='%(?..%B%F{red}%?%f%b)'
# History.
HISTFILE=${ZDOTDIR:-~}/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_find_no_dups
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt hist_reduce_blanks
setopt inc_append_history
setopt share_history
# Convenience.
setopt autocd
bindkey -M vicmd '^[h' run-help
bindkey -M viins '^[h' run-help
# Aliases.
for f in ~/.config/shellconfig/*.sh(N) ~/.config/shellconfig/*.zsh(N); do source "$f"; done

View File

@ -1,13 +1,38 @@
set -g status-bg colour0
set -g status-fg colour7
set -g prefix C-t
bind-key C-t send-prefix
bind-key C-j select-pane -D
bind-key C-k select-pane -U
bind-key C-h select-pane -L
bind-key C-l select-pane -R
bind-key j switch-client -n
bind-key k switch-client -p
bind-key h previous-window
bind-key l next-window
bind-key t last-window
bind-key T switch-client -l
bind -n S-Left previous-window
bind -n S-Right next-window
bind -n C-S-Left swap-window -t -1
bind -n C-S-Right swap-window -t 1
bind -n S-Up switch-client -p
bind -n S-Down switch-client -n
set -g default-terminal "screen-256color"
set -as terminal-features ",xterm-256color:RGB"
set -g base-index 1
setw -g base-index 1
set -g set-titles on
set -g set-titles-string "[#S] #P:#W #T"
set -g set-titles-string "#H [#S]"
set -g status-justify centre
set -g status-left "#[bg=green]#[fg=black] #H #[bg=default]#[fg=default] #S"
set -g status-left-length 50
set -g status-right "#[bg=green]#[fg=black] %H:%M "
set-window-option -g window-status-current-style bg=green
set-window-option -ga window-status-current-style fg=black

View File

@ -11,21 +11,14 @@ if [ "$THEME" = "toggle" ]; then
fi
if [ "$THEME" = dark ]; then
BGCOLOR=#4a4a4a
GTK_THEME=Materia-dark
elif [ "$THEME" = light ]; then
BGCOLOR=#cacaca
GTK_THEME=Materia-light
else
echo "error: unknown theme: should be either dark, light or toggle" >&2
exit 1
fi
# Background color
if [ ! -x ~/.fehbg ]; then
hsetroot -solid "$BGCOLOR"
fi
# Alacritty
if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
@ -36,8 +29,3 @@ if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf
pkill -HUP -x xsettingsd
fi
# Emacs
if which emacsclient > /dev/null; then
emacsclient --eval "(my-select-theme '$THEME)"
fi