From e232f85349e84cf39fac45f56b773085a6d31679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 3 Sep 2023 12:24:47 +0200 Subject: [PATCH 1/5] Raise on click in task-list --- awesome/components/widgets/task-list.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awesome/components/widgets/task-list.lua b/awesome/components/widgets/task-list.lua index 5f01519..e636c2a 100644 --- a/awesome/components/widgets/task-list.lua +++ b/awesome/components/widgets/task-list.lua @@ -40,7 +40,8 @@ local function create_buttons(buttons, object) local btn = capi.button {modifiers = b.modifiers, button = b.button} btn:connect_signal('press', function() - object.minimized = not object.minimized + object.minimized = false + object:raise() end ) btns[#btns + 1] = btn From a40501f31454c7c2d116efc236bddfbae0e8847f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 3 Sep 2023 13:54:02 +0200 Subject: [PATCH 2/5] Use vi-mode in ZSH and use better cpr/mvr --- zsh/.zshrc | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 19c9427..8c05d80 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -21,6 +21,10 @@ setopt autocd # to add other keys to this hash, see: man 5 terminfo typeset -g -A key +# Use vi-mode +bindkey -v +bindkey jj vi-cmd-mode + key[Home]="${terminfo[khome]}" key[End]="${terminfo[kend]}" key[Insert]="${terminfo[kich1]}" @@ -104,15 +108,7 @@ source $XDG_CONFIG_HOME/zsh/powerlevel10k/powerlevel10k.zsh-theme unsetopt share_history -# Compilation flags -export ARCHFLAGS="-arch x86_64" - -# ssh -export SSH_KEY_PATH="~/.ssh/rsa_id" - -export PYTHONDONTWRITEBYTECODE=1 BROWSER=/usr/bin/firefox -export EDITOR=nvim # Add bash aliases. if [ -f ~/.bash_aliases ]; then @@ -127,21 +123,14 @@ export GPULAB_DEV='False' export SMARTCD_QUIET=1 source ~/.smartcd_config -# CCache -# export USE_CCACHE=1 -#ccache -M 50G - -# CMake GCC colours export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - +export EDITOR=nvim export LANG=en_US.UTF-8 - +export ARCHFLAGS="-arch x86_64" +export SSH_KEY_PATH="~/.ssh/rsa_id" +export PYTHONDONTWRITEBYTECODE=1 export TERM="screen-256color" - -# Local python installation export PATH=$HOME/.local/bin:$PATH - -# GO export GOPATH=/tmp/go # >>> mamba initialize >>> @@ -165,13 +154,6 @@ autoload -Uz add-zsh-hook eval "$(zoxide init zsh --cmd j)" -function cpr() { - rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@" -} -function mvr() { - rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files "$@" -} - function xterm_title_precmd () { print -Pn -- '\e]2;%n@%m %~\a' } @@ -202,3 +184,5 @@ alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config" alias python=python3 alias r=". ranger" +alias cpr=rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 +alias mvr=rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files From 1343b816849a3a2131086ce9964de7f246802995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 3 Sep 2023 14:12:00 +0200 Subject: [PATCH 3/5] Set timer for Xmodmap, change ctrl-o shortcut --- awesome/rc.lua | 17 +++++++++++------ clang/.clang-tidy | 3 ++- nvim/lua/teaching.lua | 1 + nvim/lua/telescope_config.lua | 12 +++++++++--- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index 70ca91d..94eccd6 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -24,11 +24,8 @@ local run_on_start_up = { "numlockx on", "nm-applet", "xcape -e \"Super_L=Super_L|XF86Launch5\" -t 5000", - "xmodmap /home/user/.Xmodmap", - os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/setup_display.sh", + gears.filesystem.get_configuration_dir() .. "/scripts/setup_display.sh", "feh --no-fehbg --bg-fill " .. gears.filesystem.get_configuration_dir() .. "/images/wallpaper.png", - -- "/opt/power/powersave.sh", - -- os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/setup_display.sh" } -- Define layouts @@ -43,8 +40,6 @@ awful.layout.layouts = { grid, } - - -- Run all the apps listed in run_on_start_up for _, app in ipairs(run_on_start_up) do local findme = app @@ -56,6 +51,16 @@ for _, app in ipairs(run_on_start_up) do awful.spawn.with_shell(string.format("echo 'pgrep -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false) end +-- Start timers +gears.timer { + timeout = 60, + call_now = true, + autostart = true, + callback = function() + awful.spawn.easy_async({"xmodmap", "/home/user/.Xmodmap"}) -- If not repeated it sometimes just stops working + end +} + -- Import Keybinds local keys = require("keys") root.keys(keys.globalkeys) diff --git a/clang/.clang-tidy b/clang/.clang-tidy index 6f9e73a..0299936 100644 --- a/clang/.clang-tidy +++ b/clang/.clang-tidy @@ -16,7 +16,8 @@ Checks: "*, -modernize-use-nodiscard -cppcoreguidelines-narrowing-conversions -cppcoreguidelines-avoid-magic-numbers - --Wsign-compare + -Wsign-compare + -hicpp-uppercase-literal-suffix -readability-uppercase-literal-suffix" WarningsAsErrors: '' HeaderFilterRegex: '' diff --git a/nvim/lua/teaching.lua b/nvim/lua/teaching.lua index 24f5360..135c716 100644 --- a/nvim/lua/teaching.lua +++ b/nvim/lua/teaching.lua @@ -11,6 +11,7 @@ local function should_load(path) [3] = "build", [4] = "third-party", [5] = "sfml", + [6] = "TinyXML" } local match = { [1] = ".hpp", diff --git a/nvim/lua/telescope_config.lua b/nvim/lua/telescope_config.lua index ab6863f..f48fb34 100644 --- a/nvim/lua/telescope_config.lua +++ b/nvim/lua/telescope_config.lua @@ -6,7 +6,7 @@ if not hastelescope then return M end -M.project_files = function() +M.git_files = function() local opts = require('telescope.themes').get_ivy({}) opts["show_untracked"] = true opts["layout_config"] = {height=0.2} @@ -15,6 +15,12 @@ M.project_files = function() end end +M.project_files = function() + local opts = require('telescope.themes').get_ivy({}) + opts["layout_config"] = {height=0.2} + require"telescope.builtin".find_files(opts) +end + M.buffers = function() local opts = require('telescope.themes').get_ivy({}) opts["layout_config"] = {height=0.2} @@ -66,8 +72,8 @@ telescope.load_extension('fzf') vim.keymap.set("n", "u", function() require("telescope").extensions.undo.undo() end, {noremap = true, silent = true}) -vim.keymap.set("n", "", function() require('telescope_config').project_files() end, {noremap = true, silent = true}) -vim.keymap.set("n", "", function() require('telescope_config').buffers() end, { silent = true, noremap = true }) +vim.keymap.set("n", "", function() require('telescope_config').git_files() end, {noremap = true, silent = true}) +vim.keymap.set("n", "", function() require('telescope_config').project_files() end, { silent = true, noremap = true }) vim.keymap.set("n", "", function() require('telescope.builtin').live_grep{ cwd = vim.fn.systemlist("git rev-parse --show-toplevel 2> /dev/null || pwd")[1] } end, { silent = true, noremap = true }) return M From d856782d6671246013fd0e832d520253793db622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 3 Sep 2023 14:51:42 +0200 Subject: [PATCH 4/5] Fix minimized clients not showing in tasklist --- awesome/components/widgets/task-list.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/awesome/components/widgets/task-list.lua b/awesome/components/widgets/task-list.lua index e636c2a..c3d895a 100644 --- a/awesome/components/widgets/task-list.lua +++ b/awesome/components/widgets/task-list.lua @@ -195,18 +195,18 @@ local tasklist_buttons = awful.util.table.join( local filter = function(c, _) - local tags = c.screen.tags - for _, t in ipairs(tags) do - if t.selected then - local ctags = c:tags() - for _, v in ipairs(ctags) do - if v == t and client.focus and c.screen == client.focus.screen then - return true - end + local tags = c.screen.tags + for _, t in ipairs(tags) do + if t.selected then + local ctags = c:tags() + for _, v in ipairs(ctags) do + if v == t and c.screen == client.focus.screen then + return true end - end - end - return false + end + end + end + return false end From e58a7361f16f3497126f36d0acc87b1dd5955d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 3 Sep 2023 14:55:27 +0200 Subject: [PATCH 5/5] Upgrade node version --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a16d70c..0bf8eb0 100755 --- a/install.sh +++ b/install.sh @@ -44,7 +44,7 @@ if $NVIM; then $SUDO apt update $SUDO apt install -y software-properties-common $SUDO add-apt-repository ppa:neovim-ppa/unstable -y - $SUDO curl -sL https://deb.nodesource.com/setup_14.x | $SUDO bash - + $SUDO curl -sL https://deb.nodesource.com/setup_20.x | $SUDO bash - $SUDO apt update $SUDO apt install -y $dependencies python3-venv nodejs fi