Compare commits
No commits in common. "0a6ba0f5231a216322ef80a014f39ef62df8d988" and "cfd7767e697f0535e4793994bb661519a94583e7" have entirely different histories.
0a6ba0f523
...
cfd7767e69
|
@ -1,150 +0,0 @@
|
|||
{ setting, util, ... }: {
|
||||
text = util.trimTabs ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function _tmux_battery() {
|
||||
local IFS=$'\n'
|
||||
|
||||
local batteries=($(ls /sys/class/power_supply/ | grep ^BAT[0-9]$))
|
||||
[[ "''${batteries}" = "" ]] && return 1
|
||||
|
||||
local battery="/sys/class/power_supply/''${batteries[0]}"
|
||||
local level=$(cat ''${battery}/capacity)
|
||||
local status=$(cat ''${battery}/status)
|
||||
local is_charging=false
|
||||
[[ "''${status}" = "Charging" ]] && is_charging=true
|
||||
|
||||
local icon
|
||||
if ((level>=${toString(setting.tmux.status.battery.threshold.high)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.battery.threshold.medium)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.battery.threshold.low)}))
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
echo -n "''${icon}"
|
||||
''${is_charging} && echo -n ""
|
||||
echo
|
||||
echo -n "''${level}"
|
||||
}
|
||||
|
||||
function _tmux_volume() {
|
||||
local IFS=$'\n'
|
||||
local level=$(wpctl get-volume @DEFAULT_SINK@ | cut -d\ -f2 | sed -e "s/^0//" -e "s/\.//")
|
||||
[[ "''${level}" = "" ]] && return 1
|
||||
[[ "''${level}" = "00" ]] && level="0"
|
||||
|
||||
local icon
|
||||
if ((level>=${toString(setting.tmux.status.volume.threshold.high)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.volume.threshold.medium)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.volume.threshold.low)}))
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
local muted=$(wpctl get-volume @DEFAULT_SINK@ | grep '[MUTED]')
|
||||
if [[ "''${muted}" != "" ]]; then
|
||||
icon=""
|
||||
fi
|
||||
|
||||
echo "''${icon}"
|
||||
echo -n "''${level}"
|
||||
}
|
||||
|
||||
function _tmux_statusbar() {
|
||||
local IFS=$'\n'
|
||||
local sep=""
|
||||
local thr_volume=${toString(setting.tmux.status.volume.threshold.show)}
|
||||
local thr_battery=${toString(setting.tmux.status.battery.threshold.show)}
|
||||
local is_uber=$(cat "/tmp/.tmux_uber" || echo -n false)
|
||||
|
||||
# Get data.
|
||||
battery=($(_tmux_battery))
|
||||
volume=($(_tmux_volume))
|
||||
|
||||
# Prepare separators.
|
||||
sep_batvol=" "
|
||||
|
||||
if ''${is_uber} || [[ "''${battery[1]}" -lt "''${thr_battery}" ]] || [[ "''${volume[1]}" -gt "''${thr_volume}" ]]; then
|
||||
sep_batvol=" ''${sep} "
|
||||
fi
|
||||
if [[ "''${battery[0]}" = "" ]]; then
|
||||
sep_batvol=""
|
||||
fi
|
||||
|
||||
# Print.
|
||||
echo -n " "
|
||||
|
||||
# Assemble.
|
||||
if ''${is_uber}; then
|
||||
local lang=($(_tmux_language))
|
||||
[[ "''${lang[0]}" != "" ]] && {
|
||||
echo -n "''${lang[0]} ''${sep} "
|
||||
};
|
||||
|
||||
[[ "''${volume[0]}" != "" ]] && echo -n "''${volume[0]} ''${volume[1]}%''${sep_batvol}"
|
||||
[[ "''${battery[0]}" != "" ]] && echo -n "''${battery[0]} ''${battery[1]}%"
|
||||
else
|
||||
[[ "''${volume[0]}" != "" ]] && {
|
||||
echo -n "''${volume[0]}"
|
||||
[[ "''${volume[1]}" -gt 100 ]] && echo -n " ''${volume[1]}%"
|
||||
echo -n "''${sep_batvol}"
|
||||
};
|
||||
[[ "''${battery[0]}" != "" ]] && {
|
||||
echo -n "''${battery[0]}"
|
||||
[[ "''${battery[1]}" -lt 40 ]] && echo -n " ''${battery[1]}%"
|
||||
};
|
||||
fi
|
||||
|
||||
echo -n " "
|
||||
}
|
||||
|
||||
function _tmux_language() {
|
||||
local IFS=$'\n'
|
||||
local lang=$(swaymsg -t get_inputs | jq 'map(select(has("xkb_active_layout_name")))[0].xkb_active_layout_name')
|
||||
|
||||
echo -n ''${lang:1:2}
|
||||
}
|
||||
|
||||
function _tmux_client_count() {
|
||||
local IFS=$'\n'
|
||||
local session=''${1}
|
||||
local count=$(tmux list-clients -t ''${session} | wc -l)
|
||||
|
||||
[ ''${count} -gt 1 ] && echo -n "+''${count} "
|
||||
}
|
||||
|
||||
function _tmux_toggle_statusbar() {
|
||||
local file="/tmp/.tmux_uber"
|
||||
if [[ ! -f ''${file} ]]; then
|
||||
echo "true" > ''${file}
|
||||
elif $(cat ''${file}); then
|
||||
echo "false" > ''${file}
|
||||
else
|
||||
echo "true" > ''${file}
|
||||
fi
|
||||
}
|
||||
|
||||
IFS=$'\n'
|
||||
action=''${1}
|
||||
session=''${2}
|
||||
|
||||
case "''${action}" in
|
||||
"statusbar") _tmux_statusbar ;;
|
||||
"client_count") _tmux_client_count ''${session} ;;
|
||||
"togglestatusbar") _tmux_toggle_statusbar ;;
|
||||
esac
|
||||
'';
|
||||
}
|
|
@ -1,4 +1,268 @@
|
|||
{ style, key, util, setting, ... } @args: {
|
||||
config = util.catAllText ./module args;
|
||||
script = (import ./Script.nix args).text;
|
||||
{ style, key, util, setting, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
|
||||
accent = style.color.accent;
|
||||
bg = style.color.bg.dark;
|
||||
fg = style.color.fg.light;
|
||||
in {
|
||||
config = util.trimTabs ''
|
||||
# Remap <C-b> to <C-t>.
|
||||
unbind-key C-b
|
||||
set-option -g prefix C-t
|
||||
bind-key C-${key.tmux.prefix} send-prefix
|
||||
|
||||
# Disable escape delay.
|
||||
set -sg escape-time 0
|
||||
|
||||
# Reload config.
|
||||
bind -n ${mod}-${key.tmux.reload} source-file /etc/tmux.conf
|
||||
|
||||
# Scroll.
|
||||
bind -n ${mod}-${key.tmux.scroll.up} copy-mode -u
|
||||
bind -n ${mod}-${key.tmux.scroll.down} send-keys Pagedown
|
||||
|
||||
# Copy mode.
|
||||
setw -g mode-keys vi
|
||||
bind -n ${mod}-${key.tmux.copy.select} copy-mode
|
||||
bind -n ${mod}-${key.tmux.copy.paste} choose-buffer;
|
||||
bind -T copy-mode-vi ${key.tmux.copy.select} send -X begin-selection
|
||||
bind -T copy-mode-vi ${key.tmux.copy.copy} send-keys -X copy-pipe-and-cancel "pbcopy"
|
||||
|
||||
# Remap split keys.
|
||||
bind -n ${mod}-${key.action.split.vertical} split-window -h -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.action.split.horizontal} split-window -v -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.action.resize.equalize} select-layout tiled
|
||||
bind -n ${mod}-${key.action.resize.up} resize-pane -U ${toString(setting.tmux.resize.step.vertical)}
|
||||
bind -n ${mod}-${key.action.resize.down} resize-pane -D ${toString(setting.tmux.resize.step.vertical)}
|
||||
bind -n ${mod}-${key.action.resize.left} resize-pane -L ${toString(setting.tmux.resize.step.horizontal)}
|
||||
bind -n ${mod}-${key.action.resize.right} resize-pane -R ${toString(setting.tmux.resize.step.horizontal)}
|
||||
bind -n ${mod}-${key.navigation.move.left} swap-pane -U
|
||||
bind -n ${mod}-${key.navigation.move.right} swap-pane -D
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# Swith panes.
|
||||
bind -n ${mod}-${key.navigation.go.left} select-pane -L
|
||||
bind -n ${mod}-${key.navigation.go.right} select-pane -R
|
||||
bind -n ${mod}-${key.navigation.go.up} select-pane -U
|
||||
bind -n ${mod}-${key.navigation.go.down} select-pane -D
|
||||
|
||||
# Close pane.
|
||||
bind -n ${mod}-${key.action.hide} kill-pane
|
||||
bind -n ${mod}-${key.action.seek} kill-pane -a
|
||||
|
||||
# Detach.
|
||||
bind -n ${mod}-${key.action.wait} detach-client
|
||||
bind -n ${mod}-${key.action.exit} detach-client -a
|
||||
|
||||
# Switch sessions.
|
||||
bind -n ${mod}-${key.tmux.session.prev} switch-client -p
|
||||
bind -n ${mod}-${key.tmux.session.next} switch-client -n
|
||||
bind -n ${mod}-${key.tmux.session.choose} choose-session
|
||||
|
||||
# Resize to smallest client.
|
||||
set -g window-size smallest
|
||||
|
||||
# Selection style.
|
||||
set -g mode-style "fg=#${bg} bg=#${accent} bold"
|
||||
|
||||
# Pane style.
|
||||
set -g pane-border-style "fg=#${bg}"
|
||||
set -g pane-active-border-style "fg=#${accent}"
|
||||
|
||||
# Statusbar.
|
||||
bind-key -n ${mod}-${key.tmux.status.toggle} set-option -g status;
|
||||
bind-key -n ${mod}-${key.tmux.status.uber} run-shell 'tmux_script togglestatusbar'
|
||||
set -g status-interval ${toString(setting.tmux.status.interval)}
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style "fg=#${fg}"
|
||||
|
||||
set -g status-left "#[bold] #H-#S #(tmux_script client_count #S)"
|
||||
set -g status-left-length ${toString(setting.tmux.status.length)}
|
||||
set -g status-right-length ${toString(setting.tmux.status.length)}
|
||||
set -g status-right "#(tmux_script statusbar) %d %a #[bold] %H:%M "
|
||||
|
||||
set-window-option -g window-status-separator ""
|
||||
|
||||
setw -g window-status-current-style "fg=#${accent} bold"
|
||||
setw -g window-status-current-format " #W "
|
||||
|
||||
setw -g window-status-style ""
|
||||
setw -g window-status-format " #W "
|
||||
|
||||
set-window-option -g visual-bell off
|
||||
setw -g window-status-bell-style "bold blink"
|
||||
|
||||
# Create new window.
|
||||
bind -n ${mod}-${key.tmux.window.new} new-window -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.tmux.window.new_compat} new-window -c "#{pane_current_path}"
|
||||
|
||||
# Close window.
|
||||
bind -n ${mod}-${key.action.close} kill-window
|
||||
bind -n ${mod}-${key.action.kill} kill-window -a
|
||||
|
||||
# Switch window.
|
||||
bind -n ${mod}-${key.navigation.go.next} next-window
|
||||
bind -n ${mod}-${key.navigation.go.prev} previous-window
|
||||
|
||||
# Move window.
|
||||
bind -n ${mod}-${key.navigation.move.next} swap-window -t +1\; select-window -t +1
|
||||
bind -n ${mod}-${key.navigation.move.prev} swap-window -t -1\; select-window -t -1
|
||||
|
||||
# Env.
|
||||
set-option -g default-terminal "tmux-256color"
|
||||
set-option -g focus-events on
|
||||
set-option -sa terminal-features "RGB"
|
||||
set-option -g update-environment "SSH_CLIENT SSH_TTY DOCKER_CONFIG DOCKER_HOST DISPLAY XAUTHORITY BASH_PATH SWAY_SOCK"
|
||||
'';
|
||||
|
||||
script = ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function _tmux_battery() {
|
||||
local IFS=$'\n'
|
||||
|
||||
local batteries=($(ls /sys/class/power_supply/ | grep ^BAT[0-9]$))
|
||||
[[ "''${batteries}" = "" ]] && return 1
|
||||
|
||||
local battery="/sys/class/power_supply/''${batteries[0]}"
|
||||
local level=$(cat ''${battery}/capacity)
|
||||
local status=$(cat ''${battery}/status)
|
||||
local is_charging=false
|
||||
[[ "''${status}" = "Charging" ]] && is_charging=true
|
||||
|
||||
local icon
|
||||
if ((level>=${toString(setting.tmux.status.battery.threshold.high)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.battery.threshold.medium)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.battery.threshold.low)}))
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
echo -n "''${icon}"
|
||||
''${is_charging} && echo -n ""
|
||||
echo
|
||||
echo -n "''${level}"
|
||||
}
|
||||
|
||||
function _tmux_volume() {
|
||||
local IFS=$'\n'
|
||||
local level=$(wpctl get-volume @DEFAULT_SINK@ | cut -d\ -f2 | sed -e "s/^0//" -e "s/\.//")
|
||||
[[ "''${level}" = "" ]] && return 1
|
||||
[[ "''${level}" = "00" ]] && level="0"
|
||||
|
||||
local icon
|
||||
if ((level>=${toString(setting.tmux.status.volume.threshold.high)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.volume.threshold.medium)}))
|
||||
then
|
||||
icon=""
|
||||
elif ((level>=${toString(setting.tmux.status.volume.threshold.low)}))
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
local muted=$(wpctl get-volume @DEFAULT_SINK@ | grep '[MUTED]')
|
||||
if [[ "''${muted}" != "" ]]; then
|
||||
icon=""
|
||||
fi
|
||||
|
||||
echo "''${icon}"
|
||||
echo -n "''${level}"
|
||||
}
|
||||
|
||||
function _tmux_statusbar() {
|
||||
local IFS=$'\n'
|
||||
local sep=""
|
||||
local thr_volume=${toString(setting.tmux.status.volume.threshold.show)}
|
||||
local thr_battery=${toString(setting.tmux.status.battery.threshold.show)}
|
||||
local is_uber=$(cat "/tmp/.tmux_uber" || echo -n false)
|
||||
|
||||
# Get data.
|
||||
battery=($(_tmux_battery))
|
||||
volume=($(_tmux_volume))
|
||||
|
||||
# Prepare separators.
|
||||
sep_batvol=" "
|
||||
|
||||
if ''${is_uber} || [[ "''${battery[1]}" -lt "''${thr_battery}" ]] || [[ "''${volume[1]}" -gt "''${thr_volume}" ]]; then
|
||||
sep_batvol=" ''${sep} "
|
||||
fi
|
||||
if [[ "''${battery[0]}" = "" ]]; then
|
||||
sep_batvol=""
|
||||
fi
|
||||
|
||||
# Print.
|
||||
echo -n " "
|
||||
|
||||
# Assemble.
|
||||
if ''${is_uber}; then
|
||||
local lang=($(_tmux_language))
|
||||
[[ "''${lang[0]}" != "" ]] && {
|
||||
echo -n "''${lang[0]} ''${sep} "
|
||||
};
|
||||
|
||||
[[ "''${volume[0]}" != "" ]] && echo -n "''${volume[0]} ''${volume[1]}%''${sep_batvol}"
|
||||
[[ "''${battery[0]}" != "" ]] && echo -n "''${battery[0]} ''${battery[1]}%"
|
||||
else
|
||||
[[ "''${volume[0]}" != "" ]] && {
|
||||
echo -n "''${volume[0]}"
|
||||
[[ "''${volume[1]}" -gt 100 ]] && echo -n " ''${volume[1]}%"
|
||||
echo -n "''${sep_batvol}"
|
||||
};
|
||||
[[ "''${battery[0]}" != "" ]] && {
|
||||
echo -n "''${battery[0]}"
|
||||
[[ "''${battery[1]}" -lt 40 ]] && echo -n " ''${battery[1]}%"
|
||||
};
|
||||
fi
|
||||
|
||||
echo -n " "
|
||||
}
|
||||
|
||||
function _tmux_language() {
|
||||
local IFS=$'\n'
|
||||
local lang=$(swaymsg -t get_inputs | jq 'map(select(has("xkb_active_layout_name")))[0].xkb_active_layout_name')
|
||||
|
||||
echo -n ''${lang:1:2}
|
||||
}
|
||||
|
||||
function _tmux_client_count() {
|
||||
local IFS=$'\n'
|
||||
local session=''${1}
|
||||
local count=$(tmux list-clients -t ''${session} | wc -l)
|
||||
|
||||
[ ''${count} -gt 1 ] && echo -n "+''${count} "
|
||||
}
|
||||
|
||||
function _tmux_toggle_statusbar() {
|
||||
local file="/tmp/.tmux_uber"
|
||||
if [[ ! -f ''${file} ]]; then
|
||||
echo "true" > ''${file}
|
||||
elif $(cat ''${file}); then
|
||||
echo "false" > ''${file}
|
||||
else
|
||||
echo "true" > ''${file}
|
||||
fi
|
||||
}
|
||||
|
||||
IFS=$'\n'
|
||||
action=''${1}
|
||||
session=''${2}
|
||||
|
||||
case "''${action}" in
|
||||
"statusbar") _tmux_statusbar ;;
|
||||
"client_count") _tmux_client_count ''${session} ;;
|
||||
"togglestatusbar") _tmux_toggle_statusbar ;;
|
||||
esac
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{ key, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
in {
|
||||
text = ''
|
||||
bind -n ${mod}-${key.tmux.reload} source-file /etc/tmux.conf
|
||||
'';
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{ key, style, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
|
||||
accent = style.color.accent;
|
||||
bg = style.color.bg.dark;
|
||||
fg = style.color.fg.light;
|
||||
in {
|
||||
text = ''
|
||||
setw -g mode-keys vi
|
||||
bind -n ${mod}-${key.tmux.copy.select} copy-mode
|
||||
bind -n ${mod}-${key.tmux.copy.paste} choose-buffer;
|
||||
bind -T copy-mode-vi ${key.tmux.copy.select} send -X begin-selection
|
||||
bind -T copy-mode-vi ${key.tmux.copy.copy} send-keys -X copy-pipe-and-cancel "pbcopy"
|
||||
|
||||
set -g mode-style "fg=#${bg} bg=#${accent} bold"
|
||||
'';
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ ... }: {
|
||||
text = ''
|
||||
set -sg escape-time 0
|
||||
set-option -g default-terminal "tmux-256color"
|
||||
set-option -g focus-events on
|
||||
set-option -sa terminal-features "RGB"
|
||||
set-option -g update-environment "SSH_CLIENT SSH_TTY DOCKER_CONFIG DOCKER_HOST DISPLAY XAUTHORITY BASH_PATH SWAY_SOCK"
|
||||
'';
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{ key, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
in {
|
||||
text = ''
|
||||
bind -n ${mod}-${key.tmux.scroll.up} copy-mode -u
|
||||
bind -n ${mod}-${key.tmux.scroll.down} send-keys Pagedown
|
||||
'';
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{ key, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
in {
|
||||
text = ''
|
||||
bind -n ${mod}-${key.action.wait} detach-client
|
||||
bind -n ${mod}-${key.action.exit} detach-client -a
|
||||
|
||||
bind -n ${mod}-${key.tmux.session.prev} switch-client -p
|
||||
bind -n ${mod}-${key.tmux.session.next} switch-client -n
|
||||
bind -n ${mod}-${key.tmux.session.choose} choose-session
|
||||
|
||||
set -g window-size smallest
|
||||
'';
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
{ key, setting, style, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
|
||||
accent = style.color.accent;
|
||||
bg = style.color.bg.dark;
|
||||
fg = style.color.fg.light;
|
||||
in {
|
||||
text = ''
|
||||
bind -n ${mod}-${key.action.split.vertical} split-window -h -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.action.split.horizontal} split-window -v -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.action.resize.equalize} select-layout tiled
|
||||
bind -n ${mod}-${key.action.resize.up} resize-pane -U ${toString(setting.tmux.resize.step.vertical)}
|
||||
bind -n ${mod}-${key.action.resize.down} resize-pane -D ${toString(setting.tmux.resize.step.vertical)}
|
||||
bind -n ${mod}-${key.action.resize.left} resize-pane -L ${toString(setting.tmux.resize.step.horizontal)}
|
||||
bind -n ${mod}-${key.action.resize.right} resize-pane -R ${toString(setting.tmux.resize.step.horizontal)}
|
||||
bind -n ${mod}-${key.navigation.move.left} swap-pane -U
|
||||
bind -n ${mod}-${key.navigation.move.right} swap-pane -D
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
bind -n ${mod}-${key.navigation.go.left} select-pane -L
|
||||
bind -n ${mod}-${key.navigation.go.right} select-pane -R
|
||||
bind -n ${mod}-${key.navigation.go.up} select-pane -U
|
||||
bind -n ${mod}-${key.navigation.go.down} select-pane -D
|
||||
|
||||
bind -n ${mod}-${key.action.hide} kill-pane
|
||||
bind -n ${mod}-${key.action.seek} kill-pane -a
|
||||
|
||||
set -g pane-border-style "fg=#${bg}"
|
||||
set -g pane-active-border-style "fg=#${accent}"
|
||||
'';
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
{ style, key, setting, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
|
||||
accent = style.color.accent;
|
||||
bg = style.color.bg.dark;
|
||||
fg = style.color.fg.light;
|
||||
in {
|
||||
text = ''
|
||||
bind-key -n ${mod}-${key.tmux.status.toggle} set-option -g status;
|
||||
bind-key -n ${mod}-${key.tmux.status.uber} run-shell 'tmux_script togglestatusbar'
|
||||
set -g status-interval ${toString(setting.tmux.status.interval)}
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style "fg=#${fg}"
|
||||
|
||||
set -g status-left "#[bold] #H-#S #(tmux_script client_count #S)"
|
||||
set -g status-left-length ${toString(setting.tmux.status.length)}
|
||||
set -g status-right-length ${toString(setting.tmux.status.length)}
|
||||
set -g status-right "#(tmux_script statusbar) %d %a #[bold] %H:%M "
|
||||
|
||||
set-window-option -g window-status-separator ""
|
||||
|
||||
setw -g window-status-current-style "fg=#${accent} bold"
|
||||
setw -g window-status-current-format " #W "
|
||||
|
||||
setw -g window-status-style ""
|
||||
setw -g window-status-format " #W "
|
||||
|
||||
set-window-option -g visual-bell off
|
||||
setw -g window-status-bell-style "bold blink"
|
||||
'';
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{ key, ... }: let
|
||||
mod = key.tmux.mod;
|
||||
in {
|
||||
text = ''
|
||||
bind -n ${mod}-${key.tmux.window.new} new-window -c "#{pane_current_path}"
|
||||
bind -n ${mod}-${key.tmux.window.new_compat} new-window -c "#{pane_current_path}"
|
||||
|
||||
bind -n ${mod}-${key.action.close} kill-window
|
||||
bind -n ${mod}-${key.action.kill} kill-window -a
|
||||
|
||||
bind -n ${mod}-${key.navigation.go.next} next-window
|
||||
bind -n ${mod}-${key.navigation.go.prev} previous-window
|
||||
|
||||
bind -n ${mod}-${key.navigation.move.next} swap-window -t +1\; select-window -t +1
|
||||
bind -n ${mod}-${key.navigation.move.prev} swap-window -t -1\; select-window -t -1
|
||||
'';
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{ pkgs, ... } @args: let
|
||||
mangohud = import ./mangohud args;
|
||||
in {
|
||||
{ pkgs, ... }: {
|
||||
xdg.mime.defaultApplications = {
|
||||
# Use `file -i file.txt` to find file mime type.
|
||||
# Use `xdg-mime query default "text/plain"` to find default app.
|
||||
|
@ -16,7 +14,7 @@ in {
|
|||
packages = with pkgs; [
|
||||
dxvk
|
||||
gamescope
|
||||
pkgs.mangohud
|
||||
mangohud
|
||||
vkd3d
|
||||
];
|
||||
in {
|
||||
|
@ -29,7 +27,7 @@ in {
|
|||
android-studio jetbrains.idea-community
|
||||
appimage-run
|
||||
blender-hip
|
||||
bottles dxvk gamescope pkgs.mangohud vkd3d wine64
|
||||
bottles dxvk gamescope mangohud vkd3d wine64
|
||||
calibre
|
||||
gimp
|
||||
godot_4
|
||||
|
@ -45,8 +43,8 @@ in {
|
|||
variables = {
|
||||
# MangoHud.
|
||||
MANGOHUD = "1";
|
||||
MANGOHUD_CONFIGFILE = pkgs.writeText "mangoConfig" mangohud.config;
|
||||
MANGOHUD_PRESETSFILE = pkgs.writeText "mangoPreset" mangohud.presets;
|
||||
MANGOHUD_CONFIGFILE = ./mangohud/MangoHud.conf;
|
||||
MANGOHUD_PRESETSFILE = ./mangohud/MangoPresets.conf;
|
||||
|
||||
# Proton.
|
||||
WINEFSYNC = "1";
|
||||
|
|
12
module/desktop/mangohud/MangoHud.conf
Normal file
12
module/desktop/mangohud/MangoHud.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
af=16
|
||||
blacklist=example
|
||||
fps_limit=165
|
||||
fps_limit_method=early
|
||||
fps_sampling_period=1000
|
||||
frame_timing=0
|
||||
gl_vsync=1
|
||||
no_display=0
|
||||
preset=1,0,2
|
||||
toggle_preset=F1
|
||||
toggle_logging=F2
|
||||
vsync=3
|
26
module/desktop/mangohud/MangoPresets.conf
Normal file
26
module/desktop/mangohud/MangoPresets.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
[preset 0]
|
||||
no_display=1
|
||||
|
||||
[preset 1]
|
||||
alpha=1.0
|
||||
arch=0
|
||||
background_alpha=0.5
|
||||
battery=1
|
||||
battery_time=1
|
||||
benchmark_percentiles=0
|
||||
cpu_temp=1
|
||||
device_battery=gamepad,mouse
|
||||
font_size=12
|
||||
fps_sampling_period=1000
|
||||
gpu_junction_temp=1
|
||||
gpu_mem_temp=1
|
||||
gpu_temp=1
|
||||
hud_no_margin=1
|
||||
ram=1
|
||||
swap=1
|
||||
throttling_status=1
|
||||
time=1
|
||||
vram=1
|
||||
|
||||
[preset 2]
|
||||
full=1
|
|
@ -1,45 +0,0 @@
|
|||
{ util, ... }: {
|
||||
config = util.trimTabs ''
|
||||
af=16
|
||||
blacklist=example
|
||||
fps_limit=165
|
||||
fps_limit_method=early
|
||||
fps_sampling_period=1000
|
||||
frame_timing=0
|
||||
gl_vsync=1
|
||||
no_display=0
|
||||
preset=1,0,2
|
||||
toggle_preset=F1
|
||||
toggle_logging=F2
|
||||
vsync=3
|
||||
'';
|
||||
|
||||
presets = util.trimTabs ''
|
||||
[preset 0]
|
||||
no_display=1
|
||||
|
||||
[preset 1]
|
||||
alpha=1.0
|
||||
arch=0
|
||||
background_alpha=0.5
|
||||
battery=1
|
||||
battery_time=1
|
||||
benchmark_percentiles=0
|
||||
cpu_temp=1
|
||||
device_battery=gamepad,mouse
|
||||
font_size=12
|
||||
fps_sampling_period=1000
|
||||
gpu_junction_temp=1
|
||||
gpu_mem_temp=1
|
||||
gpu_temp=1
|
||||
hud_no_margin=1
|
||||
ram=1
|
||||
swap=1
|
||||
throttling_status=1
|
||||
time=1
|
||||
vram=1
|
||||
|
||||
[preset 2]
|
||||
full=1
|
||||
'';
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, wallpaper, style, util, setting, ... } @args: let
|
||||
mkConfig = { modules }: builtins.foldl' (acc: mod:
|
||||
acc + util.trimTabs((import mod args).text)
|
||||
acc + (import mod args).text
|
||||
) "" modules;
|
||||
|
||||
swayRc = mkConfig {
|
||||
|
@ -27,9 +27,9 @@
|
|||
];
|
||||
};
|
||||
in {
|
||||
config = (util.trimTabs ''
|
||||
config = util.trimTabs (''
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
include /etc/sway/config.d/*
|
||||
'') + swayRc;
|
||||
'' + swayRc);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
|
||||
tmux = {
|
||||
mod = "M";
|
||||
prefix = "t";
|
||||
reload = "r";
|
||||
scroll = {
|
||||
down = "n";
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
ls = path: map (f: "${path}/${f}") (builtins.attrNames (builtins.readDir path));
|
||||
|
||||
# Concat all files by `text` key.
|
||||
catAllText = path: args: builtins.foldl' (acc: mod:
|
||||
acc + trimTabs ((import mod args).text)
|
||||
) "" (ls path);
|
||||
catAllText = path: args: trimTabs (
|
||||
(builtins.foldl' (acc: mod:
|
||||
acc + (import mod args).text
|
||||
) "" (ls path))
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
{ ... }: {
|
||||
text = ''
|
||||
[firefox]
|
||||
alt.a = alt+left
|
||||
alt.d = alt+right
|
||||
alt.s = down
|
||||
alt.w = up
|
||||
alt.a = left
|
||||
alt.d = right
|
||||
alt.e = C-tab
|
||||
alt.f = C-f
|
||||
alt.l = A-S-a
|
||||
alt.n = f3
|
||||
alt.p = C-S-l
|
||||
alt.p = S-f3
|
||||
alt.q = C-S-tab
|
||||
alt.r = C-f5
|
||||
alt.s = down
|
||||
alt.space = f6
|
||||
alt.t = C-t
|
||||
alt.u = C-S-t
|
||||
alt.w = up
|
||||
alt.x = C-w
|
||||
alt.f = C-f
|
||||
alt.n = f3
|
||||
alt.N = S-f3
|
||||
alt.l = A-S-a
|
||||
alt.p = C-S-l
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{ ... }: {
|
||||
text = ''
|
||||
[jetbrains-idea-ce]
|
||||
alt.s = C-A-s
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue