mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
Merge branch 'master' of github.com:kristoferssolo/solorice
This commit is contained in:
commit
4e4089a261
@ -2,9 +2,8 @@
|
|||||||
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
|
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
|
||||||
pcall(require, "luarocks.loader")
|
pcall(require, "luarocks.loader")
|
||||||
|
|
||||||
-- Awesome Wm Widgets
|
-- AwesomeWM Widgets
|
||||||
local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget")
|
local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget")
|
||||||
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
|
|
||||||
local spotify_widget = require("awesome-wm-widgets.spotify-widget.spotify")
|
local spotify_widget = require("awesome-wm-widgets.spotify-widget.spotify")
|
||||||
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
|
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
|
||||||
local net_speed_widget = require("awesome-wm-widgets.net-speed-widget.net-speed")
|
local net_speed_widget = require("awesome-wm-widgets.net-speed-widget.net-speed")
|
||||||
@ -29,6 +28,32 @@ local hotkeys_popup = require("awful.hotkeys_popup")
|
|||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
|
|
||||||
|
-- OpenWeather API
|
||||||
|
-- !Create file ~/.config/awesome/weather and paste API from OpenWeather, latitude and longitude, each on separate lines
|
||||||
|
local weather_file = '/home/kristofers/.config/awesome/weather' -- absolute path to `weather` file
|
||||||
|
-- see if the file exists
|
||||||
|
local function file_exists(file)
|
||||||
|
local f = io.open(file, "rb")
|
||||||
|
if f then f:close() end
|
||||||
|
return f ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- get all lines from a file, returns an empty
|
||||||
|
-- list/table if the file does not exist
|
||||||
|
local function lines_from(file)
|
||||||
|
if not file_exists(file) then return {} end
|
||||||
|
local lines = {}
|
||||||
|
for line in io.lines(file) do
|
||||||
|
lines[#lines + 1] = line
|
||||||
|
end
|
||||||
|
return lines
|
||||||
|
end
|
||||||
|
|
||||||
|
local weather_output = lines_from(weather_file)
|
||||||
|
local API = weather_output[1]
|
||||||
|
local latitude = tonumber(weather_output[2])
|
||||||
|
local longitude = tonumber(weather_output[3])
|
||||||
|
|
||||||
|
|
||||||
-- {{{ Error handling
|
-- {{{ Error handling
|
||||||
-- Check if awesome encountered an error during startup and fell back to
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
@ -244,8 +269,8 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
max_lenght = -1,
|
max_lenght = -1,
|
||||||
}),
|
}),
|
||||||
weather_widget({
|
weather_widget({
|
||||||
api_key = '3bc28ba1ee6eeaf28af31d9d948aecd1',
|
api_key = API,
|
||||||
coordinates = { 56.861415323546815, 24.386162623793343 },
|
coordinates = { latitude, longitude },
|
||||||
show_daily_forecast = true,
|
show_daily_forecast = true,
|
||||||
}),
|
}),
|
||||||
--volume_widget{
|
--volume_widget{
|
||||||
@ -274,6 +299,9 @@ globalkeys = gears.table.join(
|
|||||||
awful.key({}, "Pause", function() awful.spawn.with_shell("playerctl -a play-pause") end,
|
awful.key({}, "Pause", function() awful.spawn.with_shell("playerctl -a play-pause") end,
|
||||||
{ description = "pause/play", group = "media controls" }),
|
{ description = "pause/play", group = "media controls" }),
|
||||||
|
|
||||||
|
awful.key({ "Control" }, "Pause", function() awful.spawn.with_shell("playerctl -a pause") end,
|
||||||
|
{ description = "pause all", group = "media controls" }),
|
||||||
|
|
||||||
awful.key({}, "#117", function() awful.spawn.with_shell("playerctl next") end,
|
awful.key({}, "#117", function() awful.spawn.with_shell("playerctl next") end,
|
||||||
{ description = "play next", group = "media controls" }),
|
{ description = "play next", group = "media controls" }),
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,32 @@ local hotkeys_popup = require("awful.hotkeys_popup")
|
|||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
|
|
||||||
|
-- OpenWeather API
|
||||||
|
-- !Create file ~/.config/awesome/weather and paste API from OpenWeather, latitude and longitude, each on separate lines
|
||||||
|
local weather_file = '/home/kristofers/.config/awesome/weather' -- absolute path to `weather` file
|
||||||
|
-- see if the file exists
|
||||||
|
local function file_exists(file)
|
||||||
|
local f = io.open(file, "rb")
|
||||||
|
if f then f:close() end
|
||||||
|
return f ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- get all lines from a file, returns an empty
|
||||||
|
-- list/table if the file does not exist
|
||||||
|
local function lines_from(file)
|
||||||
|
if not file_exists(file) then return {} end
|
||||||
|
local lines = {}
|
||||||
|
for line in io.lines(file) do
|
||||||
|
lines[#lines + 1] = line
|
||||||
|
end
|
||||||
|
return lines
|
||||||
|
end
|
||||||
|
|
||||||
|
local weather_output = lines_from(weather_file)
|
||||||
|
local API = weather_output[1]
|
||||||
|
local latitude = tonumber(weather_output[2])
|
||||||
|
local longitude = tonumber(weather_output[3])
|
||||||
|
|
||||||
|
|
||||||
-- {{{ Error handling
|
-- {{{ Error handling
|
||||||
-- Check if awesome encountered an error during startup and fell back to
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
@ -255,8 +281,8 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
tooltip = true,
|
tooltip = true,
|
||||||
},
|
},
|
||||||
weather_widget({
|
weather_widget({
|
||||||
api_key = '3bc28ba1ee6eeaf28af31d9d948aecd1',
|
api_key = API,
|
||||||
coordinates = { 56.86140361300421, 24.386173343039193 },
|
coordinates = { latitude, longitude },
|
||||||
show_hourly_forecst = true,
|
show_hourly_forecst = true,
|
||||||
show_daily_forecast = true,
|
show_daily_forecast = true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -117,29 +117,30 @@ bindkey -M vicmd '^e' edit-command-line
|
|||||||
bindkey -M visual '^[[P' vi-delete
|
bindkey -M visual '^[[P' vi-delete
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
alias airpods='bluetoothctl connect C8:B1:CD:E0:14:4F'
|
||||||
|
alias battery='acpi'
|
||||||
|
alias code='vscodium'
|
||||||
alias cp='cp -iv' # Confirm before overwriting something
|
alias cp='cp -iv' # Confirm before overwriting something
|
||||||
alias mv='mv -iv'
|
|
||||||
alias rm='rm -vI'
|
|
||||||
alias mkdir='mkdir -pv'
|
|
||||||
alias df='df -h' # Human-readable sizes
|
alias df='df -h' # Human-readable sizes
|
||||||
|
alias diff='diff --color=auto'
|
||||||
|
alias dv='doasedit'
|
||||||
alias free='free -m' # Show sizes in MB
|
alias free='free -m' # Show sizes in MB
|
||||||
alias gitu='git add . && git commit && git push'
|
alias gitu='git add . && git commit && git push'
|
||||||
alias ls='exa -a --icons --group-directories-first'
|
alias grep='grep --color=auto'
|
||||||
|
alias grep='rg'
|
||||||
|
alias ip='ip -color=auto'
|
||||||
alias lf='lfrun'
|
alias lf='lfrun'
|
||||||
alias v='nvim'
|
alias ls='exa -a --icons --group-directories-first'
|
||||||
alias dv='doasedit'
|
|
||||||
alias matrix='unimatrix -s 95'
|
alias matrix='unimatrix -s 95'
|
||||||
|
alias mkdir='mkdir -pv'
|
||||||
|
alias mv='mv -iv'
|
||||||
|
alias nsxiv='nsxiv -a'
|
||||||
alias pman='doas pacman'
|
alias pman='doas pacman'
|
||||||
alias battery='acpi'
|
alias py='python'
|
||||||
alias airpods='bluetoothctl connect C8:B1:CD:E0:14:4F'
|
alias rm='rm -vI'
|
||||||
|
alias v='nvim'
|
||||||
alias weather='curl wttr.in/'
|
alias weather='curl wttr.in/'
|
||||||
alias ww='nvim ~/vimwiki/index.wiki'
|
alias ww='nvim ~/vimwiki/index.wiki'
|
||||||
alias py='python'
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias diff='diff --color=auto'
|
|
||||||
alias ip='ip -color=auto'
|
|
||||||
alias grep='rg'
|
|
||||||
alias code='vscodium'
|
|
||||||
|
|
||||||
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user