Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-unified-theme-switcher
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Алексей Николаевич Пахомкин
ximper-unified-theme-switcher
Commits
a369c3c4
Commit
a369c3c4
authored
Jun 29, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manipulate-list function rewritten
parent
c033537e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
ximper-unified-theme-switcher-gui.sh
ximper-unified-theme-switcher-gui.sh
+5
-16
No files found.
ximper-unified-theme-switcher-gui.sh
View file @
a369c3c4
...
...
@@ -39,24 +39,13 @@ EDITABLE_CONFIG_FILE=$(cfg_check)
echo
"
$EDITABLE_CONFIG_FILE
"
# Вспомогательная функция для обработки списка тем
и поиска номера строки
# Вспомогательная функция для обработки списка тем
manipulate-list
()
{
local
LIST
=
"
$1
"
local
REPLACE_OBJ
=
"
$2
"
local
LINE_NUMBER
LINE_NUMBER
=
$(
echo
"
$LIST
"
|
grep
-n
"
$REPLACE_OBJ
"
|
cut
-d
:
-f1
)
if
[
"
$LINE_NUMBER
"
=
1
]
;
then
OUTPUT
=
"
$LIST
"
else
OUTPUT
=
$(
echo
"
$LIST
"
|
awk
-v
ln
=
"
$LINE_NUMBER
"
-v
first
=
"
$(
echo
"
$LIST
"
|
head
-n
1
)
"
-v
replace
=
"
$REPLACE_OBJ
"
'
NR == 1 { print replace }
NR == ln { print first }
NR != 1 && NR != ln { print $0 }
'
)
fi
TARGET
=
"
$2
"
THEMES_LIST
=
"
$1
"
echo
"
$OUTPUT
"
RESULT
=
$(
echo
"
$THEMES_LIST
"
|
grep
-Fxv
"
$TARGET
"
)
echo
-e
"
$TARGET
\n
$RESULT
"
}
gtk3-themes-list
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment