正确的ignore修改 与init

main
Yogi 2023-10-14 17:39:34 +08:00
parent 250c015339
commit 804d784219
37 changed files with 5566 additions and 8 deletions

15
.gitignore vendored
View File

@ -1,8 +1,7 @@
# 忽略其他的文件和文件夹
*
!/polybar/*
!/i3/*
!/rofi/*
!/lvim/*
!/fcitx5/*
!/terminator/*
/*
!/polybar/
!/i3/
!/rofi/
!/lvim/
!/fcitx5/
!/terminator/

3480
fcitx5/conf/cached_layouts Normal file

File diff suppressed because it is too large Load Diff

12
fcitx5/conf/chttrans.conf Normal file
View File

@ -0,0 +1,12 @@
# Translate engine
Engine=OpenCC
# Enabled Input Methods
EnabledIM=
# OpenCC profile for Simplified to Traditional
OpenCCS2TProfile=
# OpenCC profile for Traditional to Simplified
OpenCCT2SProfile=
[Hotkey]
0=Control+Shift+F

View File

@ -0,0 +1,3 @@
# Hidden Notifications
HiddenNotifications=

117
fcitx5/conf/pinyin.conf Normal file
View File

@ -0,0 +1,117 @@
# Shuangpin Profile
ShuangpinProfile=Ziranma
# Show current shuangpin mode
ShowShuangpinMode=True
# Page size
PageSize=7
# Enable Spell
SpellEnabled=True
# Enable Emoji
EmojiEnabled=True
# Enable Chaizi
ChaiziEnabled=True
# Enable Cloud Pinyin
CloudPinyinEnabled=False
# Cloud Pinyin Index
CloudPinyinIndex=2
# Show preedit within application
PreeditInApplication=True
# Fix embedded preedit cursor at the beginning of the preedit
PreeditCursorPositionAtBeginning=True
# Show complete pinyin in preedit
PinyinInPreedit=False
# Enable Prediction
Prediction=False
# Prediction Size
PredictionSize=10
# Select 2nd Candidate
SecondCandidate=
# Select 3rd Candidate
ThirdCandidate=
# Number of Sentences
Number of sentence=2
# Prompt long word length when input length over (0 for disable)
LongWordLengthLimit=4
# Key to trigger quickphrase
QuickPhraseKey=semicolon
# Use V to trigger quickphrase
VAsQuickphrase=True
# FirstRun
FirstRun=False
[ForgetWord]
0=Control+7
[PrevPage]
0=minus
1=Up
2=KP_Up
[NextPage]
0=equal
1=Down
2=KP_Down
[PrevCandidate]
0=Shift+Tab
[NextCandidate]
0=Tab
[ChooseCharFromPhrase]
0=bracketleft
1=bracketright
[FilterByStroke]
0=grave
[QuickPhrase trigger]
0=www.
1=ftp.
2=http:
3=mail.
4=bbs.
5=forum.
6=https:
7=ftp:
8=telnet:
9=mailto:
[Fuzzy]
# ue -> ve
VE_UE=True
# gn -> ng
NG_GN=True
# Inner Segment (xian -> xi'an)
Inner=True
# Inner Segment for Short Pinyin (qie -> qi'e)
InnerShort=True
# Match partial finals (e -> en, eng, ei)
PartialFinal=True
# Match partial shuangpin if input length is longer than 4
PartialSp=False
# u <-> v
V_U=False
# an <-> ang
AN_ANG=False
# en <-> eng
EN_ENG=False
# ian <-> iang
IAN_IANG=False
# in <-> ing
IN_ING=False
# u <-> ou
U_OU=False
# uan <-> uang
UAN_UANG=False
# c <-> ch
C_CH=False
# f <-> h
F_H=False
# l <-> n
L_N=False
# s <-> sh
S_SH=False
# z <-> zh
Z_ZH=False

View File

@ -0,0 +1,10 @@
# Half width punctuation after latin letter or number
HalfWidthPuncAfterLetterOrNumber=True
# Type paired punctuations together (e.g. Quote)
TypePairedPunctuationsTogether=False
# Enabled
Enabled=True
[Hotkey]
0=Control+period

75
fcitx5/config Normal file
View File

@ -0,0 +1,75 @@
[Hotkey]
# Enumerate when press trigger key repeatedly
EnumerateWithTriggerKeys=True
# Skip first input method while enumerating
EnumerateSkipFirst=False
[Hotkey/TriggerKeys]
0=Shift+space
1=Zenkaku_Hankaku
2=Hangul
[Hotkey/AltTriggerKeys]
0=Shift_L
[Hotkey/EnumerateForwardKeys]
0=Control+Shift_L
[Hotkey/EnumerateBackwardKeys]
0=Control+Shift_R
[Hotkey/EnumerateGroupForwardKeys]
0=Super+space
[Hotkey/EnumerateGroupBackwardKeys]
0=Shift+Super+space
[Hotkey/ActivateKeys]
0=Hangul_Hanja
[Hotkey/DeactivateKeys]
0=Hangul_Romaja
[Hotkey/PrevPage]
0=Up
[Hotkey/NextPage]
0=Down
[Hotkey/PrevCandidate]
0=Shift+Tab
[Hotkey/NextCandidate]
0=Tab
[Hotkey/TogglePreedit]
0=Control+Alt+P
[Behavior]
# Active By Default
ActiveByDefault=False
# Share Input State
ShareInputState=No
# Show preedit in application
PreeditEnabledByDefault=True
# Show Input Method Information when switch input method
ShowInputMethodInformation=True
# Show Input Method Information when changing focus
showInputMethodInformationWhenFocusIn=False
# Show compact input method information
CompactInputMethodInformation=True
# Show first input method information
ShowFirstInputMethodInformation=True
# Default page size
DefaultPageSize=5
# Override Xkb Option
OverrideXkbOption=False
# Custom Xkb Option
CustomXkbOption=
# Force Enabled Addons
EnabledAddons=
# Force Disabled Addons
DisabledAddons=
# Preload input method to be used by default
PreloadInputMethod=True

23
fcitx5/profile Normal file
View File

@ -0,0 +1,23 @@
[Groups/0]
# Group Name
Name=Default
# Layout
Default Layout=us
# Default Input Method
DefaultIM=shuangpin
[Groups/0/Items/0]
# Name
Name=keyboard-us
# Layout
Layout=
[Groups/0/Items/1]
# Name
Name=shuangpin
# Layout
Layout=
[GroupOrder]
0=Default

10
i3/brightness.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Change below to suit your system
BACKLIGHT="/sys/class/backlight/amdgpu_bl0"
BRIGHTNESS="$BACKLIGHT/brightness"
MAX_BRIGHTNESS=$(cat "$BACKLIGHT/max_brightness")
inotifywait -m -e modify "$BRIGHTNESS" \
| while IFS= read -r line; do cat $BRIGHTNESS; done \
| xob -m "$MAX_BRIGHTNESS"

47
i3/cat.sh Normal file
View File

@ -0,0 +1,47 @@
feh ~/Pictures/cutppuccin.png --bg-fill
cp ~/.config/alacritty/alacritty-cat.yml ~/.config/alacritty/alacritty.yml
cp ~/.config/nvim/lua/user/colorscheme-cat.lua ~/.config/nvim/lua/user/colorscheme.lua
cp ~/.config/nvim/lua/user/lualine-cat.lua ~/.config/nvim/lua/user/lualine.lua
cp ~/.gtkrc-2.0-cat ~/.gtkrc-2.0
cp ~/.config/bat/config-cat ~/.config/bat/config
cp ~/.config/bottom/bottom-cat.toml ~/.config/bottom/bottom.toml
cp ~/.config/dunst/dunstrc-cat ~/.config/dunst/dunstrc
cp ~/.config/fcitx5/conf/classicui-cat.conf ~/.config/fcitx5/conf/classicui.conf
cp ~/.config/gitui/theme-cat.ron ~/.config/gitui/theme.ron
cp ~/.config/gtk-3.0/settings-cat.ini ~/.config/gtk-3.0/settings.ini
cp ~/.config/gtk-4.0/gtk-dark-cat.css ~/.config/gtk-4.0/gtk-dark.css
cp ~/.config/gtk-4.0/gtk-cat.css ~/.config/gtk-4.0/gtk.css
cp ~/.config/polybar/config-cat.ini ~/.config/polybar/config.ini
sh ~/.config/polybar/launch.sh
cp ~/.config/rofi/config-cat.rasi ~/.config/rofi/config.rasi
cp ~/.config/zathura/zathurarc-cat ~/.config/zathura/zathurarc
cp ~/.config/xob/styles-cat.cfg ~/.config/xob/styles.cfg
cp ~/.config/Kvantum/kvantum-cat.kvconfig ~/.config/Kvantum/kvantum.kvconfig
pkill fcitx5
fcitx5 & diswon
pkill xob
sh ~/.config/i3/start.sh
pkill dunst

245
i3/config Normal file
View File

@ -0,0 +1,245 @@
# font for window titles and bar
# font pango:Source Sans Pro 10
# refence docs: https://i3wm.org/docs/
# refence video : https://www.youtube.com/watch?v=8-S0cWnLBKg&list=RDCMUCcQsDUZiK1GWDcP7BpVO_kw&start_radio=1&rv=8-S0cWnLBKg
font pango:Noto Sans 10
# use win key
set $mod Mod4
# 1. download awesome font: https://fontawesome.com/?utm_source=v4_homepage&utm_medium=display&utm_campaign=fa5_released&utm_content=banner
# 2. just copy paste from: https://fontawesome.com/v4/cheatsheet/
# define names for workspaces
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# multi screen setting
# workspace 1 output HDMI-0
# workspace 2 output DP-1
# workspace 3 output HDMI-0
# workspace 4 output DP-1
# workspace 5 output HDMI-0
# workspace 6 output DP-1
# workspace 7 output HDMI-0
# workspace 8 output DP-1
# workspace 9 output HDMI-0
# workspace 10 output DP-1
# floating window u can use mouse left drag or right drag move or scale
# use $mod+Mouse to drag floating windows to their wanted position
floating_modifier $mod
# control focused window when follows the mouse movements
focus_follows_mouse no
# window border settings
#1default_border none
default_border pixel 1
#default_border none
default_floating_border pixel 1
# smart_borders on
# hiding borders adjacent to the screen edges
hide_edge_borders both
# set popups during fullscreen mode
popup_during_fullscreen smart
# start a terminal
# jump to wind1 then open terminal
# bindsym $mod+Return workspace $ws1; exec --no-startup-id terminator
bindsym $mod+Return exec --no-startup-id terminator
bindsym $mod+w exec --no-startup-id rofi -show drun
# bindsym $mod+b exec --no-startup-id dmenu-bluetooth
bindsym $mod+b exec --no-startup-id rofi-bluetooth
# switching window with win+tab
bindsym $mod+Tab exec --no-startup-id rofi -show window
bindsym $mod+n exec --no-startup-id networkmanager_dmenu
# show_marks yes
# kill focused window
bindsym $mod+q kill
# alternatively, you can use the cursor keys:
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# change container layout
# bindsym $mod+s layout stacking
bindsym $mod+d layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+a split v
bindsym $mod+s split h
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# toggle tiling / floating
bindsym $mod+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+Shift+space focus mode_toggle
# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# show the next scratchpad window or hide the focused scratchpad window
bindsym $mod+minus scratchpad show
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# bindsym $mod+l exec --no-startup-id "sh ~/.config/i3/lock.sh"
bindsym $mod+Shift+Ctrl+l exec --no-startup-id "sh ~/.config/rofi/powermenu.sh"
bindsym $mod+p exec --no-startup-id "flameshot gui"
# volume
bindsym $mod+i exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym $mod+o exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2%
# bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2%
# bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 2
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 2
# reload the configuration file
bindsym $mod+Shift+r reload
# resize window
bindsym $mod+r mode "  "
mode "  " {
bindsym h resize shrink width 4 px or 4 ppt
bindsym j resize grow height 4 px or 4 ppt
bindsym k resize shrink height 4 px or 4 ppt
bindsym l resize grow width 4 px or 4 ppt
# back to normal: Enter or win+r
bindsym Return mode "default"
bindsym $mod+r mode "default"
}
# set specific windows to floating mode
for_window [window_role="app"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [title="Preferences$"] floating enable
# class border backgr. text indicator child_border
# set specific windows to floating mode
for_window [window_role="app"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [title="Preferences$"] floating enable
# #546735 -> #81a1c1
# class border backgr. text indicator child_border
client.focused #81a1c1 #81a1c1 #F8F8F2 #81a1c1 #81a1c1
client.focused_inactive #2E3440 #2E3440 #F8F8F2 #2E3440 #2E3440
client.unfocused #2E3440 #2E3440 #BFBFBF #2E3440 #2E3440
client.urgent #2E3440 #FF5555 #F8F8F2 #FF5555 #FF5555
client.placeholder #2E3440 #2E3440 #F8F8F2 #2E3440 #2E3440
client.background #F8F8F2
# 设置程序为浮动窗口调用一下命令 然后点击鼠标即可获得信息, 注意是第二个名字
# xprop | grep "WM_CLASS"
for_window [class="xdman-Main"] floating enable
for_window [class="java-lang-Thread"] floating enable
for_window [class="VirtualBox Manager"] floating enable
for_window [class="Qq"] floating enable
for_window [class="Lxappearance"] floating enable
for_window [class="Qalculate-gtk"] floating enable
for_window [class="Nitrogen"] floating enable
for_window [class="Steam"] floating enable
for_window [class="steam"] floating enable
for_window [class="words-picker"] floating enable
for_window [class="icalingua"] floating enable
for_window [class="stacer"] floating enable
for_window [class="Virt-manager"] floating enable
for_window [class="TelegramDesktop"] floating enable
for_window [class="Quickgui"] floating enable
for_window [class="R_x11"] floating enable
for_window [class="Pavucontrol"] floating enable
for_window [class="Geph"] floating enable
for_window [class="kdeconnect-app"] floating enable
for_window [class="KDE_Connect"] floating enabl
for_window [class="mpv"] floating enable
for_window [class="NewsFlashGTK"] floating enable
for_window [class="PrismLauncher"] floating enable
for_window [class="zoom"] floating enable
for_window [class="wemeetapp"] floating enable
for_window [class="fsearch"] floating enable
for_window [class="Fsearch"] floating enable
for_window [class="kvantummanager"] floating enable
for_window [class="Kvantum Manager"] floating enable
for_window [class="cmake-gui"] floating enable
for_window [class="CMakeSetup"] floating enable
for_window [class="feh"] floating enable
for_window [class="Tlp-UI"] floating enable
for_window [class="steamwebhelper"] floating enable
# for_window [class="Godot_ProjectList"] floating enable
# for_window [class="Godot_Engine"] floating enable
for_window [class="WorldTree"] floating enable
# 设置程序为某个workspace
# assign [class="Godot"] $ws1
# exec 代表 login时执行
# exec_always 代表 login和reload i3时 都会执行
# local config file
# startup applications
# exec --no-startup-id xautolock -time 5 -locker '~/.config/i3/lock.sh'
exec --no-startup-id ~/Software/Clash/cfw
exec --no-startup-id dunst
# exec --no-startup-id bash ~/.config/i3/gummy.sh
# exec --no-startup-id gummy start
#exec --no-startup-id sh ~/.config/i3/mon.sh
exec_always --no-startup-id feh --bg-fill ~/Pictures/wallpapers/archlinux.png
#exec_always --no-startup-id sh ~/.config/i3/start.sh
exec_always --no-startup-id picom --config ~/.config/picom/picom.sample.conf
exec_always --no-startup-id fcitx5
exec_always --no-startup-id bash ~/.config/polybar/polybar.sh
#exec_always --no-startup-id copyq

5
i3/effect/effect-plus.sh Normal file
View File

@ -0,0 +1,5 @@
feh ~/Pictures/wallhaven-6oxgp6.jpg --bg-fill
pkill picom
picom --config ~/.config/picom/ftlab.conf & disown

5
i3/effect/effect.sh Normal file
View File

@ -0,0 +1,5 @@
feh ~/Pictures/wallhaven-6oxgp6.jpg --bg-fill
pkill picom
picom --config ~/.config/picom/picom.conf & disown

5
i3/effect/no-effect.sh Normal file
View File

@ -0,0 +1,5 @@
feh ~/Pictures/nord1.png --bg-fill
pkill picom
picom --config ~/.config/picom/picom.conf1 & disown

1
i3/gummy.sh Normal file
View File

@ -0,0 +1 @@
gummy start

13
i3/lock.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
blank='#000000' # blank
#background='#1A6785FF'
background='#2e3440'
foreground='#D8DEE9FF' # text
primary='#4c566a' # default
alert='#81a1c1' # wrong
verifying='#A3BE8CFF' # verifying
i3lock \
--color=$blank \

1
i3/mon.sh Normal file
View File

@ -0,0 +1 @@
xrandr --output HDMI-A-0 --same-as eDP &

47
i3/nord.sh Normal file
View File

@ -0,0 +1,47 @@
feh ~/Pictures/nord1.png --bg-fill
cp ~/.config/alacritty/alacritty-nord.yml ~/.config/alacritty/alacritty.yml
cp ~/.config/nvim/lua/user/colorscheme-nord.lua ~/.config/nvim/lua/user/colorscheme.lua
cp ~/.config/nvim/lua/user/lualine-nord.lua ~/.config/nvim/lua/user/lualine.lua
cp ~/.gtkrc-2.0-nord ~/.gtkrc-2.0
cp ~/.config/bat/config-nord ~/.config/bat/config
cp ~/.config/bottom/bottom-nord.toml ~/.config/bottom/bottom.toml
cp ~/.config/dunst/dunstrc-nord ~/.config/dunst/dunstrc
cp ~/.config/fcitx5/conf/classicui-nord.conf ~/.config/fcitx5/conf/classicui.conf
cp ~/.config/gitui/theme-nord.ron ~/.config/gitui/theme.ron
cp ~/.config/gtk-3.0/settings-nord.ini ~/.config/gtk-3.0/settings.ini
cp ~/.config/gtk-4.0/gtk-dark-nord.css ~/.config/gtk-4.0/gtk-dark.css
cp ~/.config/gtk-4.0/gtk-nord.css ~/.config/gtk-4.0/gtk.css
cp ~/.config/polybar/config-nord.ini ~/.config/polybar/config.ini
sh ~/.config/polybar/launch.sh
cp ~/.config/rofi/config-nord.rasi ~/.config/rofi/config.rasi
cp ~/.config/zathura/zathurarc-nord ~/.config/zathura/zathurarc
cp ~/.config/xob/styles-nord.cfg ~/.config/xob/styles.cfg
cp ~/.config/Kvantum/kvantum-nord.kvconfig ~/.config/Kvantum/kvantum.kvconfig
pkill fcitx5
fcitx5 & diswon
pkill xob
sh ~/.config/i3/start.sh
pkill dunst

3
i3/start.sh Normal file
View File

@ -0,0 +1,3 @@
sh /home/charles/.config/i3/volume.sh &
sh /home/charles/.config/i3/brightness.sh &

24
i3/volume.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# Wait for amixer to become available
until [ "$(amixer)" ]; do sleep 0.1; done
# `amixer events` always emits 1 event from the start, so we must skip it
skip=1
stdbuf -oL amixer events |
while IFS= read -r line; do
case ${line%%,*} in
('event value: numid='[34])
if [ "$skip" -eq 0 ]; then
# The `0+$2` below is to remove the '%' sign
# amixer sget Master |
# awk -F'[][]' '/Left:/ {print 0+$2 ($4 == "off" ? "!" : "")}'
# Using Pipewire/Wireplumber:
wpctl get-volume @DEFAULT_AUDIO_SINK@ |
awk '{ gsub(/\./, "", $2); print $2 ($3 == "[MUTED]" ? "!" : "")}'
else
skip=$(( skip - 1 ))
fi
esac
done | xob

96
lvim/config.lua Normal file
View File

@ -0,0 +1,96 @@
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
lvim.plugins =
{
"iamcco/markdown-preview.nvim",
config = function()
vim.fn["mkdp#util#install"]()
end,
}
-- layout
lvim.builtin.telescope.defaults.layout_config.width = 0.5
-- Disable use space to instead of tab
vim.o.expandtab = false
-- DAP configuration
local dap = require('dap')
dap.adapters.godot = {
type = "server",
host = '127.0.0.1',
port = 6006,
}
dap.configurations.gdscript = {
{
type = "godot",
request = "launch",
name = "Launch scene",
project = "${workspaceFolder}",
launch_scene = true,
}
}
-- LSP Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
local _notify = client.notify
client.notify = function (method, params)
if method == 'textDocument/didClose' then
-- Godot doesn't implement didClose yet
return
end
_notify(method, params)
end
end
-- LSP Config for Godot
local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}
require'lspconfig'.gdscript.setup{
on_attach = on_attach,
flags = lsp_flags,
filetypes = { "gd", "gdscript", "gdscript3" },
}

45
lvim/lazy-lock.json Normal file
View File

@ -0,0 +1,45 @@
{
"Comment.nvim": { "branch": "master", "commit": "38d3b7eb553872d8866f14a0dd4fe84126068fce" },
"LuaSnip": { "branch": "master", "commit": "e77fa9ad0b1f4fc6cddf54e51047e17e90c7d7ed" },
"alpha-nvim": { "branch": "main", "commit": "87c204040e3f5d4c1c95067b35905d8f8a2f2545" },
"bigfile.nvim": { "branch": "main", "commit": "c1bad34ce742b4f360b67ca23c873fef998240fc" },
"bufferline.nvim": { "branch": "main", "commit": "a4bd44523316928a7c4a5c09a3407d02c30b6027" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"friendly-snippets": { "branch": "main", "commit": "631f79e346b0b3203d2ce3eae619ca8d612e5463" },
"gitsigns.nvim": { "branch": "main", "commit": "e5edefd9976039f5352e0c900f35206770b33a2d" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"lazy.nvim": { "branch": "main", "commit": "d6a782c7002682f4a01b79fc3918c4584ad6e8fb" },
"lir.nvim": { "branch": "master", "commit": "1aa871f20637eccc4e1e26b0fbcf9aafc9b6caf7" },
"lualine.nvim": { "branch": "master", "commit": "84ffb80e452d95e2c46fa29a98ea11a240f7843e" },
"lunar.nvim": { "branch": "master", "commit": "08bbc93b96ad698d22fc2aa01805786bcedc34b9" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7276ffffcf51a8304b5fd4b81293be4ee010ec47" },
"mason.nvim": { "branch": "main", "commit": "057ac5ca159c83e302a55bd839a96ff1ea2396db" },
"neodev.nvim": { "branch": "main", "commit": "0043cf91c18aeac8db5765eb86c6078e17ac9325" },
"nlsp-settings.nvim": { "branch": "main", "commit": "32aa12da328258f2dccb15d327c26a8d21d9f4bd" },
"null-ls.nvim": { "branch": "main", "commit": "33b853a3933eed3137cd055aac4e539e69832ad0" },
"nvim-autopairs": { "branch": "master", "commit": "7566a86f44bb72ba2b1a609f528a27d93241502d" },
"nvim-cmp": { "branch": "main", "commit": "11102d3db12c7f8b35265ad0e17a21511e5b1e68" },
"nvim-dap": { "branch": "master", "commit": "6cedcb527e264c8f25e86afa8dae74c6692dee51" },
"nvim-dap-ui": { "branch": "master", "commit": "286f682f366fbc652b38dff893569374e9433dd3" },
"nvim-lspconfig": { "branch": "master", "commit": "427378a03ffc1e1bc023275583a49b1993e524d0" },
"nvim-navic": { "branch": "master", "commit": "83dc174da915f9dbc9b51169e9b62a2e0d42b527" },
"nvim-tree.lua": { "branch": "master", "commit": "bb375fb20327c49920c41d2b51c1ce2f4fe7deb3" },
"nvim-treesitter": { "branch": "master", "commit": "2ce3c9080cfe4a39c7907e672edafd2a95244a7c" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
"nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" },
"onedarker.nvim": { "branch": "freeze", "commit": "b00dd2189f264c5aeb4cf04c59439655ecd573ec" },
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"schemastore.nvim": { "branch": "main", "commit": "0b396f538f195c249f021a48c3d8988f0d3f86f7" },
"structlog.nvim": { "branch": "main", "commit": "45b26a2b1036bb93c0e83f4225e85ab3cee8f476" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "9de317bdea2bc393074651179c4fc7f93e9b2d56" },
"toggleterm.nvim": { "branch": "main", "commit": "68fdf851c2b7901a7065ff129b77d3483419ddce" },
"tokyonight.nvim": { "branch": "main", "commit": "c5df636ce62a8aab7565f35da143cfd672526302" },
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"which-key.nvim": { "branch": "main", "commit": "4acffc92953a90a790603bfdab7c92319ab167b1" }
}

416
polybar/config Normal file
View File

@ -0,0 +1,416 @@
;==========================================================
;
; THIS IS AN EXAMPLE CONFIGURATION FILE!
; IT IS NOT SUPPOSED TO WORK OUT OF THE BOX SINCE IS CONTAINS
; SETTINGS THAT ARE SPECIFIC TO THE MACHINE WHICH WAS USED
; TO GENERATE IT.
; Please refer to the web documentation hosted at:
; https://github.com/polybar/polybar#configuration
; and
; https://github.com/polybar/polybar/wiki/Configuration
; if you want to automatically generate one for you.
;
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
;background = ${xrdb:color0:#222}
background = #222
background-alt = #444
;foreground = ${xrdb:color7:#222}
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40
# [bar/bar1]
[section/base]
# ;monitor = ${env:MONITOR:HDMI-0}
width = 100%
height = 27
;offset-x = 1%
;offset-y = 1%
radius = 6.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = fixed:pixelsize=10;1
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1
tray-position = right
tray-padding = 2
;tray-background = #0063ff
;wm-restack = i3
;override-redirect = true
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[bar/bar1]
inherit = section/base
monitor = ${env:MONITOR:HDMI-0}
modules-left = i3
modules-right = powermenu alsa pulseaudio memory cpu date
[bar/bar2]
inherit = section/base
monitor = ${env:MONITOR:DP-1}
modules-left = i3
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
# format-prefix = "Cpu: "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
# format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #4bffdc
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp59s0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = enp0s31f6
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date =
date-alt = " %Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-prefix = 
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #0a6cf5
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume>
label-volume-foreground = ${root.foreground}
label-muted = 🔇
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = sound muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 5
; vim:ft=dosini

28
polybar/polybar.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
screens=$(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f6)
if [[ $(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f4 | cut -d"+" -f2- | uniq | wc -l) == 1 ]]; then
MONITOR=$(polybar --list-monitors | cut -d":" -f1) TRAY_POS=right polybar main &
else
primary=$(xrandr --query | grep primary | cut -d" " -f1)
for m in $screens; do
if [[ $primary == $m ]]; then
MONITOR=$m TRAY_POS=right polybar bar1 & echo "bar1 init" &
else
MONITOR=$m TRAY_POS=none polybar bar2 & echo "bar2 init" &
fi
done
fi
#polybar -q bar1 -c "~/.config/polybar/config"&
# polybar bar2

107
rofi/catppuccin-frappe.rasi Normal file
View File

@ -0,0 +1,107 @@
/**
* Nordic rofi theme
* Adapted by undiabler <undiabler@gmail.com>
*
* Nord Color palette imported from https://www.nordtheme.com/
*
*/
configuration {
font: "JetBrainsMono Nerd Font Medium 10";
drun {
display-name: "";
}
run {
display-name: "";
}
window {
display-name: "";
}
timeout {
delay: 10;
action: "kb-cancel";
}
}
* {
border: 0;
margin: 0;
padding: 0;
spacing: 0;
/* bg: #2E3440; */
/* bg-alt: #3B4252; */
/* fg: #81A1C1; */
/* fg-alt: #EBCB8B; */
bg: #303446;
bg-alt: #414559;
/* border-col: #303446; */
/* selected-col: #303446; */
blue: #8caaee;
fg: #c6d0f5;
fg-alt: #e78284;
grey: #737994;
background-color: @bg;
text-color: @fg;
transparent: rgba(46,52,64,0);
}
window {
location: center;
anchor: center;
transparency: "screenshot";
/* padding: 10px; */
border: 0px;
/* border-radius: 6px; */
width: 700px;
background-color: @transparent;
spacing: 0;
children: [mainbox];
orientation: horizontal;
}
mainbox {
children: [inputbar, listview];
}
inputbar {
background-color: @bg-alt;
children: [prompt, entry];
}
entry {
background-color: inherit;
padding: 12px 3px;
}
prompt {
background-color: inherit;
padding: 12px;
}
listview {
lines: 8;
}
element {
children: [element-icon, element-text];
}
element-icon {
padding: 10px 10px;
}
element-text {
padding: 10px 0;
}
element-text selected {
text-color: @fg-alt;
}

9
rofi/colors.rasi Normal file
View File

@ -0,0 +1,9 @@
/* colors */
* {
al: #00000000;
bg: #24273A;
se: #1E1E2E;
fg: #BF616A;
ac: #24273A;
}

9
rofi/config-cat.rasi Normal file
View File

@ -0,0 +1,9 @@
/** Basic config file **/
configuration {
show-icons: true;
modi: "window,drun,ssh,run,filebrowser,file-browser-extended";
}
@theme "catppuccin-frappe"

9
rofi/config-nord.rasi Normal file
View File

@ -0,0 +1,9 @@
/** Basic config file **/
configuration {
show-icons: true;
modi: "window,drun,ssh,run,filebrowser,file-browser-extended";
}
@theme "nord"

9
rofi/config.rasi Normal file
View File

@ -0,0 +1,9 @@
/** Basic config file **/
configuration {
show-icons: true;
modi: "window,drun,ssh,run,filebrowser";
}
@theme "nord"

33
rofi/launcher.sh Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env bash
theme="nord"
dir="$HOME/.config/rofi/"
# catppuccin
ALPHA="#00000000"
BG="#24273A"
FG="#BF616A"
SELECT="#1E1E2E"
ACCENT="#24273A"
# nord
#ALPHA="#00000000"
#BG="#3B4253"
#FG="#BF616A"
#SELECT="#343a46"
#ACCENT="#3B4252"
# overwrite colors file
cat > $dir/colors.rasi <<- EOF
/* colors */
* {
al: $ALPHA;
bg: $BG;
se: $SELECT;
fg: $FG;
ac: $ACCENT;
}
EOF
rofi -no-lazy-grab -show drun -modi drun -theme $dir/"$theme"

2
rofi/lock_i3.sh Normal file
View File

@ -0,0 +1,2 @@
#betterlockscreen --lock
i3lock \

77
rofi/nord.rasi Normal file
View File

@ -0,0 +1,77 @@
/**
* Nordic rofi theme
* Adapted by undiabler <undiabler@gmail.com>
*
* Nord Color palette imported from https://www.nordtheme.com/
*
*/
* {
border: 0;
margin: 0;
padding: 0;
spacing: 0;
bg: #2E3440;
bg-alt: #3B4252;
fg: #81A1C1;
fg-alt: #EBCB8B;
background-color: @bg;
text-color: @fg;
transparent: rgba(46,52,64,0);
}
window {
location: center;
anchor: center;
transparency: "screenshot";
/* padding: 10px; */
border: 0px;
/* border-radius: 6px; */
width: 700px;
background-color: @transparent;
spacing: 0;
children: [mainbox];
orientation: horizontal;
}
mainbox {
children: [inputbar, listview];
}
inputbar {
background-color: @bg-alt;
children: [prompt, entry];
}
entry {
background-color: inherit;
padding: 12px 3px;
}
prompt {
background-color: inherit;
padding: 12px;
}
listview {
lines: 8;
}
element {
children: [element-icon, element-text];
}
element-icon {
padding: 10px 10px;
}
element-text {
padding: 10px 0;
}
element-text selected {
text-color: @fg-alt;
}

154
rofi/off.sh Executable file
View File

@ -0,0 +1,154 @@
#!/usr/bin/env bash
set -e
set -u
# All supported choices
# all=(shutdown reboot suspend hibernate logout lockscreen)
all=(shutdown reboot suspend hibernate logout )
# By default, show all (i.e., just copy the array)
show=("${all[@]}")
declare -A texts
#texts[lockscreen]="lock screen"
texts[logout]="logout"
texts[suspend]="suspend"
texts[hibernate]="hibernate"
texts[reboot]="reboot"
texts[shutdown]="shutdown"
declare -A icons
# icons[lockscreen]="\uf023"
icons[logout]="\uf842"
icons[suspend]="\uf9b1"
icons[hibernate]="\uf7c9"
icons[reboot]="\ufc07"
icons[shutdown]="\uf011"
icons[cancel]="\u00d7"
declare -A actions
#actions[lockscreen]="sh $HOME/.config/sway/swaylock.sh"
actions[logout]="i3-msg exit, mode \"default\""
#actions[logout]="loginctl terminate-session ${XDG_SESSION_ID-}"
actions[suspend]="systemctl suspend"
actions[hibernate]="systemctl hibernate"
actions[reboot]="systemctl reboot"
actions[shutdown]="systemctl poweroff"
# By default, ask for confirmation for actions that are irreversible
confirmations=(reboot shutdown logout)
# By default, no dry run
dryrun=false
showsymbols=true
function check_valid {
option="$1"
shift 1
for entry in "${@}"
do
if [ -z "${actions[$entry]+x}" ]
then
echo "Invalid choice in $1: $entry" >&2
exit 1
fi
done
}
# Define the messages after parsing the CLI options so that it is possible to
# configure them in the future.
function write_message {
icon="<span font_size=\"medium\">$1</span>"
text="<span font_size=\"medium\">$2</span>"
if [ "$showsymbols" = "true" ]
then
echo -n "\u200e$icon \u2068$text\u2069"
else
echo -n "$text"
fi
}
function print_selection {
echo -e "$1" | $(read -r -d '' entry; echo "echo $entry")
}
declare -A messages
declare -A confirmationMessages
for entry in "${all[@]}"
do
messages[$entry]=$(write_message "${icons[$entry]}" "${texts[$entry]^}")
done
for entry in "${all[@]}"
do
confirmationMessages[$entry]=$(write_message "${icons[$entry]}" "Yes, ${texts[$entry]}")
done
confirmationMessages[cancel]=$(write_message "${icons[cancel]}" "No, cancel")
if [ $# -gt 0 ]
then
# If arguments given, use those as the selection
selection="${@}"
else
# Otherwise, use the CLI passed choice if given
if [ -n "${selectionID+x}" ]
then
selection="${messages[$selectionID]}"
fi
fi
# Don't allow custom entries
echo -e "\0no-custom\x1ftrue"
# Use markup
echo -e "\0markup-rows\x1ftrue"
if [ -z "${selection+x}" ]
then
echo -e "\0prompt\x1fPower menu"
for entry in "${show[@]}"
do
echo -e "${messages[$entry]}\0icon\x1f${icons[$entry]}"
done
else
for entry in "${show[@]}"
do
if [ "$selection" = "$(print_selection "${messages[$entry]}")" ]
then
# Check if the selected entry is listed in confirmation requirements
for confirmation in "${confirmations[@]}"
do
if [ "$entry" = "$confirmation" ]
then
# Ask for confirmation
echo -e "\0prompt\x1fAre you sure"
echo -e "${confirmationMessages[$entry]}\0icon\x1f${icons[$entry]}"
echo -e "${confirmationMessages[cancel]}\0icon\x1f${icons[cancel]}"
exit 0
fi
done
# If not, then no confirmation is required, so mark confirmed
selection=$(print_selection "${confirmationMessages[$entry]}")
fi
if [ "$selection" = "$(print_selection "${confirmationMessages[$entry]}")" ]
then
if [ $dryrun = true ]
then
# Tell what would have been done
echo "Selected: $entry" >&2
else
# Perform the action
${actions[$entry]}
fi
exit 0
fi
if [ "$selection" = "$(print_selection "${confirmationMessages[cancel]}")" ]
then
# Do nothing
exit 0
fi
done
# The selection didn't match anything, so raise an error
echo "Invalid selection: $selection" >&2
exit 1
fi

2
rofi/powermenu.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
rofi -show p -modi p:~/.config/rofi/off.sh -theme ~/.config/rofi/nord.rasi

69
terminator/config Normal file
View File

@ -0,0 +1,69 @@
[global_config]
tab_position = hidden
scroll_tabbar = True
homogeneous_tabbar = False
title_hide_sizetext = True
title_transmit_fg_color = "#99c1f1"
title_transmit_bg_color = "#000000"
title_receive_fg_color = "#f9f06b"
title_receive_bg_color = "#000000"
title_inactive_fg_color = "#9a9996"
title_inactive_bg_color = "#000000"
inactive_color_offset = 0.7046263345195729
enabled_plugins = TerminalShot, MavenPluginURLHandler, CustomCommandsMenu, LaunchpadBugURLHandler, LaunchpadCodeURLHandler, APTURLHandler
suppress_multiple_term_dialog = True
title_use_system_font = False
title_font = JetBrainsMono Nerd Font Bold 10
[keybindings]
zoom_in = <Primary>equal
[profiles]
[[default]]
background_darkness = 0.8
background_type = transparent
cursor_color = "#aaaaaa"
font = JetBrainsMono Nerd Font 10
show_titlebar = False
use_system_font = False
copy_on_selection = True
[[Nebula]]
background_color = "#23262e"
cursor_color = "#00e8c6"
cursor_color_fg = False
foreground_color = "#ffffff"
palette = "#2e3436:#ff007a:#84ff39:#f3d56e:#7cb7ff:#c74ded:#00e8c6:#d3d7cf:#555753:#ff007a:#84ff39:#f3d56e:#7cb7ff:#c74ded:#00e8c6:#eeeeec"
[[synthwave]]
background_color = "#241b30"
cursor_color = "#f2f2e3"
cursor_color_fg = False
foreground_color = "#f2f2e3"
palette = "#241b30:#e60a70:#00986c:#adad3e:#6e29ad:#b300ad:#00b0b1:#b9b1bc:#7f7094:#e60a70:#0ae4a4:#f9f972:#aa54f9:#ff00f6:#00fbfd:#f2f2e3"
[[synthwave-everything]]
background_color = "#2a2139"
cursor_color = "#72f1b8"
cursor_color_fg = False
foreground_color = "#f0eff1"
palette = "#fefefe:#f97e72:#72f1b8:#fede5d:#6d77b3:#c792ea:#f772e0:#fefefe:#fefefe:#f88414:#72f1b8:#fff951:#36f9f6:#e1acff:#f92aad:#fefefe"
[[Tomorrow Night Eighties]]
background_color = "#2d2d2d"
cursor_color = "#cccccc"
cursor_color_fg = False
foreground_color = "#cccccc"
palette = "#000000:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#ffffff:#000000:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#ffffff"
[[Wryan]]
background_color = "#101010"
cursor_color = "#9e9ecb"
cursor_color_fg = False
foreground_color = "#999993"
palette = "#333333:#8c4665:#287373:#7c7c99:#395573:#5e468c:#31658c:#899ca1:#3d3d3d:#bf4d80:#53a6a6:#9e9ecb:#477ab3:#7e62b3:#6096bf:#c0c0c0"
[[SynthwaveAlpha]]
cursor_color = "#aaaaaa"
[layouts]
[[default]]
[[[window0]]]
type = Window
parent = ""
[[[child1]]]
type = Terminal
parent = window0
profile = default
[plugins]

View File

@ -0,0 +1,368 @@
import requests
import terminatorlib.plugin as plugin
from gi.repository import Gtk, Gdk
from terminatorlib.config import ConfigBase
from terminatorlib.translation import _
from terminatorlib.util import get_config_dir, err, dbg, gerr
from terminatorlib.version import APP_VERSION
AVAILABLE = ['TerminatorThemes']
class TerminatorThemes(plugin.Plugin):
capabilities = ['terminal_menu']
config_base = ConfigBase()
base_url = 'https://api.github.com/repos/EliverLara/terminator-themes/contents/themes.json'
inherits_config_from = "default"
def callback(self, menuitems, menu, terminal):
"""Add our item to the menu"""
self.terminal = terminal
item = Gtk.ImageMenuItem(Gtk.STOCK_FIND)
item.connect('activate',self.configure)
item.set_label("Themes")
item.set_sensitive(True)
menuitems.append(item)
def configure(self, widget, data = None):
ui = {}
dbox = Gtk.Dialog( _("Terminator themes"), None, Gtk.DialogFlags.MODAL)
headers = { "Accept": "application/vnd.github.v3.raw" }
response = requests.get(self.base_url, headers=headers)
if response.status_code != 200:
gerr(_("Failed to get list of available themes"))
return
self.themes_from_repo = response.json()["themes"]
self.profiles = self.terminal.config.list_profiles()
main_container = Gtk.HBox(spacing=5)
main_container.pack_start(self._create_themes_grid(ui), True, True, 0) #Left column
main_container.pack_start(self._create_settings_grid(ui), True, True, 0) #Right column
dbox.vbox.pack_start(main_container, True, True, 0)
self.dbox = dbox
dbox.show_all()
res = dbox.run()
if res == Gtk.ResponseType.ACCEPT:
self.terminal.config.save()
del(self.dbox)
dbox.destroy()
return
def _create_themes_grid(self, ui):
grid = Gtk.Grid()
grid.set_column_spacing(5)
grid.set_row_spacing(7)
grid.set_column_homogeneous(True)
grid.set_row_homogeneous(True)
scroll_window = self._create_themes_list(ui)
(combo, search_entry) = self._create_filter_widgets(ui)
grid.attach(search_entry, 0,0,2,1)
grid.attach(combo, 2,0,1,1)
grid.attach(scroll_window, 0, 1, 3, 10)
return grid
def _create_filter_widgets(self, ui):
combo = Gtk.ComboBoxText()
combo.set_entry_text_column(0)
combo.connect("changed", self.on_filter_combo_changed)
combo.append_text("Filter by type")
for theme_type in ["light", "dark", "All"]:
combo.append_text(theme_type)
combo.set_active(0)
search_entry = Gtk.SearchEntry(max_width_chars=30)
search_entry.connect("search-changed", self.on_theme_search_changed, ui)
return [combo,search_entry]
def _create_themes_list(self, ui):
profiles_list_model = Gtk.ListStore(str, str,bool, object)
# Set add/remove buttons availability
for theme in self.themes_from_repo:
if theme["name"] in self.profiles:
profiles_list_model.append([theme["name"], theme["type"],False, theme])
else:
profiles_list_model.append([theme["name"], theme["type"],True, theme])
self.current_filter_theme = None
self.filter_type = "theme_type"
self.theme_filter = profiles_list_model.filter_new()
self.theme_filter.set_visible_func(self.theme_filter_func)
treeview = Gtk.TreeView.new_with_model(self.theme_filter)
selection = treeview.get_selection()
selection.set_mode(Gtk.SelectionMode.SINGLE)
selection.connect("changed", self.on_selection_changed, ui)
ui['treeview'] = treeview
for i, column_title in enumerate(["Theme", "Type"]):
renderer = Gtk.CellRendererText()
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
treeview.append_column(column)
scroll_window = Gtk.ScrolledWindow()
scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scroll_window.add(treeview)
return scroll_window
def _create_settings_grid(self, ui):
grid = Gtk.Grid()
grid.set_column_spacing(5)
grid.set_row_spacing(7)
grid.attach(self._create_default_inherits_check(ui), 0, 15, 2, 1)
grid.attach(Gtk.Label("Available profiles: "), 0, 16, 1, 1)
grid.attach(self._create_inherits_from_combo(ui), 1, 16, 1, 1)
grid.attach(self._create_main_action_button(ui, "install", self.on_install), 0, 20, 1, 1)
grid.attach(self._create_main_action_button(ui, "remove", self.on_uninstall), 1, 20, 1, 1)
self.theme_preview = ThemePreview(self.themes_from_repo[0])
grid.attach(self.theme_preview, 0, 10, 4, 2)
return grid
def _create_default_inherits_check(self, ui):
check = Gtk.CheckButton("Inherit preferences from default profile")
check.set_active(True)
check.connect("toggled", self.on_inheritsfromdefaultcheck_toggled, ui)
ui['check_inherits_from_default'] = check
return check
def _create_inherits_from_combo(self, ui):
combo = Gtk.ComboBoxText()
combo.set_entry_text_column(0)
combo.set_sensitive(False)
combo.connect("changed", self.on_inheritsfromcombo_changed, ui)
ui['inherits_from_combo'] = combo
for profile in self.profiles:
combo.append_text(profile)
combo.set_active(self.profiles.index(self.terminal.config.get_profile())) #set current terminal profile as current item
return combo
def _create_main_action_button(self, ui, label, action):
btn = Gtk.Button(_(label.capitalize()))
btn.connect("clicked", action, ui)
btn.set_sensitive(False)
ui['button_' + label] = btn
return btn
def theme_filter_func(self, model, iter, data):
if self.filter_type == "theme_type":
return self.filter_by_theme_type(model, iter, data)
else:
return self.filter_by_theme_search(model, iter, data)
def filter_by_theme_search(self, model, iter, data):
return model[iter][0].lower().find(self.current_filter_theme) > -1
def filter_by_theme_type(self, model, iter, data):
if self.current_filter_theme is None or self.current_filter_theme == "All":
return True
else:
return model[iter][1] == self.current_filter_theme
def on_theme_search_changed(self, widget, ui):
self.filter_type = "theme_search"
self.current_filter_theme = widget.get_text()
self.theme_filter.refilter()
def on_filter_combo_changed(self, widget):
if widget.get_active() == 0:
self.current_filter_theme = None
else:
self.current_filter_theme = widget.get_active_text()
self.filter_type = "theme_type"
# #we update the filter, which updates in turn the view
self.theme_filter.refilter()
def on_inheritsfromdefaultcheck_toggled(self, check, data=None):
if check.get_active() is not True:
data["inherits_from_combo"].set_sensitive(True)
self.inherits_config_from = self.profiles[data['inherits_from_combo'].get_active()]
else:
data["inherits_from_combo"].set_sensitive(False)
self.inherits_config_from = 'default'
def on_inheritsfromcombo_changed(self, combo, data):
if combo.get_sensitive():
self.inherits_config_from = self.profiles[combo.get_active()]
else:
self.inherits_config_from = 'default'
def on_selection_changed(self, selection, data=None):
(model, iter) = selection.get_selected()
data['button_install'].set_sensitive(model[iter][2])
data['button_remove'].set_sensitive(model[iter][2] is not True)
self.theme_preview.update_preview(model[iter][3])
def on_uninstall(self, button, data):
treeview = data['treeview']
selection = treeview.get_selection()
(store, iter) = selection.get_selected()
target = store[iter][0]
# If selected theme is active, sets terminal profile to default before unistalling
if self.terminal.get_profile() == target:
widget = self.terminal.get_vte()
self.terminal.force_set_profile(widget, 'default')
self.terminal.config.del_profile(target)
self.terminal.config.save()
self.update_comboInheritsFrom(data)
#'Add' button available again
data['treeview'].get_model().set_value(iter, 2, True)
self.on_selection_changed(selection, data)
def on_install(self, button, data):
treeview = data['treeview']
selection = treeview.get_selection()
(store, iter) = selection.get_selected()
target = store[iter][3]
widget = self.terminal.get_vte()
treeview.set_enable_tree_lines(False)
if not iter:
return
# In newer versions of terminator an extra parameter ('toClone') was added to the add_profile method, so it must be set to None
if APP_VERSION > "2.1.1":
self.terminal.config.add_profile(target["name"], None)
else:
self.terminal.config.add_profile(target["name"])
template_data = self.config_base.profiles[self.inherits_config_from].copy()
for k, v in target.items():
if k != 'background_image' and k != 'name' and k != 'type':
if k == 'background_darkness':
template_data[k] = float(v)
elif k == 'cursor_color':
if APP_VERSION > "2.1.1": # Apply new renamed properties for terminator >= 2.1.2
template_data['cursor_bg_color'] = v
#template_data['cursor_fg_color'] = "#f9f06b"
#template_Data['cursor_color_default'] = False
else:
template_data['cursor_color_fg'] = False # Add this property in order to use the custom cursor color
template_data[k] = v
else:
template_data[k] = v
for k, v in template_data.items():
self.config_base.set_item(k, v, target["name"])
self.terminal.force_set_profile(widget, target["name"])
self.terminal.config.save()
self.update_comboInheritsFrom(data)
# "Remove" button available again
data['treeview'].get_model().set_value(iter, 2, False)
self.on_selection_changed(selection, data)
treeview.set_enable_tree_lines(True)
def update_comboInheritsFrom(self, data):
data['inherits_from_combo'].remove_all()
profiles = self.terminal.config.list_profiles()
self.profiles = profiles
for profile in profiles:
data['inherits_from_combo'].append_text(profile)
data['inherits_from_combo'].set_active(profiles.index(self.terminal.config.get_profile()))
class ThemePreview(Gtk.VBox):
def __init__(self, theme):
Gtk.VBox.__init__(self)
self.theme = theme
self.palette_preview_colors = list()
self.prompt_line = {}
self.pack_start (self._create_preview_margin(), True, True,0)
self.pack_start (self._create_palette_preview(), False,False,0)
self.pack_start (self._create_preview_margin(), True, True,0)
self.pack_start (self._create_prompt_line(), True, True,0)
self.update_preview(self.theme)
def _create_palette_preview(self):
palette_preview = Gtk.FlowBox()
palette_preview.set_min_children_per_line(10)
palette_preview.set_max_children_per_line(10)
palette_preview.set_selection_mode(Gtk.SelectionMode.NONE)
palette_preview.add(Gtk.VBox())
for color in self.theme['palette'].split(":")[0:8]:
area = Gtk.DrawingArea()
area.set_size_request(20, 25)
color_preview = Gtk.VBox()
color_preview.pack_start(area, False,False,0)
color_preview.modify_bg(0, color = Gdk.color_parse(color))
self.palette_preview_colors.append(color_preview)
palette_preview.add(color_preview)
palette_preview.add(Gtk.VBox())
return palette_preview
def _create_prompt_line(self):
line = Gtk.HBox()
self.prompt_line["prompt"] = Gtk.Label(" ~> ")
self.prompt_line["cmd"] = Gtk.Label("echo ")
self.prompt_line["arg"] = Gtk.Label("\"nice\" ")
line.pack_start(self.prompt_line["prompt"],False,True,0)
line.pack_start(self.prompt_line["cmd"],False,True,0)
line.pack_start(self.prompt_line["arg"],False,True,0)
return line
def _create_preview_margin(self):
area = Gtk.DrawingArea()
area.set_size_request(270, 50)
return area
def update_preview(self, new_theme):
self.modify_bg(0, color = Gdk.color_parse(new_theme['background_color']))
self.update_palette_preview(new_theme['palette'])
self.update_prompt_line_colors(new_theme['palette'])
def update_palette_preview(self, palette):
for i,color in enumerate(palette.split(":")[0:8]):
self.palette_preview_colors[i].modify_bg(0,color = Gdk.color_parse(color))
def update_prompt_line_colors(self, palette):
palette = palette.split(":")
self.prompt_line["prompt"].modify_fg(0,color = Gdk.color_parse(palette[6]))
self.prompt_line["cmd"].modify_fg(0,color = Gdk.color_parse(palette[3]))
self.prompt_line["arg"].modify_fg(0,color = Gdk.color_parse(palette[2]))