repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell: new command akku. not yet a module

9a2a3990d53878726f906a8c69b39cf939423516

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (5)

+36 / −13 text lines

Diff layout

justfile

Modified

+1 / −0 text lines

2424ssh-remote:
2525 git remote rm origin
2626 git remote add origin git@github.com:bugabinga/dotfiles.git
27 git branch --set-upstream-to=origin/trunk trunk
2829# install previously exported winget apps. see topgrade config for exports.
2930import_winget:

nushell/akku.nu

Added
new file mode 100644

+33 / −0 text lines

1# Print information about the battery on this device
2def main [] {
3 let device_directory = '/sys/class/power_supply/BAT0'
4 if ( not ($device_directory | path exists) ) {
5 print --stderr $"Could not find ($device_directory). Does this device have a battery? Maybe under another path?"
6 return
7 }
8 let energy_full = (open ([$device_directory energy_full] | path join) | into int)
9 let energy_now = (open ([$device_directory energy_now] | path join) | into int)
10 let current_energy = $energy_now / $energy_full
11 let current_energy_percent = $current_energy * 100 | into int
12 let icon = battery_icon $current_energy_percent
13 print $"($icon) ($current_energy_percent)%"
14}
16def battery_icon [
17 percent: int
18] {
19 let index = ( ($percent | math ceil) / 10 | math floor | into int)
20 let icons = [
21 '󰁺 '
22 '󰁻 '
23 '󰁼 '
24 '󰁽 '
25 '󰁾 '
26 '󰁿 '
27 '󰂀 '
28 '󰂁'
29 '󰂂 '
30 '󰁹 '
31 ]
32 return ($icons | get $index)
33}

wezterm/bugabinga/dotfiles_workspace.lua

Modified

+0 / −10 text lines

99 cwd = dotfiles_path,
1010 } )
12 local neovim_pane = command_pane:split {
13 direction = 'Top',
14 size = 0.92,
15 args = { 'nvim', 'neovim', '-c', 'lua vim.api.nvim_set_current_dir("' .. dotfiles_path .. '/neovim' .. '")', },
16 }
17 local wezterm_pane = neovim_pane:split {
18 size = 0.42,
19 args = { 'nvim', 'wezterm', '-c', 'lua vim.api.nvim_set_current_dir("' .. dotfiles_path .. '/wezterm' .. '")', },
20 }
21 command_pane:activate()
2212 wez.mux.set_active_workspace 'dotfiles'
2313 window:gui_window():maximize()
2414 end )

wezterm/bugabinga/hosts/x230.lua

Modified

+2 / −0 text lines

44 cfg.window_decorations = 'NONE'
55 cfg.font_size = 11
66 cfg.font = wez.font 'M+ 2m'
7 -- old version of wezterm in arch has bug preventing to start wezterm wit wayland
8 cfg.enable_wayland = false
79end

x230.symlinks

Modified

+0 / −3 text lines

1919subversion/merge
2020~/.subversion/merge
22tools/git-info
23~/.local/bin/git-info
2522cargo/config.toml
2623~/.cargo/config.toml