mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2025-07-04 19:19:41 +03:00
Switch to i3
This commit is contained in:
389
.config/polybar/config
Normal file
389
.config/polybar/config
Normal file
@ -0,0 +1,389 @@
|
||||
;==========================================================
|
||||
;
|
||||
;
|
||||
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||
;
|
||||
;
|
||||
; To learn more about how to configure Polybar
|
||||
; go to https://github.com/polybar/polybar
|
||||
;
|
||||
; The README contains a lot of information
|
||||
;
|
||||
;==========================================================
|
||||
;
|
||||
; 並 全 侀 冀 勇 勺 喝 啕 喙 嗢 塚 墳 奄 奔 婢 嬨 廒 廙 彩 徭 惘 慎 愈 憎 慠 懲 戴 揄 搜 摒 敖 晴 朗 望 杖 歹 殺 流 滛 滋 漢 瀞 煮 瞧 爵 犯 猪 瑱 甆 画 瘝 瘟 益 盛 直 睊 着 磌 窱 節 类 絛 練 缾 者 荒 華 蝹 襁 覆 視 調 諸 請 謁 諾 諭 謹 變 贈 輸 遲 醙 鉶 陼 難 靖 韛 響 頋 頻 鬒 龜 𢡊 𢡄 𣏕 㮝 䀘 䀹 𥉉 𥳐 𧻓 齃 龎
|
||||
[colors]
|
||||
background = #fa1e2137
|
||||
foreground = #e3eaf3
|
||||
primary = #02c084
|
||||
secondary = #65a2d9
|
||||
tertiary = #d07ef2
|
||||
fourth = #e5c246
|
||||
alert = #ed404c
|
||||
|
||||
[colors-andromeda]
|
||||
background = #282A3A
|
||||
background-alt = #3a3e4e
|
||||
foreground = #e1e3e4
|
||||
foreground-alt = #7e8294
|
||||
primary = #f0c362
|
||||
secondary = #bb97ee
|
||||
alert = #fb617e
|
||||
red = #fb617e
|
||||
green = #9ed06c
|
||||
yellow = #f0c362
|
||||
blue = #6dcae8
|
||||
magenta = #bb97ee
|
||||
cyan = #f89860
|
||||
gray = #7e8294
|
||||
black = #181a1c
|
||||
|
||||
[bar/main]
|
||||
width = 100%
|
||||
offset-x = 0
|
||||
offset-y = 0
|
||||
|
||||
height = 20
|
||||
radius = 0.0
|
||||
|
||||
override-redirect = true
|
||||
wm-restack = i3
|
||||
|
||||
background = #1E222A
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
padding-left = 1
|
||||
padding-right = 1
|
||||
module-margin-left = 1
|
||||
module-margin-right = 2
|
||||
|
||||
font-0 = Hack Nerd Font:pixelsize=11:antialias=true;2.5
|
||||
font-1 = Hack Nerd Font:style=Regular:pixelsize=17:antialias=true;3
|
||||
|
||||
modules-left = i3 cpu temperaturecpu memory
|
||||
modules-center = xwindow
|
||||
modules-right = audio backlight wlan wired-network battery date powermenu
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 0
|
||||
;tray-background = #0063ff
|
||||
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title%
|
||||
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25111
|
||||
mount-0 = /
|
||||
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
|
||||
label-unmounted = %mountpoint% not mounted
|
||||
label-unmounted-foreground = ${colors.foreground}
|
||||
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
pin-workspaces = false
|
||||
strip-wsnumbers = true
|
||||
index-sort = true
|
||||
enable-click = true
|
||||
enable-scroll = true
|
||||
wrapping-scroll = false
|
||||
reverse-scroll = false
|
||||
fuzzy-match = true
|
||||
; bigger icons
|
||||
; ws-icon-0 = "0;%{T2}%{T-}"
|
||||
; ws-icon-1 = "1;%{T2}%{T-}"
|
||||
; ws-icon-2 = "2;%{T2}%{T-}"
|
||||
; ws-icon-3 = "3;%{T2}%{T-}"
|
||||
; ws-icon-4 = "4;%{T2}4%{T-}"
|
||||
; ﲵ
|
||||
ws-icon-default = ""
|
||||
ws-icon-0 = "0;"
|
||||
ws-icon-1 = "1;"
|
||||
ws-icon-2 = "2;"
|
||||
ws-icon-3 = "3;"
|
||||
ws-icon-4 = "4;4"
|
||||
ws-icon-5 = "5;5"
|
||||
ws-icon-6 = "6;6"
|
||||
ws-icon-7 = "7;7"
|
||||
ws-icon-8 = "8;8"
|
||||
ws-icon-9 = "9;ﭮ"
|
||||
|
||||
format = <label-state> <label-mode>
|
||||
label-mode = %mode%
|
||||
label-mode-padding = 2
|
||||
label-mode-background = #e60053
|
||||
|
||||
label-focused = %icon%
|
||||
label-focused-foreground = ${colors.fourth}
|
||||
label-focused-background = #3a3e4e
|
||||
label-focused-padding = 1
|
||||
|
||||
label-unfocused = ${self.label-focused}
|
||||
label-unfocused-foreground = #0a7383
|
||||
label-unfocused-padding = ${self.label-focused-padding}
|
||||
|
||||
label-visible = ${self.label-focused}
|
||||
label-visible-foreground = #0a7383
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
|
||||
label-urgent = ${self.label-focused}
|
||||
label-urgent-foreground = ${colors.alert}
|
||||
label-urgent-padding = ${self.label-focused-padding}
|
||||
|
||||
|
||||
[module/backlight]
|
||||
type = internal/backlight
|
||||
card = intel_backlight
|
||||
|
||||
format = <label>
|
||||
label = " %percentage%%"
|
||||
label-foreground = ${colors.tertiary}
|
||||
|
||||
[module/wlan]
|
||||
type = internal/network
|
||||
interface = wlan0
|
||||
interval = 3.0
|
||||
|
||||
format-connected = <label-connected>
|
||||
format-connected-underline = #9f78e1
|
||||
; label-connected = "直"
|
||||
label-connected = 直 %essid% %signal%%
|
||||
label-connected-foreground = ${colors.primary}
|
||||
|
||||
format-disconnected = <label-disconnected>
|
||||
format-disconnected-underline = ${self.format-connected-underline}
|
||||
label-disconnected = 睊
|
||||
label-disconnected-foreground = ${colors.alert}
|
||||
|
||||
; a = worst
|
||||
ramp-signal-0 = a
|
||||
ramp-signal-1 = b
|
||||
ramp-signal-2 = c
|
||||
ramp-signal-3 = d
|
||||
ramp-signal-4 = e
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 0.5
|
||||
|
||||
|
||||
; format = <label> <ramp-coreload>
|
||||
format = <label>
|
||||
label = " %percentage%%"
|
||||
format-prefix =
|
||||
format-foreground = ${colors-andromeda.magenta}
|
||||
format-padding = 0
|
||||
ramp-coreload-spacing = 0
|
||||
ramp-coreload-0 = ▁
|
||||
ramp-coreload-1 = ▂
|
||||
ramp-coreload-2 = ▃
|
||||
ramp-coreload-3 = ▄
|
||||
ramp-coreload-4 = ▅
|
||||
ramp-coreload-5 = ▆
|
||||
ramp-coreload-6 = ▇
|
||||
ramp-coreload-7 = █
|
||||
|
||||
|
||||
[module/temperaturecpu]
|
||||
type = internal/temperature
|
||||
interval = 1
|
||||
thermal-zone = 0
|
||||
|
||||
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input
|
||||
|
||||
warn-temperature = 65
|
||||
|
||||
units = true
|
||||
|
||||
format = <ramp> <label>
|
||||
; format-background = ${colors-andromeda.background}
|
||||
format-foreground = ${colors.secondary}
|
||||
format-overline = ${colors-andromeda.background}
|
||||
format-underline = ${colors-andromeda.background}
|
||||
; format-padding = 2
|
||||
|
||||
format-warn = <ramp> <label-warn>
|
||||
; format-warn-background = ${colors-andromeda.background}
|
||||
format-warn-foreground = ${colors-andromeda.red}
|
||||
format-warn-overline = ${colors-andromeda.background}
|
||||
format-warn-underline = ${colors-andromeda.background}
|
||||
; format-warn-padding = 2
|
||||
|
||||
label = %temperature-c%
|
||||
|
||||
label-warn = "%temperature-c%"
|
||||
|
||||
; Requires the <ramp> tag
|
||||
; The icon selection will range from 0 to `warn-temperature`
|
||||
; with the current temperature as index.
|
||||
ramp-0 =
|
||||
ramp-1 =
|
||||
ramp-2 =
|
||||
ramp-3 =
|
||||
ramp-4 =
|
||||
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
|
||||
interval = 1
|
||||
|
||||
format = <label>
|
||||
format-prefix =
|
||||
; format-background = ${colors-andromeda.background}
|
||||
format-foreground = ${colors.fourth}
|
||||
format-padding = 1
|
||||
|
||||
|
||||
label = " %percentage_used%%"
|
||||
|
||||
|
||||
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
[module/wired-network]
|
||||
type = internal/network
|
||||
interface = eth0
|
||||
|
||||
format-connected-underline = #55aa55
|
||||
; label-connected = %linkspeed%
|
||||
label-connected =
|
||||
label-connected-foreground = ${colors.primary}
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
|
||||
date = "%a %b %e,"
|
||||
time = "%l:%M %p"
|
||||
date-alt = "%d-%m-%Y"
|
||||
time-alt = "%H:%M:%S"
|
||||
|
||||
format-prefix-foreground = ${colors.foreground}
|
||||
format-underline = #0a6cf5
|
||||
label = %date% %time%
|
||||
|
||||
[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/audio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-volume = <ramp-volume> <label-volume>
|
||||
label-volume-foreground = ${colors.secondary}
|
||||
ramp-volume-foreground = ${colors.secondary}
|
||||
interval = 5
|
||||
label-volume = %percentage%%
|
||||
|
||||
ramp-volume-0 =
|
||||
ramp-volume-1 =
|
||||
ramp-volume-2 =
|
||||
|
||||
label-muted = ﱝ
|
||||
label-muted-foreground = ${colors.secondary}
|
||||
click-right = pavucontrol
|
||||
|
||||
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
adapter = AC0
|
||||
full-at = 98
|
||||
|
||||
format-charging = <animation-charging> <label-charging>
|
||||
format-discharging = <ramp-capacity> <label-discharging>
|
||||
label-charging = %percentage%%
|
||||
label-discharging = %percentage%%
|
||||
|
||||
label-full =
|
||||
label-full-foreground = ${colors.fourth}
|
||||
|
||||
|
||||
ramp-capacity-0 =
|
||||
ramp-capacity-0-foreground = #ff0000
|
||||
ramp-capacity-1 =
|
||||
ramp-capacity-1-foreground = #ff4000
|
||||
ramp-capacity-2 =
|
||||
ramp-capacity-2-foreground = #ff8000
|
||||
ramp-capacity-3 =
|
||||
ramp-capacity-3-foreground = #ffc000
|
||||
ramp-capacity-4 =
|
||||
ramp-capacity-4-foreground = #ffff00
|
||||
ramp-capacity-5 =
|
||||
ramp-capacity-5-foreground = #aaff00
|
||||
ramp-capacity-6 =
|
||||
ramp-capacity-6-foreground = #aaff00
|
||||
ramp-capacity-7 =
|
||||
ramp-capacity-7-foreground = #55ff00
|
||||
ramp-capacity-8 =
|
||||
ramp-capacity-8-foreground = #55ff00
|
||||
ramp-capacity-9 =
|
||||
ramp-capacity-9-foreground = #00ff00
|
||||
ramp-capacity-foreground = ${colors.fourth}
|
||||
|
||||
animation-charging-0 =
|
||||
animation-charging-1 =
|
||||
animation-charging-2 =
|
||||
animation-charging-3 =
|
||||
animation-charging-4 =
|
||||
animation-charging-5 =
|
||||
animation-charging-6 =
|
||||
|
||||
animation-charging-foreground = ${colors.fourth}
|
||||
|
||||
label-discharging-foreground = ${colors.fourth}
|
||||
label-charging-foreground = ${colors.fourth}
|
||||
|
||||
[module/powermenu]
|
||||
type = custom/text
|
||||
format-spacing = 1
|
||||
content =
|
||||
content-foreground = ${colors.alert}
|
||||
click-left = bash ~/scripts/rofi/launch.sh powermenu
|
||||
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
;compositing-background = xor
|
||||
;compositing-background = screen
|
||||
;compositing-foreground = source
|
||||
;compositing-border = over
|
||||
;pseudo-transparency =true
|
||||
|
||||
[global/wm]
|
||||
margin-bottom = 20
|
||||
; vim:ft=dosini
|
4
.config/polybar/launch.sh
Executable file
4
.config/polybar/launch.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
pkill polybar
|
||||
polybar -r main &
|
10
.config/polybar/rofi/colors.rasi
Normal file
10
.config/polybar/rofi/colors.rasi
Normal file
@ -0,0 +1,10 @@
|
||||
/* colors */
|
||||
|
||||
* {
|
||||
al: #00000000;
|
||||
bg: #282A3A;
|
||||
bga: #3a3e4e;
|
||||
fga: #e1e3e0;
|
||||
fg: #e1e3e4;
|
||||
ac: #7e8294;
|
||||
}
|
20
.config/polybar/rofi/confirm.rasi
Normal file
20
.config/polybar/rofi/confirm.rasi
Normal file
@ -0,0 +1,20 @@
|
||||
* {
|
||||
background-color: #282A3A;
|
||||
text-color: #7e8294;
|
||||
font: "Segoe UI 10";
|
||||
}
|
||||
|
||||
window {
|
||||
width: 250px;
|
||||
padding: 0px;
|
||||
border: 0px 0px -1px 0px;
|
||||
margin: 0px 50px;
|
||||
location: north;
|
||||
left: 50%;
|
||||
margin-left:-50%;
|
||||
}
|
||||
|
||||
entry {
|
||||
expand: true;
|
||||
text-color: #7e8294;
|
||||
}
|
123
.config/polybar/rofi/networkmenu.rasi
Normal file
123
.config/polybar/rofi/networkmenu.rasi
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
*
|
||||
* Author : Aditya Shakya
|
||||
* Mail : adi1090x@gmail.com
|
||||
* Github : @adi1090x
|
||||
* Twitter : @adi1090x
|
||||
*
|
||||
*/
|
||||
|
||||
configuration {
|
||||
font: "Iosevka Nerd Font 10";
|
||||
show-icons: true;
|
||||
icon-theme: "Papirus";
|
||||
display-drun: "";
|
||||
drun-display-format: "{name}";
|
||||
disable-history: false;
|
||||
fullscreen: false;
|
||||
hide-scrollbar: true;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
@import "colors.rasi"
|
||||
|
||||
window {
|
||||
transparency: "real";
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
border: 0px 0px 4px 0px;
|
||||
border-color: @ac;
|
||||
border-radius: 0px;
|
||||
width: 400px;
|
||||
location: center;
|
||||
x-offset: 0;
|
||||
y-offset: 0;
|
||||
}
|
||||
|
||||
prompt {
|
||||
enabled: true;
|
||||
padding: 2px 0px 0px 10px;
|
||||
background-color: @al;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
textbox-prompt-colon {
|
||||
padding: 2px 0px 0px 5px;
|
||||
background-color: @al;
|
||||
text-color: @fg;
|
||||
expand: false;
|
||||
str: "";
|
||||
font: "feather 12";
|
||||
}
|
||||
|
||||
entry {
|
||||
background-color: @al;
|
||||
text-color: @fg;
|
||||
placeholder-color: @fg;
|
||||
expand: true;
|
||||
horizontal-align: 0;
|
||||
placeholder: "Search...";
|
||||
padding: 2px 0px 0px 6px;
|
||||
blink: true;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
children: [ textbox-prompt-colon, prompt ];
|
||||
background-color: @bga;
|
||||
text-color: @fg;
|
||||
expand: false;
|
||||
border: 0px;
|
||||
border-radius: 0px;
|
||||
border-color: @ac;
|
||||
margin: 0px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
listview {
|
||||
background-color: @al;
|
||||
padding: 0px;
|
||||
columns: 1;
|
||||
lines: 8;
|
||||
spacing: 6px;
|
||||
cycle: true;
|
||||
dynamic: true;
|
||||
layout: vertical;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
background-color: @al;
|
||||
border: 0px;
|
||||
border-radius: 0px;
|
||||
border-color: @ac;
|
||||
children: [ inputbar, listview ];
|
||||
spacing: 6px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
element {
|
||||
background-color: @al;
|
||||
text-color: @fga;
|
||||
orientation: horizontal;
|
||||
border-radius: 0px;
|
||||
padding: 8px 8px 8px -10px;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
size: 24px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
element-text {
|
||||
expand: true;
|
||||
horizontal-align: 0;
|
||||
vertical-align: 0.5;
|
||||
margin: 0px 2.5px 0px 2.5px;
|
||||
}
|
||||
|
||||
element selected {
|
||||
background-color: @bga;
|
||||
text-color: @fg;
|
||||
border: 0px 0px 0px 0px;
|
||||
border-radius: 0px;
|
||||
border-color: @ac;
|
||||
}
|
40
.config/polybar/rofi/powermenu.rasi
Normal file
40
.config/polybar/rofi/powermenu.rasi
Normal file
@ -0,0 +1,40 @@
|
||||
* {
|
||||
background-color: #282A3A;
|
||||
color: #7e8294;
|
||||
font: "Segoe UI 10";
|
||||
}
|
||||
|
||||
#window {
|
||||
location: north;
|
||||
width: 375px;
|
||||
padding: -6px 0px;
|
||||
children: [horibox];
|
||||
}
|
||||
|
||||
#horibox {
|
||||
orientation: horizontal;
|
||||
children: [listview];
|
||||
}
|
||||
|
||||
#listview {
|
||||
layout: horizontal;
|
||||
padding: 0px 0px;
|
||||
spacing: 2px;
|
||||
lines: 50;
|
||||
|
||||
}
|
||||
|
||||
#element {
|
||||
margin: 0px 5px;
|
||||
padding: 6px 2px;
|
||||
}
|
||||
|
||||
#element selected {
|
||||
color: #e1e3e4;
|
||||
}
|
||||
|
||||
#button {
|
||||
font: "Segoe UI 1 ";
|
||||
width: 12;
|
||||
text-color: #7e8294;
|
||||
}
|
3
.config/polybar/scripts/gpu.sh
Executable file
3
.config/polybar/scripts/gpu.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ print "GPU",""$1"","%"}'
|
3
.config/polybar/scripts/launcher.sh
Executable file
3
.config/polybar/scripts/launcher.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rofi -no-config -no-lazy-grab -show drun -modi drun -theme ~/.config/rofi/andromeda.rasi
|
67
.config/polybar/scripts/network.sh
Executable file
67
.config/polybar/scripts/network.sh
Executable file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
style="$($HOME/.config/rofi/)"
|
||||
|
||||
dir="$HOME/.config/rofi$style"
|
||||
rofi_command="rofi -theme $dir/andromeda.rasi"
|
||||
|
||||
## Get info
|
||||
IFACE="$(nmcli | grep -i interface | awk '/interface/ {print $2}')"
|
||||
#SSID="$(iwgetid -r)"
|
||||
#LIP="$(nmcli | grep -i server | awk '/server/ {print $2}')"
|
||||
#PIP="$(dig +short myip.opendns.com @resolver1.opendns.com )"
|
||||
STATUS="$(nmcli radio wifi)"
|
||||
|
||||
active=""
|
||||
urgent=""
|
||||
|
||||
if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
if [[ $IFACE == e* ]]; then
|
||||
connected=""
|
||||
else
|
||||
connected=""
|
||||
fi
|
||||
active="-a 0"
|
||||
SSID=" $(iwgetid -r)"
|
||||
PIP="$(wget --timeout=30 http://ipinfo.io/ip -qO -)"
|
||||
fi
|
||||
else
|
||||
urgent="-u 0"
|
||||
SSID="Disconnected"
|
||||
PIP="Not Available"
|
||||
connected=""
|
||||
fi
|
||||
|
||||
## Icons
|
||||
bmon=""
|
||||
launch_cli=""
|
||||
launch=""
|
||||
|
||||
options="$connected\n$bmon\n$launch_cli\n$launch"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "$SSID" -dmenu $active $urgent -selected-row 1)"
|
||||
case $chosen in
|
||||
$connected)
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
nmcli radio wifi off
|
||||
else
|
||||
nmcli radio wifi on
|
||||
fi
|
||||
;;
|
||||
$bmon)
|
||||
termite -e bmon
|
||||
;;
|
||||
$launch_cli)
|
||||
termite -e nmtui
|
||||
;;
|
||||
$launch)
|
||||
nm-connection-editor
|
||||
;;
|
||||
esac
|
94
.config/polybar/scripts/powermenu.sh
Executable file
94
.config/polybar/scripts/powermenu.sh
Executable file
@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
dir="~/.config/polybar/rofi"
|
||||
uptime=$(uptime -p | sed -e 's/up //g')
|
||||
|
||||
rofi_command="rofi -theme $dir/powermenu.rasi"
|
||||
|
||||
# Options
|
||||
shutdown=" Shutdown"
|
||||
reboot=" Restart"
|
||||
lock=" Lock"
|
||||
suspend=" Sleep"
|
||||
logout=" Logout"
|
||||
|
||||
# Confirmation
|
||||
confirm_exit() {
|
||||
rofi -dmenu\
|
||||
-i\
|
||||
-no-fixed-num-lines\
|
||||
-p "Are You Sure? : "\
|
||||
-theme $dir/confirm.rasi
|
||||
}
|
||||
|
||||
# Message
|
||||
msg() {
|
||||
rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
|
||||
}
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
|
||||
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
|
||||
case $chosen in
|
||||
$shutdown)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "ye" || $ans == "YE" || $ans == "yeah" || $ans == "yep" || $ans == "YEAH" || $ans == "YEP" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
systemctl poweroff
|
||||
elif [[ $ans == "no" || $ans == "nope" || $ans == "NOPE" || $ans == "nah" || $ans == "NAH" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$reboot)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "ye" || $ans == "YE" || $ans == "yeah" || $ans == "yep" || $ans == "YEAH" || $ans == "YEP" ||$ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
systemctl reboot
|
||||
elif [[ $ans == "no" || $ans == "nope" || $ans == "NOPE" || $ans == "nah" || $ans == "NAH" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$lock)
|
||||
if [[ -f /usr/bin/betterlockscreen ]]; then
|
||||
betterlockscreen -l -b 0.5
|
||||
elif [[ -f /usr/bin/betterlockscreen ]]; then
|
||||
betterlockscreen -l
|
||||
fi
|
||||
;;
|
||||
$suspend)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "ye" || $ans == "YE" || $ans == "yeah" || $ans == "yep" || $ans == "YEAH" || $ans == "YEP" ||$ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
mpc -q pause
|
||||
amixer set Master mute
|
||||
systemctl suspend
|
||||
elif [[ $ans == "no" || $ans == "nope" || $ans == "NOPE" || $ans == "nah" || $ans == "NAH" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$logout)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "ye" || $ans == "YE" || $ans == "yeah" || $ans == "yep" || $ans == "YEAH" || $ans == "YEP" ||$ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
if [[ "$DESKTOP_SESSION" == "Openbox" ]]; then
|
||||
openbox --exit
|
||||
elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then
|
||||
bspc quit
|
||||
elif [[ "$DESKTOP_SESSION" == "i3" ]]; then
|
||||
i3-msg exit
|
||||
fi
|
||||
elif [[ $ans == "no" || $ans == "nope" || $ans == "NOPE" || $ans == "nah" || $ans == "NAH" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
esac
|
3
.config/polybar/scripts/uptime.sh
Executable file
3
.config/polybar/scripts/uptime.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
notify-send -u low "$(awk '{print "Uptime: " int($1/3600)" Hours "int(($1%3600)/60)" minutes "int($1%60)" seconds"}' /proc/uptime)"
|
3
.config/polybar/scripts/weather.sh
Executable file
3
.config/polybar/scripts/weather.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec notify-send "$(curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=76692 \ | sed -n '/Currently:/ s/.*: \(.*\): \([0-9]*\)\([CF]\).*/\2°\3 \1/p')"
|
4
.config/polybar/scripts/wttr.sh
Executable file
4
.config/polybar/scripts/wttr.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl wttr.in/76692
|
||||
|
Reference in New Issue
Block a user